Re: [PATCH v4 7/8] x86/fpu/xstate: Introduce "guest-only" supervisor xfeature set

From: Chao Gao
Date: Wed Apr 02 2025 - 00:29:55 EST


On Tue, Apr 01, 2025 at 10:16:24AM -0700, Chang S. Bae wrote:
>On 3/18/2025 8:31 AM, Chao Gao wrote:
>>
>> Dropped Dave's Suggested-by as the patch has been changed significantly
>
>I think you should provide a clear argument outlining the considerable naming
>options and their trade-offs.
>
>I noticed you referenced Thomas’s feedback in the cover letter (it would be
>clearer to elaborate here rather than using just the above one-liner):
>
>> Rename XFEATURE_MASK_KERNEL_DYNAMIC to XFEATURE_MASK_SUPERVISOR_GUEST
>> as tglx noted "this dynamic naming is really bad":
>>
>> https://lore.kernel.org/all/87sg1owmth.ffs@xxxxxxxxxxxxxxxxxxxxxxx/
>
>While Thomas objected to the "dynamic" naming, have you fully considered why
>he found it problematic? Likewise, have you re-evaluated Dave’s original
>suggestion and his intent? Rather than just quoting feedback, you should
>summarize the key concerns, analyze the pros and cons of different naming
>approaches, and clearly justify your final choice.

Hi Chang,

The 'dynamic' naming was initially slightly preferred over 'guest-only'. But
later I discovered new evidence suggesting we should be cautious with the
'dynamic' naming, leading me to choose 'guest-only'.

'dynamic' is abstract, while 'guest-only' more clearly conveys the intended
purpose. Using "dynamic" might cause confusion, as it could be associated with
dynamic user features. As you noted in the last version, it is quite confusing
because it doesn't involve permissions and reallocations like dynamic user
features do.

I'm not entirely sure why Thomas found "dynamic" problematic. His comment, made
4 years ago, was about independent features. But I am sure that we shouldn't
reinstate a name that was considered "really bad" without strong justification.

And Dave clearly mentioned he wouldn't oppose the "guest-only" name [1]:

But I also don't feel strongly about it and I've said my peace. I won't NAK
it one way or the other.

Therefore, to be cautious, I chose "guest-only," assuming it is acceptable to
Dave and can prevent Thomas and others from questioning the reinstatement of
dynamic supervisor features.

I can add my thoughts below the --- separator line if the above answers your
questions.

[1]: https://lore.kernel.org/all/893ac578-baaf-4f4f-96ee-e012dfc073a8@xxxxxxxxx/#t