diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-25 18:51:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-25 18:51:27 -0400 |
commit | b18f1e21993f73f072b1e0859f942fb11afddcb1 (patch) | |
tree | 50c8a36a1518d43a4198afb304a05727609b24f7 /arch | |
parent | a0c1af135a93ee25b07cbc61762fb957fd2f3733 (diff) | |
parent | a2edf57f510cce6a389cc14e58c6ad0a4296d6f9 (diff) |
Merge branch 'kvm-updates/2.6.30' of git://git.kernel.org/pub/scm/virt/kvm/kvm
* 'kvm-updates/2.6.30' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
KVM: Fix PDPTR reloading on CR4 writes
KVM: Make paravirt tlb flush also reload the PAE PDPTRs
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/mmu.c | 3 | ||||
-rw-r--r-- | arch/x86/kvm/x86.c | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index b6caf1329b1b..32cf11e5728a 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -2897,8 +2897,7 @@ static int kvm_pv_mmu_write(struct kvm_vcpu *vcpu, | |||
2897 | 2897 | ||
2898 | static int kvm_pv_mmu_flush_tlb(struct kvm_vcpu *vcpu) | 2898 | static int kvm_pv_mmu_flush_tlb(struct kvm_vcpu *vcpu) |
2899 | { | 2899 | { |
2900 | kvm_x86_ops->tlb_flush(vcpu); | 2900 | kvm_set_cr3(vcpu, vcpu->arch.cr3); |
2901 | set_bit(KVM_REQ_MMU_SYNC, &vcpu->requests); | ||
2902 | return 1; | 2901 | return 1; |
2903 | } | 2902 | } |
2904 | 2903 | ||
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); |