diff options
author | Avi Kivity <avi@qumranet.com> | 2007-01-05 19:36:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2007-01-06 02:55:24 -0500 |
commit | aef3d3fe1314f2a130f5ccc7114df20865ba784f (patch) | |
tree | 7814192c1b4b8b438885dd59a4fa6c31cab71ede /drivers/kvm | |
parent | 1b0973bd8f788178f21d9eebdd879203464f8528 (diff) |
[PATCH] KVM: MMU: Make the shadow page tables also special-case pae
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')
-rw-r--r-- | drivers/kvm/paging_tmpl.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h index 3ade9445ab23..7af49ae80e5a 100644 --- a/drivers/kvm/paging_tmpl.h +++ b/drivers/kvm/paging_tmpl.h | |||
@@ -170,6 +170,11 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr, | |||
170 | 170 | ||
171 | shadow_addr = vcpu->mmu.root_hpa; | 171 | shadow_addr = vcpu->mmu.root_hpa; |
172 | level = vcpu->mmu.shadow_root_level; | 172 | level = vcpu->mmu.shadow_root_level; |
173 | if (level == PT32E_ROOT_LEVEL) { | ||
174 | shadow_addr = vcpu->mmu.pae_root[(addr >> 30) & 3]; | ||
175 | shadow_addr &= PT64_BASE_ADDR_MASK; | ||
176 | --level; | ||
177 | } | ||
173 | 178 | ||
174 | for (; ; level--) { | 179 | for (; ; level--) { |
175 | u32 index = SHADOW_PT_INDEX(addr, level); | 180 | u32 index = SHADOW_PT_INDEX(addr, level); |
@@ -202,10 +207,8 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr, | |||
202 | shadow_addr = kvm_mmu_alloc_page(vcpu, shadow_ent); | 207 | shadow_addr = kvm_mmu_alloc_page(vcpu, shadow_ent); |
203 | if (!VALID_PAGE(shadow_addr)) | 208 | if (!VALID_PAGE(shadow_addr)) |
204 | return ERR_PTR(-ENOMEM); | 209 | return ERR_PTR(-ENOMEM); |
205 | shadow_pte = shadow_addr | PT_PRESENT_MASK; | 210 | shadow_pte = shadow_addr | PT_PRESENT_MASK | PT_ACCESSED_MASK |
206 | if (vcpu->mmu.root_level > 3 || level != 3) | 211 | | PT_WRITABLE_MASK | PT_USER_MASK; |
207 | shadow_pte |= PT_ACCESSED_MASK | ||
208 | | PT_WRITABLE_MASK | PT_USER_MASK; | ||
209 | *shadow_ent = shadow_pte; | 212 | *shadow_ent = shadow_pte; |
210 | prev_shadow_ent = shadow_ent; | 213 | prev_shadow_ent = shadow_ent; |
211 | } | 214 | } |