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
parentKVM: MTRR: simplify kvm_mtrr_get_guest_memory_type (diff)
downloadlinux-41dbc6bcd9722bba8f09256655d060af30c63d34.tar.xz
linux-41dbc6bcd9722bba8f09256655d060af30c63d34.zip
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 bbc678a66b18..8cbec765b08d 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);