Skip to contentSkip to conversation

meson: Do not build Xen x86_64-softmmu on Aarch64

PATCH Philippe Mathieu-Daudé 2 participants 7 messages Jan 31, 2021 – Feb 1, 2021 5 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 10 lines · On 1/31/21 3:45 PM, andrew.cooper3--- via wrote:
Quoted 5 lines · Philippe Mathieu-Daudé

The Xen on ARM documentation only mentions the i386-softmmu target. As the x86_64-softmmu doesn't seem used, remove it to avoid wasting cpu cycles building it.

As far as I understand, it only gets used at all on ARM for the blkback=>qcow path, and has nothing to do with I440FX or other boards. i.e. it is a paravirt disk and nothing else.

Yeah the PIIX3 part is messy, this is easier to select I440FX which provides all the required dependencies. TBH I'd rather invest my time in other tasks, and the Xen folks don't seem interested in getting this improved. I only did that series to reply to Paolo and pass over to Alex Bennée.

Quoted 3 lines

xenpv should not be tied to i386-softmmu in the first place, and would remove a very-WTF-worthy current state of things.  That said, I have no idea how much effort that might be.

Here the problem isn't much Xen but the rest of x86 machines in QEMU.

Regards,

Phil.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

Re: [PATCH v2 4/4] hw/xen: Have Xen machines select 9pfs

Quoted 34 lines · Philippe Mathieu-Daudé

9pfs is not an accelerator feature but a machine one, move the selection on the machine Kconfig (in hw/).

---
  accel/Kconfig       | 1 -
  hw/i386/xen/Kconfig | 1 +
  hw/xen/Kconfig      | 1 +
  3 files changed, 2 insertions(+), 1 deletion(-)
accel/Kconfig +0 -1
index 461104c7715..b9e9a2d35b0 100644
@@ -15,4 +15,3 @@ config KVM
 
  config XEN
      bool
-    select FSDEV_9P if VIRTFS
hw/i386/xen/Kconfig +1 -0
index ad9d774b9ea..4affd842f28 100644
@@ -3,3 +3,4 @@ config XEN_FV
      default y if XEN
      depends on XEN
      select I440FX
+    select FSDEV_9P if VIRTFS
hw/xen/Kconfig +0 -0
index 0b8427d6bd1..825277969fa 100644

hw/xen/Kconfig config XEN_PV · line 8

Quoted 4 lines
hw/xen/Kconfig +1 -0
@@ -5,3 +5,4 @@ config XEN_PV
      select PCI
      select USB
      select IDE_PIIX
+    select FSDEV_9P if VIRTFS

I think you can compile without FSDEV_9P selected? If so, this should be "imply".

If on the other hand you cannot, and that is because of some other file brought in by CONFIG_XEN, this patch shouldn't be there.

I can queue the series once you resolve this doubt.

Paolo

#6 lore raw

Re: [PATCH v2 4/4] hw/xen: Have Xen machines select 9pfs

Quoted 42 lines · Paolo Bonzini
Quoted 32 lines · Philippe Mathieu-Daudé

9pfs is not an accelerator feature but a machine one, move the selection on the machine Kconfig (in hw/).

---
  accel/Kconfig       | 1 -
  hw/i386/xen/Kconfig | 1 +
  hw/xen/Kconfig      | 1 +

  3 files changed, 2 insertions(+), 1 deletion(-)
accel/Kconfig +0 -0
index 461104c7715..b9e9a2d35b0 100644
@@ -15,4 +15,3 @@ config KVM

    config XEN
      bool
-    select FSDEV_9P if VIRTFS

hw/i386/xen/Kconfig +0 -0
index ad9d774b9ea..4affd842f28 100644
@@ -3,3 +3,4 @@ config XEN_FV

      default y if XEN
      depends on XEN
      select I440FX
+    select FSDEV_9P if VIRTFS

hw/xen/Kconfig +0 -0
index 0b8427d6bd1..825277969fa 100644
@@ -5,3 +5,4 @@ config XEN_PV
Quoted 5 lines

      select PCI
      select USB
      select IDE_PIIX
+    select FSDEV_9P if VIRTFS

I think you can compile without FSDEV_9P selected?  If so, this should be "imply".

Quoted 2 lines

If on the other hand you cannot, and that is because of some other file brought in by CONFIG_XEN, this patch shouldn't be there.

FYI using 'imply FSDEV_9P' instead I get:

/usr/bin/ld: libcommon.fa.p/hw_xen_xen-legacy-backend.c.o: in function `xen_be_register_common':
hw/xen/xen-legacy-backend.c:754: undefined reference to `xen_9pfs_ops'

The function is:

  void xen_be_register_common(void)
  {
      xen_set_dynamic_sysbus();
      xen_be_register("console", &xen_console_ops);
      xen_be_register("vkbd", &xen_kbdmouse_ops);
  #ifdef CONFIG_VIRTFS
      xen_be_register("9pfs", &xen_9pfs_ops);
  #endif
  #ifdef CONFIG_USB_LIBUSB
      xen_be_register("qusb", &xen_usb_ops);

#endif
}

The object is compiled using:

-- >8 --
-#ifdef CONFIG_VIRTFS
+#ifdef CONFIG_FSDEV_9P

     xen_be_register("9pfs", &xen_9pfs_ops);

#endif
---

Respin planned.

Thanks,

Phil.

#7 lore raw

Re: [PATCH v2 4/4] hw/xen: Have Xen machines select 9pfs

Quoted 5 lines · Philippe Mathieu-Daudé

FYI using 'imply FSDEV_9P' instead I get:

/usr/bin/ld: libcommon.fa.p/hw_xen_xen-legacy-backend.c.o: in function `xen_be_register_common':
hw/xen/xen-legacy-backend.c:754: undefined reference to `xen_9pfs_ops'

Ok, so then we have the case of a file (hw/xen/xen-legacy-backend.c) brought in by CONFIG_XEN. In that case this patch is incorrect...

Quoted 19 lines

The function is:

   void xen_be_register_common(void)
   {
       xen_set_dynamic_sysbus();
       xen_be_register("console", &xen_console_ops);
       xen_be_register("vkbd", &xen_kbdmouse_ops);
   #ifdef CONFIG_VIRTFS
       xen_be_register("9pfs", &xen_9pfs_ops);
   #endif
   #ifdef CONFIG_USB_LIBUSB
       xen_be_register("qusb", &xen_usb_ops);
   #endif
   }

The object is compiled using:

-- >8 --

Review

Quoted 5 lines
(quoted diff) +1 -2
-#ifdef CONFIG_VIRTFS
+#ifdef CONFIG_FSDEV_9P
      xen_be_register("9pfs", &xen_9pfs_ops);
  #endif
---

... and this is the best fix, together with:

- a "#include CONFIG_DEVICES" at the top (to get CONFIG_FSDEV_9P)

- moving xen-legacy-backend.c from softmmu_ss to specific_ss (to get CONFIG_DEVICES)

- changing "select" to "imply" in accel/Kconfig (otherwise the patch has no effect)

But really, doing nothing and just dropping this patch is perfectly fine.

Paolo

#8 lore raw

Re: [PATCH v2 4/4] hw/xen: Have Xen machines select 9pfs

Quoted 37 lines · Paolo Bonzini
Quoted 5 lines · Philippe Mathieu-Daudé

FYI using 'imply FSDEV_9P' instead I get:

/usr/bin/ld: libcommon.fa.p/hw_xen_xen-legacy-backend.c.o: in function `xen_be_register_common':
hw/xen/xen-legacy-backend.c:754: undefined reference to `xen_9pfs_ops'

Ok, so then we have the case of a file (hw/xen/xen-legacy-backend.c) brought in by CONFIG_XEN.  In that case this patch is incorrect...

