buildsys: Build most stubs once
v2 cover buildsys: Build most stubs once
Missing review: #5
v2: Move acpi_send_event() declaration
Use meson magical machinery to build stubs once,
instead of one time per qemu-system-FOO binary.
Philippe Mathieu-Daudé (11):
meson: Include various directories providing stubs before libqemuutil hw/acpi: Move acpi_send_event() function out of acpi_interface.c hw/acpi: Move qbus_build_aml() function out of acpi_interface.c hw/acpi: Always link QOM interfaces with system binaries hw/nvram: Build fw_cfg-acpi.c once
hw/acpi: Build stubs once
hw/display: Build stubs once
hw/net: Build stubs once
hw/*: Build stubs once
fsdev: Build stubs once
semihosting: Build stubs once
meson.build | 14 +++++-----
include/hw/acpi/acpi.h | 1 +
include/hw/acpi/acpi_dev_interface.h | 2 --
hw/acpi/acpi_interface.c | 19 -------------
hw/acpi/aml-build.c | 11 ++++++++
hw/acpi/core.c | 10 +++++++
hw/display/acpi-vga-stub.c | 1 +
.../rocker/{qmp-norocker.c => rocker-stubs.c} | 0
fsdev/meson.build | 3 +-
hw/acpi/meson.build | 28 ++++++++++---------
hw/cxl/meson.build | 4 +--
hw/display/meson.build | 19 ++++++-------
hw/i386/kvm/meson.build | 5 +---
hw/mem/meson.build | 4 +--
hw/net/meson.build | 3 +-
hw/nvram/meson.build | 4 +--
hw/pci/meson.build | 2 +-
hw/smbios/meson.build | 10 +++----
hw/usb/meson.build | 3 +-
hw/virtio/meson.build | 9 ++----
semihosting/meson.build | 9 +++---
21 files changed, 80 insertions(+), 81 deletions(-)
rename hw/net/rocker/{qmp-norocker.c => rocker-stubs.c} (100%)Signature · 1 line
2.52.0
PATCH v2 1/11 meson: Include various directories providing stubs before libqemuutil
Stubs are provided by libqemuutil. We want to use the generic meson machinery to provide stubs once, instead of per sub-directories. Move the 'subdir' calls earlier so when these directories are processed they can add units to the global stub_ss[] source set.
--- meson.build | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
meson.build +7 -7
@@ -3725,6 +3725,13 @@ subdir('authz') subdir('crypto') subdir('ui') subdir('gdbstub') +subdir('semihosting') +subdir('audio') +subdir('io') +subdir('chardev') +subdir('fsdev') +subdir('dump') + if have_system subdir('hw') else
@@ -3770,12 +3777,6 @@ if have_system or have_user subdir('target') endif -subdir('audio') -subdir('io') -subdir('chardev') -subdir('fsdev') -subdir('dump') - if have_block block_ss.add(files( 'block.c',
@@ -3845,7 +3846,6 @@ subdir('migration') subdir('monitor') subdir('net') subdir('replay') -subdir('semihosting') subdir('stats') subdir('tcg') subdir('fpu')
Signature · 1 line
2.52.0
PATCH v2 2/11 hw/acpi: Move acpi_send_event() function out of acpi_interface.c
In reply to Philippe Mathieu-Daudéacpi_interface.c should only register QOM interfaces. Move the acpi_send_event() function to core.c with the other event handlers, and its declaration in 'hw/acpi/acpi.h'.
--- include/hw/acpi/acpi.h | 1 + include/hw/acpi/acpi_dev_interface.h | 2 -- hw/acpi/acpi_interface.c | 9 --------- hw/acpi/core.c | 10 ++++++++++ 4 files changed, 11 insertions(+), 11 deletions(-)
include/hw/acpi/acpi.h +1 -0
@@ -182,6 +182,7 @@ void acpi_gpe_reset(ACPIREGS *ar);void acpi_gpe_ioport_writeb (ACPIREGS *ar,uint32_t addr,uint32_t val);uint32_t acpi_gpe_ioport_readb (ACPIREGS *ar,uint32_t addr); +void acpi_send_event (DeviceState *dev,AcpiEventStatusBits event);void acpi_send_gpe_event (ACPIREGS *ar,qemu_irq irq,AcpiEventStatusBits status);
include/hw/acpi/acpi_dev_interface.h +0 -2
@@ -27,8 +27,6 @@ DECLARE_CLASS_CHECKERS(AcpiDeviceIfClass, ACPI_DEVICE_IF,typedef struct AcpiDeviceIf AcpiDeviceIf ; -void acpi_send_event (DeviceState *dev,AcpiEventStatusBits event); -/** * AcpiDeviceIfClass: *
hw/acpi/acpi_interface.c +0 -9
@@ -4,15 +4,6 @@#include "qemu/module.h" #include "qemu/queue.h" -void acpi_send_event (DeviceState *dev,AcpiEventStatusBits event) -{ -AcpiDeviceIfClass *adevc =ACPI_DEVICE_IF_GET_CLASS (dev); -if (adevc->send_event) { -AcpiDeviceIf *adev =ACPI_DEVICE_IF (dev); - adevc->send_event (adev, event); - } -} -void qbus_build_aml (BusState *bus,Aml *scope) {BusChild *kid;
hw/acpi/core.c +10 -0
@@ -22,6 +22,7 @@#include "qemu/osdep.h" #include "hw/core/irq.h" #include "hw/acpi/acpi.h" +#include "hw/acpi/acpi_dev_interface.h" #include "hw/nvram/fw_cfg.h" #include "qemu/config-file.h" #include "qapi/error.h"
@@ -753,3 +754,12 @@ void acpi_update_sci(ACPIREGS *regs, qemu_irq irq) (regs->pm1.evt.en &ACPI_BITMASK_TIMER_ENABLE ) && !(pm1a_sts & ACPI_BITMASK_TIMER_STATUS)); } + +void acpi_send_event (DeviceState *dev,AcpiEventStatusBits event) +{ +AcpiDeviceIfClass *adevc =ACPI_DEVICE_IF_GET_CLASS (dev); +if (adevc->send_event) { +AcpiDeviceIf *adev =ACPI_DEVICE_IF (dev); + adevc->send_event (adev, event); + } +}
Signature · 1 line
2.52.0
Re: [PATCH v2 02/11] hw/acpi: Move acpi_send_event() function out of acpi_interface.c
Quoted 6 lines · On Wed, 25 Feb 2026 04:57:30 +0100 Philippe Mathieu-Daudé <[email protected]>…
acpi_interface.cshould only register QOM interfaces. Move theacpi_send_event()function tocore.cwith the other event handlers, and its declaration in 'hw/acpi/acpi.h'.Reviewed-by Pierrick Bouvier <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Quoted 77 lines
--- include/hw/acpi/acpi.h | 1 + include/hw/acpi/acpi_dev_interface.h | 2 -- hw/acpi/acpi_interface.c | 9 --------- hw/acpi/core.c | 10 ++++++++++ 4 files changed, 11 insertions(+), 11 deletions(-)include/hw/acpi/acpi.h +1
-0@@ -182,6 +182,7 @@ void acpi_gpe_reset(ACPIREGS *ar);void acpi_gpe_ioport_writeb (ACPIREGS *ar,uint32_t addr,uint32_t val);uint32_t acpi_gpe_ioport_readb (ACPIREGS *ar,uint32_t addr); +void acpi_send_event (DeviceState *dev,AcpiEventStatusBits event);void acpi_send_gpe_event (ACPIREGS *ar,qemu_irq irq,AcpiEventStatusBits status);include/hw/acpi/acpi_dev_interface.h +0
-2@@ -27,8 +27,6 @@ DECLARE_CLASS_CHECKERS(AcpiDeviceIfClass, ACPI_DEVICE_IF,typedef struct AcpiDeviceIf AcpiDeviceIf ; -void acpi_send_event (DeviceState *dev,AcpiEventStatusBits event); -/** * AcpiDeviceIfClass: * hw/acpi/acpi_interface.c +0
-9@@ -4,15 +4,6 @@#include "qemu/module.h" #include "qemu/queue.h" -void acpi_send_event (DeviceState *dev,AcpiEventStatusBits event) -{ -AcpiDeviceIfClass *adevc =ACPI_DEVICE_IF_GET_CLASS (dev); -if (adevc->send_event) { -AcpiDeviceIf *adev =ACPI_DEVICE_IF (dev); - adevc->send_event (adev, event); - } -} -void qbus_build_aml (BusState *bus,Aml *scope) {BusChild *kid;hw/acpi/core.c +10
-0@@ -22,6 +22,7 @@#include "qemu/osdep.h" #include "hw/core/irq.h" #include "hw/acpi/acpi.h" +#include "hw/acpi/acpi_dev_interface.h" #include "hw/nvram/fw_cfg.h" #include "qemu/config-file.h" #include "qapi/error.h" @@ -753,3 +754,12 @@ void acpi_update_sci(ACPIREGS *regs, qemu_irq irq) (regs->pm1.evt.en &ACPI_BITMASK_TIMER_ENABLE ) && !(pm1a_sts & ACPI_BITMASK_TIMER_STATUS)); } + +void acpi_send_event (DeviceState *dev,AcpiEventStatusBits event) +{ +AcpiDeviceIfClass *adevc =ACPI_DEVICE_IF_GET_CLASS (dev); +if (adevc->send_event) { +AcpiDeviceIf *adev =ACPI_DEVICE_IF (dev); + adevc->send_event (adev, event); + } +}
PATCH v2 3/11 hw/acpi: Move qbus_build_aml() function out of acpi_interface.c
In reply to Philippe Mathieu-Daudéacpi_interface.c should only register QOM interfaces. Move the qbus_build_aml() function to aml-build.c with the other AML build-related helpers.
--- hw/acpi/acpi_interface.c | 10 ---------- hw/acpi/aml-build.c | 11 +++++++++++ 2 files changed, 11 insertions(+), 10 deletions(-)
hw/acpi/acpi_interface.c +0 -10
@@ -2,16 +2,6 @@#include "hw/acpi/acpi_dev_interface.h" #include "hw/acpi/acpi_aml_interface.h" #include "qemu/module.h" -#include "qemu/queue.h" - -void qbus_build_aml (BusState *bus,Aml *scope) -{ -BusChild *kid; - - QTAILQ_FOREACH(kid, &bus->children, sibling) { -call_dev_aml_func (DEVICE (kid->child), scope); - } -}static void register_types (void ) {
hw/acpi/aml-build.c +11 -0
@@ -25,12 +25,14 @@#include "hw/acpi/acpi.h" #include "qemu/bswap.h" #include "qemu/bitops.h" +#include "qemu/queue.h" #include "system/numa.h" #include "hw/core/boards.h" #include "hw/acpi/tpm.h" #include "hw/pci/pci_host.h" #include "hw/pci/pci_bus.h" #include "hw/pci/pci_bridge.h" +#include "hw/acpi/acpi_aml_interface.h" #include "qemu/cutils.h" static GArray *build_alloc_array (void )
@@ -2647,3 +2649,12 @@ Aml *aml_error_device(void)return dev; } + +void qbus_build_aml (BusState *bus,Aml *scope) +{ +BusChild *kid; + + QTAILQ_FOREACH(kid, &bus->children, sibling) { +call_dev_aml_func (DEVICE (kid->child), scope); + } +}
Signature · 1 line
2.52.0
Re: [PATCH v2 03/11] hw/acpi: Move qbus_build_aml() function out of acpi_interface.c
Quoted 6 lines · On Wed, 25 Feb 2026 04:57:31 +0100 Philippe Mathieu-Daudé <[email protected]>…
acpi_interface.cshould only register QOM interfaces. Move theqbus_build_aml()function toaml-build.cwith the other AML build-related helpers.Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Pierrick Bouvier <[email protected]>
Quoted 58 lines
--- hw/acpi/acpi_interface.c | 10 ---------- hw/acpi/aml-build.c | 11 +++++++++++ 2 files changed, 11 insertions(+), 10 deletions(-)hw/acpi/acpi_interface.c +0
-10@@ -2,16 +2,6 @@#include "hw/acpi/acpi_dev_interface.h" #include "hw/acpi/acpi_aml_interface.h" #include "qemu/module.h" -#include "qemu/queue.h" - -void qbus_build_aml (BusState *bus,Aml *scope) -{ -BusChild *kid; - - QTAILQ_FOREACH(kid, &bus->children, sibling) { -call_dev_aml_func (DEVICE (kid->child), scope); - } -}static void register_types (void ) {hw/acpi/aml-build.c +11
-0@@ -25,12 +25,14 @@#include "hw/acpi/acpi.h" #include "qemu/bswap.h" #include "qemu/bitops.h" +#include "qemu/queue.h" #include "system/numa.h" #include "hw/core/boards.h" #include "hw/acpi/tpm.h" #include "hw/pci/pci_host.h" #include "hw/pci/pci_bus.h" #include "hw/pci/pci_bridge.h" +#include "hw/acpi/acpi_aml_interface.h" #include "qemu/cutils.h" static GArray *build_alloc_array (void )@@ -2647,3 +2649,12 @@ Aml *aml_error_device(void)return dev; } + +void qbus_build_aml (BusState *bus,Aml *scope) +{ +BusChild *kid; + + QTAILQ_FOREACH(kid, &bus->children, sibling) { +call_dev_aml_func (DEVICE (kid->child), scope); + } +}
PATCH v2 4/11 hw/acpi: Always link QOM interfaces with system binaries
In reply to Philippe Mathieu-DaudéNow that acpi_interface.c only contains QOM interfaces, unconditionally link it with system binaries, regardless of whether CONFIG_ACPI is set or not. It is now easier to deselect hardware models depending on ACPI.
--- hw/acpi/meson.build | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
hw/acpi/meson.build +1 -2
@@ -1,6 +1,5 @@ acpi_ss = ss.source_set() acpi_ss.add(files( - 'acpi_interface.c', 'aml-build.c', 'bios-linker-loader.c', 'core.c',
@@ -36,4 +35,4 @@ system_ss.add(when: 'CONFIG_ACPI_PCI_BRIDGE', if_false: files('pci-bridge-stub.c system_ss.add_all(when: 'CONFIG_ACPI', if_true: acpi_ss) system_ss.add(when: 'CONFIG_GHES_CPER', if_true: files('ghes_cper.c')) system_ss.add(when: 'CONFIG_GHES_CPER', if_false: files('ghes_cper_stub.c')) -system_ss.add(files('acpi-qmp-cmds.c')) +system_ss.add(files('acpi-qmp-cmds.c', 'acpi_interface.c'))
Signature · 1 line
2.52.0
Re: [PATCH v2 04/11] hw/acpi: Always link QOM interfaces with system binaries
Quoted 7 lines · On Wed, 25 Feb 2026 04:57:32 +0100 Philippe Mathieu-Daudé <[email protected]>…
Now that
acpi_interface.conly contains QOM interfaces, unconditionally link it with system binaries, regardless of whetherCONFIG_ACPIis set or not. It is now easier to deselect hardware models depending on ACPI.Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Pierrick Bouvier <[email protected]>
Quoted 21 lines
--- hw/acpi/meson.build | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)hw/acpi/meson.build +1
-2@@ -1,6 +1,5 @@ acpi_ss = ss.source_set() acpi_ss.add(files( - 'acpi_interface.c', 'aml-build.c', 'bios-linker-loader.c', 'core.c',@@ -36,4 +35,4 @@ system_ss.add(when: 'CONFIG_ACPI_PCI_BRIDGE', if_false: files('pci-bridge-stub.c system_ss.add_all(when: 'CONFIG_ACPI', if_true: acpi_ss) system_ss.add(when: 'CONFIG_GHES_CPER', if_true: files('ghes_cper.c')) system_ss.add(when: 'CONFIG_GHES_CPER', if_false: files('ghes_cper_stub.c')) -system_ss.add(files('acpi-qmp-cmds.c')) +system_ss.add(files('acpi-qmp-cmds.c', 'acpi_interface.c'))
PATCH v2 5/11 hw/nvram: Build fw_cfg-acpi.c once
In reply to Philippe Mathieu-Daudé--- hw/nvram/meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/nvram/meson.build +2 -2
@@ -18,8 +18,8 @@ system_ss.add(when: 'CONFIG_XLNX_EFUSE_ZYNQMP', if_true: files( system_ss.add(when: 'CONFIG_XLNX_BBRAM', if_true: files('xlnx-bbram.c')) specific_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr_nvram.c')) -specific_ss.add(when: 'CONFIG_ACPI', if_true: files('fw_cfg-acpi.c')) +system_ss.add(when: 'CONFIG_ACPI', if_true: files('fw_cfg-acpi.c')) system_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files( 'aspeed_otp.c', - )) + ))
Signature · 1 line
2.52.0
Re: [PATCH v2 05/11] hw/nvram: Build fw_cfg-acpi.c once
Quoted 2 lines · On Wed, 25 Feb 2026 04:57:33 +0100 Philippe Mathieu-Daudé <[email protected]>…
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Pierrick Bouvier <[email protected]>
Quoted 20 lines
--- hw/nvram/meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)hw/nvram/meson.build +2
-2@@ -18,8 +18,8 @@ system_ss.add(when: 'CONFIG_XLNX_EFUSE_ZYNQMP', if_true: files( system_ss.add(when: 'CONFIG_XLNX_BBRAM', if_true: files('xlnx-bbram.c')) specific_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr_nvram.c')) -specific_ss.add(when: 'CONFIG_ACPI', if_true: files('fw_cfg-acpi.c')) +system_ss.add(when: 'CONFIG_ACPI', if_true: files('fw_cfg-acpi.c')) system_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files( 'aspeed_otp.c', - )) + ))
PATCH v2 6/11 hw/acpi: Build stubs once
In reply to Philippe Mathieu-DaudéMove stubs to the global stub_ss[] source set. These files are now built once for all binaries, instead of one time per system binary.
--- hw/acpi/meson.build | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-)
hw/acpi/meson.build +14 -11
@@ -6,33 +6,36 @@ acpi_ss.add(files( 'utils.c', )) acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_true: files('cpu.c')) -acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_false: files('acpi-cpu-hotplug-stub.c')) +stub_ss.add(files('acpi-cpu-hotplug-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_MEMORY_HOTPLUG', if_true: files('memory_hotplug.c')) -acpi_ss.add(when: 'CONFIG_ACPI_MEMORY_HOTPLUG', if_false: files('acpi-mem-hotplug-stub.c')) +stub_ss.add(files('acpi-mem-hotplug-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_NVDIMM', if_true: files('nvdimm.c')) -acpi_ss.add(when: 'CONFIG_ACPI_NVDIMM', if_false: files('acpi-nvdimm-stub.c')) +stub_ss.add(files('acpi-nvdimm-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_PCI', if_true: files('pci.c')) -acpi_ss.add(when: 'CONFIG_ACPI_CXL', if_true: files('cxl.c'), if_false: files('cxl-stub.c')) +acpi_ss.add(when: 'CONFIG_ACPI_CXL', if_true: files('cxl.c')) +stub_ss.add(files('cxl-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_VMGENID', if_true: files('vmgenid.c')) acpi_ss.add(when: 'CONFIG_ACPI_VMCLOCK', if_true: files('vmclock.c')) acpi_ss.add(when: 'CONFIG_ACPI_HW_REDUCED', if_true: files('generic_event_device.c')) acpi_ss.add(when: 'CONFIG_ACPI_HMAT', if_true: files('hmat.c')) -acpi_ss.add(when: 'CONFIG_ACPI_APEI', if_true: files('ghes.c'), if_false: files('ghes-stub.c')) +acpi_ss.add(when: 'CONFIG_ACPI_APEI', if_true: files('ghes.c')) +stub_ss.add(files('ghes-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_PIIX4', if_true: files('piix4.c')) acpi_ss.add(when: 'CONFIG_ACPI_PCI_BRIDGE', if_true: files('pci-bridge.c')) acpi_ss.add(when: 'CONFIG_ACPI_PCIHP', if_true: files('pcihp.c')) -acpi_ss.add(when: 'CONFIG_ACPI_PCIHP', if_false: files('acpi-pci-hotplug-stub.c')) +stub_ss.add(files('acpi-pci-hotplug-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_VIOT', if_true: files('viot.c')) acpi_ss.add(when: 'CONFIG_ACPI_ICH9', if_true: files('ich9.c', 'ich9_tco.c', 'ich9_timer.c')) acpi_ss.add(when: 'CONFIG_ACPI_ERST', if_true: files('erst.c')) -acpi_ss.add(when: 'CONFIG_IPMI', if_true: files('ipmi.c'), if_false: files('ipmi-stub.c')) -acpi_ss.add(when: 'CONFIG_PC', if_false: files('acpi-x86-stub.c')) +acpi_ss.add(when: 'CONFIG_IPMI', if_true: files('ipmi.c')) +stub_ss.add(files('ipmi-stub.c')) +stub_ss.add(files('acpi-x86-stub.c')) if have_tpm acpi_ss.add(files('tpm.c')) endif -system_ss.add(when: 'CONFIG_ACPI', if_false: files('acpi-stub.c', 'aml-build-stub.c', 'ghes-stub.c', 'acpi_interface.c')) -system_ss.add(when: 'CONFIG_ACPI_PCI_BRIDGE', if_false: files('pci-bridge-stub.c')) +stub_ss.add(files('acpi-stub.c', 'aml-build-stub.c', 'ghes-stub.c')) +stub_ss.add(files('pci-bridge-stub.c')) system_ss.add_all(when: 'CONFIG_ACPI', if_true: acpi_ss) system_ss.add(when: 'CONFIG_GHES_CPER', if_true: files('ghes_cper.c')) -system_ss.add(when: 'CONFIG_GHES_CPER', if_false: files('ghes_cper_stub.c')) +stub_ss.add(files('ghes_cper_stub.c')) system_ss.add(files('acpi-qmp-cmds.c', 'acpi_interface.c'))
Signature · 1 line
2.52.0
Re: [PATCH v2 06/11] hw/acpi: Build stubs once
Quoted 6 lines · On Wed, 25 Feb 2026 04:57:34 +0100 Philippe Mathieu-Daudé <[email protected]>…
Move stubs to the global stub_ss[] source set. These files are now built once for all binaries, instead of one time per system binary.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Pierrick Bouvier <[email protected]>
Quoted 56 lines
--- hw/acpi/meson.build | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-)hw/acpi/meson.build +14
-11@@ -6,33 +6,36 @@ acpi_ss.add(files( 'utils.c', )) acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_true: files('cpu.c')) -acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_false: files('acpi-cpu-hotplug-stub.c')) +stub_ss.add(files('acpi-cpu-hotplug-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_MEMORY_HOTPLUG', if_true: files('memory_hotplug.c')) -acpi_ss.add(when: 'CONFIG_ACPI_MEMORY_HOTPLUG', if_false: files('acpi-mem-hotplug-stub.c')) +stub_ss.add(files('acpi-mem-hotplug-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_NVDIMM', if_true: files('nvdimm.c')) -acpi_ss.add(when: 'CONFIG_ACPI_NVDIMM', if_false: files('acpi-nvdimm-stub.c')) +stub_ss.add(files('acpi-nvdimm-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_PCI', if_true: files('pci.c')) -acpi_ss.add(when: 'CONFIG_ACPI_CXL', if_true: files('cxl.c'), if_false: files('cxl-stub.c')) +acpi_ss.add(when: 'CONFIG_ACPI_CXL', if_true: files('cxl.c')) +stub_ss.add(files('cxl-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_VMGENID', if_true: files('vmgenid.c')) acpi_ss.add(when: 'CONFIG_ACPI_VMCLOCK', if_true: files('vmclock.c')) acpi_ss.add(when: 'CONFIG_ACPI_HW_REDUCED', if_true: files('generic_event_device.c')) acpi_ss.add(when: 'CONFIG_ACPI_HMAT', if_true: files('hmat.c')) -acpi_ss.add(when: 'CONFIG_ACPI_APEI', if_true: files('ghes.c'), if_false: files('ghes-stub.c')) +acpi_ss.add(when: 'CONFIG_ACPI_APEI', if_true: files('ghes.c')) +stub_ss.add(files('ghes-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_PIIX4', if_true: files('piix4.c')) acpi_ss.add(when: 'CONFIG_ACPI_PCI_BRIDGE', if_true: files('pci-bridge.c')) acpi_ss.add(when: 'CONFIG_ACPI_PCIHP', if_true: files('pcihp.c')) -acpi_ss.add(when: 'CONFIG_ACPI_PCIHP', if_false: files('acpi-pci-hotplug-stub.c')) +stub_ss.add(files('acpi-pci-hotplug-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_VIOT', if_true: files('viot.c')) acpi_ss.add(when: 'CONFIG_ACPI_ICH9', if_true: files('ich9.c', 'ich9_tco.c', 'ich9_timer.c')) acpi_ss.add(when: 'CONFIG_ACPI_ERST', if_true: files('erst.c')) -acpi_ss.add(when: 'CONFIG_IPMI', if_true: files('ipmi.c'), if_false: files('ipmi-stub.c')) -acpi_ss.add(when: 'CONFIG_PC', if_false: files('acpi-x86-stub.c')) +acpi_ss.add(when: 'CONFIG_IPMI', if_true: files('ipmi.c')) +stub_ss.add(files('ipmi-stub.c')) +stub_ss.add(files('acpi-x86-stub.c')) if have_tpm acpi_ss.add(files('tpm.c')) endif -system_ss.add(when: 'CONFIG_ACPI', if_false: files('acpi-stub.c', 'aml-build-stub.c', 'ghes-stub.c', 'acpi_interface.c')) -system_ss.add(when: 'CONFIG_ACPI_PCI_BRIDGE', if_false: files('pci-bridge-stub.c')) +stub_ss.add(files('acpi-stub.c', 'aml-build-stub.c', 'ghes-stub.c')) +stub_ss.add(files('pci-bridge-stub.c')) system_ss.add_all(when: 'CONFIG_ACPI', if_true: acpi_ss) system_ss.add(when: 'CONFIG_GHES_CPER', if_true: files('ghes_cper.c')) -system_ss.add(when: 'CONFIG_GHES_CPER', if_false: files('ghes_cper_stub.c')) +stub_ss.add(files('ghes_cper_stub.c')) system_ss.add(files('acpi-qmp-cmds.c', 'acpi_interface.c'))
PATCH v2 7/11 hw/display: Build stubs once
In reply to Philippe Mathieu-DaudéMove stubs to the global stub_ss[] source set. These files are now built once for all binaries, instead of one time per system binary.
--- hw/display/acpi-vga-stub.c | 1 + hw/display/meson.build | 19 ++++++++----------- 2 files changed, 9 insertions(+), 11 deletions(-)
hw/display/acpi-vga-stub.c +1 -0
@@ -1,4 +1,5 @@#include "qemu/osdep.h" +#undef CONFIG_PIXMAN#include "hw/acpi/acpi_aml_interface.h" #include "vga_int.h"
hw/display/meson.build +8 -11
@@ -3,7 +3,8 @@ hw_display_modules = {} system_ss.add(when: 'CONFIG_DDC', if_true: files('i2c-ddc.c')) system_ss.add(when: 'CONFIG_EDID', if_true: files('edid-generate.c', 'edid-region.c')) -system_ss.add(when: 'CONFIG_FW_CFG_DMA', if_true: files('ramfb.c'), if_false: files('ramfb-stubs.c')) +system_ss.add(when: 'CONFIG_FW_CFG_DMA', if_true: files('ramfb.c')) +stub_ss.add(files('ramfb-stubs.c')) system_ss.add(when: 'CONFIG_FW_CFG_DMA', if_true: files('ramfb-standalone.c')) system_ss.add(when: 'CONFIG_VGA_CIRRUS', if_true: files('cirrus_vga.c'))
@@ -36,21 +37,20 @@ system_ss.add(when: 'CONFIG_VGA', if_true: files('vga.c')) system_ss.add(when: 'CONFIG_VIRTIO', if_true: files('virtio-dmabuf.c')) system_ss.add(when: 'CONFIG_DM163', if_true: files('dm163.c')) +stub_ss.add([files('acpi-vga-stub.c'), pixman]) if (config_all_devices.has_key('CONFIG_VGA_CIRRUS') or config_all_devices.has_key('CONFIG_VGA_PCI') or config_all_devices.has_key('CONFIG_VMWARE_VGA') or config_all_devices.has_key('CONFIG_ATI_VGA') ) - system_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-vga.c'), - if_false: files('acpi-vga-stub.c')) + system_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-vga.c')) endif if config_all_devices.has_key('CONFIG_QXL') qxl_ss = ss.source_set() qxl_ss.add(when: 'CONFIG_QXL', if_true: [files('qxl.c', 'qxl-logger.c', 'qxl-render.c'), pixman, spice]) - qxl_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-vga.c'), - if_false: files('acpi-vga-stub.c')) + qxl_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-vga.c')) hw_display_modules += {'qxl': qxl_ss} endif
@@ -119,16 +119,14 @@ if config_all_devices.has_key('CONFIG_VIRTIO_VGA') if_true: [files('virtio-vga.c'), pixman]) virtio_vga_ss.add(when: 'CONFIG_VHOST_USER_VGA', if_true: files('vhost-user-vga.c')) - virtio_vga_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-vga.c'), - if_false: files('acpi-vga-stub.c')) + virtio_vga_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-vga.c')) hw_display_modules += {'virtio-vga': virtio_vga_ss} if virgl.found() and opengl.found() virtio_vga_gl_ss = ss.source_set() virtio_vga_gl_ss.add(when: ['CONFIG_VIRTIO_VGA', virgl, opengl], if_true: [files('virtio-vga-gl.c'), pixman]) - virtio_vga_gl_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-vga.c'), - if_false: files('acpi-vga-stub.c')) + virtio_vga_gl_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-vga.c')) hw_display_modules += {'virtio-vga-gl': virtio_vga_gl_ss} endif
@@ -136,8 +134,7 @@ if config_all_devices.has_key('CONFIG_VIRTIO_VGA') virtio_vga_rutabaga_ss = ss.source_set() virtio_vga_rutabaga_ss.add(when: ['CONFIG_VIRTIO_VGA', rutabaga], if_true: [files('virtio-vga-rutabaga.c'), pixman]) - virtio_vga_rutabaga_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-vga.c'), - if_false: files('acpi-vga-stub.c')) + virtio_vga_rutabaga_ss.add(when: 'CONFIG_ACPI', if_true: files('acpi-vga.c')) hw_display_modules += {'virtio-vga-rutabaga': virtio_vga_rutabaga_ss} endif endif
Signature · 1 line
2.52.0
PATCH v2 8/11 hw/net: Build stubs once
In reply to Philippe Mathieu-DaudéMove stubs to the global stub_ss[] source set. These files are now built once for all binaries, instead of one time per system binary.
qmp-norocker.c only contains stubs, rename it accordingly.
---
hw/net/rocker/{qmp-norocker.c => rocker-stubs.c} | 0
hw/net/meson.build | 3 ++-
2 files changed, 2 insertions(+), 1 deletion(-)
rename hw/net/rocker/{qmp-norocker.c => rocker-stubs.c} (100%)hw/net/rocker/rocker-stubs.c renamed from hw/net/rocker/qmp-norocker.c +0 -0
hw/net/meson.build +2 -1
@@ -67,7 +67,8 @@ system_ss.add(when: 'CONFIG_ROCKER', if_true: files( 'rocker/rocker_fp.c', 'rocker/rocker_of_dpa.c', 'rocker/rocker_world.c', -), if_false: files('rocker/qmp-norocker.c')) +)) +stub_ss.add(files('rocker/rocker-stubs.c')) system_ss.add(files('rocker/rocker-hmp-cmds.c')) subdir('can')
Signature · 1 line
2.52.0
PATCH v2 9/11 hw/*: Build stubs once
In reply to Philippe Mathieu-DaudéMove stubs to the global stub_ss[] source set. These files are now built once for all binaries, instead of one time per system binary.
--- hw/cxl/meson.build | 4 ++-- hw/i386/kvm/meson.build | 5 +---- hw/mem/meson.build | 4 ++-- hw/pci/meson.build | 2 +- hw/smbios/meson.build | 10 +++++----- hw/usb/meson.build | 3 ++- hw/virtio/meson.build | 9 +++------ 7 files changed, 16 insertions(+), 21 deletions(-)
hw/cxl/meson.build +2 -2
@@ -7,7 +7,7 @@ system_ss.add(when: 'CONFIG_CXL', 'cxl-cdat.c', 'cxl-events.c', 'switch-mailbox-cci.c', - ), - if_false: files( + )) +stub_ss.add(files( 'cxl-host-stubs.c', ))
hw/i386/kvm/meson.build +1 -4
@@ -15,9 +15,6 @@ i386_kvm_ss.add(when: 'CONFIG_XEN_EMU', if_true: files( i386_ss.add_all(when: 'CONFIG_KVM', if_true: i386_kvm_ss) -xen_stubs_ss = ss.source_set() -xen_stubs_ss.add(when: 'CONFIG_XEN_EMU', if_false: files( +stub_ss.add(files( 'xen-stubs.c', )) - -specific_ss.add_all(when: 'CONFIG_SYSTEM_ONLY', if_true: xen_stubs_ss)
hw/mem/meson.build +2 -2
@@ -4,9 +4,9 @@ mem_ss.add(when: 'CONFIG_DIMM', if_true: files('pc-dimm.c')) mem_ss.add(when: 'CONFIG_NPCM7XX', if_true: files('npcm7xx_mc.c')) mem_ss.add(when: 'CONFIG_NVDIMM', if_true: files('nvdimm.c')) mem_ss.add(when: 'CONFIG_CXL_MEM_DEVICE', if_true: files('cxl_type3.c')) -system_ss.add(when: 'CONFIG_CXL_MEM_DEVICE', if_false: files('cxl_type3_stubs.c')) +stub_ss.add(files('cxl_type3_stubs.c')) -system_ss.add(when: 'CONFIG_MEM_DEVICE', if_false: files('memory-device-stubs.c')) +stub_ss.add(files('memory-device-stubs.c')) system_ss.add_all(when: 'CONFIG_MEM_DEVICE', if_true: mem_ss) system_ss.add(when: 'CONFIG_SPARSE_MEM', if_true: files('sparse-mem.c'))
hw/pci/meson.build +1 -1
@@ -19,4 +19,4 @@ pci_ss.add(files('pcie_doe.c')) system_ss.add(when: 'CONFIG_PCI_EXPRESS', if_true: files('pcie_port.c', 'pcie_host.c')) system_ss.add_all(when: 'CONFIG_PCI', if_true: pci_ss) -system_ss.add(when: 'CONFIG_PCI', if_false: files('pci-stub.c')) +stub_ss.add(files('pci-stub.c'))
hw/smbios/meson.build +5 -5
@@ -1,12 +1,12 @@ smbios_ss = ss.source_set() smbios_ss.add(files('smbios.c')) smbios_ss.add(when: 'CONFIG_IPMI', - if_true: files('smbios_type_38.c'), - if_false: files('smbios_type_38-stub.c')) + if_true: files('smbios_type_38.c')) +stub_ss.add(files('smbios_type_38-stub.c')) smbios_ss.add(when: 'CONFIG_SMBIOS_LEGACY', - if_true: files('smbios_legacy.c'), - if_false: files('smbios_legacy_stub.c')) + if_true: files('smbios_legacy.c')) +stub_ss.add(files('smbios_legacy_stub.c')) system_ss.add_all(when: 'CONFIG_SMBIOS', if_true: smbios_ss) -system_ss.add(when: 'CONFIG_SMBIOS', if_false: files('smbios-stub.c')) +stub_ss.add(files('smbios-stub.c'))
hw/usb/meson.build +2 -1
@@ -9,7 +9,8 @@ system_ss.add(when: 'CONFIG_USB', if_true: files( 'desc-msos.c', 'libhw.c', 'pcap.c', -), if_false: files('bus-stub.c')) +)) +stub_ss.add(files('bus-stub.c')) # usb host adapters system_ss.add(when: 'CONFIG_USB_UHCI', if_true: files('hcd-uhci.c'))
hw/virtio/meson.build +3 -6
@@ -50,8 +50,6 @@ if have_vhost system_virtio_ss.add(files('vhost-vdpa.c')) system_virtio_ss.add(files('vhost-shadow-virtqueue.c')) endif -else - system_virtio_ss.add(files('vhost-stub.c')) endif system_virtio_ss.add(when: 'CONFIG_VHOST_USER_VSOCK', if_true: files('vhost-user-vsock.c')) system_virtio_ss.add(when: 'CONFIG_VIRTIO_RNG', if_true: files('virtio-rng.c'))
@@ -94,10 +92,9 @@ virtio_pci_ss.add(when: 'CONFIG_VIRTIO_MD', if_true: files('virtio-md-pci.c')) system_virtio_ss.add_all(when: 'CONFIG_VIRTIO_PCI', if_true: virtio_pci_ss) system_ss.add_all(when: 'CONFIG_VIRTIO', if_true: system_virtio_ss) -system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('vhost-stub.c')) -system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('virtio-stub.c')) -system_ss.add(when: ['CONFIG_VIRTIO_MD', 'CONFIG_VIRTIO_PCI'], - if_false: files('virtio-md-stubs.c')) +stub_ss.add(files('vhost-stub.c')) +stub_ss.add(files('virtio-stub.c')) +stub_ss.add(files('virtio-md-stubs.c')) system_ss.add(files('virtio-hmp-cmds.c'))
Signature · 1 line
2.52.0
PATCH v2 10/11 fsdev: Build stubs once
In reply to Philippe Mathieu-DaudéMove stubs to the global stub_ss[] source set. These files are now built once for all binaries, instead of one time per system binary.
--- fsdev/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fsdev/meson.build +2 -1
@@ -4,7 +4,8 @@ fsdev_ss.add(when: ['CONFIG_FSDEV_9P'], if_true: files( '9p-iov-marshal.c', '9p-marshal.c', 'qemu-fsdev.c', -), if_false: files('qemu-fsdev-dummy.c')) +)) +stub_ss.add(files('qemu-fsdev-dummy.c')) if host_os in ['linux', 'darwin', 'freebsd'] system_ss.add_all(fsdev_ss) endif
Signature · 1 line
2.52.0
PATCH v2 11/11 semihosting: Build stubs once
In reply to Philippe Mathieu-DaudéMove stubs to the global stub_ss[] source set. These files are now built once for all binaries, instead of one time per system binary.
--- semihosting/meson.build | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
semihosting/meson.build +5 -4
@@ -1,4 +1,4 @@ -common_ss.add(when: 'CONFIG_SEMIHOSTING', if_false: files('stubs-all.c')) +stub_ss.add(files('stubs-all.c')) user_ss.add(when: 'CONFIG_SEMIHOSTING', if_true: files( 'user.c', 'guestfd.c'))
@@ -8,12 +8,13 @@ system_ss.add(when: 'CONFIG_SEMIHOSTING', if_true: files( 'guestfd.c', 'uaccess.c', 'syscalls.c', -), if_false: files( +)) +stub_ss.add(files( 'stubs-system.c', )) system_ss.add(when: 'CONFIG_ARM_COMPATIBLE_SEMIHOSTING', - if_true: files('arm-compat-semi.c'), - if_false: files('arm-compat-semi-stub.c')) + if_true: files('arm-compat-semi.c')) +stub_ss.add(files('arm-compat-semi-stub.c')) specific_ss.add(when: ['CONFIG_SEMIHOSTING', 'CONFIG_USER_ONLY'], if_true: files('syscalls.c'))
Signature · 1 line
2.52.0
Quoted 7 lines · Philippe Mathieu-Daudé
Missing review: #5
v2: Move
acpi_send_event()declarationUse meson magical machinery to build stubs once,
instead of one time per qemu-system-FOO binary.
Quoted 12 lines
Philippe Mathieu-Daudé (11):
meson: Include various directories providing stubs before libqemuutil hw/acpi: Moveacpi_send_event()function out ofacpi_interface.chw/acpi: Moveqbus_build_aml()function out ofacpi_interface.chw/acpi: Always link QOM interfaces with system binaries hw/nvram: Buildfw_cfg-acpi.conce
hw/acpi: Build stubs once
hw/display: Build stubs once
hw/net: Build stubs once
hw/*: Build stubs once
fsdev: Build stubs once
semihosting: Build stubs once
r~
Quoted 4 lines · Philippe Mathieu-Daudé
Philippe Mathieu-Daudé (11):
meson: Include various directories providing stubs before libqemuutil hw/acpi: Moveacpi_send_event()function out ofacpi_interface.chw/acpi: Moveqbus_build_aml()function out ofacpi_interface.c
Quoted 8 lines
hw/acpi: Always link QOM interfaces with system binaries hw/nvram: Build
fw_cfg-acpi.conce
hw/acpi: Build stubs once
hw/display: Build stubs once
hw/net: Build stubs once
hw/*: Build stubs once
fsdev: Build stubs once
semihosting: Build stubs once
Series queued, thanks.