summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.h
diff options
context:
space:
mode:
authorGleb Natapov2009-05-11 12:35:46 +0200
committerAvi Kivity2009-06-10 10:48:57 +0200
commit3298b75c880d6f0fd70750233c0f3e71a72a5bfb (patch)
tree8472e1747ac49a43d13e8c4c232415d107c6f3bc /arch/x86/kvm/x86.h
parentKVM: s390: Verify memory in kvm run (diff)
downloadkernel-qcow2-linux-3298b75c880d6f0fd70750233c0f3e71a72a5bfb.tar.gz
kernel-qcow2-linux-3298b75c880d6f0fd70750233c0f3e71a72a5bfb.tar.xz
kernel-qcow2-linux-3298b75c880d6f0fd70750233c0f3e71a72a5bfb.zip
KVM: Unprotect a page if #PF happens during NMI injection.
It is done for exception and interrupt already. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.h')
-rw-r--r--arch/x86/kvm/x86.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h
index 39350b252725..21203d421276 100644
--- a/arch/x86/kvm/x86.h
+++ b/arch/x86/kvm/x86.h
@@ -30,4 +30,10 @@ static inline u8 kvm_pop_irq(struct kvm_vcpu *vcpu)
clear_bit(word_index, &vcpu->arch.irq_summary);
return irq;
}
+
+static inline bool kvm_event_needs_reinjection(struct kvm_vcpu *vcpu)
+{
+ return vcpu->arch.exception.pending || vcpu->arch.interrupt.pending ||
+ vcpu->arch.nmi_injected;
+}
#endif