diff options
author | Avi Kivity <avi@qumranet.com> | 2007-01-05 19:36:47 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2007-01-06 02:55:25 -0500 |
commit | 5f015a5b28c75bb6cc5158640db58689b1ee1b51 (patch) | |
tree | 7b103d11d256bfc83c8cd61841cdb893d2b09617 /drivers/kvm/mmu.c | |
parent | ebeace8609205bf5e1b96fe325b7dea148042232 (diff) |
[PATCH] KVM: MMU: Remove invlpg interception
Since we write protect shadowed guest page tables, there is no need to trap
page invalidations (the guest will always change the mapping before issuing
the invlpg instruction).
Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/kvm/mmu.c')
-rw-r--r-- | drivers/kvm/mmu.c | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c index e4a20a45d834..b7b05c44399d 100644 --- a/drivers/kvm/mmu.c +++ b/drivers/kvm/mmu.c | |||
@@ -767,10 +767,6 @@ static int nonpaging_page_fault(struct kvm_vcpu *vcpu, gva_t gva, | |||
767 | return nonpaging_map(vcpu, addr & PAGE_MASK, paddr); | 767 | return nonpaging_map(vcpu, addr & PAGE_MASK, paddr); |
768 | } | 768 | } |
769 | 769 | ||
770 | static void nonpaging_inval_page(struct kvm_vcpu *vcpu, gva_t addr) | ||
771 | { | ||
772 | } | ||
773 | |||
774 | static void nonpaging_free(struct kvm_vcpu *vcpu) | 770 | static void nonpaging_free(struct kvm_vcpu *vcpu) |
775 | { | 771 | { |
776 | mmu_free_roots(vcpu); | 772 | mmu_free_roots(vcpu); |
@@ -782,7 +778,6 @@ static int nonpaging_init_context(struct kvm_vcpu *vcpu) | |||
782 | 778 | ||
783 | context->new_cr3 = nonpaging_new_cr3; | 779 | context->new_cr3 = nonpaging_new_cr3; |
784 | context->page_fault = nonpaging_page_fault; | 780 | context->page_fault = nonpaging_page_fault; |
785 | context->inval_page = nonpaging_inval_page; | ||
786 | context->gva_to_gpa = nonpaging_gva_to_gpa; | 781 | context->gva_to_gpa = nonpaging_gva_to_gpa; |
787 | context->free = nonpaging_free; | 782 | context->free = nonpaging_free; |
788 | context->root_level = 0; | 783 | context->root_level = 0; |
@@ -895,42 +890,6 @@ static int may_access(u64 pte, int write, int user) | |||
895 | return 1; | 890 | return 1; |
896 | } | 891 | } |
897 | 892 | ||
898 | /* | ||
899 | * Remove a shadow pte. | ||
900 | */ | ||
901 | static void paging_inval_page(struct kvm_vcpu *vcpu, gva_t addr) | ||
902 | { | ||
903 | hpa_t page_addr = vcpu->mmu.root_hpa; | ||
904 | int level = vcpu->mmu.shadow_root_level; | ||
905 | |||
906 | ++kvm_stat.invlpg; | ||
907 | |||
908 | for (; ; level--) { | ||
909 | u32 index = PT64_INDEX(addr, level); | ||
910 | u64 *table = __va(page_addr); | ||
911 | |||
912 | if (level == PT_PAGE_TABLE_LEVEL ) { | ||
913 | rmap_remove(vcpu->kvm, &table[index]); | ||
914 | table[index] = 0; | ||
915 | return; | ||
916 | } | ||
917 | |||
918 | if (!is_present_pte(table[index])) | ||
919 | return; | ||
920 | |||
921 | page_addr = table[index] & PT64_BASE_ADDR_MASK; | ||
922 | |||
923 | if (level == PT_DIRECTORY_LEVEL && | ||
924 | (table[index] & PT_SHADOW_PS_MARK)) { | ||
925 | table[index] = 0; | ||
926 | release_pt_page_64(vcpu, page_addr, PT_PAGE_TABLE_LEVEL); | ||
927 | |||
928 | kvm_arch_ops->tlb_flush(vcpu); | ||
929 | return; | ||
930 | } | ||
931 | } | ||
932 | } | ||
933 | |||
934 | static void paging_free(struct kvm_vcpu *vcpu) | 893 | static void paging_free(struct kvm_vcpu *vcpu) |
935 | { | 894 | { |
936 | nonpaging_free(vcpu); | 895 | nonpaging_free(vcpu); |
@@ -951,7 +910,6 @@ static int paging64_init_context_common(struct kvm_vcpu *vcpu, int level) | |||
951 | ASSERT(is_pae(vcpu)); | 910 | ASSERT(is_pae(vcpu)); |
952 | context->new_cr3 = paging_new_cr3; | 911 | context->new_cr3 = paging_new_cr3; |
953 | context->page_fault = paging64_page_fault; | 912 | context->page_fault = paging64_page_fault; |
954 | context->inval_page = paging_inval_page; | ||
955 | context->gva_to_gpa = paging64_gva_to_gpa; | 913 | context->gva_to_gpa = paging64_gva_to_gpa; |
956 | context->free = paging_free; | 914 | context->free = paging_free; |
957 | context->root_level = level; | 915 | context->root_level = level; |
@@ -974,7 +932,6 @@ static int paging32_init_context(struct kvm_vcpu *vcpu) | |||
974 | 932 | ||
975 | context->new_cr3 = paging_new_cr3; | 933 | context->new_cr3 = paging_new_cr3; |
976 | context->page_fault = paging32_page_fault; | 934 | context->page_fault = paging32_page_fault; |
977 | context->inval_page = paging_inval_page; | ||
978 | context->gva_to_gpa = paging32_gva_to_gpa; | 935 | context->gva_to_gpa = paging32_gva_to_gpa; |
979 | context->free = paging_free; | 936 | context->free = paging_free; |
980 | context->root_level = PT32_ROOT_LEVEL; | 937 | context->root_level = PT32_ROOT_LEVEL; |