aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kvm/mmu.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 51d4cd7ae4f9..3ee856f6812d 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -1240,15 +1240,10 @@ static int __direct_map(struct kvm_vcpu *vcpu, gpa_t v, int write,
1240 ASSERT(VALID_PAGE(table_addr)); 1240 ASSERT(VALID_PAGE(table_addr));
1241 table = __va(table_addr); 1241 table = __va(table_addr);
1242 1242
1243 if (level == 1) { 1243 if (level == 1 || (largepage && level == 2)) {
1244 mmu_set_spte(vcpu, &table[index], ACC_ALL, ACC_ALL, 1244 mmu_set_spte(vcpu, &table[index], ACC_ALL, ACC_ALL,
1245 0, write, 1, &pt_write, 0, gfn, pfn, false); 1245 0, write, 1, &pt_write, largepage,
1246 return pt_write; 1246 gfn, pfn, false);
1247 }
1248
1249 if (largepage && level == 2) {
1250 mmu_set_spte(vcpu, &table[index], ACC_ALL, ACC_ALL,
1251 0, write, 1, &pt_write, 1, gfn, pfn, false);
1252 return pt_write; 1247 return pt_write;
1253 } 1248 }
1254 1249