diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2008-09-26 03:30:51 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2008-12-31 09:51:41 -0500 |
commit | 66a5a347c2690db4c0756524a8eb5a05e0437aa8 (patch) | |
tree | 2539e97b26b2b9539955381d5713aa42397cf84e | |
parent | f460ee43e250b675376246b1c4c9fe9b9af4ab16 (diff) |
KVM: VMX: fix real-mode NMI support
Fix NMI injection in real-mode with the same pattern we perform IRQ
injection.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r-- | arch/x86/kvm/vmx.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 440f56cd4bdd..38d138566617 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -2358,6 +2358,19 @@ static void vmx_inject_irq(struct kvm_vcpu *vcpu, int irq) | |||
2358 | 2358 | ||
2359 | static void vmx_inject_nmi(struct kvm_vcpu *vcpu) | 2359 | static void vmx_inject_nmi(struct kvm_vcpu *vcpu) |
2360 | { | 2360 | { |
2361 | struct vcpu_vmx *vmx = to_vmx(vcpu); | ||
2362 | |||
2363 | if (vcpu->arch.rmode.active) { | ||
2364 | vmx->rmode.irq.pending = true; | ||
2365 | vmx->rmode.irq.vector = NMI_VECTOR; | ||
2366 | vmx->rmode.irq.rip = kvm_rip_read(vcpu); | ||
2367 | vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, | ||
2368 | NMI_VECTOR | INTR_TYPE_SOFT_INTR | | ||
2369 | INTR_INFO_VALID_MASK); | ||
2370 | vmcs_write32(VM_ENTRY_INSTRUCTION_LEN, 1); | ||
2371 | kvm_rip_write(vcpu, vmx->rmode.irq.rip - 1); | ||
2372 | return; | ||
2373 | } | ||
2361 | vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, | 2374 | vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, |
2362 | INTR_TYPE_NMI_INTR | INTR_INFO_VALID_MASK | NMI_VECTOR); | 2375 | INTR_TYPE_NMI_INTR | INTR_INFO_VALID_MASK | NMI_VECTOR); |
2363 | } | 2376 | } |