Re: [PATCH v7 02/10] x86/fred: Pass event data to the NMI entry point from KVM
From: Sohil Mehta
Date: Fri Jun 13 2025 - 11:22:21 EST
On 6/12/2025 5:18 PM, Sean Christopherson wrote:
>> Read the VMCS exit qualification unconditionally since almost all
>> upcoming CPUs are expected to enable FRED and NMI-source together. In
>> the rare case that NMI-source isn't enabled, the extra VMREAD would be
>> harmless since the exit qualification is expected to be zero.
>
> Nit, instead of "is expected to be zero", something like this
>
> harmless since the exit qualification is architecturally guaranteed to be
> zero on CPUs that don't support NMI-source reporting. Per the SDM's
> "Exit qualification" subsection of "Basic VM-Exit Information":
>
> For all other VM exits, this field is cleared.
> --
>
Looks good. Clarifying it explicitly reduces ambiguity.
If this patchset gets applied directly, I am hoping the clarification
can be included while applying. If we end up doing another version, I'll
add it to the log.
> to make it very explicit that reading the exit qualification on older CPUs is 100%
> safe, e.g. even on non-FRED CPUs (see https://lore.kernel.org/all/aBUiwLV4ZY2HdRbz@xxxxxxxxxx).
>
That's interesting. Thanks for the link.
>> Suggested-by: Sean Christopherson <seanjc@xxxxxxxxxx>
>> Originally-by: Zeng Guang <guang.zeng@xxxxxxxxx>
>> Signed-off-by: Sohil Mehta <sohil.mehta@xxxxxxxxx>
>> ---
>
> Acked-by: Sean Christopherson <seanjc@xxxxxxxxxx>
Thank you!