[PATCH 08/50] meson: Remove cpu == x86 tests

Richard Henderson posted 50 patches 2 days, 5 hours ago
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Thomas Huth <thuth@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Fabiano Rosas <farosas@suse.de>, Laurent Vivier <lvivier@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Riku Voipio <riku.voipio@iki.fi>, Stefan Hajnoczi <stefanha@redhat.com>, Fam Zheng <fam@euphon.net>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Warner Losh <imp@bsdimp.com>, Kyle Evans <kevans@freebsd.org>, "Daniel P. Berrangé" <berrange@redhat.com>, Stefano Stabellini <sstabellini@kernel.org>, Anthony PERARD <anthony@xenproject.org>, Paul Durrant <paul@xen.org>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, "Michael S. Tsirkin" <mst@redhat.com>, David Hildenbrand <david@kernel.org>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Peter Xu <peterx@redhat.com>, Li Zhijian <lizhijian@fujitsu.com>, Hyman Huang <yong.huang@smartx.com>, Peter Maydell <peter.maydell@linaro.org>, Helge Deller <deller@gmx.de>, Zhao Liu <zhao1.liu@intel.com>, Eduardo Habkost <eduardo@habkost.net>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <dbarboza@ventanamicro.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Ilya Leoshkevich <iii@linux.ibm.com>, WANG Xuerui <git@xen0n.name>, Stefan Weil <sw@weilnetz.de>
[PATCH 08/50] meson: Remove cpu == x86 tests
Posted by Richard Henderson 2 days, 5 hours ago
The 32-bit x86 host is no longer supported.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 configure   | 16 +---------------
 meson.build | 49 ++++++++++---------------------------------------
 2 files changed, 11 insertions(+), 54 deletions(-)

diff --git a/configure b/configure
index 00e455be57..846fab904e 100755
--- a/configure
+++ b/configure
@@ -440,13 +440,6 @@ case "$cpu" in
     linux_arch=arm64
     ;;
 
-  i386|i486|i586|i686)
-    cpu="i386"
-    host_arch=i386
-    linux_arch=x86
-    CPU_CFLAGS="-m32"
-    ;;
-
   loongarch*)
     cpu=loongarch64
     host_arch=loongarch64
@@ -1933,14 +1926,7 @@ if test "$skip_meson" = no; then
   if test "$cross_compile" = "yes"; then
     echo "[host_machine]" >> $cross
     echo "system = '$host_os'" >> $cross
-    case "$cpu" in
-        i386)
-            echo "cpu_family = 'x86'" >> $cross
-            ;;
-        *)
-            echo "cpu_family = '$cpu'" >> $cross
-            ;;
-    esac
+    echo "cpu_family = '$cpu'" >> $cross
     echo "cpu = '$cpu'" >> $cross
     if test "$bigendian" = "yes" ; then
         echo "endian = 'big'" >> $cross
diff --git a/meson.build b/meson.build
index e53bc1e643..e5bdcf651d 100644
--- a/meson.build
+++ b/meson.build
@@ -50,7 +50,7 @@ qapi_trace_events = []
 
 bsd_oses = ['gnu/kfreebsd', 'freebsd', 'netbsd', 'openbsd', 'dragonfly', 'darwin']
 supported_oses = ['windows', 'freebsd', 'netbsd', 'openbsd', 'darwin', 'sunos', 'linux', 'emscripten']
-supported_cpus = ['ppc', 'ppc64', 's390x', 'riscv32', 'riscv64', 'x86', 'x86_64',
+supported_cpus = ['ppc', 'ppc64', 's390x', 'riscv32', 'riscv64', 'x86_64',
   'aarch64', 'loongarch64', 'mips64', 'sparc64', 'wasm32']
 
 cpu = host_machine.cpu_family()
@@ -265,8 +265,6 @@ enable_modules = get_option('modules') \
 
 if cpu not in supported_cpus
   host_arch = 'unknown'
-elif cpu == 'x86'
-  host_arch = 'i386'
 elif cpu == 'mips64'
   host_arch = 'mips'
 elif cpu in ['riscv32', 'riscv64']
@@ -275,9 +273,7 @@ else
   host_arch = cpu
 endif
 
-if cpu == 'x86'
-  kvm_targets = ['i386-softmmu']
-elif cpu == 'x86_64'
+if cpu == 'x86_64'
   kvm_targets = ['i386-softmmu', 'x86_64-softmmu']
 elif cpu == 'aarch64'
   kvm_targets = ['aarch64-softmmu']
@@ -300,9 +296,7 @@ else
 endif
 accelerator_targets = { 'CONFIG_KVM': kvm_targets }
 
-if cpu == 'x86'
-  xen_targets = ['i386-softmmu']
-elif cpu == 'x86_64'
+if cpu == 'x86_64'
   xen_targets = ['i386-softmmu', 'x86_64-softmmu']
 elif cpu == 'aarch64'
   # i386 emulator provides xenpv machine type for multiple architectures
@@ -391,40 +385,17 @@ endif
 
 qemu_isa_flags = []
 
-# __sync_fetch_and_and requires at least -march=i486. Many toolchains
-# use i686 as default anyway, but for those that don't, an explicit
-# specification is necessary
-if host_arch == 'i386' and not cc.links('''
-  static int sfaa(int *ptr)
-  {
-    return __sync_fetch_and_and(ptr, 0);
-  }
-
-  int main(void)
-  {
-    int val = 42;
-    val = __sync_val_compare_and_swap(&val, 0, 1);
-    sfaa(&val);
-    return val;
-  }''')
-  qemu_isa_flags += ['-march=i486']
-endif
-
 # Pick x86-64 baseline version
-if host_arch in ['i386', 'x86_64']
-  if get_option('x86_version') == '0' and host_arch == 'x86_64'
+if host_arch == 'x86_64'
+  if get_option('x86_version') == '0'
     error('x86_64-v1 required for x86-64 hosts')
   endif
 
   # add flags for individual instruction set extensions
   if get_option('x86_version') >= '1'
-    if host_arch == 'i386'
-      qemu_common_flags = ['-mfpmath=sse'] + qemu_common_flags
-    else
-      # present on basically all processors but technically not part of
-      # x86-64-v1, so only include -mneeded for x86-64 version 2 and above
-      qemu_isa_flags += ['-mcx16']
-    endif
+    # present on basically all processors but technically not part of
+    # x86-64-v1, so only include -mneeded for x86-64 version 2 and above
+    qemu_isa_flags += ['-mcx16']
   endif
   if get_option('x86_version') >= '2'
     qemu_isa_flags += ['-mpopcnt']
@@ -1031,7 +1002,7 @@ have_xen_pci_passthrough = get_option('xen_pci_passthrough') \
            error_message: 'Xen PCI passthrough requested but Xen not enabled') \
   .require(host_os == 'linux',
            error_message: 'Xen PCI passthrough not available on this platform') \
