aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2008-09-23 12:18:38 -0400
committerAvi Kivity <avi@redhat.com>2008-10-15 08:25:24 -0400
commit6844dec6948679d084f054235fee19ba4e3a3096 (patch)
treea7f2bfa7e2fb664e42486a82c44f681bc1e38e01 /arch/x86
parent0738541396be165995c7f2387746eb0b47024fec (diff)
KVM: MMU: mmu_convert_notrap helper
Need to convert shadow_notrap_nonpresent -> shadow_trap_nonpresent when unsyncing pages. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kvm/mmu.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index c9b4b902527b..57c7580e7f98 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -1173,6 +1173,20 @@ static void page_header_update_slot(struct kvm *kvm, void *pte, gfn_t gfn)
1173 __set_bit(slot, &sp->slot_bitmap); 1173 __set_bit(slot, &sp->slot_bitmap);
1174} 1174}
1175 1175
1176static void mmu_convert_notrap(struct kvm_mmu_page *sp)
1177{
1178 int i;
1179 u64 *pt = sp->spt;
1180
1181 if (shadow_trap_nonpresent_pte == shadow_notrap_nonpresent_pte)
1182 return;
1183
1184 for (i = 0; i < PT64_ENT_PER_PAGE; ++i) {
1185 if (pt[i] == shadow_notrap_nonpresent_pte)
1186 set_shadow_pte(&pt[i], shadow_trap_nonpresent_pte);
1187 }
1188}
1189
1176struct page *gva_to_page(struct kvm_vcpu *vcpu, gva_t gva) 1190struct page *gva_to_page(struct kvm_vcpu *vcpu, gva_t gva)
1177{ 1191{
1178 struct page *page; 1192 struct page *page;