All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Yegor Yefremov <yegorslists@googlemail.com>
Cc: buildroot@buildroot.org, Romain Naour <romain.naour@gmail.com>
Subject: Re: [Buildroot] [PATCH] package/qemu: host-qemu does not support AVX512 CPUs
Date: Thu, 17 Sep 2026 09:26:48 +0200	[thread overview]
Message-ID: <aquV1bdJfyJ04l6h@windsurf> (raw)
In-Reply-To: <CAGm1_kux2mRrdnvkcX=y2vB=Hb3-UxkjCu-F67L2_2-N3cs-tg@mail.gmail.com>

Hello Yegor,

On Thu, Sep 17, 2026 at 08:56:46AM +0200, Yegor Yefremov wrote:

>  No, I don't think it does anymore, and I believe it can simply be dropped.
> 
>   1. The exclusion comes from commit 1f7efaf89f03 ("package/qemu: do not
>   support x86_steamroller or x86_core_avx2", Feb 2020), i.e. from the Qemu
>   4.2 era, when TCG had no AVX support at all. Since Qemu 7.2, TCG
>   implements AVX, AVX2, F16C, FMA3 and VAES. In Qemu 11.0.0,
>   target/i386/cpu.c:
> 
>     #define TCG_EXT_FEATURES (... | CPUID_EXT_AVX | CPUID_EXT_F16C | \
>               CPUID_EXT_FMA | ...)
>     #define TCG_7_0_EBX_FEATURES (... | CPUID_7_0_EBX_BMI1 | \
>               CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_AVX2 | ...)
> 
>   which covers everything -march=core-avx2 can generate.

Cool!

>   2. You are right that core-avx2 and haswell are equivalent: gcc's
>   core-avx2 is a deprecated alias for haswell, and "gcc -march=core-avx2
>   -Q --help=target" yields exactly the same feature bits as

TIL about "gcc -march=core-avx2 -Q --help=target", nice!

>   -march=haswell. In arch/Config.in.x86 both also select the very same
>   BR2_X86_CPU_HAS_* symbols. So excluding one and not the other never
>   made much sense. The same applies to broadwell, skylake, zen*,
>   x86-64-v3, ..., which all enable AVX2 and were never excluded - and
>   they do build fine on the autobuilders, which is another hint that
>   AVX2 is not the problem.

ACK.

>   3. The steamroller exclusion, however, is still needed - but it is
>   incomplete. steamroller is bdver3, and what TCG cannot emulate there is
>   not AVX, but XOP/FMA4/TBM/LWP. Qemu 11.0.0 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 deliberately not part of that
>   mask.
> 
>   And the whole Bulldozer family is affected, not only steamroller
>   (checked with gcc -march=<variant> -Q --help=target):
> 
>     bdver1 (bulldozer):   XOP, FMA4, LWP
>     bdver2 (piledriver):  XOP, FMA4, TBM, LWP
>     bdver3 (steamroller): XOP, FMA4, TBM, LWP
>     bdver4 (excavator):   XOP, FMA4, TBM, LWP (and AVX2)
> 
>   So BR2_x86_bulldozer, BR2_x86_piledriver and BR2_x86_excavator ought to
>   be excluded as well.
> 
>   If you agree, I'll send a follow-up patch that:
> 
>    - drops the !BR2_x86_core_avx2 dependency,
>    - adds a hidden BR2_X86_CPU_HAS_XOP symbol in arch/Config.in.x86,
>      selected by the four bdver variants, and replaces
>      !BR2_x86_steamroller with !BR2_X86_CPU_HAS_XOP in
>      BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS - i.e. the same pattern as the
>      existing BR2_X86_CPU_HAS_AVX512 dependency.

This looks perfect!

>   If you'd rather not add a new BR2_X86_CPU_HAS_* symbol for a single
>   user, I can just list the four variants explicitly instead.

I think adding BR2_X86_CPU_HAS_XOP is better, even if it has a single
user. Indeed, it makes it explicit what is the feature that isn't
implemented by Qemu.

Thanks a lot for this very thorough answer!

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2026-09-17  7:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14  9:26 [Buildroot] [PATCH] package/qemu: host-qemu does not support AVX512 CPUs Yegor Yefremov via buildroot
2026-09-16 18:57 ` Thomas Petazzoni via buildroot
2026-09-17  6:56   ` Yegor Yefremov via buildroot
2026-09-17  7:26     ` Thomas Petazzoni via buildroot [this message]
2026-09-25 14:44 ` Raphaël Mélotte via buildroot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aquV1bdJfyJ04l6h@windsurf \
    --to=buildroot@buildroot.org \
    --cc=romain.naour@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=yegorslists@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.