Quoted 21 lines

The function is:

   void xen_be_register_common(void)
   {
       xen_set_dynamic_sysbus();

       xen_be_register("console", &xen_console_ops); xen_be_register("vkbd", &xen_kbdmouse_ops); #ifdef CONFIG_VIRTFS xen_be_register("9pfs", &xen_9pfs_ops); #endif
   #ifdef CONFIG_USB_LIBUSB xen_be_register("qusb", &xen_usb_ops); #endif
   }

The object is compiled using:

-- >8 --

(quoted diff) +1 -1
-#ifdef CONFIG_VIRTFS
+#ifdef CONFIG_FSDEV_9P
Quoted 3 lines

      xen_be_register("9pfs", &xen_9pfs_ops);
  #endif
---

... and this is the best fix, together with:

Quoted 7 lines

- a "#include CONFIG_DEVICES" at the top (to get CONFIG_FSDEV_9P)

- moving xen-legacy-backend.c from softmmu_ss to specific_ss (to get CONFIG_DEVICES)

- changing "select" to "imply" in accel/Kconfig (otherwise the patch has no effect)

OK.

Quoted 2 lines

But really, doing nothing and just dropping this patch is perfectly fine.

Yes, I'll respin what I have so far and continue when I find the time and motivation another week-end.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#10 lore raw

Re: [PATCH v2 3/4] hw/xen/Kconfig: Introduce XEN_PV config

Quoted 37 lines · Philippe Mathieu-Daudé

xenpv machine requires USB, IDE_PIIX and PCI:

/usr/bin/ld:
libcommon.fa.p/hw_xen_xen-legacy-backend.c.o: in function `xen_be_register_common':
hw/xen/xen-legacy-backend.c:757: undefined reference to xen_usb_ops' libqemu-i386-softmmu.fa.p/hw_i386_xen_xen_platform.c.o: in function unplug_disks':
hw/i386/xen/xen_platform.c:153: undefined reference to pci_piix3_xen_ide_unplug' libqemu-i386-softmmu.fa.p/hw_i386_xen_xen_platform.c.o: in function pci_unplug_nics':
hw/i386/xen/xen_platform.c:137: undefined reference to pci_for_each_device' libqemu-i386-softmmu.fa.p/hw_i386_xen_xen_platform.c.o: in function xen_platform_realize':
hw/i386/xen/xen_platform.c:483: undefined reference to `pci_register_bar'

---
 hw/Kconfig     | 1 +
 hw/xen/Kconfig | 7 +++++++
 2 files changed, 8 insertions(+)
 create mode 100644 hw/xen/Kconfig
hw/Kconfig +1 -0
index 5ad3c6b5a4b..f2a95591d94 100644
@@ -39,6 +39,7 @@ source usb/Kconfig
 source virtio/Kconfig
 source vfio/Kconfig
 source watchdog/Kconfig
+source xen/Kconfig
 
 # arch Kconfig
 source arm/Kconfig
hw/xen/Kconfig new file +0 -0
new file mode 100644
index 00000000000..0b8427d6bd1

hw/xen/Kconfig line 7

Quoted 7 lines
hw/xen/Kconfig new file +7 -0
@@ -0,0 +1,7 @@
+config XEN_PV
+    bool
+    default y if XEN
+    depends on XEN
+    select PCI
+    select USB
+    select IDE_PIIX

Well this is not enough, --without-default-devices fails:

/usr/bin/ld: libqemu-x86_64-softmmu.fa.p/softmmu_physmem.c.o: in function `cpu_physical_memory_set_dirty_range':
include/exec/ram_addr.h:333: undefined reference to `xen_hvm_modified_memory'
/usr/bin/ld: libqemu-x86_64-softmmu.fa.p/softmmu_physmem.c.o: in function `ram_block_add':
softmmu/physmem.c:1873: undefined reference to xen_ram_alloc' /usr/bin/ld: libqemu-x86_64-softmmu.fa.p/softmmu_physmem.c.o: in function cpu_physical_memory_set_dirty_range':
include/exec/ram_addr.h:333: undefined reference to `xen_hvm_modified_memory'
/usr/bin/ld: include/exec/ram_addr.h:333: undefined reference to `xen_hvm_modified_memory'
/usr/bin/ld: libqemu-x86_64-softmmu.fa.p/softmmu_memory.c.o: in function `cpu_physical_memory_set_dirty_range':
include/exec/ram_addr.h:333: undefined reference to `xen_hvm_modified_memory'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

#11 lore raw

Re: [PATCH v2 3/4] hw/xen/Kconfig: Introduce XEN_PV config

Quoted 59 lines · Philippe Mathieu-Daudé
Quoted 37 lines · Philippe Mathieu-Daudé

xenpv machine requires USB, IDE_PIIX and PCI:

/usr/bin/ld:
libcommon.fa.p/hw_xen_xen-legacy-backend.c.o: in function `xen_be_register_common':
hw/xen/xen-legacy-backend.c:757: undefined reference to xen_usb_ops' libqemu-i386-softmmu.fa.p/hw_i386_xen_xen_platform.c.o: in function unplug_disks':
hw/i386/xen/xen_platform.c:153: undefined reference to pci_piix3_xen_ide_unplug' libqemu-i386-softmmu.fa.p/hw_i386_xen_xen_platform.c.o: in function pci_unplug_nics':
hw/i386/xen/xen_platform.c:137: undefined reference to pci_for_each_device' libqemu-i386-softmmu.fa.p/hw_i386_xen_xen_platform.c.o: in function xen_platform_realize':
hw/i386/xen/xen_platform.c:483: undefined reference to `pci_register_bar'

---
  hw/Kconfig     | 1 +
  hw/xen/Kconfig | 7 +++++++
  2 files changed, 8 insertions(+)

create mode 100644 hw/xen/Kconfig

hw/Kconfig +1 -0
index 5ad3c6b5a4b..f2a95591d94 100644
@@ -39,6 +39,7 @@ source usb/Kconfig
  source virtio/Kconfig
  source vfio/Kconfig
  source watchdog/Kconfig
+source xen/Kconfig
 
  # arch Kconfig
  source arm/Kconfig
hw/xen/Kconfig new file +0 -0
new file mode 100644
index 00000000000..0b8427d6bd1

hw/xen/Kconfig line 7

Quoted 7 lines
hw/xen/Kconfig new file +7 -0
@@ -0,0 +1,7 @@
+config XEN_PV
+    bool
+    default y if XEN
+    depends on XEN
+    select PCI
+    select USB
+    select IDE_PIIX

Well this is not enough, --without-default-devices fails:

/usr/bin/ld: libqemu-x86_64-softmmu.fa.p/softmmu_physmem.c.o: in function `cpu_physical_memory_set_dirty_range':
include/exec/ram_addr.h:333: undefined reference to `xen_hvm_modified_memory'
/usr/bin/ld: libqemu-x86_64-softmmu.fa.p/softmmu_physmem.c.o: in function `ram_block_add':
softmmu/physmem.c:1873: undefined reference to xen_ram_alloc' /usr/bin/ld: libqemu-x86_64-softmmu.fa.p/softmmu_physmem.c.o: in function cpu_physical_memory_set_dirty_range':
include/exec/ram_addr.h:333: undefined reference to `xen_hvm_modified_memory'

Quoted 8 lines

/usr/bin/ld: include/exec/ram_addr.h:333: undefined reference to `xen_hvm_modified_memory'
/usr/bin/ld: libqemu-x86_64-softmmu.fa.p/softmmu_memory.c.o: in function `cpu_physical_memory_set_dirty_range':
include/exec/ram_addr.h:333: undefined reference to `xen_hvm_modified_memory'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

I think you can modify xen_hvm_modified_memory to become a virtual function in AccelClass.

Paolo