aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2010-03-14 04:16:40 -0400
committerAvi Kivity <avi@redhat.com>2010-05-17 05:16:44 -0400
commit84b0c8c6a6f87b62bca93727dee12ec59e32e597 (patch)
tree2ae71e4f9000ea90f8ed2dea192ffb4662fbc2eb
parentf815bce8940bc28e42e6b924825bb31df2a4bff5 (diff)
KVM: MMU: Disassociate direct maps from guest levels
Direct maps are linear translations for a section of memory, used for real mode or with large pages. As such, they are independent of the guest levels. Teach the mmu about this by making page->role.glevels = 0 for direct maps. This allows direct maps to be shared among real mode and the various paging modes. Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r--arch/x86/kvm/mmu.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 83d2ebce9ea9..1cc60d3f445b 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -1329,6 +1329,8 @@ static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu,
1329 role = vcpu->arch.mmu.base_role; 1329 role = vcpu->arch.mmu.base_role;
1330 role.level = level; 1330 role.level = level;
1331 role.direct = direct; 1331 role.direct = direct;
1332 if (role.direct)
1333 role.glevels = 0;
1332 role.access = access; 1334 role.access = access;
1333 if (vcpu->arch.mmu.root_level <= PT32_ROOT_LEVEL) { 1335 if (vcpu->arch.mmu.root_level <= PT32_ROOT_LEVEL) {
1334 quadrant = gaddr >> (PAGE_SHIFT + (PT64_PT_BITS * level)); 1336 quadrant = gaddr >> (PAGE_SHIFT + (PT64_PT_BITS * level));