public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Amit Shah <amit@kernel.org>
To: Dave Hansen <dave.hansen@intel.com>,
	linux-kernel@vger.kernel.org,  kvm@vger.kernel.org,
	x86@kernel.org, linux-doc@vger.kernel.org
Cc: thomas.lendacky@amd.com, bp@alien8.de, tglx@linutronix.de,
	 peterz@infradead.org, jpoimboe@kernel.org,
	pawan.kumar.gupta@linux.intel.com, 	corbet@lwn.net,
	mingo@redhat.com, dave.hansen@linux.intel.com, hpa@zytor.com,
		seanjc@google.com, pbonzini@redhat.com,
	daniel.sneddon@linux.intel.com, 	kai.huang@intel.com,
	sandipan.das@amd.com, boris.ostrovsky@oracle.com,
		Babu.Moger@amd.com, david.kaplan@amd.com, dwmw@amazon.co.uk,
		andrew.cooper3@citrix.com, Amit Shah <Amit.Shah@amd.com>
Subject: Re: [RFC PATCH v3 1/2] x86: cpu/bugs: add AMD ERAPS support; hardware flushes RSB
Date: Mon, 02 Dec 2024 19:09:34 +0100	[thread overview]
Message-ID: <4601ca077c95393837eb40909c941a4d67bb04dd.camel@kernel.org> (raw)
In-Reply-To: <7222b969-30a8-42de-b2ca-601f6d1b03cd@intel.com>

On Mon, 2024-12-02 at 09:26 -0800, Dave Hansen wrote:
> On 11/28/24 05:28, Amit Shah wrote:
> > From: Amit Shah <amit.shah@amd.com>
> > 
> > When Automatic IBRS is disabled, Linux flushed the RSB on every
> > context
> > switch.  This RSB flush is not necessary in software with the ERAPS
> > feature on Zen5+ CPUs that flushes the RSB in hardware on a context
> > switch (triggered by mov-to-CR3).
> > 
> > Additionally, the ERAPS feature also tags host and guest addresses
> > in
> > the RSB - eliminating the need for software flushing of the RSB on
> > VMEXIT.
> > 
> > Disable all RSB flushing by Linux when the CPU has ERAPS.
> > 
> > Feature mentioned in AMD PPR 57238.  Will be resubmitted once APM
> > is
> > public - which I'm told is imminent.
> 
> There was a _lot_ of discussion about this. But all of that
> discussion
> seems to have been trimmed out and it seems like we're basically back
> to: "this is new hardware supposed to mitigate SpectreRSB, thus it
> mitigates SpectreRSB."

Absolutely, I don't want that to get lost -- but I think that got
captured in Josh's rework patchset.  With that rework, I don't even
need this patchset for the hardware feature to work, because we now
rely on AutoIBRS to do the RSB clearing; and the hardware takes care of
AutoIBRS and ERAPS interaction in Zen5.

The only thing this patch now does is to handle the AutoIBRS-disabled
case -- which happens when SEV-SNP is turned on (i.e. let the hw clear
the RSB instead of stuffing it in Linux).

I can still include the summary of the discussion in this patch - I
just feel it isn't necessary with the rework.

		Amit

  reply	other threads:[~2024-12-02 18:09 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-21 20:07 [PATCH v2 0/2] x86/bugs: RSB tweaks Josh Poimboeuf
2024-11-21 20:07 ` [PATCH v2 1/2] x86/bugs: Don't fill RSB on VMEXIT with eIBRS+retpoline Josh Poimboeuf
2024-11-30 15:31   ` Borislav Petkov
2024-12-02 11:15     ` Shah, Amit
2024-12-02 12:19       ` Borislav Petkov
2024-12-02 23:35     ` Pawan Gupta
2024-12-03 11:20       ` Borislav Petkov
2024-12-05 23:12         ` Josh Poimboeuf
2024-12-21  9:13           ` Borislav Petkov
2025-04-02  9:19           ` Shah, Amit
2025-04-02 14:16             ` Josh Poimboeuf
2025-04-02 14:19               ` Shah, Amit
2024-12-05 23:13     ` Josh Poimboeuf
2024-11-21 20:07 ` [PATCH v2 2/2] x86/bugs: Don't fill RSB on context switch with eIBRS Josh Poimboeuf
2024-12-03 11:42   ` Borislav Petkov
2024-12-05 23:32   ` Josh Poimboeuf
2024-12-06  0:53     ` Josh Poimboeuf
2024-12-06 23:02       ` Josh Poimboeuf
2024-12-30 14:54         ` Shah, Amit
2025-01-08 11:50         ` Shah, Amit
2024-12-06 10:10     ` Shah, Amit
2024-12-09 20:46       ` jpoimboe
2024-11-28 13:28 ` [RFC PATCH v3 0/2] Add support for the ERAPS feature Amit Shah
2024-11-28 13:28   ` [RFC PATCH v3 1/2] x86: cpu/bugs: add AMD ERAPS support; hardware flushes RSB Amit Shah
2024-12-02 17:26     ` Dave Hansen
2024-12-02 18:09       ` Amit Shah [this message]
2024-12-02 18:25         ` Dave Hansen
2024-12-02 18:36           ` Sean Christopherson
2024-11-28 13:28   ` [RFC PATCH v3 2/2] x86: kvm: svm: advertise ERAPS (larger RSB) support to guests Amit Shah
2024-12-02 18:30     ` Sean Christopherson
2025-03-27 11:10       ` Shah, Amit

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=4601ca077c95393837eb40909c941a4d67bb04dd.camel@kernel.org \
    --to=amit@kernel.org \
    --cc=Amit.Shah@amd.com \
    --cc=Babu.Moger@amd.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@alien8.de \
    --cc=corbet@lwn.net \
    --cc=daniel.sneddon@linux.intel.com \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=david.kaplan@amd.com \
    --cc=dwmw@amazon.co.uk \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@kernel.org \
    --cc=kai.huang@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pawan.kumar.gupta@linux.intel.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=sandipan.das@amd.com \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --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