-  .require(cpu == 'x86'  or cpu == 'x86_64',
+  .require(cpu == 'x86_64',
            error_message: 'Xen PCI passthrough not available on this platform') \
   .allowed()
 
@@ -4553,7 +4524,7 @@ if have_tools
                               libcap_ng, mpathpersist],
                install: true)
 
-    if cpu in ['x86', 'x86_64']
+    if cpu == 'x86_64'
       executable('qemu-vmsr-helper', files('tools/i386/qemu-vmsr-helper.c'),
                dependencies: [authz, crypto, io, qom, qemuutil,
                               libcap_ng, mpathpersist],
-- 
2.43.0
Re: [PATCH 08/50] meson: Remove cpu == x86 tests
Posted by Pierrick Bouvier 1 day, 14 hours ago
On 1/7/26 9:29 PM, Richard Henderson wrote:
> The 32-bit x86 host is no longer supported.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   configure   | 16 +---------------
>   meson.build | 49 ++++++++++---------------------------------------
>   2 files changed, 11 insertions(+), 54 deletions(-)
> 

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Re: [PATCH 08/50] meson: Remove cpu == x86 tests
Posted by Thomas Huth 2 days, 1 hour ago
On 08/01/2026 06.29, Richard Henderson wrote:
> The 32-bit x86 host is no longer supported.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   configure   | 16 +---------------
>   meson.build | 49 ++++++++++---------------------------------------
>   2 files changed, 11 insertions(+), 54 deletions(-)
> 
> diff --git a/configure b/configure
> index 00e455be57..846fab904e 100755
> --- a/configure
> +++ b/configure
> @@ -440,13 +440,6 @@ case "$cpu" in
>       linux_arch=arm64
>       ;;
>   
> -  i386|i486|i586|i686)
> -    cpu="i386"
> -    host_arch=i386
> -    linux_arch=x86
> -    CPU_CFLAGS="-m32"
> -    ;;

Ah, it's removed here, please forget my previous related comment about this 
in an earlier partch!

> @@ -300,9 +296,7 @@ else
>   endif
>   accelerator_targets = { 'CONFIG_KVM': kvm_targets }
>   
> -if cpu == 'x86'
> -  xen_targets = ['i386-softmmu']
> -elif cpu == 'x86_64'
> +if cpu == 'x86_64'
>     xen_targets = ['i386-softmmu', 'x86_64-softmmu']

I wonder whether we should limit xen_targets to x86_64-softmmu now?

Anyway:
Reviewed-by: Thomas Huth <thuth@redhat.com>
Re: [PATCH 08/50] meson: Remove cpu == x86 tests
Posted by Pierrick Bouvier 1 day, 14 hours ago
On 1/8/26 1:50 AM, Thomas Huth wrote:
> On 08/01/2026 06.29, Richard Henderson wrote:
>> The 32-bit x86 host is no longer supported.
>>
>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
>> ---
>>    configure   | 16 +---------------
>>    meson.build | 49 ++++++++++---------------------------------------
>>    2 files changed, 11 insertions(+), 54 deletions(-)
>>
>> diff --git a/configure b/configure
>> index 00e455be57..846fab904e 100755
>> --- a/configure
>> +++ b/configure
>> @@ -440,13 +440,6 @@ case "$cpu" in
>>        linux_arch=arm64
>>        ;;
>>    
>> -  i386|i486|i586|i686)
>> -    cpu="i386"
>> -    host_arch=i386
>> -    linux_arch=x86
>> -    CPU_CFLAGS="-m32"
>> -    ;;
> 
> Ah, it's removed here, please forget my previous related comment about this
> in an earlier partch!
> 
>> @@ -300,9 +296,7 @@ else
>>    endif
>>    accelerator_targets = { 'CONFIG_KVM': kvm_targets }
>>    
>> -if cpu == 'x86'
>> -  xen_targets = ['i386-softmmu']
>> -elif cpu == 'x86_64'
>> +if cpu == 'x86_64'
>>      xen_targets = ['i386-softmmu', 'x86_64-softmmu']
> 
> I wonder whether we should limit xen_targets to x86_64-softmmu now?
>

The i386 target still exists, and it can be run with xen on a x86_64 
machine, so I think it's supposed to stay.

> Anyway:
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> 
>