mbox series

[v2,0/2] x86/cpu, kvm: Support AMD Automatic IBRS

Message ID 20221124000449.79014-1-kim.phillips@amd.com (mailing list archive)
Headers show
Series x86/cpu, kvm: Support AMD Automatic IBRS | expand

Message

Kim Phillips Nov. 24, 2022, 12:04 a.m. UTC
The AMD Zen4 core supports a new feature called Automatic IBRS
(Indirect Branch Restricted Speculation).

Enable Automatic IBRS by default if the CPU feature is present.
It typically provides greater performance over the incumbent
generic retpolines mitigation.

Patch 1 adds support for AutoIBRS and other feature
bits in the CPUID_8000_0021_EAX leaf.

Patch 2 adds support for AMD Automatic IBRS

Co-developed-by: Babu Moger <Babu.Moger@amd.com>
Co-developed-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Kim Phillips <kim.phillips@amd.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Joao Martins <joao.m.martins@oracle.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Juergen Gross <jgross@suse.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: kvm@vger.kernel.org
Cc: linux-doc@vger.kernel.org
Cc: x86@kernel.org
Cc: linux-kernel@vger.kernel.org

Kim Phillips (2):
  x86/cpu, kvm: Use CPU capabilities for CPUID[0x80000021].EAX
  x86/cpu, kvm: Support AMD Automatic IBRS

 .../admin-guide/kernel-parameters.txt         |  9 +++--
 arch/x86/include/asm/cpufeatures.h            |  5 +--
 arch/x86/include/asm/msr-index.h              |  2 ++
 arch/x86/kernel/cpu/bugs.c                    | 23 +++++++-----
 arch/x86/kernel/cpu/common.c                  |  8 +++++
 arch/x86/kernel/cpu/scattered.c               |  4 +++
 arch/x86/kvm/cpuid.c                          | 35 +++++++++++--------
 arch/x86/kvm/reverse_cpuid.h                  | 24 +++++++++----
 arch/x86/kvm/svm/svm.c                        |  3 ++
 arch/x86/kvm/x86.c                            |  3 ++
 10 files changed, 82 insertions(+), 34 deletions(-)