aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2024-06-20 19:53:59 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2025-05-12 17:48:32 +0200
commit0f1f06ca61d8f1290780829728603c570834b3c0 (patch)
tree946f670ef57af47df2b3f815ed80238ff53c518f
parent336dbe8e9993da447630f7edb59152dd7edcdcd1 (diff)
downloadqemu-0f1f06ca61d8f1290780829728603c570834b3c0.zip
qemu-0f1f06ca61d8f1290780829728603c570834b3c0.tar.gz
qemu-0f1f06ca61d8f1290780829728603c570834b3c0.tar.bz2
target/i386: list TCG-supported features for CPUID[80000021h].EAX
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--target/i386/cpu.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 1ca6307..1656de3 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -922,6 +922,17 @@ void x86_cpu_vendor_words2str(char *dst, uint32_t vendor1,
#define TCG_8000_0008_EBX (CPUID_8000_0008_EBX_XSAVEERPTR | \
CPUID_8000_0008_EBX_WBNOINVD | CPUID_8000_0008_EBX_KERNEL_FEATURES)
+#if defined CONFIG_USER_ONLY
+#define CPUID_8000_0021_EAX_KERNEL_FEATURES CPUID_8000_0021_EAX_AUTO_IBRS
+#else
+#define CPUID_8000_0021_EAX_KERNEL_FEATURES 0
+#endif
+
+#define TCG_8000_0021_EAX_FEATURES ( \
+ CPUID_8000_0021_EAX_NO_NESTED_DATA_BP | \
+ CPUID_8000_0021_EAX_NULL_SEL_CLR_BASE | \
+ CPUID_8000_0021_EAX_KERNEL_FEATURES)
+
FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
[FEAT_1_EDX] = {
.type = CPUID_FEATURE_WORD,
@@ -1249,7 +1260,7 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
"ibpb-brtype", "srso-no", "srso-user-kernel-no", NULL,
},
.cpuid = { .eax = 0x80000021, .reg = R_EAX, },
- .tcg_features = 0,
+ .tcg_features = TCG_8000_0021_EAX_FEATURES,
.unmigratable_flags = 0,
},
[FEAT_8000_0021_EBX] = {