[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241128132834.15126-1-amit@kernel.org>
Date: Thu, 28 Nov 2024 14:28:32 +0100
From: Amit Shah <amit@...nel.org>
To: linux-kernel@...r.kernel.org,
kvm@...r.kernel.org,
x86@...nel.org,
linux-doc@...r.kernel.org
Cc: amit.shah@....com,
thomas.lendacky@....com,
bp@...en8.de,
tglx@...utronix.de,
peterz@...radead.org,
jpoimboe@...nel.org,
pawan.kumar.gupta@...ux.intel.com,
corbet@....net,
mingo@...hat.com,
dave.hansen@...ux.intel.com,
hpa@...or.com,
seanjc@...gle.com,
pbonzini@...hat.com,
daniel.sneddon@...ux.intel.com,
kai.huang@...el.com,
sandipan.das@....com,
boris.ostrovsky@...cle.com,
Babu.Moger@....com,
david.kaplan@....com,
dwmw@...zon.co.uk,
andrew.cooper3@...rix.com,
Amit Shah <amit@...nel.org>
Subject: [RFC PATCH v3 0/2] Add support for the ERAPS feature
Newer AMD CPUs (Zen5+) have the ERAPS feature bit that allows us to remove the
RSB filling loops required during context switches and VM exits.
This patchset implements the feature to:
* remove the need for RSB filling on context switches and VMEXITs in host and
guests
* allow KVM guests to use the full default RSB stack
The feature isn't yet part of an APM update that details its working, so this
is still tagged as RFC. The notes at
https://amitshah.net/2024/11/eraps-reduces-software-tax-for-hardware-bugs/
may help follow along till the APM is public.
v3:
* rebase on top of Josh's RSB tweaks series
* with that rebase, only the non-AutoIBRS case needs special ERAPS support.
AutoIBRS is currently disabled when SEV-SNP is active (commit acaa4b5c4c8)
* remove comment about RSB_CLEAR_LOOPS and the size of the RSB -- it's not
necessary anymore with the rework
* remove comment from patch 2 in svm.c in favour of the commit message
v2:
* reword comments to highlight context switch as the main trigger for RSB
flushes in hardware (Dave Hansen)
* Split out outdated comment updates in (v1) patch1 to be a standalone
patch1 in this series, to reinforce RSB filling is only required for RSB
poisoning cases for AMD
* Remove mentions of BTC/BTC_NO (Andrew Cooper)
* Add braces in case stmt (kernel test robot)
* s/boot_cpu_has/cpu_feature_enabled (Boris Petkov)
Amit Shah (2):
x86: cpu/bugs: add AMD ERAPS support; hardware flushes RSB
x86: kvm: svm: advertise ERAPS (larger RSB) support to guests
Documentation/admin-guide/hw-vuln/spectre.rst | 5 ++--
arch/x86/include/asm/cpufeatures.h | 1 +
arch/x86/include/asm/svm.h | 6 +++-
arch/x86/kernel/cpu/bugs.c | 6 +++-
arch/x86/kvm/cpuid.c | 18 ++++++++++--
arch/x86/kvm/svm/svm.c | 29 +++++++++++++++++++
arch/x86/kvm/svm/svm.h | 15 ++++++++++
7 files changed, 74 insertions(+), 6 deletions(-)
--
2.47.0
Powered by blists - more mailing lists