diff options
author | Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> | 2012-06-20 07:58:04 (GMT) |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-07-11 13:51:17 (GMT) |
commit | 4f5982a56a70a4a8b7966ef458d3fcdd27aa16cf (patch) | |
tree | 38fd4d80fccb21b6556370341610126e7f2bc81a /arch/x86/kvm/vmx.c | |
parent | 8e22f955fb65c5930cc4c5a863cce4e27d0e4a3c (diff) | |
download | linux-fsl-qoriq-4f5982a56a70a4a8b7966ef458d3fcdd27aa16cf.tar.xz |
KVM: VMX: export PFEC.P bit on ept
Export the present bit of page fault error code, the later patch
will use it
Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r-- | arch/x86/kvm/vmx.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index a2b9dd9..5c52a6d 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -4838,6 +4838,7 @@ static int handle_ept_violation(struct kvm_vcpu *vcpu) { unsigned long exit_qualification; gpa_t gpa; + u32 error_code; int gla_validity; exit_qualification = vmcs_readl(EXIT_QUALIFICATION); @@ -4862,7 +4863,13 @@ static int handle_ept_violation(struct kvm_vcpu *vcpu) gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS); trace_kvm_page_fault(gpa, exit_qualification); - return kvm_mmu_page_fault(vcpu, gpa, exit_qualification & 0x3, NULL, 0); + + /* It is a write fault? */ + error_code = exit_qualification & (1U << 1); + /* ept page table is present? */ + error_code |= (exit_qualification >> 3) & 0x1; + + return kvm_mmu_page_fault(vcpu, gpa, error_code, NULL, 0); } static u64 ept_rsvd_mask(u64 spte, int level) |