diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2010-10-22 12:18:15 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-01-12 04:23:37 -0500 |
commit | ff1fcb9ebd53ee3f21ae117e6952204e465f46d8 (patch) | |
tree | ac316541da4ad9559c4ca027d133c08b3c558954 /arch/x86/kvm/vmx.c | |
parent | 83bcacb1a548d4d8df532376c981277761622bce (diff) |
KVM: VMX: remove setting of shadow_base_ptes for EPT
The EPT present/writable bits use the same position as normal
pagetable bits.
Since direct_map passes ACC_ALL to mmu_set_spte, thus always setting
the writable bit on sptes, use the generic PT_PRESENT shadow_base_pte.
Also pass present/writable error code information from EPT violation
to generic pagefault handler.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.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 | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 46c89252f820..e42727b305cb 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -3476,7 +3476,7 @@ static int handle_ept_violation(struct kvm_vcpu *vcpu) | |||
3476 | 3476 | ||
3477 | gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS); | 3477 | gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS); |
3478 | trace_kvm_page_fault(gpa, exit_qualification); | 3478 | trace_kvm_page_fault(gpa, exit_qualification); |
3479 | return kvm_mmu_page_fault(vcpu, gpa & PAGE_MASK, 0); | 3479 | return kvm_mmu_page_fault(vcpu, gpa, exit_qualification & 0x3); |
3480 | } | 3480 | } |
3481 | 3481 | ||
3482 | static u64 ept_rsvd_mask(u64 spte, int level) | 3482 | static u64 ept_rsvd_mask(u64 spte, int level) |
@@ -4409,8 +4409,6 @@ static int __init vmx_init(void) | |||
4409 | 4409 | ||
4410 | if (enable_ept) { | 4410 | if (enable_ept) { |
4411 | bypass_guest_pf = 0; | 4411 | bypass_guest_pf = 0; |
4412 | kvm_mmu_set_base_ptes(VMX_EPT_READABLE_MASK | | ||
4413 | VMX_EPT_WRITABLE_MASK); | ||
4414 | kvm_mmu_set_mask_ptes(0ull, 0ull, 0ull, 0ull, | 4412 | kvm_mmu_set_mask_ptes(0ull, 0ull, 0ull, 0ull, |
4415 | VMX_EPT_EXECUTABLE_MASK); | 4413 | VMX_EPT_EXECUTABLE_MASK); |
4416 | kvm_enable_tdp(); | 4414 | kvm_enable_tdp(); |