diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2008-02-20 14:47:24 -0500 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-04-27 04:53:25 -0400 |
commit | 2e53d63acba75795aa226febd140f67c58c6a353 (patch) | |
tree | be4ad4e5b28c737053af78a950d270a657e9f628 /arch/x86/kvm/x86.c | |
parent | 847f0ad8cbfa70c1af6948025836dfbd9ed6da1e (diff) |
KVM: MMU: ignore zapped root pagetables
Mark zapped root pagetables as invalid and ignore such pages during lookup.
This is a problem with the cr3-target feature, where a zapped root table fools
the faulting code into creating a read-only mapping. The result is a lockup
if the instruction can't be emulated.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 0dd038e7392b..e8e64927bddc 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -2658,6 +2658,10 @@ preempted: | |||
2658 | kvm_x86_ops->guest_debug_pre(vcpu); | 2658 | kvm_x86_ops->guest_debug_pre(vcpu); |
2659 | 2659 | ||
2660 | again: | 2660 | again: |
2661 | if (vcpu->requests) | ||
2662 | if (test_and_clear_bit(KVM_REQ_MMU_RELOAD, &vcpu->requests)) | ||
2663 | kvm_mmu_unload(vcpu); | ||
2664 | |||
2661 | r = kvm_mmu_reload(vcpu); | 2665 | r = kvm_mmu_reload(vcpu); |
2662 | if (unlikely(r)) | 2666 | if (unlikely(r)) |
2663 | goto out; | 2667 | goto out; |
@@ -2689,6 +2693,14 @@ again: | |||
2689 | goto out; | 2693 | goto out; |
2690 | } | 2694 | } |
2691 | 2695 | ||
2696 | if (vcpu->requests) | ||
2697 | if (test_bit(KVM_REQ_MMU_RELOAD, &vcpu->requests)) { | ||
2698 | local_irq_enable(); | ||
2699 | preempt_enable(); | ||
2700 | r = 1; | ||
2701 | goto out; | ||
2702 | } | ||
2703 | |||
2692 | if (signal_pending(current)) { | 2704 | if (signal_pending(current)) { |
2693 | local_irq_enable(); | 2705 | local_irq_enable(); |
2694 | preempt_enable(); | 2706 | preempt_enable(); |