diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2010-09-10 11:30:38 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-10-24 04:52:27 -0400 |
commit | 957446afce22df9a42b9482fcd55985f4037fe66 (patch) | |
tree | 13b3965a5cb6096397ec2ed4cdd5a5a4e2ec7fe6 /arch | |
parent | 7b91409822ed37f2a58974e49498bdbe92ddd93c (diff) |
KVM: MMU: Check for root_level instead of long mode
The walk_addr function checks for !is_long_mode in its 64
bit version. But what is meant here is a check for pae
paging. Change the condition to really check for pae paging
so that it also works with nested nested paging.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/paging_tmpl.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index debe77035366..e4ad3dc84df3 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h | |||
@@ -132,7 +132,7 @@ walk: | |||
132 | walker->level = vcpu->arch.mmu.root_level; | 132 | walker->level = vcpu->arch.mmu.root_level; |
133 | pte = vcpu->arch.cr3; | 133 | pte = vcpu->arch.cr3; |
134 | #if PTTYPE == 64 | 134 | #if PTTYPE == 64 |
135 | if (!is_long_mode(vcpu)) { | 135 | if (vcpu->arch.mmu.root_level == PT32E_ROOT_LEVEL) { |
136 | pte = kvm_pdptr_read(vcpu, (addr >> 30) & 3); | 136 | pte = kvm_pdptr_read(vcpu, (addr >> 30) & 3); |
137 | trace_kvm_mmu_paging_element(pte, walker->level); | 137 | trace_kvm_mmu_paging_element(pte, walker->level); |
138 | if (!is_present_gpte(pte)) { | 138 | if (!is_present_gpte(pte)) { |
@@ -205,7 +205,7 @@ walk: | |||
205 | (PTTYPE == 64 || is_pse(vcpu))) || | 205 | (PTTYPE == 64 || is_pse(vcpu))) || |
206 | ((walker->level == PT_PDPE_LEVEL) && | 206 | ((walker->level == PT_PDPE_LEVEL) && |
207 | is_large_pte(pte) && | 207 | is_large_pte(pte) && |
208 | is_long_mode(vcpu))) { | 208 | vcpu->arch.mmu.root_level == PT64_ROOT_LEVEL)) { |
209 | int lvl = walker->level; | 209 | int lvl = walker->level; |
210 | 210 | ||
211 | walker->gfn = gpte_to_gfn_lvl(pte, lvl); | 211 | walker->gfn = gpte_to_gfn_lvl(pte, lvl); |