qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: qemu-devel@nongnu.org,  pbonzini@redhat.com,
	mark.cave-ayland@ilande.co.uk,  berrange@redhat.com,
	 philmd@linaro.org, thuth@redhat.com
Subject: Re: [PATCH v2 12/14] meson: Disallow 64-bit on 32-bit TCG emulation
Date: Mon, 03 Feb 2025 13:54:37 +0000	[thread overview]
Message-ID: <87o6zjcew2.fsf@draig.linaro.org> (raw)
In-Reply-To: <20250203031821.741477-13-richard.henderson@linaro.org> (Richard Henderson's message of "Sun, 2 Feb 2025 19:18:19 -0800")

Richard Henderson <richard.henderson@linaro.org> writes:

> For system mode, we can rarely support the amount of RAM that
> the guest requires. Emulation is restricted to round-robin
> mode, which solves many of the atomicity issues, but not those
> associated with virtio.  In any case, round-robin does nothing
> to help the speed of emulation.
>
> For user mode, most emulation does not succeed at all.  Most
> of the time we cannot even load 64-bit non-PIE binaries due
> to lack of a 64-bit address space.  Threads are run in
> parallel, not round-robin, which means that atomicity
> is not handled.

I think in itself is not enough, on aarch64.ci.org:

  ./../configure --disable-docs --disable-tools --cross-prefix=arm-linux-gnueabihf-

Should only build 32 bit binaries. Which it does:

  13:52:57 [alex@aarch64:~/l/q/b/arm32.crossbuild] review/deprecate-64-on-32-v2|… + ls qemu-*
  qemu-arm         qemu-keymap        qemu-mipsel       qemu-sh4         qemu-system-i386    qemu-system-ppc      qemu-system-sparc     qemu-xtensa
  qemu-armeb       qemu-m68k          qemu-options.def  qemu-sh4eb       qemu-system-m68k    qemu-system-riscv32  qemu-system-tricore   qemu-xtensaeb
  qemu-hexagon     qemu-microblaze    qemu-or1k         qemu-sparc       qemu-system-mips    qemu-system-rx       qemu-system-xtensa
  qemu-i386        qemu-microblazeel  qemu-ppc          qemu-system-arm  qemu-system-mipsel  qemu-system-sh4      qemu-system-xtensaeb
  qemu-img-cmds.h  qemu-mips          qemu-riscv32      qemu-system-avr  qemu-system-or1k    qemu-system-sh4eb    qemu-version.h

However make check-tcg fails because:

  13:53:09 [alex@aarch64:~/l/q/b/arm32.crossbuild] review/deprecate-64-on-32-v2|… + cat config-host.mak 
  # Automatically generated by configure - do not modify

  all:
  SRC_PATH=/home/alex/lsrc/qemu.git
  TARGET_DIRS=aarch64-linux-user aarch64_be-linux-user alpha-linux-user arm-linux-user armeb-linux-user hexagon-linux-user hppa-linux-user i386-linux-user loongarch64-linux-user m68k-linux-user microblaze-linux-user microblazeel-linux-user mips-linux-user mips64-linux-user mips64el-linux-user mipsel-linux-user mipsn32-linux-user mipsn32el-linux-user or1k-linux-user ppc-linux-user ppc64-linux-user ppc64le-linux-user riscv32-linux-user riscv64-linux-user s390x-linux-user sh4-linux-user sh4eb-linux-user sparc-linux-user sparc32plus-linux-user sparc64-linux-user x86_64-linux-user xtensa-linux-user xtensaeb-linux-user aarch64-softmmu alpha-softmmu arm-softmmu avr-softmmu hppa-softmmu i386-softmmu loongarch64-softmmu m68k-softmmu microblaze-softmmu microblazeel-softmmu mips-softmmu mips64-softmmu mips64el-softmmu mipsel-softmmu or1k-softmmu ppc-softmmu ppc64-softmmu riscv32-softmmu riscv64-softmmu rx-softmmu s390x-softmmu sh4-softmmu sh4eb-softmmu sparc-softmmu sparc64-softmmu tricore-softmmu x86_64-softmmu xtensa-softmmu xtensaeb-softmmu
  GDB=/usr/bin/gdb-multiarch
  RUNC=docker
  SUBDIRS= pc-bios/optionrom pc-bios/s390-ccw
  PYTHON=/home/alex/lsrc/qemu.git/builds/arm32.crossbuild/pyvenv/bin/python3 -B
  MKVENV_ENSUREGROUP=/home/alex/lsrc/qemu.git/builds/arm32.crossbuild/pyvenv/bin/python3 -B /home/alex/lsrc/qemu.git/python/scripts/mkvenv.py ensuregroup  --online
  GENISOIMAGE=/usr/bin/genisoimage
  MESON=/home/alex/lsrc/qemu.git/builds/arm32.crossbuild/pyvenv/bin/meson
  NINJA=/usr/bin/ninja
  EXESUF=
  CONFIG_DEFAULT_TARGETS=y
  TCG_TESTS_TARGETS= aarch64-linux-user arm-linux-user i386-linux-user mips64el-linux-user mipsel-linux-user riscv64-linux-user s390x-linux-user aarch64-softmmu arm-softmmu i386-softmmu riscv64-softmmu s390x-softmmu

So possible TCG_TESTS_TARGET needs to be merged with the meson code?
Also do we still use TARGET_DIRS?

>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  meson.build | 14 +++++++++++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/meson.build b/meson.build
> index 5ca3cc3f34..866b8ce477 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -3176,6 +3176,9 @@ if host_os == 'windows'
>    endif
>  endif
>  
> +# Detect host pointer size for the target configuration loop.
> +host_long_bits = cc.sizeof('void *') * 8
> +
>  ########################
>  # Target configuration #
>  ########################
> @@ -3268,11 +3271,18 @@ foreach target : target_dirs
>      }
>    endif
>  
> +  config_target += keyval.load('configs/targets' / target + '.mak')
> +
>    target_kconfig = []
>    foreach sym: accelerators
>      if sym == 'CONFIG_TCG'
> +      # Disallow 64-bit on 32-bit TCG emulation.
> +      if host_long_bits < config_target['TARGET_LONG_BITS'].to_int()
> +        continue
> +      endif
>        config_target += { 'CONFIG_TCG_TARGET': 'y' }
>      elif target not in accelerator_targets.get(sym, [])
> +      # Other accelerators are handled by accelerator_targets.
>        continue
>      endif
>      config_target += { sym: 'y' }
> @@ -3286,9 +3296,6 @@ foreach target : target_dirs
>      error('No accelerator available for target @0@'.format(target))
>    endif
>  
> -  config_target += keyval.load('configs/targets' / target + '.mak')
> -  config_target += { 'TARGET_' + config_target['TARGET_ARCH'].to_upper(): 'y' }
> -
>    if 'TARGET_NEED_FDT' in config_target and not fdt.found()
>      if default_targets
>        warning('Disabling ' + target + ' due to missing libfdt')
> @@ -3301,6 +3308,7 @@ foreach target : target_dirs
>    actual_target_dirs += target
>  
>    # Add default keys
> +  config_target += { 'TARGET_' + config_target['TARGET_ARCH'].to_upper(): 'y' }
>    if 'TARGET_BASE_ARCH' not in config_target
>      config_target += {'TARGET_BASE_ARCH': config_target['TARGET_ARCH']}
>    endif

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


  parent reply	other threads:[~2025-02-03 13:55 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-03  3:18 [PATCH v2 00/14] meson: Deprecate 32-bit host support Richard Henderson
2025-02-03  3:18 ` [PATCH v2 01/14] meson: Drop tcg as a module Richard Henderson
2025-02-03  9:58   ` Thomas Huth
2025-02-03 18:39     ` Philippe Mathieu-Daudé
2025-02-03 11:34   ` Alex Bennée
2025-02-03 18:36   ` Philippe Mathieu-Daudé
2025-02-03  3:18 ` [PATCH v2 02/14] tcg: Move stubs in tcg/perf.h to tcg/perf-stubs.c Richard Henderson
2025-02-03 10:00   ` Thomas Huth
2025-02-03 11:34   ` Alex Bennée
2025-02-03  3:18 ` [PATCH v2 03/14] plugins: Uninline qemu_plugin_add_opts Richard Henderson
2025-02-03 10:02   ` Thomas Huth
2025-02-03 11:44   ` Alex Bennée
2025-02-03  3:18 ` [PATCH v2 04/14] meson: Introduce CONFIG_TCG_TARGET Richard Henderson
2025-02-03 10:08   ` Thomas Huth
2025-02-03 16:38     ` Richard Henderson
2025-02-04  6:41       ` Thomas Huth
2025-02-03  3:18 ` [PATCH v2 05/14] tcg: Link only when required in system mode Richard Henderson
2025-02-03 10:15   ` Thomas Huth
2025-02-03 11:48   ` Alex Bennée
2025-02-03  3:18 ` [PATCH v2 06/14] plugins: " Richard Henderson
2025-02-03 10:16   ` Thomas Huth
2025-02-03 11:49   ` Alex Bennée
2025-02-03  3:18 ` [PATCH v2 07/14] accel/stubs: Expand stubs for TCG Richard Henderson
2025-02-03 10:22   ` Thomas Huth
2025-02-03 16:43     ` Richard Henderson
2025-02-03 17:38       ` Thomas Huth
2025-02-03 20:00         ` Richard Henderson
2025-02-03  3:18 ` [PATCH v2 08/14] target/mips: Protect objects with CONFIG_TCG Richard Henderson
2025-02-03 10:24   ` Thomas Huth
2025-02-03 17:25   ` Philippe Mathieu-Daudé
2025-02-03 18:01     ` Richard Henderson
2025-02-03  3:18 ` [PATCH v2 09/14] gitlab: Replace aarch64 with arm in cross-i686-tci build Richard Henderson
2025-02-03 10:30   ` Thomas Huth
2025-02-03 12:31   ` Alex Bennée
2025-02-03  3:18 ` [PATCH v2 10/14] configure: Define TARGET_LONG_BITS in configs/targets/*.mak Richard Henderson
2025-02-03 10:39   ` Thomas Huth
2025-02-03 12:33     ` Alex Bennée
2025-02-03 16:49     ` Richard Henderson
2025-02-03 17:39       ` Thomas Huth
2025-02-03 17:48   ` Philippe Mathieu-Daudé
2025-02-03 18:30   ` Philippe Mathieu-Daudé
2025-02-03 19:19     ` Richard Henderson
2025-02-03  3:18 ` [PATCH v2 11/14] target/*: Remove TARGET_LONG_BITS from cpu-param.h Richard Henderson
2025-02-03 10:43   ` Thomas Huth
2025-02-03 12:34   ` Alex Bennée
2025-02-03 18:31   ` Philippe Mathieu-Daudé
2025-02-03  3:18 ` [PATCH v2 12/14] meson: Disallow 64-bit on 32-bit TCG emulation Richard Henderson
2025-02-03 10:46   ` Thomas Huth
2025-02-03 13:54   ` Alex Bennée [this message]
2025-02-03  3:18 ` [PATCH v2 13/14] meson: Deprecate 32-bit host support Richard Henderson
2025-02-03 10:47   ` Thomas Huth
2025-02-03 13:56   ` Alex Bennée
2025-02-03  3:18 ` [PATCH v2 14/14] tcg: Remove TCG_OVERSIZED_GUEST Richard Henderson
2025-02-03 13:59   ` Alex Bennée
2025-02-04 17:42     ` Richard Henderson
2025-02-03 12:54 ` [PATCH v2 00/14] meson: Deprecate 32-bit host support Paolo Bonzini
2025-02-03 21:55   ` Richard Henderson
2025-02-03 22:43     ` Stefano Stabellini
2025-02-04  8:12       ` Daniel P. Berrangé
2025-02-04  8:19       ` Juergen Gross
2025-02-04  9:11         ` Jan Beulich
2025-02-04 10:44           ` Philippe Mathieu-Daudé

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=87o6zjcew2.fsf@draig.linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).