* [PATCH v2 00/11] buildsys: Build most stubs once
@ 2026-02-25 3:57 Philippe Mathieu-Daudé
2026-02-25 3:57 ` [PATCH v2 01/11] meson: Include various directories providing stubs before libqemuutil Philippe Mathieu-Daudé
` (12 more replies)
0 siblings, 13 replies; 19+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-02-25 3:57 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Michael S. Tsirkin, Igor Mammedov,
Pierrick Bouvier, Philippe Mathieu-Daudé
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%)
--
2.52.0
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v2 01/11] meson: Include various directories providing stubs before libqemuutil
2026-02-25 3:57 [PATCH v2 00/11] buildsys: Build most stubs once Philippe Mathieu-Daudé
@ 2026-02-25 3:57 ` Philippe Mathieu-Daudé
2026-02-25 3:57 ` [PATCH v2 02/11] hw/acpi: Move acpi_send_event() function out of acpi_interface.c Philippe Mathieu-Daudé
` (11 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-02-25 3:57 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Michael S. Tsirkin, Igor Mammedov,
Pierrick Bouvier, Philippe Mathieu-Daudé,
Marc-André Lureau, Daniel P. Berrangé
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.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
meson.build | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/meson.build b/meson.build
index 4ffbb96fe49..db051a1b87b 100644
--- a/meson.build
+++ b/meson.build
@@ -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')
--
2.52.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 02/11] hw/acpi: Move acpi_send_event() function out of acpi_interface.c
2026-02-25 3:57 [PATCH v2 00/11] buildsys: Build most stubs once Philippe Mathieu-Daudé
2026-02-25 3:57 ` [PATCH v2 01/11] meson: Include various directories providing stubs before libqemuutil Philippe Mathieu-Daudé
@ 2026-02-25 3:57 ` Philippe Mathieu-Daudé
2026-03-02 6:22 ` Igor Mammedov
2026-02-25 3:57 ` [PATCH v2 03/11] hw/acpi: Move qbus_build_aml() " Philippe Mathieu-Daudé
` (10 subsequent siblings)
12 siblings, 1 reply; 19+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-02-25 3:57 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Michael S. Tsirkin, Igor Mammedov,
Pierrick Bouvier, Philippe Mathieu-Daudé, Ani Sinha
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'.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
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(-)
diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h
index b036116dfb8..dc3672db521 100644
--- a/include/hw/acpi/acpi.h
+++ b/include/hw/acpi/acpi.h
@@ -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);
diff --git a/include/hw/acpi/acpi_dev_interface.h b/include/hw/acpi/acpi_dev_interface.h
index 5927e40eaff..65debb90a8d 100644
--- a/include/hw/acpi/acpi_dev_interface.h
+++ b/include/hw/acpi/acpi_dev_interface.h
@@ -27,8 +27,6 @@ DECLARE_CLASS_CHECKERS(AcpiDeviceIfClass, ACPI_DEVICE_IF,
typedef struct AcpiDeviceIf AcpiDeviceIf;
-void acpi_send_event(DeviceState *dev, AcpiEventStatusBits event);
-
/**
* AcpiDeviceIfClass:
*
diff --git a/hw/acpi/acpi_interface.c b/hw/acpi/acpi_interface.c
index 8637ff18fca..e58e8aaee23 100644
--- a/hw/acpi/acpi_interface.c
+++ b/hw/acpi/acpi_interface.c
@@ -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;
diff --git a/hw/acpi/core.c b/hw/acpi/core.c
index 6b65e587f2a..a6a62a742d1 100644
--- a/hw/acpi/core.c
+++ b/hw/acpi/core.c
@@ -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);
+ }
+}
--
2.52.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 03/11] hw/acpi: Move qbus_build_aml() function out of acpi_interface.c
2026-02-25 3:57 [PATCH v2 00/11] buildsys: Build most stubs once Philippe Mathieu-Daudé
2026-02-25 3:57 ` [PATCH v2 01/11] meson: Include various directories providing stubs before libqemuutil Philippe Mathieu-Daudé
2026-02-25 3:57 ` [PATCH v2 02/11] hw/acpi: Move acpi_send_event() function out of acpi_interface.c Philippe Mathieu-Daudé
@ 2026-02-25 3:57 ` Philippe Mathieu-Daudé
2026-03-02 6:23 ` Igor Mammedov
2026-02-25 3:57 ` [PATCH v2 04/11] hw/acpi: Always link QOM interfaces with system binaries Philippe Mathieu-Daudé
` (9 subsequent siblings)
12 siblings, 1 reply; 19+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-02-25 3:57 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Michael S. Tsirkin, Igor Mammedov,
Pierrick Bouvier, Philippe Mathieu-Daudé, Ani Sinha
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.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
hw/acpi/acpi_interface.c | 10 ----------
hw/acpi/aml-build.c | 11 +++++++++++
2 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/hw/acpi/acpi_interface.c b/hw/acpi/acpi_interface.c
index e58e8aaee23..a44679017ea 100644
--- a/hw/acpi/acpi_interface.c
+++ b/hw/acpi/acpi_interface.c
@@ -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)
{
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index ea1c415b211..4b374050881 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -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);
+ }
+}
--
2.52.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 04/11] hw/acpi: Always link QOM interfaces with system binaries
2026-02-25 3:57 [PATCH v2 00/11] buildsys: Build most stubs once Philippe Mathieu-Daudé
` (2 preceding siblings ...)
2026-02-25 3:57 ` [PATCH v2 03/11] hw/acpi: Move qbus_build_aml() " Philippe Mathieu-Daudé
@ 2026-02-25 3:57 ` Philippe Mathieu-Daudé
2026-03-02 6:24 ` Igor Mammedov
2026-02-25 3:57 ` [PATCH v2 05/11] hw/nvram: Build fw_cfg-acpi.c once Philippe Mathieu-Daudé
` (8 subsequent siblings)
12 siblings, 1 reply; 19+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-02-25 3:57 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Michael S. Tsirkin, Igor Mammedov,
Pierrick Bouvier, Philippe Mathieu-Daudé, Ani Sinha
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.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
hw/acpi/meson.build | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/hw/acpi/meson.build b/hw/acpi/meson.build
index 66c978aae83..e1e848327b9 100644
--- a/hw/acpi/meson.build
+++ b/hw/acpi/meson.build
@@ -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'))
--
2.52.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 05/11] hw/nvram: Build fw_cfg-acpi.c once
2026-02-25 3:57 [PATCH v2 00/11] buildsys: Build most stubs once Philippe Mathieu-Daudé
` (3 preceding siblings ...)
2026-02-25 3:57 ` [PATCH v2 04/11] hw/acpi: Always link QOM interfaces with system binaries Philippe Mathieu-Daudé
@ 2026-02-25 3:57 ` Philippe Mathieu-Daudé
2026-03-02 6:25 ` Igor Mammedov
2026-02-25 3:57 ` [PATCH v2 06/11] hw/acpi: Build stubs once Philippe Mathieu-Daudé
` (7 subsequent siblings)
12 siblings, 1 reply; 19+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-02-25 3:57 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Michael S. Tsirkin, Igor Mammedov,
Pierrick Bouvier, Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
hw/nvram/meson.build | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/nvram/meson.build b/hw/nvram/meson.build
index b66f23605b7..26343359875 100644
--- a/hw/nvram/meson.build
+++ b/hw/nvram/meson.build
@@ -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',
- ))
\ No newline at end of file
+ ))
--
2.52.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 06/11] hw/acpi: Build stubs once
2026-02-25 3:57 [PATCH v2 00/11] buildsys: Build most stubs once Philippe Mathieu-Daudé
` (4 preceding siblings ...)
2026-02-25 3:57 ` [PATCH v2 05/11] hw/nvram: Build fw_cfg-acpi.c once Philippe Mathieu-Daudé
@ 2026-02-25 3:57 ` Philippe Mathieu-Daudé
2026-03-02 6:42 ` Igor Mammedov
2026-02-25 3:57 ` [PATCH v2 07/11] hw/display: " Philippe Mathieu-Daudé
` (6 subsequent siblings)
12 siblings, 1 reply; 19+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-02-25 3:57 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Michael S. Tsirkin, Igor Mammedov,
Pierrick Bouvier, Philippe Mathieu-Daudé, Ani Sinha
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é <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
hw/acpi/meson.build | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/hw/acpi/meson.build b/hw/acpi/meson.build
index e1e848327b9..1c5251909b4 100644
--- a/hw/acpi/meson.build
+++ b/hw/acpi/meson.build
@@ -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'))
--
2.52.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 07/11] hw/display: Build stubs once
2026-02-25 3:57 [PATCH v2 00/11] buildsys: Build most stubs once Philippe Mathieu-Daudé
` (5 preceding siblings ...)
2026-02-25 3:57 ` [PATCH v2 06/11] hw/acpi: Build stubs once Philippe Mathieu-Daudé
@ 2026-02-25 3:57 ` Philippe Mathieu-Daudé
2026-02-25 3:57 ` [PATCH v2 08/11] hw/net: " Philippe Mathieu-Daudé
` (5 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-02-25 3:57 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Michael S. Tsirkin, Igor Mammedov,
Pierrick Bouvier, 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.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
hw/display/acpi-vga-stub.c | 1 +
hw/display/meson.build | 19 ++++++++-----------
2 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/hw/display/acpi-vga-stub.c b/hw/display/acpi-vga-stub.c
index a9b0ecf76d0..ee0fbf8175d 100644
--- a/hw/display/acpi-vga-stub.c
+++ b/hw/display/acpi-vga-stub.c
@@ -1,4 +1,5 @@
#include "qemu/osdep.h"
+#undef CONFIG_PIXMAN
#include "hw/acpi/acpi_aml_interface.h"
#include "vga_int.h"
diff --git a/hw/display/meson.build b/hw/display/meson.build
index 90e6c041bdb..e730c289b15 100644
--- a/hw/display/meson.build
+++ b/hw/display/meson.build
@@ -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
--
2.52.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 08/11] hw/net: Build stubs once
2026-02-25 3:57 [PATCH v2 00/11] buildsys: Build most stubs once Philippe Mathieu-Daudé
` (6 preceding siblings ...)
2026-02-25 3:57 ` [PATCH v2 07/11] hw/display: " Philippe Mathieu-Daudé
@ 2026-02-25 3:57 ` Philippe Mathieu-Daudé
2026-02-25 3:57 ` [PATCH v2 09/11] hw/*: " Philippe Mathieu-Daudé
` (4 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-02-25 3:57 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Michael S. Tsirkin, Igor Mammedov,
Pierrick Bouvier, Philippe Mathieu-Daudé, Jason Wang
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.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
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%)
diff --git a/hw/net/rocker/qmp-norocker.c b/hw/net/rocker/rocker-stubs.c
similarity index 100%
rename from hw/net/rocker/qmp-norocker.c
rename to hw/net/rocker/rocker-stubs.c
diff --git a/hw/net/meson.build b/hw/net/meson.build
index 913eaedbc52..4ee09143165 100644
--- a/hw/net/meson.build
+++ b/hw/net/meson.build
@@ -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')
--
2.52.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 09/11] hw/*: Build stubs once
2026-02-25 3:57 [PATCH v2 00/11] buildsys: Build most stubs once Philippe Mathieu-Daudé
` (7 preceding siblings ...)
2026-02-25 3:57 ` [PATCH v2 08/11] hw/net: " Philippe Mathieu-Daudé
@ 2026-02-25 3:57 ` Philippe Mathieu-Daudé
2026-02-25 3:57 ` [PATCH v2 10/11] fsdev: " Philippe Mathieu-Daudé
` (3 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-02-25 3:57 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Michael S. Tsirkin, Igor Mammedov,
Pierrick Bouvier, Philippe Mathieu-Daudé, Jonathan Cameron,
Fan Ni, Richard Henderson, Eduardo Habkost, Marcel Apfelbaum,
Ani Sinha
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é <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
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(-)
diff --git a/hw/cxl/meson.build b/hw/cxl/meson.build
index 3e375f61a98..5f61273a68d 100644
--- a/hw/cxl/meson.build
+++ b/hw/cxl/meson.build
@@ -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',
))
diff --git a/hw/i386/kvm/meson.build b/hw/i386/kvm/meson.build
index a4a2e23c06e..a34b3504cba 100644
--- a/hw/i386/kvm/meson.build
+++ b/hw/i386/kvm/meson.build
@@ -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)
diff --git a/hw/mem/meson.build b/hw/mem/meson.build
index 1c1c6da24b5..8c2beeb7d4d 100644
--- a/hw/mem/meson.build
+++ b/hw/mem/meson.build
@@ -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'))
diff --git a/hw/pci/meson.build b/hw/pci/meson.build
index b9c34b2acfe..a6cbd89c0a3 100644
--- a/hw/pci/meson.build
+++ b/hw/pci/meson.build
@@ -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'))
diff --git a/hw/smbios/meson.build b/hw/smbios/meson.build
index a59039f6692..9bf4b1ad1e5 100644
--- a/hw/smbios/meson.build
+++ b/hw/smbios/meson.build
@@ -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'))
diff --git a/hw/usb/meson.build b/hw/usb/meson.build
index 17360a5b5a4..ba55c28ef69 100644
--- a/hw/usb/meson.build
+++ b/hw/usb/meson.build
@@ -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'))
diff --git a/hw/virtio/meson.build b/hw/virtio/meson.build
index 6675b63ce65..3af34ef9321 100644
--- a/hw/virtio/meson.build
+++ b/hw/virtio/meson.build
@@ -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'))
--
2.52.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 10/11] fsdev: Build stubs once
2026-02-25 3:57 [PATCH v2 00/11] buildsys: Build most stubs once Philippe Mathieu-Daudé
` (8 preceding siblings ...)
2026-02-25 3:57 ` [PATCH v2 09/11] hw/*: " Philippe Mathieu-Daudé
@ 2026-02-25 3:57 ` Philippe Mathieu-Daudé
2026-02-25 3:57 ` [PATCH v2 11/11] semihosting: " Philippe Mathieu-Daudé
` (2 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-02-25 3:57 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Michael S. Tsirkin, Igor Mammedov,
Pierrick Bouvier, Philippe Mathieu-Daudé,
Christian Schoenebeck, Greg Kurz
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é <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
fsdev/meson.build | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fsdev/meson.build b/fsdev/meson.build
index 95fe816604f..b552cc7153a 100644
--- a/fsdev/meson.build
+++ b/fsdev/meson.build
@@ -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
--
2.52.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 11/11] semihosting: Build stubs once
2026-02-25 3:57 [PATCH v2 00/11] buildsys: Build most stubs once Philippe Mathieu-Daudé
` (9 preceding siblings ...)
2026-02-25 3:57 ` [PATCH v2 10/11] fsdev: " Philippe Mathieu-Daudé
@ 2026-02-25 3:57 ` Philippe Mathieu-Daudé
2026-02-25 4:44 ` [PATCH v2 00/11] buildsys: Build most " Richard Henderson
2026-02-26 16:43 ` Philippe Mathieu-Daudé
12 siblings, 0 replies; 19+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-02-25 3:57 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Michael S. Tsirkin, Igor Mammedov,
Pierrick Bouvier, Philippe Mathieu-Daudé, Alex Bennée
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é <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
semihosting/meson.build | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/semihosting/meson.build b/semihosting/meson.build
index 99f10e2e2bb..15e3be26989 100644
--- a/semihosting/meson.build
+++ b/semihosting/meson.build
@@ -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'))
--
2.52.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH v2 00/11] buildsys: Build most stubs once
2026-02-25 3:57 [PATCH v2 00/11] buildsys: Build most stubs once Philippe Mathieu-Daudé
` (10 preceding siblings ...)
2026-02-25 3:57 ` [PATCH v2 11/11] semihosting: " Philippe Mathieu-Daudé
@ 2026-02-25 4:44 ` Richard Henderson
2026-02-26 16:43 ` Philippe Mathieu-Daudé
12 siblings, 0 replies; 19+ messages in thread
From: Richard Henderson @ 2026-02-25 4:44 UTC (permalink / raw)
To: qemu-devel
On 2/25/26 14:57, Philippe Mathieu-Daudé wrote:
> 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
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 00/11] buildsys: Build most stubs once
2026-02-25 3:57 [PATCH v2 00/11] buildsys: Build most stubs once Philippe Mathieu-Daudé
` (11 preceding siblings ...)
2026-02-25 4:44 ` [PATCH v2 00/11] buildsys: Build most " Richard Henderson
@ 2026-02-26 16:43 ` Philippe Mathieu-Daudé
12 siblings, 0 replies; 19+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-02-26 16:43 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Michael S. Tsirkin, Igor Mammedov,
Pierrick Bouvier
On 25/2/26 04:57, Philippe Mathieu-Daudé wrote:
> 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
Series queued, thanks.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 02/11] hw/acpi: Move acpi_send_event() function out of acpi_interface.c
2026-02-25 3:57 ` [PATCH v2 02/11] hw/acpi: Move acpi_send_event() function out of acpi_interface.c Philippe Mathieu-Daudé
@ 2026-03-02 6:22 ` Igor Mammedov
0 siblings, 0 replies; 19+ messages in thread
From: Igor Mammedov @ 2026-03-02 6:22 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Paolo Bonzini, Michael S. Tsirkin, Pierrick Bouvier,
Ani Sinha
On Wed, 25 Feb 2026 04:57:30 +0100
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
> 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'.
>
> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> ---
> 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(-)
>
> diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h
> index b036116dfb8..dc3672db521 100644
> --- a/include/hw/acpi/acpi.h
> +++ b/include/hw/acpi/acpi.h
> @@ -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);
>
> diff --git a/include/hw/acpi/acpi_dev_interface.h b/include/hw/acpi/acpi_dev_interface.h
> index 5927e40eaff..65debb90a8d 100644
> --- a/include/hw/acpi/acpi_dev_interface.h
> +++ b/include/hw/acpi/acpi_dev_interface.h
> @@ -27,8 +27,6 @@ DECLARE_CLASS_CHECKERS(AcpiDeviceIfClass, ACPI_DEVICE_IF,
>
> typedef struct AcpiDeviceIf AcpiDeviceIf;
>
> -void acpi_send_event(DeviceState *dev, AcpiEventStatusBits event);
> -
> /**
> * AcpiDeviceIfClass:
> *
> diff --git a/hw/acpi/acpi_interface.c b/hw/acpi/acpi_interface.c
> index 8637ff18fca..e58e8aaee23 100644
> --- a/hw/acpi/acpi_interface.c
> +++ b/hw/acpi/acpi_interface.c
> @@ -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;
> diff --git a/hw/acpi/core.c b/hw/acpi/core.c
> index 6b65e587f2a..a6a62a742d1 100644
> --- a/hw/acpi/core.c
> +++ b/hw/acpi/core.c
> @@ -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);
> + }
> +}
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 03/11] hw/acpi: Move qbus_build_aml() function out of acpi_interface.c
2026-02-25 3:57 ` [PATCH v2 03/11] hw/acpi: Move qbus_build_aml() " Philippe Mathieu-Daudé
@ 2026-03-02 6:23 ` Igor Mammedov
0 siblings, 0 replies; 19+ messages in thread
From: Igor Mammedov @ 2026-03-02 6:23 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Paolo Bonzini, Michael S. Tsirkin, Pierrick Bouvier,
Ani Sinha
On Wed, 25 Feb 2026 04:57:31 +0100
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
> 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.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> ---
> hw/acpi/acpi_interface.c | 10 ----------
> hw/acpi/aml-build.c | 11 +++++++++++
> 2 files changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/hw/acpi/acpi_interface.c b/hw/acpi/acpi_interface.c
> index e58e8aaee23..a44679017ea 100644
> --- a/hw/acpi/acpi_interface.c
> +++ b/hw/acpi/acpi_interface.c
> @@ -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)
> {
> diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
> index ea1c415b211..4b374050881 100644
> --- a/hw/acpi/aml-build.c
> +++ b/hw/acpi/aml-build.c
> @@ -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);
> + }
> +}
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 04/11] hw/acpi: Always link QOM interfaces with system binaries
2026-02-25 3:57 ` [PATCH v2 04/11] hw/acpi: Always link QOM interfaces with system binaries Philippe Mathieu-Daudé
@ 2026-03-02 6:24 ` Igor Mammedov
0 siblings, 0 replies; 19+ messages in thread
From: Igor Mammedov @ 2026-03-02 6:24 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Paolo Bonzini, Michael S. Tsirkin, Pierrick Bouvier,
Ani Sinha
On Wed, 25 Feb 2026 04:57:32 +0100
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
> 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.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> ---
> hw/acpi/meson.build | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/hw/acpi/meson.build b/hw/acpi/meson.build
> index 66c978aae83..e1e848327b9 100644
> --- a/hw/acpi/meson.build
> +++ b/hw/acpi/meson.build
> @@ -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'))
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 05/11] hw/nvram: Build fw_cfg-acpi.c once
2026-02-25 3:57 ` [PATCH v2 05/11] hw/nvram: Build fw_cfg-acpi.c once Philippe Mathieu-Daudé
@ 2026-03-02 6:25 ` Igor Mammedov
0 siblings, 0 replies; 19+ messages in thread
From: Igor Mammedov @ 2026-03-02 6:25 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Paolo Bonzini, Michael S. Tsirkin, Pierrick Bouvier
On Wed, 25 Feb 2026 04:57:33 +0100
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> ---
> hw/nvram/meson.build | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/nvram/meson.build b/hw/nvram/meson.build
> index b66f23605b7..26343359875 100644
> --- a/hw/nvram/meson.build
> +++ b/hw/nvram/meson.build
> @@ -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',
> - ))
> \ No newline at end of file
> + ))
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 06/11] hw/acpi: Build stubs once
2026-02-25 3:57 ` [PATCH v2 06/11] hw/acpi: Build stubs once Philippe Mathieu-Daudé
@ 2026-03-02 6:42 ` Igor Mammedov
0 siblings, 0 replies; 19+ messages in thread
From: Igor Mammedov @ 2026-03-02 6:42 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Paolo Bonzini, Michael S. Tsirkin, Pierrick Bouvier,
Ani Sinha
On Wed, 25 Feb 2026 04:57:34 +0100
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
> 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é <philmd@linaro.org>
> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> ---
> hw/acpi/meson.build | 25 ++++++++++++++-----------
> 1 file changed, 14 insertions(+), 11 deletions(-)
>
> diff --git a/hw/acpi/meson.build b/hw/acpi/meson.build
> index e1e848327b9..1c5251909b4 100644
> --- a/hw/acpi/meson.build
> +++ b/hw/acpi/meson.build
> @@ -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'))
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2026-03-02 6:43 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-25 3:57 [PATCH v2 00/11] buildsys: Build most stubs once Philippe Mathieu-Daudé
2026-02-25 3:57 ` [PATCH v2 01/11] meson: Include various directories providing stubs before libqemuutil Philippe Mathieu-Daudé
2026-02-25 3:57 ` [PATCH v2 02/11] hw/acpi: Move acpi_send_event() function out of acpi_interface.c Philippe Mathieu-Daudé
2026-03-02 6:22 ` Igor Mammedov
2026-02-25 3:57 ` [PATCH v2 03/11] hw/acpi: Move qbus_build_aml() " Philippe Mathieu-Daudé
2026-03-02 6:23 ` Igor Mammedov
2026-02-25 3:57 ` [PATCH v2 04/11] hw/acpi: Always link QOM interfaces with system binaries Philippe Mathieu-Daudé
2026-03-02 6:24 ` Igor Mammedov
2026-02-25 3:57 ` [PATCH v2 05/11] hw/nvram: Build fw_cfg-acpi.c once Philippe Mathieu-Daudé
2026-03-02 6:25 ` Igor Mammedov
2026-02-25 3:57 ` [PATCH v2 06/11] hw/acpi: Build stubs once Philippe Mathieu-Daudé
2026-03-02 6:42 ` Igor Mammedov
2026-02-25 3:57 ` [PATCH v2 07/11] hw/display: " Philippe Mathieu-Daudé
2026-02-25 3:57 ` [PATCH v2 08/11] hw/net: " Philippe Mathieu-Daudé
2026-02-25 3:57 ` [PATCH v2 09/11] hw/*: " Philippe Mathieu-Daudé
2026-02-25 3:57 ` [PATCH v2 10/11] fsdev: " Philippe Mathieu-Daudé
2026-02-25 3:57 ` [PATCH v2 11/11] semihosting: " Philippe Mathieu-Daudé
2026-02-25 4:44 ` [PATCH v2 00/11] buildsys: Build most " Richard Henderson
2026-02-26 16:43 ` Philippe Mathieu-Daudé
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.