Files
buildroot/package/qemu/Config.in.host
Yegor Yefremov 64db867929 package/qemu: host-qemu does not support XOP capable CPUs
Commit 1f7efaf89f ("package/qemu: do not support x86_steamroller or
x86_core_avx2") excluded BR2_x86_steamroller from
BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS. This is still needed, but for a
different reason than AVX, and the exclusion is incomplete.

steamroller is bdver3, and what the Qemu TCG engine cannot emulate
there is not AVX, but the Bulldozer-specific XOP, FMA4, TBM and LWP
extensions. In Qemu 11.0.0 (the version we currently package) and
11.1.1, target/i386/cpu.c has:

  #define TCG_EXT3_FEATURES (CPUID_EXT3_LAHF_LM | CPUID_EXT3_SVM | \
            CPUID_EXT3_CR8LEG | CPUID_EXT3_ABM | CPUID_EXT3_SSE4A | \
            CPUID_EXT3_3DNOWPREFETCH | CPUID_EXT3_KERNEL_FEATURES | \
            CPUID_EXT3_CMP_LEG)

CPUID_EXT3_XOP, CPUID_EXT3_FMA4, CPUID_EXT3_TBM and CPUID_EXT3_LWP are
defined in target/i386/cpu.h, but are not part of that mask, i.e. TCG
does not implement them. Binaries using those instructions therefore
die with:

  qemu: uncaught target signal 4 (Illegal instruction) - core dumped

This affects the whole Bulldozer family, not only steamroller:
bulldozer (bdver1), piledriver (bdver2) and excavator (bdver4) are
equally unsupported, but were never excluded.

Use the newly introduced BR2_X86_CPU_HAS_XOP symbol, which covers all
four variants, instead of listing BR2_x86_steamroller alone. As for
AVX512, this disables gobject-introspection and nodejs, which are the
two packages needing host-qemu in user mode.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Assisted-by: Claude:claude-opus-5
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
(cherry picked from commit 22c0ec4fcf)
Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
2026-09-23 18:20:04 +02:00

110 lines
3.4 KiB
Plaintext

config BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS
bool
default y if BR2_arm
default y if BR2_armeb
default y if BR2_aarch64
default y if BR2_i386
default y if BR2_m68k
default y if BR2_microblazeel
default y if BR2_microblazebe
default y if BR2_mips
default y if BR2_mipsel
default y if BR2_or1k
default y if BR2_powerpc
default y if BR2_powerpc64
default y if BR2_powerpc64le
default y if BR2_riscv
default y if BR2_s390x
default y if BR2_sh
default y if BR2_sparc
default y if BR2_sparc64
default y if BR2_xtensa
default y if BR2_x86_64
# The Qemu TCG engine implements neither the XOP instruction set
# nor the other Bulldozer-specific extensions (FMA4, TBM, LWP),
# and it does not implement the AVX512 instruction set either,
# so binaries built for such CPUs cannot be emulated.
depends on !BR2_X86_CPU_HAS_XOP
depends on !BR2_X86_CPU_HAS_AVX512
depends on !BR2_powerpc_620 && !BR2_powerpc_630
config BR2_PACKAGE_HOST_QEMU_SYSTEM_ARCH_SUPPORTS
bool
default y if BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS
default y if BR2_mips64
default y if BR2_mips64el
config BR2_PACKAGE_HOST_QEMU_USER_ARCH_SUPPORTS
bool
default y if BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS
comment "host-qemu needs a host gcc >= 8"
depends on BR2_PACKAGE_HOST_QEMU_SYSTEM_ARCH_SUPPORTS || \
BR2_PACKAGE_HOST_QEMU_USER_ARCH_SUPPORT
depends on !BR2_HOST_GCC_AT_LEAST_8
config BR2_PACKAGE_HOST_QEMU
bool "host qemu"
depends on BR2_PACKAGE_HOST_QEMU_SYSTEM_ARCH_SUPPORTS || BR2_PACKAGE_HOST_QEMU_USER_ARCH_SUPPORTS
depends on BR2_HOST_GCC_AT_LEAST_8
select BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE \
if !BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE && BR2_PACKAGE_HOST_QEMU_USER_ARCH_SUPPORTS
select BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE \
if !BR2_PACKAGE_HOST_QEMU_USER_ARCH_SUPPORTS
help
QEMU is a generic and open source machine emulator and
virtualizer.
This option builds an emulator for your selected architecture.
http://www.qemu.org
if BR2_PACKAGE_HOST_QEMU
comment "Emulators selection"
config BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE
bool "Enable system emulation"
depends on BR2_PACKAGE_HOST_QEMU_SYSTEM_ARCH_SUPPORTS
help
Enables the build of the system emulator, which allows to
boot an entire system in Qemu.
config BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE
bool "Enable Linux user-land emulation"
depends on BR2_PACKAGE_HOST_QEMU_USER_ARCH_SUPPORTS
help
Enables the build of the user-land emulator, which allows to
run user-space applications.
Note that system calls made by the emulated user-land are
serviced by the running host kernel. Therefore, if the
kernel headers used by your target are more recent than
the running host kernel, you may run into invalid system
calls, which may yield surprising effects.
config BR2_PACKAGE_HOST_QEMU_USER_MODE_ARGS
string
default "-cpu Nehalem,check=false" if BR2_x86_corei7
config BR2_PACKAGE_HOST_QEMU_VDE2
bool "VDE2 support"
help
Enables VDE2 support. VDE2 stands for Virtual Distributed
Ethernet and can be used to create virtual switches to
"plug" both physical and virtual machines in them.
config BR2_PACKAGE_HOST_QEMU_VIRTFS
bool "Virtual filesystem support"
depends on BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE
help
Enables support for virtual filesystem in Qemu allowing
shared filesystem between Qemu and its emulated target.
config BR2_PACKAGE_HOST_QEMU_USB
bool "USB passthrough support"
help
Enables USB passthrough support from guest to host.
endif