summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/svm.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2015-07-23 08:22:45 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2015-07-23 08:22:45 +0200
commit41dbc6bcd9722bba8f09256655d060af30c63d34 (patch)
tree3de1f317633917da3fd57e98406eb73f42458dbc /arch/x86/kvm/svm.c
parent3e5d2fdceda172554e681b68c853bf5d08205bbf (diff)
downloadop-kernel-dev-41dbc6bcd9722bba8f09256655d060af30c63d34.zip
op-kernel-dev-41dbc6bcd9722bba8f09256655d060af30c63d34.tar.gz
KVM: x86: introduce kvm_check_has_quirk
The logic of the disabled_quirks field usually results in a double negation. Wrap it in a simple function that checks the bit and negates it. Based on a patch from Xiao Guangrong. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r--arch/x86/kvm/svm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index bbc678a..8cbec76 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -1672,7 +1672,7 @@ static void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0)
* does not do it - this results in some delay at
* reboot
*/
- if (!(vcpu->kvm->arch.disabled_quirks & KVM_QUIRK_CD_NW_CLEARED))
+ if (kvm_check_has_quirk(vcpu->kvm, KVM_QUIRK_CD_NW_CLEARED))
cr0 &= ~(X86_CR0_CD | X86_CR0_NW);
svm->vmcb->save.cr0 = cr0;
mark_dirty(svm->vmcb, VMCB_CR);
OpenPOWER on IntegriCloud