All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: speck@linutronix.de
Subject: [MODERATED] Re: SBB V10 Bundle
Date: Thu, 3 May 2018 08:07:15 +0200	[thread overview]
Message-ID: <20180503060715.pbit46ttgwjfbi4e@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1805021508230.1560@nanos.tec.linutronix.de>


* speck for Thomas Gleixner <speck@linutronix.de> wrote:

> > ==============>
> > b4fe2032d782: prctl: Add speculation control prctls
> > 
> > +/* Per task speculation control */
> > +#define PR_SET_SPECULATION_CTRL                52
> > +#define PR_GET_SPECULATION_CTRL                53
> > 
> > Please flip this around, i.e.:
> > 
> >   /* Per task speculation control */
> >   #define PR_GET_SPECULATION_CTRL                52
> >   #define PR_SET_SPECULATION_CTRL                53
> > 
> > because GET/SET is the canonical ABI order, used in most early prctl()s as well, 
> > until someone messed it up in PR_SET_TIMERSLACK, which bad example then everyone 
> > after that cargo-cult-copied ... Let's go back to the original ABI sanity.

JFYI, you didn't reply to this one - forgot to reply?

> > +       case PR_SET_SPECULATION_CTRL:
> > +               if (arg4 || arg5)
> > +                       return -EINVAL;
> > 
> > So I think returning -ENOSYS might be better, to allow future extensions to use 
> > -EINVAL for a real invalid value - and allow -ENOSYS to be the "older kernel" 
> > disambiguation. For tools that care.
> 
> Take that up with Linus. See his reply on that :)

Sorry, if that was on this list then his remarks are either not in my archive,
or Mutt doesn't properly search inside encrypted mails, or the list wasn't
Cc:-ed to that reply. Mind quoting that reply here?

Without having seen his reply:

- When introducing _new_ ABIs then using -ENOSYS is entirely canonical for "no 
  support exists that, yet".

- For _existing_ driver and syscall interfaces using -ENOSYS can be indeed be
  confusing to apps and thus be the wrong thing to use.

> > Also, a naive reading of the boot options:
> > 
> >                         auto   - Kernel detects whether the CPU model contains a
> >                                  implementation of Speculative Store Bypass and
> >                                  picks the most appropriate mitigation
> > +                       prctl  - Control Speculative Store Bypass for a thread
> > +                                via prctl. By default it is enabled. The state
> > +                                is inherited on fork.
> > 
> > does not resolve the question of whether 'on', 'on', 'auto' or 'prctl' is the best 
> > option to use. I.e. the interaction of on/off/auto/prctl isn't clear IMHO.
> 
> Can you come up with something better?

Sure:

                       auto   - Kernel detects whether the CPU model contains a
                                implementation of Speculative Store Bypass and
                                picks the most appropriate mitigation global
                                mitigation policy, which cannot be influenced
                                by apps even via prctl.
                       prctl  - Control Speculative Store Bypass for a thread
                                via prctl. By default mitigation is enabled.
                                The state is inherited on fork.

Btw., is it true that in the 'prctl' case mitigation is always enabled? If it's 
still CPU family/model sensitive like 'auto', which I think it is, then it might 
be more accurate to write:

                       prctl  - Control Speculative Store Bypass for a thread
                                via prctl. By default mitigation is enabled
                                on affected CPUs. The state is inherited on fork.

or so?

Thanks,

	Ingo

  parent reply	other threads:[~2018-05-03  6:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-01 22:53 SBB V10 Bundle Thomas Gleixner
2018-05-02 11:04 ` [MODERATED] " Ingo Molnar
2018-05-02 12:07 ` Ingo Molnar
2018-05-02 13:23   ` Thomas Gleixner
2018-05-03  5:58     ` [MODERATED] " Ingo Molnar
2018-05-03  6:07     ` Ingo Molnar [this message]
2018-05-03  6:18       ` Thomas Gleixner
2018-05-03  6:27       ` Thomas Gleixner
2018-05-03  6:31         ` Thomas Gleixner

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=20180503060715.pbit46ttgwjfbi4e@gmail.com \
    --to=mingo@kernel.org \
    --cc=speck@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.