From 00268e00027459abede448662f8794d78eb4b0a4 Mon Sep 17 00:00:00 2001 From: Xiaoyao Li Date: Tue, 4 Mar 2025 00:24:50 -0500 Subject: [PATCH] i386/cpu: Warn about why CPUID_EXT_PDCM is not available When user requests PDCM explicitly via "+pdcm" without PMU enabled, emit a warning to inform the user. Signed-off-by: Xiaoyao Li Reviewed-by: Zhao Liu Link: https://lore.kernel.org/r/20250304052450.465445-3-xiaoyao.li@intel.com Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 29bce67c3a..0d35e95430 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -8339,6 +8339,9 @@ void x86_cpu_expand_features(X86CPU *cpu, Error **errp) } if (!cpu->enable_pmu) { + mark_unavailable_features(cpu, FEAT_1_ECX, + env->user_features[FEAT_1_ECX] & CPUID_EXT_PDCM, + "This feature is not available due to PMU being disabled"); env->features[FEAT_1_ECX] &= ~CPUID_EXT_PDCM; }