Re: [PATCH RFC v1 02/11] x86/fpu/xstate: Introduce xstate order table and accessor macro

From: Ingo Molnar
Date: Thu Feb 27 2025 - 15:06:26 EST



* Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:

> > I really don't see the issue:
> >
> >> There were basically three choices: 1. Reuse XFEATURES 3/4 (MPX) 2.
> >> Create a new out-of-order XFEATURE 19 that reuses MPX space 3. Create
> >> a n in-order XFEATURE 19 that needs XFD and an opt-in #1 risks
> >> breaking old MPX code in weird ways.
> >
> > This is a false trichotomy. ;-)
> >
> > There's a 4th option:
> >
> > 4. Reuse XFEATURES 3/4 (MPX) only on APX-aware kernels, keep it
> > disabled for old kernels.
> >
> > Problem solved.
>
> Forget breaking MPX code in weird ways; there's very little of it,
> and it was distinctly of negative value.
>
> What options #1 and #4 will cause is the virt people to come after
> you with sharp implements for creating incompatibilities in an ABI. 
> The XFEATUREs are the tag(ish) of the union that is the xsave buffer.

There's no incompatibility for a default-disabled feature that gets
enabled by an AVX-aware host kernel and by AVX-aware guest kernels.
What ABI would be broken?

Kernels need to be updated for AVX support *anyway*, so it's not like
the proposed approach is a simple shoe-in for old kernels.

Thanks,

Ingo