Allow running qemu-system-x86_64 in 32-bit-only mode (by renaming or symlinking the binary to "qemu-system-i386"). After doing this, qemu-system-x86_64 should be a proper superset of qemu-system-i386 (apart from 32-bit KVM support, which however is not really required anymore, see https://lore.kernel.org/kvm/y%2ffkts5ajfy0h...@google.com/ ). Thus we can finally deprecate the qemu-system-i386 binary. This will help to avoid that we have to compile a lot of the x86 stuff twice once we'll finally be able to drop qemu-system-i386.
Marked as RFC since there are likely still a bunch of spots around that need attention, e.g.: - CPU types have different suffixes between the -x86_64 and -i386 variant (see TYPE_X86_CPU in cpu-qom.h) ... do we need to care about this in the new qemu-system-i386 symlink run mode? - The code in target/i386/tcg/sysemu/smm_helper.c looks like it maybe needs a runtime switch, too ... or is it ok to leave this hard-coded to the x86_64 version? Anyway, I'd like to get some feedback on this idea here... What do you think of the idea of getting rid of the qemu-system-i386 binary this way in the future? Thomas Huth (3): cpu: Add a way to detect 32-bit mode from argv0 target/i386/cpu: Allow to limit the 64-bit binary to 32-bit mode only docs/about/deprecated: Deprecate the qemu-system-i386 binary docs/about/deprecated.rst | 16 ++++++++++++++++ include/hw/core/cpu.h | 10 ++++++++++ target/i386/cpu.h | 4 ++-- cpu.c | 13 +++++++++++++ softmmu/vl.c | 1 + target/i386/cpu.c | 28 +++++++++++++--------------- target/i386/gdbstub.c | 8 +------- 7 files changed, 56 insertions(+), 24 deletions(-) -- 2.31.1