diff options
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-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 | } |