Re: [PATCH 0/7] Use NMI to nofity vCPUs with lapic-pt


Kaige Fu
 

Hi Sainath,

Thanks for your review. Comment inline.

-----Original Message-----
From: acrn-dev@... <acrn-dev@...> On
Behalf Of Grandhi, Sainath
Sent: Friday, December 6, 2019 2:22 PM
To: acrn-dev@...
Subject: Re: [acrn-dev] [PATCH 0/7] Use NMI to nofity vCPUs with lapic-pt



-----Original Message-----
From: acrn-dev@... <acrn-dev@...>
On Behalf Of Kaige Fu
Sent: Friday, December 06, 2019 5:48 AM
To: acrn-dev@...
Subject: [acrn-dev] [PATCH 0/7] Use NMI to nofity vCPUs with lapic-pt

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.

Consequently, 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). The IPI vector will be delivered to VMs
directly. If the guest can't handle it properly, further interrupts might be
blocked which will cause the VMs hang.

The NMI can be used as the notification signal to kick the vCPU off
VMX non- root mode for lapic-pt vCPUs. This patchset does it by enable
NMI-exiting after passthroughing the lapic to vCPU.

TODOs:
- Filter out all NMI sources:
* Write ICR with deliver mode NMI
* Program the MSI data with deliver mode NMI
* Program the LVTs with deliver mode NMI
- Implement the smp_call for lapic-pt VMs to facilitate the debug
of lapic-pt VMs.

Kaige Fu (7):
HV: Push NMI vector on to the exception stack
HV: Add helper function send_single_nmi
HV: Use NMI to kick lapic-pt vCPU's thread
HV: ignore the NMI injection request for lapic-pt vCPUs
HV: Use NMI-window exiting to address req missing issue
Hi Kaige,
This patch " Use NMI-window exiting to address req missing issue"
has nothing to do LAPIC PT and "NMI being used for notification". Is that right?
When we use the NMI signal to kick the vCPU thread, there is such kind of issue that
we may miss the request in current notification period. In this way, this patch has something
to do with LAPIC PT and "NMI being used for notification".

However, there may be the same issue when we use IPI for non lapic-pt VMs to kick the vCPU thread.
I will investigate it and see if there is such kind of issue in current code.

HV: Use NMI to replace INIT signal for lapic-pt VMs S5
HV: Remove INIT signal notification related code

hypervisor/arch/x86/guest/virq.c | 76 ++++++++++++++++++++--------
hypervisor/arch/x86/guest/vmcs.c | 18 +++++--
hypervisor/arch/x86/guest/vmexit.c | 23 +--------
hypervisor/arch/x86/idt.S | 6 +--
hypervisor/arch/x86/irq.c | 55 ++++++++++++++++----
hypervisor/arch/x86/lapic.c | 9 +---
hypervisor/common/schedule.c | 24 ++++++---
hypervisor/include/arch/x86/irq.h | 1 +
hypervisor/include/arch/x86/lapic.h | 4 +-
hypervisor/include/common/schedule.h | 4 +-
10 files changed, 146 insertions(+), 74 deletions(-)

--
2.20.0



Join acrn-dev@lists.projectacrn.org to automatically receive all group messages.