KVM: x86: introduce kvm_register_clear_available
Small refactoring that will be used in the next patch. Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Message-Id: <20210607090203.133058-7-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
committed by
Paolo Bonzini
parent
0f85722341
commit
329675dde9
@@ -55,6 +55,13 @@ static inline void kvm_register_mark_available(struct kvm_vcpu *vcpu,
|
|||||||
__set_bit(reg, (unsigned long *)&vcpu->arch.regs_avail);
|
__set_bit(reg, (unsigned long *)&vcpu->arch.regs_avail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void kvm_register_clear_available(struct kvm_vcpu *vcpu,
|
||||||
|
enum kvm_reg reg)
|
||||||
|
{
|
||||||
|
__clear_bit(reg, (unsigned long *)&vcpu->arch.regs_avail);
|
||||||
|
__clear_bit(reg, (unsigned long *)&vcpu->arch.regs_dirty);
|
||||||
|
}
|
||||||
|
|
||||||
static inline void kvm_register_mark_dirty(struct kvm_vcpu *vcpu,
|
static inline void kvm_register_mark_dirty(struct kvm_vcpu *vcpu,
|
||||||
enum kvm_reg reg)
|
enum kvm_reg reg)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3873,10 +3873,8 @@ static __no_kcsan fastpath_t svm_vcpu_run(struct kvm_vcpu *vcpu)
|
|||||||
vcpu->arch.apf.host_apf_flags =
|
vcpu->arch.apf.host_apf_flags =
|
||||||
kvm_read_and_reset_apf_flags();
|
kvm_read_and_reset_apf_flags();
|
||||||
|
|
||||||
if (npt_enabled) {
|
if (npt_enabled)
|
||||||
vcpu->arch.regs_avail &= ~(1 << VCPU_EXREG_PDPTR);
|
kvm_register_clear_available(vcpu, VCPU_EXREG_PDPTR);
|
||||||
vcpu->arch.regs_dirty &= ~(1 << VCPU_EXREG_PDPTR);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We need to handle MC intercepts here before the vcpu has a chance to
|
* We need to handle MC intercepts here before the vcpu has a chance to
|
||||||
|
|||||||
Reference in New Issue
Block a user