From: Chunjie Zhu <chunjie.zhu@citrix.com>
With V_INTR_MASKING=0 in L1's VMCB, L2's EFLAGS.IF masks physical
interrupts, but L0 always runs L2 with V_INTR_MASKING set, so an
interrupt would exit to L0 and be forwarded to L1 even with L2's IF
clear. Patch 2 fixes this in nsvm_intr_blocked().
As Ross pointed out, that check must not hold back NMI/#MC, and the
callers of nhvm_interrupt_blocked() already ignore the blocking reason,
which is wrong for NMI/#MC even with V_INTR_MASKING=1. Patch 1 fixes
that first.
Changes in v2:
* Move the check into nsvm_intr_blocked() instead of
nestedsvm_vcpu_interrupt().
* Add patch 1 to stop EFLAGS.IF from blocking NMI/#MC.
* Report hvm_intblk_arch from nvmx_intr_blocked() for states that have
nothing to do with RFLAGS.IF, so patch 1 doesn't affect VMX.
Chunjie Zhu (2):
x86/hvm: don't let EFLAGS.IF block NMI/#MC due to nested state
x86/nestedsvm: honour L2's EFLAGS.IF when L1 clears V_INTR_MASKING
xen/arch/x86/hvm/hvm.c | 2 +-
xen/arch/x86/hvm/svm/nestedsvm.c | 14 +++++++++++---
xen/arch/x86/hvm/vmx/intr.c | 6 +++---
xen/arch/x86/include/asm/hvm/hvm.h | 12 ++++++++++--
4 files changed, 25 insertions(+), 9 deletions(-)
--
2.34.1