acrn-hypervisor/hypervisor/arch/x86/guest
Kaige Fu 72f7f69c47 HV: Use NMI to kick lapic-pt vCPU's thread
ACRN hypervisor needs to kick vCPU off VMX non-root mode to do some
operations in hypervisor, such as interrupt/exception injection, EPT
flush etc. For non lapic-pt vCPUs, we can use IPI to do so. But, it
doesn't work for lapic-pt vCPUs as the IPI will be injected to VMs
directly without vmexit.

Without the way to kick the vCPU off VMX non-root mode to handle pending
request on time, there may be fatal errors triggered.
1). Certain operation may not be carried out on time which may further
    lead to fatal errors. Taking the EPT flush request as an example, once we
    don't flush the EPT on time and the guest access the out-of-date EPT,
    fatal error happens.
2). ACRN now will send an IPI with vector 0xF0 to target vCPU to kick the vCPU
    off VMX non-root mode if it wants to do some operations on target vCPU.
    However, this way doesn't work for lapic-pt vCPUs. The IPI will be delivered
    to the guest directly without vmexit and the guest will receive a unexpected
    interrupt. Consequently, if the guest can't handle this interrupt properly,
    fatal error may happen.

The NMI can be used as the notification signal to kick the vCPU off VMX
non-root mode for lapic-pt vCPUs. So, this patch uses NMI as notification signal
to address the above issues for lapic-pt vCPUs.

Tracked-On: #3886
Acked-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Kaige Fu <kaige.fu@intel.com>
2019-12-17 09:45:52 +08:00
..
assign.c HV: rename CONFIG_MAX_PCPU_NUM to MAX_PCPU_NUM 2019-12-12 13:49:28 +08:00
ept.c hv: refine 'uint64_t' string print format in x86 moudle 2019-11-09 11:42:38 +08:00
guest_memory.c hv: refine 'uint64_t' string print format in x86 moudle 2019-11-09 11:42:38 +08:00
hyperv.c HV: Kconfig: remove MAX_VCPUS_PER_VM in Kconfig 2019-12-12 13:49:28 +08:00
instr_emul.c hv: instr_emul: use cs segment when fetching instructions 2019-11-11 13:55:24 +08:00
pm.c hv:Wrap some APIs related with guest pm 2019-10-21 10:13:02 +08:00
trusty.c hv: support xsave in context switch 2019-12-02 09:31:12 +08:00
ucode.c
vcpu.c HV: Kconfig: remove MAX_VCPUS_PER_VM in Kconfig 2019-12-12 13:49:28 +08:00
vcpuid.c hv: support minimum set of TLFS 2019-10-22 10:09:16 +08:00
virq.c hv: make init_vmcs as a event of VCPU 2019-12-02 16:20:43 +08:00
virtual_cr.c hv: refine 'uint64_t' string print format in x86 moudle 2019-11-09 11:42:38 +08:00
vlapic_priv.h hv: add ops to vlapic structure 2019-07-19 16:47:06 +08:00
vlapic.c HV: Kconfig: remove MAX_VCPUS_PER_VM in Kconfig 2019-12-12 13:49:28 +08:00
vm_reset.c HV: expose port 0x64 read for SOS VM 2019-12-12 13:51:24 +08:00
vm.c hv:remove need_cleanup flag in create_vm 2019-12-12 16:34:13 +08:00
vmcall.c hv: refine 'uint64_t' string print format in x86 moudle 2019-11-09 11:42:38 +08:00
vmcs.c HV: Use NMI to kick lapic-pt vCPU's thread 2019-12-17 09:45:52 +08:00
vmexit.c HV: trace leaf and subleaf of cpuid 2019-12-03 16:34:14 +08:00
vmsr.c hv: msr: remove redundant check in write_pat_msr 2019-12-16 14:32:42 +08:00
vmtrr.c hv: refine 'uint64_t' string print format in x86 moudle 2019-11-09 11:42:38 +08:00
vmx_asm.S
vmx_io.c hv: ept: disable execute right on large pages 2019-11-13 08:00:36 +08:00