aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/mmu.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r--arch/x86/kvm/mmu.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 064c3efb49dc..83d2ebce9ea9 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -2297,13 +2297,19 @@ static void reset_rsvds_bits_mask(struct kvm_vcpu *vcpu, int level)
2297 /* no rsvd bits for 2 level 4K page table entries */ 2297 /* no rsvd bits for 2 level 4K page table entries */
2298 context->rsvd_bits_mask[0][1] = 0; 2298 context->rsvd_bits_mask[0][1] = 0;
2299 context->rsvd_bits_mask[0][0] = 0; 2299 context->rsvd_bits_mask[0][0] = 0;
2300 context->rsvd_bits_mask[1][0] = context->rsvd_bits_mask[0][0];
2301
2302 if (!is_pse(vcpu)) {
2303 context->rsvd_bits_mask[1][1] = 0;
2304 break;
2305 }
2306
2300 if (is_cpuid_PSE36()) 2307 if (is_cpuid_PSE36())
2301 /* 36bits PSE 4MB page */ 2308 /* 36bits PSE 4MB page */
2302 context->rsvd_bits_mask[1][1] = rsvd_bits(17, 21); 2309 context->rsvd_bits_mask[1][1] = rsvd_bits(17, 21);
2303 else 2310 else
2304 /* 32 bits PSE 4MB page */ 2311 /* 32 bits PSE 4MB page */
2305 context->rsvd_bits_mask[1][1] = rsvd_bits(13, 21); 2312 context->rsvd_bits_mask[1][1] = rsvd_bits(13, 21);
2306 context->rsvd_bits_mask[1][0] = context->rsvd_bits_mask[1][0];
2307 break; 2313 break;
2308 case PT32E_ROOT_LEVEL: 2314 case PT32E_ROOT_LEVEL:
2309 context->rsvd_bits_mask[0][2] = 2315 context->rsvd_bits_mask[0][2] =
@@ -2316,7 +2322,7 @@ static void reset_rsvds_bits_mask(struct kvm_vcpu *vcpu, int level)
2316 context->rsvd_bits_mask[1][1] = exb_bit_rsvd | 2322 context->rsvd_bits_mask[1][1] = exb_bit_rsvd |
2317 rsvd_bits(maxphyaddr, 62) | 2323 rsvd_bits(maxphyaddr, 62) |
2318 rsvd_bits(13, 20); /* large page */ 2324 rsvd_bits(13, 20); /* large page */
2319 context->rsvd_bits_mask[1][0] = context->rsvd_bits_mask[1][0]; 2325 context->rsvd_bits_mask[1][0] = context->rsvd_bits_mask[0][0];
2320 break; 2326 break;
2321 case PT64_ROOT_LEVEL: 2327 case PT64_ROOT_LEVEL:
2322 context->rsvd_bits_mask[0][3] = exb_bit_rsvd | 2328 context->rsvd_bits_mask[0][3] = exb_bit_rsvd |
@@ -2334,7 +2340,7 @@ static void reset_rsvds_bits_mask(struct kvm_vcpu *vcpu, int level)
2334 context->rsvd_bits_mask[1][1] = exb_bit_rsvd | 2340 context->rsvd_bits_mask[1][1] = exb_bit_rsvd |
2335 rsvd_bits(maxphyaddr, 51) | 2341 rsvd_bits(maxphyaddr, 51) |
2336 rsvd_bits(13, 20); /* large page */ 2342 rsvd_bits(13, 20); /* large page */
2337 context->rsvd_bits_mask[1][0] = context->rsvd_bits_mask[1][0]; 2343 context->rsvd_bits_mask[1][0] = context->rsvd_bits_mask[0][0];
2338 break; 2344 break;
2339 } 2345 }
2340} 2346}