summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Li <liang.z.li@intel.com>2016-08-18 15:49:19 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2016-09-07 19:34:27 +0200
commit72e0ae58a0fbded49d6fa80dcca5aaea9eb5a73f (patch)
treed0c26736ef5e0eca73610c47ec784e927c0f54d9
parent4174879b2e5a2620d9f5c1935de0c9204b34cd1c (diff)
downloadlinux-72e0ae58a0fbded49d6fa80dcca5aaea9eb5a73f.tar.bz2
vmx: refine validity check for guest linear address
The validity check for the guest line address is inefficient, check the invalid value instead of enumerating the valid ones. Signed-off-by: Liang Li <liang.z.li@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-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 5cede40e2552..8d2880466764 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -6109,7 +6109,7 @@ static int handle_ept_violation(struct kvm_vcpu *vcpu)
exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
gla_validity = (exit_qualification >> 7) & 0x3;
- if (gla_validity != 0x3 && gla_validity != 0x1 && gla_validity != 0) {
+ if (gla_validity == 0x2) {
printk(KERN_ERR "EPT: Handling EPT violation failed!\n");
printk(KERN_ERR "EPT: GPA: 0x%lx, GVA: 0x%lx\n",
(long unsigned int)vmcs_read64(GUEST_PHYSICAL_ADDRESS),