All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Woodhouse, David" <dwmw@amazon.co.uk>
To: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"tim.c.chen@linux.intel.com" <tim.c.chen@linux.intel.com>
Cc: "mingo@kernel.org" <mingo@kernel.org>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"arjan@linux.intel.com" <arjan@linux.intel.com>,
	"Raslan, KarimAllah" <karahmed@amazon.de>,
	"torvalds@linux-foundation.org" <torvalds@linux-foundation.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"nadav.amit@gmail.com" <nadav.amit@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	"ak@linux.intel.com" <ak@linux.intel.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"riel@redhat.com" <riel@redhat.com>,
	"luto@kernel.org" <luto@kernel.org>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	"bp@alien8.de" <bp@alien8.de>,
	"dave.hansen@intel.com" <dave.hansen@intel.com>,
	"mgorman@suse.de" <mgorman@suse.de>
Subject: Re: [PATCH 0/2] Backport IBPB on context switch to non-dumpable process
Date: Sat, 3 Mar 2018 11:37:56 +0000	[thread overview]
Message-ID: <1520077075.7929.4.camel@amazon.co.uk> (raw)
In-Reply-To: <20180303085454.GA23988@kroah.com>


[-- Attachment #1.1: Type: text/plain, Size: 1216 bytes --]

On Sat, 2018-03-03 at 09:54 +0100, Greg Kroah-Hartman wrote:
> On Fri, Mar 02, 2018 at 01:32:08PM -0800, Tim Chen wrote:
> > 
> > Greg,
> > 
> > I will like to propose backporting "x86/speculation: Use Indirect Branch
> > Prediction Barrier on context switch" from commit 18bf3c3e in upstream
> > to 4.9 and 4.4 stable.  The patch has already been ported to 4.14 and
> > 4.15 stable.  The patch needs mm context id that Andy added in commit
> > f39681ed. I have lifted the mm context id change from Andy's upstream
> > patch and included it here.
>
> What does this patch "fix" in those older kernels?  Is this a
> performance improvement or something else?

It's part of the Spectre variant 2 mitigation — a full flush of the
branch prediction on context switch to a sensitive¹ process. It was the
one I called out as "needs more attention" when I did the rest of the
retpoline etc backportingk, and Tim has now fixed it up. (Thanks).




¹ for now, "sensitive" means non-dumpable. This isn't perfect but it's
a reasonable approximation for now; it would be too expensive to do it
on *every* context switch. And for your purposes, the important part is
that it's what's upstream.

[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 5210 bytes --]

[-- Attachment #2.1: Type: text/plain, Size: 208 bytes --]




Amazon Web Services UK Limited. Registered in England and Wales with registration number 08650665 with its registered office at 1 Principal Place, Worship Street, London, EC2A 2FA, United Kingdom.



[-- Attachment #2.2: Type: text/html, Size: 222 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: "Woodhouse, David" <dwmw@amazon.co.uk>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Tim Chen <tim.c.chen@linux.intel.com>
Cc: <stable@vger.kernel.org>, Andy Lutomirski <luto@kernel.org>,
	Nadav Amit <nadav.amit@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arjan van de Ven <arjan@linux.intel.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@intel.com>,
	"Linus Torvalds" <torvalds@linux-foundation.org>,
	Mel Gorman <mgorman@suse.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Rik van Riel <riel@redhat.com>, "Ingo Molnar" <mingo@kernel.org>,
	<ak@linux.intel.com>, <karahmed@amazon.de>, <pbonzini@redhat.com>,
	<linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 0/2] Backport IBPB on context switch to non-dumpable process
Date: Sat, 3 Mar 2018 12:37:55 +0100	[thread overview]
Message-ID: <1520077075.7929.4.camel@amazon.co.uk> (raw)
In-Reply-To: <20180303085454.GA23988@kroah.com>

[-- Attachment #1: Type: text/plain, Size: 1216 bytes --]

On Sat, 2018-03-03 at 09:54 +0100, Greg Kroah-Hartman wrote:
> On Fri, Mar 02, 2018 at 01:32:08PM -0800, Tim Chen wrote:
> > 
> > Greg,
> > 
> > I will like to propose backporting "x86/speculation: Use Indirect Branch
> > Prediction Barrier on context switch" from commit 18bf3c3e in upstream
> > to 4.9 and 4.4 stable.  The patch has already been ported to 4.14 and
> > 4.15 stable.  The patch needs mm context id that Andy added in commit
> > f39681ed. I have lifted the mm context id change from Andy's upstream
> > patch and included it here.
>
> What does this patch "fix" in those older kernels?  Is this a
> performance improvement or something else?

It's part of the Spectre variant 2 mitigation — a full flush of the
branch prediction on context switch to a sensitive¹ process. It was the
one I called out as "needs more attention" when I did the rest of the
retpoline etc backportingk, and Tim has now fixed it up. (Thanks).




¹ for now, "sensitive" means non-dumpable. This isn't perfect but it's
a reasonable approximation for now; it would be too expensive to do it
on *every* context switch. And for your purposes, the important part is
that it's what's upstream.

[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 5210 bytes --]

  reply	other threads:[~2018-03-03 11:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-02 21:32 [PATCH 0/2] Backport IBPB on context switch to non-dumpable process Tim Chen
2018-03-02 21:32 ` Tim Chen
2018-03-02 21:32 ` [PATCH 1/2] x86/mm: Give each mm a unique ID Tim Chen
2018-03-02 21:32   ` Tim Chen
2018-03-07 17:30   ` Greg Kroah-Hartman
2018-03-07 17:30     ` Greg Kroah-Hartman
2018-03-08 18:23     ` Tim Chen
2018-03-10  1:04       ` Tim Chen
2018-03-10  1:14         ` Greg Kroah-Hartman
2018-03-02 21:32 ` [PATCH 2/2] x86/speculation: Use Indirect Branch Prediction Barrier in context switch Tim Chen
2018-03-02 21:32   ` Tim Chen
2018-03-02 21:32   ` Tim Chen
2018-03-03  8:54 ` [PATCH 0/2] Backport IBPB on context switch to non-dumpable process Greg Kroah-Hartman
2018-03-03  8:54   ` Greg Kroah-Hartman
2018-03-03 11:37   ` Woodhouse, David [this message]
2018-03-03 11:37     ` Woodhouse, David
2018-03-07 17:32 ` Greg Kroah-Hartman
2018-03-07 17:32   ` Greg Kroah-Hartman

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=1520077075.7929.4.camel@amazon.co.uk \
    --to=dwmw@amazon.co.uk \
    --cc=ak@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=karahmed@amazon.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luto@kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@kernel.org \
    --cc=nadav.amit@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=riel@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tim.c.chen@linux.intel.com \
    --cc=torvalds@linux-foundation.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 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.