|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v2] x86/nsvm: Fix L2 VINTR intercept merging when only Xen intercepts L1
On 16/11/2026 18:13, Abdelkareem Abdelsaamad wrote:
> + if ( ns_vmcb->_vintr.vintr_masking &&
> + !(ns_vmcb->_general1_intercepts & GENERAL1_INTERCEPT_VINTR) )
> + n2vmcb->_general1_intercepts &= ~GENERAL1_INTERCEPT_VINTR;
The change looks right to me. With V_INTR_MASKING set, only L1's
EFLAGS.IF at VMRUN decides if L1's interrupts are blocked, and L2
cannot change it. So L0 does not need the VINTR intercept while L2
runs. In my last mail I also suggested checking L1's EFLAGS.IF, but
I think it is not needed.
A short comment here would help, for example:
/*
* Xen's VINTR intercept only works together with its dummy V_IRQ,
* which stays in the L1 VMCB. With V_INTR_MASKING set, L2 cannot
* unmask L1's interrupts, so the intercept is not needed here.
*/
Some comments on the commit message:
> Later, when Xen handles this forced
> VMEXIT_VINTR, it can result in losing \ overwriting an already injected L2
> virtual interrupt.
The handler only clears it, so "losing" is enough. Maybe "losing L1's
pending virtual interrupt for L2".
> svm_vmexit_handler clears the executing L2 VMCB's fields, in particular
> clearing the L1 set VIRQ_PENDING.
Please use V_IRQ, the name in the APM.
> There is still an edge case where L1 might pend receiving IRQ and still
> expects
> L2 to receive the L1 IRQ (i.e., when L1 clears the V_INTR_MASKIN while its
> EFLAGS.IF is not set).
Typo: V_INTR_MASKIN -> V_INTR_MASKING.
For the V_INTR_MASKING clear case, the old problem is still there.
Xen's dummy V_IRQ is not copied into the L2 VMCB, so the intercept only
fires when L1 has its own V_IRQ pending, and then the handler clears
it. I think it is OK to leave it for a follow-up.
Stephen
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |