From: Zhao Liu Date: Mon, 15 Dec 2025 07:37:38 +0000 (+0800) Subject: i386/cpu: Allow unsupported avx10_version with x-force-features X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86efa9340fc5fa621239ab45d969540e66b17ead;p=thirdparty%2Fqemu.git i386/cpu: Allow unsupported avx10_version with x-force-features The "force_features" ("x-force-features" property) forces setting feature even if host doesn't support, but also reports the warning. Given its function, it's useful for debug, so even if the AVX10 version is unsupported by host, force to set this AVX10 version if x-force-features=on. Tested-by: Xudong Hao Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20251215073743.4055227-7-zhao1.liu@intel.com Signed-off-by: Paolo Bonzini --- diff --git a/target/i386/cpu.c b/target/i386/cpu.c index c460e3bec7..f62bd48d4b 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -9490,16 +9490,27 @@ static bool x86_cpu_filter_features(X86CPU *cpu, bool verbose) uint8_t version = x86_cpu_get_host_avx10_version(); if (version < env->avx10_version) { - if (prefix) { - warn_report("%s: avx10.%d. Adjust to avx10.%d", - prefix, env->avx10_version, version); - } /* - * Discrete feature bits have been checked and filtered based on - * host support. So it's safe to change version without reverting - * other feature bits. + * With x-force-features=on, CPUID_7_1_EDX_AVX10 will not be masked + * off, so there's no need to zero avx10 version. */ - env->avx10_version = version; + if (!cpu->force_features) { + if (prefix) { + warn_report("%s: avx10.%d. Adjust to avx10.%d", + prefix, env->avx10_version, version); + } + /* + * Discrete feature bits have been checked and filtered based + * on host support. So it's safe to change version without + * reverting other feature bits. + */ + env->avx10_version = version; + } else { + if (prefix) { + warn_report("%s: avx10.%d.", + prefix, env->avx10_version); + } + } have_filtered_features = true; } } else if (env->avx10_version) {