All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, amonakov@ispras.ru
Subject: Re: [PATCH 6/6] meson: require compiler support for chosen x86-64 instructions
Date: Thu, 20 Jun 2024 16:01:33 +0100	[thread overview]
Message-ID: <ZnRETaWTb57K0VO3@redhat.com> (raw)
In-Reply-To: <20240620130254.415699-7-pbonzini@redhat.com>

On Thu, Jun 20, 2024 at 03:02:54PM +0200, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  meson.build | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/meson.build b/meson.build
> index 54e6b09f4fb..c5360fbd299 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -2863,6 +2863,7 @@ have_cpuid_h = cc.links('''
>  config_host_data.set('CONFIG_CPUID_H', have_cpuid_h)
>  
>  config_host_data.set('CONFIG_AVX2_OPT', get_option('avx2') \
> +  .enable_auto_if(get_option('x86_version') >= '3') \
>    .require(have_cpuid_h, error_message: 'cpuid.h not available, cannot enable AVX2') \
>    .require(cc.links('''
>      #include <cpuid.h>
> @@ -2875,6 +2876,7 @@ config_host_data.set('CONFIG_AVX2_OPT', get_option('avx2') \
>    '''), error_message: 'AVX2 not available').allowed())
>  
>  config_host_data.set('CONFIG_AVX512BW_OPT', get_option('avx512bw') \
> +  .enable_auto_if(get_option('x86_version') >= '4') \
>    .require(have_cpuid_h, error_message: 'cpuid.h not available, cannot enable AVX512BW') \
>    .require(cc.links('''
>      #include <cpuid.h>

I'm not sure this makes sense. The CONFIG_AVX* options are used only
to validate whether the toolchain has support for this. The QEMU
code then has a runtime, so it automagically uses AVX2/AVX512
if-and-only-if running on a suitably new CPU.  IOW, we want this
enabled always when the toolchain supports it, regardless of what
x86_version is set.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  reply	other threads:[~2024-06-20 15:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-20 13:02 [PATCH 0/6] host/i386: allow configuring the x86-64 baseline Paolo Bonzini
2024-06-20 13:02 ` [PATCH 1/6] Revert "host/i386: assume presence of POPCNT" Paolo Bonzini
2024-06-20 13:02 ` [PATCH 2/6] Revert "host/i386: assume presence of SSSE3" Paolo Bonzini
2024-06-20 13:02 ` [PATCH 3/6] Revert "host/i386: assume presence of SSE2" Paolo Bonzini
2024-06-20 13:02 ` [PATCH 4/6] meson: allow configuring the x86-64 baseline Paolo Bonzini
2024-06-20 14:55   ` Daniel P. Berrangé
2024-06-20 15:02     ` Paolo Bonzini
2024-06-20 17:16   ` Richard Henderson
2024-06-20 13:02 ` [PATCH 5/6] meson: remove dead optimization option Paolo Bonzini
2024-06-20 17:04   ` Richard Henderson
2024-06-20 13:02 ` [PATCH 6/6] meson: require compiler support for chosen x86-64 instructions Paolo Bonzini
2024-06-20 15:01   ` Daniel P. Berrangé [this message]
2024-06-20 15:08     ` Paolo Bonzini
2024-06-20 17:21     ` Richard Henderson
2024-06-20 17:37       ` Paolo Bonzini

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=ZnRETaWTb57K0VO3@redhat.com \
    --to=berrange@redhat.com \
    --cc=amonakov@ispras.ru \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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.