Re: [PATCH 1/2] x86/fpu: Rename "dynamic" XSTATEs to "independent"

From: Thomas Gleixner
Date: Fri Jun 11 2021 - 09:30:37 EST


On Fri, Jun 11 2021 at 10:01, Peter Zijlstra wrote:
> On Thu, Jun 10, 2021 at 10:13:36PM -0700, Andy Lutomirski wrote:
> Yesterday tglx proposed the *save*_to_{user,kernel}() and
> *rstor*_from_{user,kernel}() namespace for pretty much every other such
> function.
>
> And while I agree that independent_supervisor beats dynamic_supervisor
> for a name, they're both stupid long :-(
>
> I don't suppose we can simply use xsaves_to_kernel()
> xstrors_from_kernel() and add some magic to their respective mask
> handling to ensure that a mask belongs to only 1 (of 3) types.
>
> int types = 0;
>
> if (mask & xfeatures_mask_user())
> type++;
> if (mask & xfeatures_mask_supervisor())
> types++;
> if (mask & xfeatures_mask_independent())
> types++;
>
> if (WARN_ON_ONCE(type != 1))
> return;

We basically have only two sets which are exclusive:

Features which end up in task->fpu.state.xstate and those independent
ones. Let me add something like this to the pile I have anyway.

I pick up the rename of the mask bits though, as this dynamic naming is
really bad. I'm not too happy with that independent name either, but
it's at least better.

Thanks,

tglx