summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRadim Krčmář <rkrcmar@redhat.com>2017-04-13 18:39:18 +0200
committerRadim Krčmář <rkrcmar@redhat.com>2017-04-13 19:36:55 +0200
commit332518706195007f9fbafa69652aa5b3cf72df24 (patch)
tree5f4c7f0f3834a4c38a5d9e6abf5a209f407ee503 /arch
parent405a353a0e20d09090ad96147da6afad9b0ce056 (diff)
downloadlinux-332518706195007f9fbafa69652aa5b3cf72df24.tar.bz2
KVM: nVMX: fix AD condition when handling EPT violation
I have introduced this bug when applying and simplifying Paolo's patch as we agreed on the list. The original was "x &= ~y; if (z) x |= y;". Here is the story of a bad workflow: A maintainer was already testing with the intended change, but it was applied only to a testing repo on a different machine. When the time to push tested patches to kvm/next came, he realized that this change was missing and quickly added it to the maintenance repo, didn't test again (because the change is trivial, right), and pushed the world to fire. Fixes: ae1e2d1082ae ("kvm: nVMX: support EPT accessed/dirty bits") Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/vmx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index cfdb0d9389d1..837f6dd1ae9c 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -6221,7 +6221,7 @@ static int handle_ept_violation(struct kvm_vcpu *vcpu)
* page table accesses are reads or writes.
*/
u64 eptp = nested_ept_get_cr3(vcpu);
- if (eptp & VMX_EPT_AD_ENABLE_BIT)
+ if (!(eptp & VMX_EPT_AD_ENABLE_BIT))
exit_qualification &= ~EPT_VIOLATION_ACC_WRITE;
}