Commit 329675dd authored by Maxim Levitsky's avatar Maxim Levitsky Committed by Paolo Bonzini

KVM: x86: introduce kvm_register_clear_available

Small refactoring that will be used in the next patch.
Signed-off-by: default avatarMaxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20210607090203.133058-7-mlevitsk@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 0f857223
...@@ -55,6 +55,13 @@ static inline void kvm_register_mark_available(struct kvm_vcpu *vcpu, ...@@ -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) ...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment