Skip to contentSkip to conversation

hw/xen: Fixes to only build the XEN_PV machine

RFC PATCH In review Philippe Mathieu-Daudé 2 participants 8 messages Jan 29, 2021

lore
Share & tools
lore
#0 lore raw

cover hw/xen: Fixes to only build the XEN_PV machine

Hi Alex,

These are the Xen patches I'm carrying to build the xenpv machine alone. I haven't tried to build the xenfv one.

Tagged as RFC because this was part of a draft, so must be think better, but I don't have much time to finish it. Anyhow quick review appreciated.

Missing (out of scope of this draft):
Possibility to build another config than the default-configs/ ones.

Regards,

Phil.

Philippe Mathieu-Daudé (4):
hw/ide/Kconfig: IDE_ISA requires ISA_BUS
hw/ide/Kconfig: IDE_PIIX requires IDE_ISA
hw/xen/Kconfig: Introduce XEN_PV config
hw/xen: Have the xenpv machine select 9pfs

 accel/Kconfig  | 1 -
 hw/Kconfig     | 1 +
 hw/ide/Kconfig | 3 ++-
 hw/xen/Kconfig | 7 +++++++
 4 files changed, 10 insertions(+), 2 deletions(-)
 create mode 100644 hw/xen/Kconfig
Signature · 1 line
2.26.2
#1 lore raw

RFC PATCH 1/4 hw/ide/Kconfig: IDE_ISA requires ISA_BUS

hw/ide/ioport.c has a strong dependency on hw/isa/isa-bus.c:

/usr/bin/ld: libcommon.fa.p/hw_ide_ioport.c.o: in function `ide_init_ioport':
/usr/bin/ld: hw/ide/ioport.c:61: undefined reference to `isa_register_portio_list'

---
 hw/ide/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ide/Kconfig +1 -1
index 5d9106b1ac2..41cdd9cbe03 100644
@@ -12,7 +12,7 @@ config IDE_PCI
 
 config IDE_ISA
     bool
-    depends on ISA_BUS
+    select ISA_BUS
     select IDE_QDEV
 
 config IDE_PIIX
Signature · 1 line
2.26.2
#2 lore raw

Re: [RFC PATCH 1/4] hw/ide/Kconfig: IDE_ISA requires ISA_BUS

Quoted 15 lines · Philippe Mathieu-Daudé

hw/ide/ioport.c has a strong dependency on hw/isa/isa-bus.c:

/usr/bin/ld: libcommon.fa.p/hw_ide_ioport.c.o: in function `ide_init_ioport':
/usr/bin/ld: hw/ide/ioport.c:61: undefined reference to `isa_register_portio_list'

---
  hw/ide/Kconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
hw/ide/Kconfig +0 -0
index 5d9106b1ac2..41cdd9cbe03 100644

hw/ide/Kconfig config IDE_PCI · line 18

Quoted 8 lines
hw/ide/Kconfig +1 -1
@@ -12,7 +12,7 @@ config IDE_PCI
 
  config IDE_ISA
      bool
-    depends on ISA_BUS
+    select ISA_BUS
      select IDE_QDEV
 
  config IDE_PIIX

This is incorrect. Buses are "depended on", not selected, and this is documented in docs/devel/kconfig.rst.

Paolo

#3 lore raw

RFC PATCH 2/4 hw/ide/Kconfig: IDE_PIIX requires IDE_ISA

In reply to Philippe Mathieu-Daudé

hw/ide/piix.c has a strong dependency on hw/isa/isa-bus.c:

/usr/bin/ld: libcommon.fa.p/hw_ide_piix.c.o: in function `pci_piix_init_ports':
/usr/bin/ld: hw/ide/piix.c:141: undefined reference to `isa_get_irq'

---
 hw/ide/Kconfig | 1 +
 1 file changed, 1 insertion(+)
hw/ide/Kconfig +1 -0
index 41cdd9cbe03..0f5d316558b 100644
@@ -17,6 +17,7 @@ config IDE_ISA
 
 config IDE_PIIX
     bool
+    select IDE_ISA
     select IDE_PCI
     select IDE_QDEV
 
Signature · 1 line
2.26.2
#4 lore raw

Re: [RFC PATCH 2/4] hw/ide/Kconfig: IDE_PIIX requires IDE_ISA

Quoted 16 lines · Philippe Mathieu-Daudé

hw/ide/piix.c has a strong dependency on hw/isa/isa-bus.c:

/usr/bin/ld: libcommon.fa.p/hw_ide_piix.c.o: in function `pci_piix_init_ports':
/usr/bin/ld: hw/ide/piix.c:141: undefined reference to `isa_get_irq'

---
  hw/ide/Kconfig | 1 +
  1 file changed, 1 insertion(+)
hw/ide/Kconfig +0 -0
index 41cdd9cbe03..0f5d316558b 100644

hw/ide/Kconfig config IDE_ISA · line 23

Quoted 7 lines
hw/ide/Kconfig +1 -0
@@ -17,6 +17,7 @@ config IDE_ISA
 
  config IDE_PIIX
      bool
+    select IDE_ISA
      select IDE_PCI
      select IDE_QDEV
 

This is also incorrect, it should be "depends on ISA_BUS".

Paolo

#5 lore raw

RFC PATCH 3/4 hw/xen/Kconfig: Introduce XEN_PV config

In reply to 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 | 6 ++++++
 2 files changed, 7 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 +6 -0
new file mode 100644
index 00000000000..15944144a17
@@ -0,0 +1,6 @@
+config XEN_PV
+    bool
+    depends on XEN
+    select PCI
+    select USB
+    select IDE_PIIX
Signature · 1 line
2.26.2
#6 lore raw

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

Quoted 38 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 | 6 ++++++
  2 files changed, 7 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..15944144a17

hw/xen/Kconfig line 6

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

Since you're hacking around you can also "select ISA_BUS" here, but the right solution would be to have a "config XEN_FV" and leave hw/i386/xen/xen_platform.c out of XEN_PV.

Paolo

#7 lore raw

RFC PATCH 4/4 hw/xen: Have the xenpv machine select 9pfs

In reply to Philippe Mathieu-Daudé

9pfs is not an accelerator feature but a machine one.

---
 accel/Kconfig  | 1 -
 hw/xen/Kconfig | 1 +
 2 files changed, 1 insertion(+), 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/xen/Kconfig +1 -0
index 15944144a17..14009cd6a05 100644
@@ -4,3 +4,4 @@ config XEN_PV
     select PCI
     select USB
     select IDE_PIIX
+    select FSDEV_9P if VIRTFS
Signature · 1 line
2.26.2