Details about handling NMI in KVM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



handle_exception: nmi was ignored in vmx-exit handler function,cause
it has been dealt in vmx_vcpu_run before.

4222 static int handle_exception(struct kvm_vcpu *vcpu)
....
4246
4247         if ((intr_info & INTR_INFO_INTR_TYPE_MASK) == INTR_TYPE_NMI_INTR)
4248                 return 1;  /* already handled by vmx_vcpu_run() */**

vmx_vcpu_run:this function will launch the vmx virtual pc,and the last
three lines handle the vmx_exit,so they are actuall in vmx host
status.the NMI is handled in vmx_complete_atomic_exit.

6133 static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
...
             vmx_complete_atomic_exit(vmx);
6303         vmx_recover_nmi_blocking(vmx);
6304         vmx_complete_interrupts(vmx);
6305 }

vmx_complete_atomic_exit:in this function,nmi is handled by execute
"int $2",rasise a nmi IRQ in vmx_host.how does this work????

5963 static void vmx_complete_atomic_exit(struct vcpu_vmx *vmx)
             ....
5967         if (!(vmx->exit_reason == EXIT_REASON_MCE_DURING_VMENTRY
5968               || vmx->exit_reason == EXIT_REASON_EXCEPTION_NMI))
5969                 return;
5970
5971         vmx->exit_intr_info = vmcs_read32(VM_EXIT_INTR_INFO);
5972         exit_intr_info = vmx->exit_intr_info;
             ...
5977
5978         /* We need to handle NMIs before interrupts are enabled */
5979         if ((exit_intr_info & INTR_INFO_INTR_TYPE_MASK) ==
INTR_TYPE_NMI_INTR &&
5980             (exit_intr_info & INTR_INFO_VALID_MASK)) {
5981                 kvm_before_handle_nmi(&vmx->vcpu);
5982                 asm("int $2");
5983                 kvm_after_handle_nmi(&vmx->vcpu);
5984         }
5985 }
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux