summaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorTiejun Chen <tiejun.chen@intel.com>2014-11-18 17:12:56 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2014-11-18 11:07:53 +0100
commit81ed33e4aaba65cda6367b27a21e2de9862e955f (patch)
tree168bd1f0ad7f9cdfccedaf44aeb8ba5680abeb42 /arch/x86
parentf210f7572bedf3320599e8b2d8e8ec2d96270d0b (diff)
kvm: x86: vmx: cleanup handle_ept_violation
Instead, just use PFERR_{FETCH, PRESENT, WRITE}_MASK inside handle_ept_violation() for slightly better code. Signed-off-by: Tiejun Chen <tiejun.chen@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kvm/vmx.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 330a08aa0291..6a951d823c82 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -5482,11 +5482,11 @@ static int handle_ept_violation(struct kvm_vcpu *vcpu)
trace_kvm_page_fault(gpa, exit_qualification);
/* It is a write fault? */
- error_code = exit_qualification & (1U << 1);
+ error_code = exit_qualification & PFERR_WRITE_MASK;
/* It is a fetch fault? */
- error_code |= (exit_qualification & (1U << 2)) << 2;
+ error_code |= (exit_qualification << 2) & PFERR_FETCH_MASK;
/* ept page table is present? */
- error_code |= (exit_qualification >> 3) & 0x1;
+ error_code |= (exit_qualification >> 3) & PFERR_PRESENT_MASK;
vcpu->arch.exit_qualification = exit_qualification;