[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20230131215439.17294-1-itazur@amazon.com>
Date: Tue, 31 Jan 2023 21:54:39 +0000
From: Takahiro Itazuri <itazur@...zon.com>
To: <x86@...nel.org>
CC: Takahiro Itazuri <itazur@...zon.com>,
Takahiro Itazuri <zulinx86@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"H . Peter Anvin" <hpa@...or.com>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] x86/cpufeatures: Add AMD-specific IBRS hint bits
Add AMD-specific IBRS-related hint bits to enable pass-through to KVM
guests. KVM_GET_SUPPORTED_CPUID masks capability bits that KVM does not
recognize even when host sets these bits. Making KVM recognize these
allows VMMs to pass through host values to KVM guests without
explicitly modifying KVM_GET_SUPPORTED_CPUID results.
Signed-off-by: Takahiro Itazuri <itazur@...zon.com>
---
arch/x86/include/asm/cpufeatures.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h
index fdb8e09234ba..3447a9be1616 100644
--- a/arch/x86/include/asm/cpufeatures.h
+++ b/arch/x86/include/asm/cpufeatures.h
@@ -328,7 +328,10 @@
#define X86_FEATURE_AMD_IBPB (13*32+12) /* "" Indirect Branch Prediction Barrier */
#define X86_FEATURE_AMD_IBRS (13*32+14) /* "" Indirect Branch Restricted Speculation */
#define X86_FEATURE_AMD_STIBP (13*32+15) /* "" Single Thread Indirect Branch Predictors */
+#define X86_FEATURE_AMD_IBRS_ALWAYS_ON (13*32+16) /* "" Inidrect Branch Restricted Speculation always-on preferred */
#define X86_FEATURE_AMD_STIBP_ALWAYS_ON (13*32+17) /* "" Single Thread Indirect Branch Predictors always-on preferred */
+#define X86_FEATURE_AMD_IBRS_PREFERRED (13*32+18) /* "" Indirect Branch Restricted Speculation preferred over software */
+#define X86_FEATURE_AMD_IBRS_SAME_MODE (13*32+19) /* "" Indirect Branch Restricted Speculation provides same mode protection */
#define X86_FEATURE_AMD_PPIN (13*32+23) /* Protected Processor Inventory Number */
#define X86_FEATURE_AMD_SSBD (13*32+24) /* "" Speculative Store Bypass Disable */
#define X86_FEATURE_VIRT_SSBD (13*32+25) /* Virtualized Speculative Store Bypass Disable */
--
2.38.0
Powered by blists - more mailing lists