mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "pawan.kumar.gupta@linux.intel.com"  <pawan.kumar.gupta@linux.intel.com>
To: David Laight <David.Laight@aculab.com>
Cc: 'Jim Mattson' <jmattson@google.com>,
	Suraj Jitindar Singh <surajjs@amazon.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"sjitindarsingh@gmail.com" <sjitindarsingh@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"x86@kernel.org" <x86@kernel.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"mingo@redhat.com" <mingo@redhat.com>, "bp@suse.de" <bp@suse.de>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"seanjc@google.com" <seanjc@google.com>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"jpoimboe@kernel.org" <jpoimboe@kernel.org>,
	"daniel.sneddon@linux.intel.com" <daniel.sneddon@linux.intel.com>,
	"benh@kernel.crashing.org" <benh@kernel.crashing.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH] x86/speculation: Mitigate eIBRS PBRSB predictions with WRMSR
Date: Thu, 6 Oct 2022 13:27:03 -0700	[thread overview]
Message-ID: <20221006202703.efa3ovs4eckevire@desk> (raw)
In-Reply-To: <a056259f338e411581b882555ed608cb@AcuMS.aculab.com>

On Thu, Oct 06, 2022 at 08:25:15AM +0000, David Laight wrote:
>From: Jim Mattson
>> Sent: 05 October 2022 23:29
>>
>> On Wed, Oct 5, 2022 at 3:03 PM Suraj Jitindar Singh <surajjs@amazon.com> wrote:
>> >
>> > tl;dr: The existing mitigation for eIBRS PBRSB predictions uses an INT3 to
>> > ensure a call instruction retires before a following unbalanced RET. Replace
>> > this with a WRMSR serialising instruction which has a lower performance
>> > penalty.
>>
>> The INT3 is only on a speculative path and should not impact performance.
>
>Doesn't that depend on how quickly the cpu can abort the
>decode and execution of the INT3 instruction?
>INT3 is bound to generate a lot of uops and/or be microcoded.
>
>Old cpu couldn't abort fpu instructions.
>IIRC the Intel performance guide even suggested not interleaving
>code and data because the data might get speculatively executed
>and take a long time to abort.
>
>I actually wonder whether 'JMPS .' (eb fe) shouldn't be used
>instead of INT3 (cc) because it is fast to decode and execute.
>But I'm no expect here.

I have been told that INT3 is better in this case because 'JMP .' would
waste CPU resources.

  reply	other threads:[~2022-10-06 20:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-05 22:02 Suraj Jitindar Singh
2022-10-05 22:29 ` Jim Mattson
2022-10-06  8:25   ` David Laight
2022-10-06 20:27     ` pawan.kumar.gupta [this message]
2022-10-05 23:24 ` Jim Mattson
2022-10-05 23:45   ` Pawan Gupta
2022-10-05 23:46 ` Jim Mattson
2022-10-06  0:26   ` Daniel Sneddon
2022-10-06  1:28     ` Jim Mattson
2022-10-06  8:18   ` Peter Zijlstra
2022-10-06  2:42 ` Andrew Cooper
2022-10-07  1:44   ` pawan.kumar.gupta
2022-10-07  1:54 ` Pawan Gupta

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=20221006202703.efa3ovs4eckevire@desk \
    --to=pawan.kumar.gupta@linux.intel.com \
    --cc=David.Laight@aculab.com \
    --cc=benh@kernel.crashing.org \
    --cc=bp@suse.de \
    --cc=daniel.sneddon@linux.intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=jmattson@google.com \
    --cc=jpoimboe@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=seanjc@google.com \
    --cc=sjitindarsingh@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=surajjs@amazon.com \
    --cc=tglx@linutronix.de \
    --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

all inboxes | Powered by JetHome®