All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: speck@linutronix.de
Subject: Re: [patch V8 13/15] SSB 13
Date: Tue, 1 May 2018 15:29:04 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.21.1805011522060.1596@nanos.tec.linutronix.de> (raw)
In-Reply-To: <alpine.DEB.2.21.1805011005110.1596@nanos.tec.linutronix.de>

On Tue, 1 May 2018, speck for Thomas Gleixner wrote:

> On Mon, 30 Apr 2018, speck for Kees Cook wrote:
> 
> > On Mon, Apr 30, 2018 at 05:04:36PM +0200, speck for Thomas Gleixner wrote:
> > > Subject: [patch V8 13/15] prctl: Add speculation control prctls
> > > From: Thomas Gleixner <tglx@linutronix.de>
> > > 
> > > Add two new prctls to control aspects of speculation related vulnerabilites
> > > and their mitigations to provide finer grained control over performance
> > > impacting mitigations.
> > > 
> > > PR_GET_SPECULATION_CTRL returns the state of the speculation misfeature
> > > which is selected with arg2 of prctl(2). The return value uses bit 0-2 with
> > > the following meaning:
> > > 
> > > Bit  Define           Description
> > > 0    PR_SPEC_PRCTL    Mitigation can be controlled per task by
> > >                       PR_SET_SPECULATION_CTRL
> > > 1    PR_SPEC_ENABLE   The speculation feature is enabled, mitigation is
> > >                       disabled
> > > 2    PR_SPEC_DISABLE  The speculation feature is disabled, mitigation is
> > >                       enabled
> > 
> > Err, what does it mean to have both bits 1 and 2 set?
> 
> The bits are either or. Both set are invalid. That's a leftover from
> something I experimented with earlier.
> 
> But yes, we can consolidate them into one.

Thinking about it with enough coffee applied, I know why I kept it that
way. If we just have a single bit then there is no way to check whether the
CPU is affected or not.

Bit 0  		Bit 1

0		0		PRCTL disabled, Speculation enabled
1		0		PRCTL enabled, Speculation enabled
0		1		PRCTL disabled, Speculation disabled
1		1		PRCTL enabled, Speculation disabled

with the 3 bits:

Bit 0  	Bit 1	Bit 2

0	0	0		CPU not affected
0	1	0		PRCTL disabled, Speculation enabled
1	1	0		PRCTL enaabled, Speculation enabled
0	0	1		PRCTL disabled, Speculation disabled
1	0	1		PRCTL enabled, Speculation disabled
1	1	1		Invalid (wont be returned ever)

Thanks,

	tglx

  reply	other threads:[~2018-05-01 13:29 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-30 15:04 [patch V8 00/15] SSB 0 Thomas Gleixner
2018-04-30 15:04 ` [patch V8 01/15] SSB 1 Thomas Gleixner
2018-04-30 15:04 ` [patch V8 02/15] SSB 2 Thomas Gleixner
2018-04-30 15:04 ` [patch V8 03/15] SSB 3 Thomas Gleixner
2018-04-30 15:04 ` [patch V8 04/15] SSB 4 Thomas Gleixner
2018-04-30 15:04 ` [patch V8 05/15] SSB 5 Thomas Gleixner
2018-04-30 18:53   ` [MODERATED] " Andi Kleen
2018-04-30 20:57   ` Tim Chen
2018-04-30 23:12     ` Tim Chen
2018-04-30 15:04 ` [patch V8 06/15] SSB 6 Thomas Gleixner
2018-04-30 15:04 ` [patch V8 07/15] SSB 7 Thomas Gleixner
2018-04-30 18:59   ` [MODERATED] " Andi Kleen
2018-04-30 15:04 ` [patch V8 08/15] SSB 8 Thomas Gleixner
2018-04-30 15:04 ` [patch V8 09/15] SSB 9 Thomas Gleixner
2018-05-01  1:25   ` [MODERATED] " Tim Chen
2018-05-01  2:15     ` Konrad Rzeszutek Wilk
2018-05-01  2:26       ` Tim Chen
2018-05-01 13:11       ` Thomas Gleixner
2018-05-01  7:58     ` Thomas Gleixner
2018-05-01  9:49       ` Thomas Gleixner
2018-05-01 10:11         ` Thomas Gleixner
2018-04-30 15:04 ` [patch V8 10/15] SSB 10 Thomas Gleixner
2018-04-30 15:04 ` [patch V8 11/15] SSB 11 Thomas Gleixner
2018-04-30 15:04 ` [patch V8 12/15] SSB 12 Thomas Gleixner
2018-04-30 15:04 ` [patch V8 13/15] SSB 13 Thomas Gleixner
2018-04-30 20:12   ` [MODERATED] " Konrad Rzeszutek Wilk
2018-04-30 20:26     ` Thomas Gleixner
2018-04-30 21:03       ` [MODERATED] " Kees Cook
2018-04-30 21:05         ` Linus Torvalds
2018-04-30 21:25           ` Thomas Gleixner
2018-04-30 21:51   ` [MODERATED] " Kees Cook
2018-05-01  8:06     ` Thomas Gleixner
2018-05-01 13:29       ` Thomas Gleixner [this message]
2018-04-30 15:04 ` [patch V8 14/15] SSB 14 Thomas Gleixner
2018-04-30 15:04 ` [patch V8 15/15] SSB 15 Thomas Gleixner
2018-04-30 22:15   ` [MODERATED] " Kees Cook
2018-05-01  0:34     ` Andi Kleen
2018-05-01 13:15       ` Thomas Gleixner
2018-05-01 17:45         ` [MODERATED] " Jon Masters
2018-05-01 21:45     ` Thomas Gleixner
2018-05-01  2:32   ` [MODERATED] " Tim Chen
2018-05-01  8:02     ` 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=alpine.DEB.2.21.1805011522060.1596@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --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.