package/qemu: fix x86 CPU variant exclusions
Status from this message: Applied to 2025.02.x, 2026.08.x. Thanks
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | package/qemu: drop x86_core_avx2 exclusionpackage/ | +1 | 1 reply | |
| 2/3 | arch/Config.in.x86: add BR2_X86_CPU_HAS_XOParch/ | +12 | 1 reply | |
| 3/3 | package/qemu: host-qemu does not support XOP capable CPUspackage/ | +5 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [Buildroot] [PATCH 0/3] package/qemu: fix x86 CPU variant exclusions
From: Yegor Yefremov <[email protected]>
This series is a follow-up to the discussion on
package/qemu: host-qemu does not support AVX512 CPUs
https://patchwork.buildroot.org/project/buildroot/patch/[email protected]/
where Thomas rightfully questioned whether the BR2_x86_core_avx2 exclusion in BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS still makes sense, and pointed out that excluding BR2_x86_core_avx2 but not the equivalent BR2_x86_haswell is inconsistent.
Thomas ACKed this approach in
https://lore.kernel.org/buildroot/aqrl-vOwcHy1wpBs@windsurf/
Short answer: the core-avx2 exclusion does not make sense anymore, and the neighbouring BR2_x86_steamroller exclusion, while still needed, is incomplete.
Both exclusions come from commit 1f7efaf89f03 ("package/qemu: do not support x86_steamroller or x86_core_avx2"), from the Qemu 4.2 era:
- core-avx2: the TCG engine had no AVX support at all back then. Since Qemu 7.2 it implements AVX, AVX2, F16C, FMA3 and VAES, so the exclusion is obsolete. It was also inconsistent, as gcc's core-avx2 is a deprecated alias for haswell (same feature bits, same BR2_X86_CPU_HAS_* selects), and haswell, broadwell, skylake, zen*, x86-64-v3, ... were never excluded. Patch 1 drops it.
- steamroller: the real blocker is not AVX, but the Bulldozer-specific XOP/FMA4/TBM/LWP extensions, which TCG still does not implement. And the whole Bulldozer family is affected: bulldozer (bdver1), piledriver (bdver2) and excavator (bdver4) were never excluded, although they are just as broken. Patches 2 and 3 introduce a BR2_X86_CPU_HAS_XOP capability symbol and use it, mirroring what is already done for BR2_X86_CPU_HAS_AVX512.
I verified the TCG feature masks in target/i386/cpu.c of both Qemu 11.0.0 (the version we currently package) and 11.1.1; they are identical, so bumping Qemu will not change the picture:
TCG_EXT_FEATURES has CPUID_EXT_AVX, CPUID_EXT_F16C, CPUID_EXT_FMA
TCG_7_0_EBX_FEATURES has CPUID_7_0_EBX_AVX2, BMI1, BMI2
TCG_EXT3_FEATURES has no XOP, FMA4, TBM or LWP
no TCG mask references any AVX512 bit
Tested with olddefconfig on all affected CPU variants; BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS is now:
haswell, core-avx2, broadwell, skylake, zen, x86-64 -> y bulldozer, piledriver, steamroller, excavator -> n skylake-avx512 -> n (unchanged)
Note: while looking at this, I noticed that bulldozer, piledriver and steamroller do not select BR2_X86_CPU_HAS_AVX in arch/Config.in.x86, although gcc enables AVX for bdver1 to bdver3. That looks like a separate pre-existing bug, so I left it out of this series.
Yegor Yefremov (3):
package/qemu: drop x86_core_avx2 exclusion arch/Config.in.x86: add BR2_X86_CPU_HAS_XOP package/qemu: host-qemu does not support XOP capable CPUs
arch/Config.in.x86 | 12 ++++++++++++ package/qemu/Config.in.host | 9 +++++---- 2 files changed, 17 insertions(+), 4 deletions(-)
Signature · 6 lines
2.34.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot