diff options
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 49079a46687b..3944e917e794 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -338,6 +338,9 @@ EXPORT_SYMBOL_GPL(kvm_lmsw); | |||
338 | 338 | ||
339 | void kvm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4) | 339 | void kvm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4) |
340 | { | 340 | { |
341 | unsigned long old_cr4 = vcpu->arch.cr4; | ||
342 | unsigned long pdptr_bits = X86_CR4_PGE | X86_CR4_PSE | X86_CR4_PAE; | ||
343 | |||
341 | if (cr4 & CR4_RESERVED_BITS) { | 344 | if (cr4 & CR4_RESERVED_BITS) { |
342 | printk(KERN_DEBUG "set_cr4: #GP, reserved bits\n"); | 345 | printk(KERN_DEBUG "set_cr4: #GP, reserved bits\n"); |
343 | kvm_inject_gp(vcpu, 0); | 346 | kvm_inject_gp(vcpu, 0); |
@@ -351,7 +354,8 @@ void kvm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4) | |||
351 | kvm_inject_gp(vcpu, 0); | 354 | kvm_inject_gp(vcpu, 0); |
352 | return; | 355 | return; |
353 | } | 356 | } |
354 | } else if (is_paging(vcpu) && !is_pae(vcpu) && (cr4 & X86_CR4_PAE) | 357 | } else if (is_paging(vcpu) && (cr4 & X86_CR4_PAE) |
358 | && ((cr4 ^ old_cr4) & pdptr_bits) | ||
355 | && !load_pdptrs(vcpu, vcpu->arch.cr3)) { | 359 | && !load_pdptrs(vcpu, vcpu->arch.cr3)) { |
356 | printk(KERN_DEBUG "set_cr4: #GP, pdptrs reserved bits\n"); | 360 | printk(KERN_DEBUG "set_cr4: #GP, pdptrs reserved bits\n"); |
357 | kvm_inject_gp(vcpu, 0); | 361 | kvm_inject_gp(vcpu, 0); |