Re: [PATCH 2/3] KVM: VMX: Treat partial support of an entry/exit pair as inconsistent
From: Sohil Mehta
Date: Wed Dec 02 2026 - 15:47:10 EST
On 12/2/2026 10:12 AM, Chang S. Bae wrote:
> On 11/25/2026 6:27 PM, Sohil Mehta wrote:
>> +/*
>> + * A pair may consist of one entry control and several exit controls. It
>> + * is consistent only if all of its controls are supported, or none
>> of them
>> + * are.
>> + */
>> #define vmx_check_entry_exit_pairs(pairs, entry_controls,
>> exit_controls) \
>> ({ \
> ...
>> - if (!(entry_controls & n_ctrl) == !(exit_controls &
>> x_ctrl)) \
>> + if ((exit_controls & x_ctrl) == \
>> + ((entry_controls & n_ctrl) ? x_ctrl : 0)) \
>> continue; \
>
> Nit: Since this condition is a little difficult to follow without
> explanation nearby, perhaps better to move the comment down right there.
>
I considered it but a multi-line comment inside a macro body felt odd. I
don't think any KVM macro or other arch/x86 code typically does it.
The comment describes what makes a pair consistent, which is what the
whole macro checks as well. So, I think it looks okay above the macro.
I'd prefer to keep it there unless you feel strongly about it.