linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Peter Zijlstra <peterz@infradead.org>, Andy Lutomirski <luto@kernel.org>
Cc: x86@kernel.org, Dave Hansen <dave.hansen@intel.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] x86/fpu: Rename "dynamic" XSTATEs to "independent"
Date: Fri, 11 Jun 2021 15:30:34 +0200	[thread overview]
Message-ID: <87sg1owmth.ffs@nanos.tec.linutronix.de> (raw)
In-Reply-To: <YMMYUGW9f7CUJ+oz@hirez.programming.kicks-ass.net>

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


    

  reply	other threads:[~2021-06-11 13:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-11  5:13 [PATCH 0/2] x86/fpu: Clean up "dynamic" APIs Andy Lutomirski
2021-06-11  5:13 ` [PATCH 1/2] x86/fpu: Rename "dynamic" XSTATEs to "independent" Andy Lutomirski
2021-06-11  8:01   ` Peter Zijlstra
2021-06-11 13:30     ` Thomas Gleixner [this message]
2021-06-23 22:09   ` [tip: x86/fpu] " tip-bot2 for Andy Lutomirski
2021-06-11  5:13 ` [PATCH 2/2] x86/fpu: Improve FPU APIs for independent features Andy Lutomirski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sg1owmth.ffs@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=dave.hansen@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).