microvm: Explicitly select ACPI_PCI
PATCH 1/1 microvm: Explicitly select ACPI_PCI
With a microvm-only build based on a custom device config, we get a link failure due to undefined reference to build_pci_host_bridge_osc_method() which is defined in hw/acpi/pci.c and whose compilation depends on CONFIG_ACPI_PCI. Although CONFIG_ACPI and CONFIG_PCI are set with such configuration, implied CONFIG_ACPI_PCI in config PCI_EXPRESS_GENERIC_BRIDGE is not selected as expected.
It Looks like CONFIG_ACPI_PCI must be enforced and this patch selects CONFIG_ACPI_PCI in MICROVM config directly as done for PC config.
Reproducer:
../configure \
--without-default-features \
--target-list=x86_64-softmmu \
--enable-kvm --disable-tcg \
--enable-pixman \
--enable-vnc \
--audio-drv-list="" \
--without-default-devices \
--with-devices-x86_64=microvm \
--enable-vhost-user
with configs/devices/x86_64-softmmu/microvm.mak:CONFIG_PCI_DEVICES=n
CONFIG_MICROVM=y
CONFIG_VIRTIO_BLK=yCONFIG_VIRTIO_SERIAL=yCONFIG_VIRTIO_INPUT=yCONFIG_VIRTIO_INPUT_HOST=yCONFIG_VHOST_USER_INPUT=yCONFIG_VIRTIO_NET=yCONFIG_VIRTIO_SCSI=yCONFIG_VIRTIO_RNG=yCONFIG_VIRTIO_CRYPTO=yCONFIG_VIRTIO_BALLOON=yCONFIG_VIRTIO_GPU=yCONFIG_VHOST_USER_GPU=y
FAILED: qemu-system-x86_64
cc -m64 @qemu-system-x86_64.rsp/usr/bin/ld: libsystem.a.p/hw_pci-host_gpex-acpi.c.o: in function `acpi_dsdt_add_host_bridge_methods':
hw/pci-host/gpex-acpi.c:83:(.text+0x274): undefined reference to `build_pci_host_bridge_osc_method'
collect2: error: ld returned 1 exit status
--- hw/i386/Kconfig | 1 + 1 file changed, 1 insertion(+)
hw/i386/Kconfig +1 -0
@@ -131,6 +131,7 @@ config MICROVM select I8259 select MC146818RTC select VIRTIO_MMIO + select ACPI_PCI select ACPI_HW_REDUCED select PCI_EXPRESS_GENERIC_BRIDGE select USB_XHCI_SYSBUS
Signature · 1 line
2.49.0
Quoted 47 lines · Eric Auger
With a microvm-only build based on a custom device config, we get a link failure due to undefined reference to
build_pci_host_bridge_osc_method()which is defined inhw/acpi/pci.cand whose compilation depends onCONFIG_ACPI_PCI. AlthoughCONFIG_ACPIandCONFIG_PCIare set with such configuration, impliedCONFIG_ACPI_PCIin configPCI_EXPRESS_GENERIC_BRIDGEis not selected as expected.It Looks like
CONFIG_ACPI_PCImust be enforced and this patch selectsCONFIG_ACPI_PCIin MICROVM config directly as done for PC config.Reproducer:
../configure \
--without-default-features \
--target-list=x86_64-softmmu \
--enable-kvm --disable-tcg \
--enable-pixman \
--enable-vnc \
--audio-drv-list="" \
--without-default-devices \
--with-devices-x86_64=microvm \
--enable-vhost-userwith configs/devices/x86_64-softmmu/microvm.mak:
CONFIG_PCI_DEVICES=n
CONFIG_MICROVM=y
CONFIG_VIRTIO_BLK=yCONFIG_VIRTIO_SERIAL=yCONFIG_VIRTIO_INPUT=yCONFIG_VIRTIO_INPUT_HOST=yCONFIG_VHOST_USER_INPUT=yCONFIG_VIRTIO_NET=yCONFIG_VIRTIO_SCSI=yCONFIG_VIRTIO_RNG=yCONFIG_VIRTIO_CRYPTO=yCONFIG_VIRTIO_BALLOON=yCONFIG_VIRTIO_GPU=yCONFIG_VHOST_USER_GPU=yFAILED: qemu-system-x86_64
cc -m64 @qemu-system-x86_64.rsp/usr/bin/ld:libsystem.a.p/hw_pci-host_gpex-acpi.c.o: in function `acpi_dsdt_add_host_bridge_methods':
hw/pci-host/gpex-acpi.c:83:(.text+0x274): undefined reference to `build_pci_host_bridge_osc_method'
collect2: error: ld returned 1 exit status
Quoted 3 lines
Fixes af151d50eac24 "hw/pci-host/gpex-acpi: Use build_pci_host_bridge_osc_method"Signed-off-by Eric Auger <[email protected]>Reported-by Michael Tokarev <[email protected]>
This seems to be a better fix than I proposed.
Thanks,
/mjt
Quoted 16 lines
--- hw/i386/Kconfig | 1 + 1 file changed, 1 insertion(+)hw/i386/Kconfig +1
-0@@ -131,6 +131,7 @@ config MICROVM select I8259 select MC146818RTC select VIRTIO_MMIO + select ACPI_PCI select ACPI_HW_REDUCED select PCI_EXPRESS_GENERIC_BRIDGE select USB_XHCI_SYSBUS
Quoted 47 lines · Eric Auger
With a microvm-only build based on a custom device config, we get a link failure due to undefined reference to
build_pci_host_bridge_osc_method()which is defined inhw/acpi/pci.cand whose compilation depends onCONFIG_ACPI_PCI. AlthoughCONFIG_ACPIandCONFIG_PCIare set with such configuration, impliedCONFIG_ACPI_PCIin configPCI_EXPRESS_GENERIC_BRIDGEis not selected as expected.It Looks like
CONFIG_ACPI_PCImust be enforced and this patch selectsCONFIG_ACPI_PCIin MICROVM config directly as done for PC config.Reproducer:
../configure \
--without-default-features \
--target-list=x86_64-softmmu \
--enable-kvm --disable-tcg \
--enable-pixman \
--enable-vnc \
--audio-drv-list="" \
--without-default-devices \
--with-devices-x86_64=microvm \
--enable-vhost-userwith configs/devices/x86_64-softmmu/microvm.mak:
CONFIG_PCI_DEVICES=n
CONFIG_MICROVM=y
CONFIG_VIRTIO_BLK=yCONFIG_VIRTIO_SERIAL=yCONFIG_VIRTIO_INPUT=yCONFIG_VIRTIO_INPUT_HOST=yCONFIG_VHOST_USER_INPUT=yCONFIG_VIRTIO_NET=yCONFIG_VIRTIO_SCSI=yCONFIG_VIRTIO_RNG=yCONFIG_VIRTIO_CRYPTO=yCONFIG_VIRTIO_BALLOON=yCONFIG_VIRTIO_GPU=yCONFIG_VHOST_USER_GPU=yFAILED: qemu-system-x86_64
cc -m64 @qemu-system-x86_64.rsp/usr/bin/ld:libsystem.a.p/hw_pci-host_gpex-acpi.c.o: in function `acpi_dsdt_add_host_bridge_methods':
hw/pci-host/gpex-acpi.c:83:(.text+0x274): undefined reference to `build_pci_host_bridge_osc_method'
collect2: error: ld returned 1 exit status
Quoted 6 lines
Fixes af151d50eac24 "hw/pci-host/gpex-acpi: Use build_pci_host_bridge_osc_method"Signed-off-by Eric Auger <[email protected]>Reported-by Michael Tokarev <[email protected]>--- hw/i386/Kconfig | 1 + 1 file changed, 1 insertion(+)
Patch queued, thanks.