qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: xen bits broke x32 build


From: Michael Tokarev
Subject: Re: xen bits broke x32 build
Date: Tue, 11 Apr 2023 14:56:30 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0

01.04.2023 11:40, Michael Tokarev wrote:
After bringing in xen guest support, qemu fails to build on x32:

target/i386/kvm/xen-emu.c:876:5: note: in expansion of macro ‘qemu_build_assert’
   876 |     qemu_build_assert(sizeof(struct vcpu_info) == 64);
       |     ^~~~~~~~~~~~~~~~~

This one should be easy to fix, but I wonder if there are other issues
with x32 exists..

Ok, I took a look at how to disable this new XEN stuff on x32.

It is the commit 820c1aba519bd072ac71c754733f6c86d8b4309 "xen: add
CONFIG_XEN_BUS and CONFIG_XEN_EMU options for Xen emulation" adding
this construct to hw/i386/Kconfig:

config XEN_EMU
    bool
    default y
    depends on KVM && (I386 || X86_64)

Since meson does not know about x32, and while ./conifgure does, it
is not propagated to meson, and sure not propagated to Kconfig too,
there's some more work needed to disable XEN_EMU on x32.

Something like this?

diff --git a/target/i386/Kconfig b/target/i386/Kconfig
index ce6968906e..75a91f497a 100644
--- a/target/i386/Kconfig
+++ b/target/i386/Kconfig
@@ -3,3 +3,6 @@ config I386

 config X86_64
     bool
+
+config X32
+    bool

diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
index d40802d83f..3ad6b44984 100644
--- a/hw/i386/Kconfig
+++ b/hw/i386/Kconfig
@@ -140,4 +140,4 @@ config VMMOUSE
 config XEN_EMU
     bool
     default y
-    depends on KVM && (I386 || X86_64)
+    depends on KVM && (I386 || X86_64) && !X32


diff --git a/meson.build b/meson.build
index c44d05a13f..9e7c83fc6a 100644
--- a/meson.build
+++ b/meson.build
@@ -70,6 +70,11 @@ if cpu in ['riscv32', 'riscv64']
   cpu = 'riscv'
 endif

+x32 = false
+if cpu == 'x86_64'
+  x32 = cc.sizeof('long') == 4
+endif
+
 target_dirs = config_host['TARGET_DIRS'].split()
 have_linux_user = false
 have_bsd_user = false
@@ -2554,7 +2559,8 @@ host_kconfig = \
   ('CONFIG_LINUX' in config_host ? ['CONFIG_LINUX=y'] : []) + \
   (have_pvrdma ? ['CONFIG_PVRDMA=y'] : []) + \
   (multiprocess_allowed ? ['CONFIG_MULTIPROCESS_ALLOWED=y'] : []) + \
-  (vfio_user_server_allowed ? ['CONFIG_VFIO_USER_SERVER_ALLOWED=y'] : [])
+  (vfio_user_server_allowed ? ['CONFIG_VFIO_USER_SERVER_ALLOWED=y'] : []) + \
+  (x32 ? ['CONFIG_X32=y'] : [])

 ignored = [ 'TARGET_XML_FILES', 'TARGET_ABI_DIR', 'TARGET_ARCH' ]





reply via email to

[Prev in Thread] Current Thread [Next in Thread]