* [PATCH 0/7] hw/nvram/fw_cfg: Do not build device if not needed (Spring cleanup) @ 2021-04-26 19:35 ` Philippe Mathieu-Daudé 0 siblings, 0 replies; 34+ messages in thread From: Philippe Mathieu-Daudé @ 2021-04-26 19:35 UTC (permalink / raw) To: qemu-devel Cc: Thomas Huth, qemu-riscv, Philippe Mathieu-Daudé, qemu-arm, qemu-ppc, Gerd Hoffmann, Laszlo Ersek Hi, Quite a trivial series around fw_cfg: - enforce the FW_CFG Kconfig symbol, - add missing Kconfig dependencies, - explicit machines using the fw_cfg device, - allow targets not using the device to build without it. Please review, Phil. Philippe Mathieu-Daudé (7): stubs: Restrict fw_cfg stubs to sysemu hw/nvram: Rename FW_CFG_MIPS as generic FW_CFG Kconfig symbol hw/nvram: Declare FW_CFG_DMA Kconfig symbol in hw/nvram/ hw/acpi/vmgenid: Make ACPI_VMGENID depends on FW_CFG Kconfig hw: Have machines Kconfig-select FW_CFG hw/{arm,hppa,riscv}: Add fw_cfg arch-specific stub hw/nvram: Do not build FW_CFG if not required hw/arm/fw_cfg.c | 19 +++++++++++++++++ hw/hppa/fw_cfg.c | 19 +++++++++++++++++ hw/riscv/fw_cfg.c | 19 +++++++++++++++++ stubs/fw_cfg.c | 49 ++++++++++++++++++++++++++++++++++++++++++-- MAINTAINERS | 2 +- hw/acpi/Kconfig | 1 + hw/arm/Kconfig | 2 ++ hw/arm/meson.build | 1 + hw/display/Kconfig | 3 --- hw/hppa/Kconfig | 1 + hw/hppa/meson.build | 1 + hw/i386/Kconfig | 2 ++ hw/mips/Kconfig | 5 +---- hw/mips/meson.build | 2 +- hw/nvram/Kconfig | 7 +++++++ hw/nvram/meson.build | 2 +- hw/ppc/Kconfig | 1 + hw/riscv/meson.build | 1 + hw/sparc/Kconfig | 1 + hw/sparc64/Kconfig | 1 + stubs/meson.build | 2 +- 21 files changed, 128 insertions(+), 13 deletions(-) create mode 100644 hw/arm/fw_cfg.c create mode 100644 hw/hppa/fw_cfg.c create mode 100644 hw/riscv/fw_cfg.c -- 2.26.3 ^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 0/7] hw/nvram/fw_cfg: Do not build device if not needed (Spring cleanup) @ 2021-04-26 19:35 ` Philippe Mathieu-Daudé 0 siblings, 0 replies; 34+ messages in thread From: Philippe Mathieu-Daudé @ 2021-04-26 19:35 UTC (permalink / raw) To: qemu-devel Cc: Gerd Hoffmann, qemu-riscv, Laszlo Ersek, qemu-ppc, qemu-arm, Thomas Huth, Philippe Mathieu-Daudé Hi, Quite a trivial series around fw_cfg: - enforce the FW_CFG Kconfig symbol, - add missing Kconfig dependencies, - explicit machines using the fw_cfg device, - allow targets not using the device to build without it. Please review, Phil. Philippe Mathieu-Daudé (7): stubs: Restrict fw_cfg stubs to sysemu hw/nvram: Rename FW_CFG_MIPS as generic FW_CFG Kconfig symbol hw/nvram: Declare FW_CFG_DMA Kconfig symbol in hw/nvram/ hw/acpi/vmgenid: Make ACPI_VMGENID depends on FW_CFG Kconfig hw: Have machines Kconfig-select FW_CFG hw/{arm,hppa,riscv}: Add fw_cfg arch-specific stub hw/nvram: Do not build FW_CFG if not required hw/arm/fw_cfg.c | 19 +++++++++++++++++ hw/hppa/fw_cfg.c | 19 +++++++++++++++++ hw/riscv/fw_cfg.c | 19 +++++++++++++++++ stubs/fw_cfg.c | 49 ++++++++++++++++++++++++++++++++++++++++++-- MAINTAINERS | 2 +- hw/acpi/Kconfig | 1 + hw/arm/Kconfig | 2 ++ hw/arm/meson.build | 1 + hw/display/Kconfig | 3 --- hw/hppa/Kconfig | 1 + hw/hppa/meson.build | 1 + hw/i386/Kconfig | 2 ++ hw/mips/Kconfig | 5 +---- hw/mips/meson.build | 2 +- hw/nvram/Kconfig | 7 +++++++ hw/nvram/meson.build | 2 +- hw/ppc/Kconfig | 1 + hw/riscv/meson.build | 1 + hw/sparc/Kconfig | 1 + hw/sparc64/Kconfig | 1 + stubs/meson.build | 2 +- 21 files changed, 128 insertions(+), 13 deletions(-) create mode 100644 hw/arm/fw_cfg.c create mode 100644 hw/hppa/fw_cfg.c create mode 100644 hw/riscv/fw_cfg.c -- 2.26.3 ^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 1/7] stubs: Restrict fw_cfg stubs to sysemu 2021-04-26 19:35 ` Philippe Mathieu-Daudé @ 2021-04-26 19:35 ` Philippe Mathieu-Daudé -1 siblings, 0 replies; 34+ messages in thread From: Philippe Mathieu-Daudé @ 2021-04-26 19:35 UTC (permalink / raw) To: qemu-devel Cc: Thomas Huth, qemu-riscv, Philippe Mathieu-Daudé, qemu-arm, qemu-ppc, Gerd Hoffmann, Paolo Bonzini, Laszlo Ersek User emulation or tools don't use / require the fw_cfg device. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> --- stubs/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/meson.build b/stubs/meson.build index be6f6d609e5..4ff36401cf9 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -12,7 +12,6 @@ stub_ss.add(files('dump.c')) stub_ss.add(files('error-printf.c')) stub_ss.add(files('fdset.c')) -stub_ss.add(files('fw_cfg.c')) stub_ss.add(files('gdbstub.c')) stub_ss.add(files('get-vm-name.c')) stub_ss.add(when: 'CONFIG_LINUX_IO_URING', if_true: files('io_uring.c')) @@ -49,6 +48,7 @@ stub_ss.add(files('replay-tools.c')) endif if have_system + stub_ss.add(files('fw_cfg.c')) stub_ss.add(files('semihost.c')) stub_ss.add(files('xen-hw-stub.c')) else -- 2.26.3 ^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 1/7] stubs: Restrict fw_cfg stubs to sysemu @ 2021-04-26 19:35 ` Philippe Mathieu-Daudé 0 siblings, 0 replies; 34+ messages in thread From: Philippe Mathieu-Daudé @ 2021-04-26 19:35 UTC (permalink / raw) To: qemu-devel Cc: Gerd Hoffmann, qemu-riscv, Laszlo Ersek, qemu-ppc, qemu-arm, Thomas Huth, Philippe Mathieu-Daudé, Paolo Bonzini User emulation or tools don't use / require the fw_cfg device. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> --- stubs/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/meson.build b/stubs/meson.build index be6f6d609e5..4ff36401cf9 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -12,7 +12,6 @@ stub_ss.add(files('dump.c')) stub_ss.add(files('error-printf.c')) stub_ss.add(files('fdset.c')) -stub_ss.add(files('fw_cfg.c')) stub_ss.add(files('gdbstub.c')) stub_ss.add(files('get-vm-name.c')) stub_ss.add(when: 'CONFIG_LINUX_IO_URING', if_true: files('io_uring.c')) @@ -49,6 +48,7 @@ stub_ss.add(files('replay-tools.c')) endif if have_system + stub_ss.add(files('fw_cfg.c')) stub_ss.add(files('semihost.c')) stub_ss.add(files('xen-hw-stub.c')) else -- 2.26.3 ^ permalink raw reply related [flat|nested] 34+ messages in thread
* Re: [PATCH 1/7] stubs: Restrict fw_cfg stubs to sysemu 2021-04-26 19:35 ` Philippe Mathieu-Daudé (?) @ 2021-04-28 16:23 ` Laszlo Ersek -1 siblings, 0 replies; 34+ messages in thread From: Laszlo Ersek @ 2021-04-28 16:23 UTC (permalink / raw) To: Philippe Mathieu-Daudé, qemu-devel Cc: Thomas Huth, qemu-riscv, qemu-arm, qemu-ppc, Gerd Hoffmann, Paolo Bonzini On 04/26/21 21:35, Philippe Mathieu-Daudé wrote: > User emulation or tools don't use / require the fw_cfg device. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> > --- > stubs/meson.build | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/stubs/meson.build b/stubs/meson.build > index be6f6d609e5..4ff36401cf9 100644 > --- a/stubs/meson.build > +++ b/stubs/meson.build > @@ -12,7 +12,6 @@ > stub_ss.add(files('dump.c')) > stub_ss.add(files('error-printf.c')) > stub_ss.add(files('fdset.c')) > -stub_ss.add(files('fw_cfg.c')) > stub_ss.add(files('gdbstub.c')) > stub_ss.add(files('get-vm-name.c')) > stub_ss.add(when: 'CONFIG_LINUX_IO_URING', if_true: files('io_uring.c')) > @@ -49,6 +48,7 @@ > stub_ss.add(files('replay-tools.c')) > endif > if have_system > + stub_ss.add(files('fw_cfg.c')) > stub_ss.add(files('semihost.c')) > stub_ss.add(files('xen-hw-stub.c')) > else > The intent is valid and the implementation looks plausible. Acked-by: Laszlo Ersek <lersek@redhat.com> ^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 2/7] hw/nvram: Rename FW_CFG_MIPS as generic FW_CFG Kconfig symbol 2021-04-26 19:35 ` Philippe Mathieu-Daudé @ 2021-04-26 19:35 ` Philippe Mathieu-Daudé -1 siblings, 0 replies; 34+ messages in thread From: Philippe Mathieu-Daudé @ 2021-04-26 19:35 UTC (permalink / raw) To: qemu-devel Cc: Thomas Huth, qemu-riscv, Philippe Mathieu-Daudé, Aleksandar Rikalo, Philippe Mathieu-Daudé, qemu-arm, qemu-ppc, Gerd Hoffmann, Laszlo Ersek, Aurelien Jarno Targets using the fw_cfg device might have architecture specific keys. If so, they define the fw_cfg_arch_key_name() function. The use of FW_CFG_MIPS is not MIPS-specific, it is simply the architectural implementation. Rename it using the generic 'FW_CFG' and move the Kconfig declaration in hw/nvram/ where fw_cfg code is maintained. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> --- hw/mips/Kconfig | 5 +---- hw/mips/meson.build | 2 +- hw/nvram/Kconfig | 3 +++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/mips/Kconfig b/hw/mips/Kconfig index aadd436bf4e..bbc6b9c1d11 100644 --- a/hw/mips/Kconfig +++ b/hw/mips/Kconfig @@ -42,7 +42,7 @@ config LOONGSON3V select PCI_DEVICES select PCI_EXPRESS_GENERIC_BRIDGE select MSI_NONBROKEN - select FW_CFG_MIPS + select FW_CFG config MIPS_CPS bool @@ -50,6 +50,3 @@ config MIPS_CPS config MIPS_BOSTON bool - -config FW_CFG_MIPS - bool diff --git a/hw/mips/meson.build b/hw/mips/meson.build index 1195716dc73..893e56f7453 100644 --- a/hw/mips/meson.build +++ b/hw/mips/meson.build @@ -1,6 +1,6 @@ mips_ss = ss.source_set() mips_ss.add(files('bootloader.c', 'mips_int.c')) -mips_ss.add(when: 'CONFIG_FW_CFG_MIPS', if_true: files('fw_cfg.c')) +mips_ss.add(when: 'CONFIG_FW_CFG', if_true: files('fw_cfg.c')) mips_ss.add(when: 'CONFIG_FULOONG', if_true: files('fuloong2e.c')) mips_ss.add(when: 'CONFIG_LOONGSON3V', if_true: files('loongson3_bootp.c', 'loongson3_virt.c')) mips_ss.add(when: 'CONFIG_JAZZ', if_true: files('jazz.c')) diff --git a/hw/nvram/Kconfig b/hw/nvram/Kconfig index e872fcb1941..cab1070375f 100644 --- a/hw/nvram/Kconfig +++ b/hw/nvram/Kconfig @@ -1,3 +1,6 @@ +config FW_CFG + bool + config DS1225Y bool -- 2.26.3 ^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 2/7] hw/nvram: Rename FW_CFG_MIPS as generic FW_CFG Kconfig symbol @ 2021-04-26 19:35 ` Philippe Mathieu-Daudé 0 siblings, 0 replies; 34+ messages in thread From: Philippe Mathieu-Daudé @ 2021-04-26 19:35 UTC (permalink / raw) To: qemu-devel Cc: Gerd Hoffmann, qemu-riscv, Laszlo Ersek, qemu-ppc, qemu-arm, Thomas Huth, Philippe Mathieu-Daudé, Philippe Mathieu-Daudé, Aurelien Jarno, Jiaxun Yang, Aleksandar Rikalo Targets using the fw_cfg device might have architecture specific keys. If so, they define the fw_cfg_arch_key_name() function. The use of FW_CFG_MIPS is not MIPS-specific, it is simply the architectural implementation. Rename it using the generic 'FW_CFG' and move the Kconfig declaration in hw/nvram/ where fw_cfg code is maintained. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> --- hw/mips/Kconfig | 5 +---- hw/mips/meson.build | 2 +- hw/nvram/Kconfig | 3 +++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/mips/Kconfig b/hw/mips/Kconfig index aadd436bf4e..bbc6b9c1d11 100644 --- a/hw/mips/Kconfig +++ b/hw/mips/Kconfig @@ -42,7 +42,7 @@ config LOONGSON3V select PCI_DEVICES select PCI_EXPRESS_GENERIC_BRIDGE select MSI_NONBROKEN - select FW_CFG_MIPS + select FW_CFG config MIPS_CPS bool @@ -50,6 +50,3 @@ config MIPS_CPS config MIPS_BOSTON bool - -config FW_CFG_MIPS - bool diff --git a/hw/mips/meson.build b/hw/mips/meson.build index 1195716dc73..893e56f7453 100644 --- a/hw/mips/meson.build +++ b/hw/mips/meson.build @@ -1,6 +1,6 @@ mips_ss = ss.source_set() mips_ss.add(files('bootloader.c', 'mips_int.c')) -mips_ss.add(when: 'CONFIG_FW_CFG_MIPS', if_true: files('fw_cfg.c')) +mips_ss.add(when: 'CONFIG_FW_CFG', if_true: files('fw_cfg.c')) mips_ss.add(when: 'CONFIG_FULOONG', if_true: files('fuloong2e.c')) mips_ss.add(when: 'CONFIG_LOONGSON3V', if_true: files('loongson3_bootp.c', 'loongson3_virt.c')) mips_ss.add(when: 'CONFIG_JAZZ', if_true: files('jazz.c')) diff --git a/hw/nvram/Kconfig b/hw/nvram/Kconfig index e872fcb1941..cab1070375f 100644 --- a/hw/nvram/Kconfig +++ b/hw/nvram/Kconfig @@ -1,3 +1,6 @@ +config FW_CFG + bool + config DS1225Y bool -- 2.26.3 ^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 3/7] hw/nvram: Declare FW_CFG_DMA Kconfig symbol in hw/nvram/ 2021-04-26 19:35 ` Philippe Mathieu-Daudé @ 2021-04-26 19:35 ` Philippe Mathieu-Daudé -1 siblings, 0 replies; 34+ messages in thread From: Philippe Mathieu-Daudé @ 2021-04-26 19:35 UTC (permalink / raw) To: qemu-devel Cc: Thomas Huth, qemu-riscv, Philippe Mathieu-Daudé, qemu-arm, qemu-ppc, Gerd Hoffmann, Laszlo Ersek fw_cfg related files are maintained in hw/nvram/, so it makes sense to declare the FW_CFG_DMA Kconfig symbol there, along with the FW_CFG one. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> --- hw/display/Kconfig | 3 --- hw/nvram/Kconfig | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/display/Kconfig b/hw/display/Kconfig index ca46b5830e7..0e4bb596c43 100644 --- a/hw/display/Kconfig +++ b/hw/display/Kconfig @@ -6,9 +6,6 @@ config DDC config EDID bool -config FW_CFG_DMA - bool - config VGA_CIRRUS bool default y if PCI_DEVICES diff --git a/hw/nvram/Kconfig b/hw/nvram/Kconfig index cab1070375f..59fac45c315 100644 --- a/hw/nvram/Kconfig +++ b/hw/nvram/Kconfig @@ -1,6 +1,10 @@ config FW_CFG bool +config FW_CFG_DMA + bool + select FW_CFG + config DS1225Y bool -- 2.26.3 ^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 3/7] hw/nvram: Declare FW_CFG_DMA Kconfig symbol in hw/nvram/ @ 2021-04-26 19:35 ` Philippe Mathieu-Daudé 0 siblings, 0 replies; 34+ messages in thread From: Philippe Mathieu-Daudé @ 2021-04-26 19:35 UTC (permalink / raw) To: qemu-devel Cc: Gerd Hoffmann, qemu-riscv, Laszlo Ersek, qemu-ppc, qemu-arm, Thomas Huth, Philippe Mathieu-Daudé fw_cfg related files are maintained in hw/nvram/, so it makes sense to declare the FW_CFG_DMA Kconfig symbol there, along with the FW_CFG one. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> --- hw/display/Kconfig | 3 --- hw/nvram/Kconfig | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/display/Kconfig b/hw/display/Kconfig index ca46b5830e7..0e4bb596c43 100644 --- a/hw/display/Kconfig +++ b/hw/display/Kconfig @@ -6,9 +6,6 @@ config DDC config EDID bool -config FW_CFG_DMA - bool - config VGA_CIRRUS bool default y if PCI_DEVICES diff --git a/hw/nvram/Kconfig b/hw/nvram/Kconfig index cab1070375f..59fac45c315 100644 --- a/hw/nvram/Kconfig +++ b/hw/nvram/Kconfig @@ -1,6 +1,10 @@ config FW_CFG bool +config FW_CFG_DMA + bool + select FW_CFG + config DS1225Y bool -- 2.26.3 ^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 4/7] hw/acpi/vmgenid: Make ACPI_VMGENID depends on FW_CFG Kconfig 2021-04-26 19:35 ` Philippe Mathieu-Daudé @ 2021-04-26 19:35 ` Philippe Mathieu-Daudé -1 siblings, 0 replies; 34+ messages in thread From: Philippe Mathieu-Daudé @ 2021-04-26 19:35 UTC (permalink / raw) To: qemu-devel Cc: Thomas Huth, qemu-riscv, Michael S. Tsirkin, Philippe Mathieu-Daudé, qemu-arm, qemu-ppc, Gerd Hoffmann, Igor Mammedov, Laszlo Ersek The TYPE_VMGENID device depends on fw_cfg: $ git grep \ fw_cfg hw/acpi/vmgenid.c hw/acpi/vmgenid.c:128: fw_cfg_add_file(s, VMGENID_GUID_FW_CFG_FILE, guid->data, hw/acpi/vmgenid.c:131: fw_cfg_add_file_callback(s, VMGENID_ADDR_FW_CFG_FILE, NULL, NULL, NULL, Add the proper Kconfig dependency. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> --- hw/acpi/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/acpi/Kconfig b/hw/acpi/Kconfig index 1932f66af8d..b9dc932d2a7 100644 --- a/hw/acpi/Kconfig +++ b/hw/acpi/Kconfig @@ -40,5 +40,6 @@ config ACPI_VMGENID bool default y depends on PC + select FW_CFG config ACPI_HW_REDUCED -- 2.26.3 ^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 4/7] hw/acpi/vmgenid: Make ACPI_VMGENID depends on FW_CFG Kconfig @ 2021-04-26 19:35 ` Philippe Mathieu-Daudé 0 siblings, 0 replies; 34+ messages in thread From: Philippe Mathieu-Daudé @ 2021-04-26 19:35 UTC (permalink / raw) To: qemu-devel Cc: Gerd Hoffmann, qemu-riscv, Laszlo Ersek, qemu-ppc, qemu-arm, Thomas Huth, Philippe Mathieu-Daudé, Michael S. Tsirkin, Igor Mammedov The TYPE_VMGENID device depends on fw_cfg: $ git grep \ fw_cfg hw/acpi/vmgenid.c hw/acpi/vmgenid.c:128: fw_cfg_add_file(s, VMGENID_GUID_FW_CFG_FILE, guid->data, hw/acpi/vmgenid.c:131: fw_cfg_add_file_callback(s, VMGENID_ADDR_FW_CFG_FILE, NULL, NULL, NULL, Add the proper Kconfig dependency. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> --- hw/acpi/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/acpi/Kconfig b/hw/acpi/Kconfig index 1932f66af8d..b9dc932d2a7 100644 --- a/hw/acpi/Kconfig +++ b/hw/acpi/Kconfig @@ -40,5 +40,6 @@ config ACPI_VMGENID bool default y depends on PC + select FW_CFG config ACPI_HW_REDUCED -- 2.26.3 ^ permalink raw reply related [flat|nested] 34+ messages in thread
* Re: [PATCH 4/7] hw/acpi/vmgenid: Make ACPI_VMGENID depends on FW_CFG Kconfig 2021-04-26 19:35 ` Philippe Mathieu-Daudé (?) @ 2021-04-28 16:25 ` Laszlo Ersek -1 siblings, 0 replies; 34+ messages in thread From: Laszlo Ersek @ 2021-04-28 16:25 UTC (permalink / raw) To: Philippe Mathieu-Daudé, qemu-devel Cc: Thomas Huth, qemu-riscv, Michael S. Tsirkin, qemu-arm, qemu-ppc, Gerd Hoffmann, Igor Mammedov On 04/26/21 21:35, Philippe Mathieu-Daudé wrote: > The TYPE_VMGENID device depends on fw_cfg: > > $ git grep \ fw_cfg hw/acpi/vmgenid.c > hw/acpi/vmgenid.c:128: fw_cfg_add_file(s, VMGENID_GUID_FW_CFG_FILE, guid->data, > hw/acpi/vmgenid.c:131: fw_cfg_add_file_callback(s, VMGENID_ADDR_FW_CFG_FILE, NULL, NULL, NULL, > > Add the proper Kconfig dependency. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> > --- > hw/acpi/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/hw/acpi/Kconfig b/hw/acpi/Kconfig > index 1932f66af8d..b9dc932d2a7 100644 > --- a/hw/acpi/Kconfig > +++ b/hw/acpi/Kconfig > @@ -40,5 +40,6 @@ config ACPI_VMGENID > bool > default y > depends on PC > + select FW_CFG > > config ACPI_HW_REDUCED > The intent is certainly correct and the implementation looks plausible. Reviewed-by: Laszlo Ersek <lersek@redhat.com> ^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 5/7] hw: Have machines Kconfig-select FW_CFG 2021-04-26 19:35 ` Philippe Mathieu-Daudé @ 2021-04-26 19:35 ` Philippe Mathieu-Daudé -1 siblings, 0 replies; 34+ messages in thread From: Philippe Mathieu-Daudé @ 2021-04-26 19:35 UTC (permalink / raw) To: qemu-devel Cc: Peter Maydell, Thomas Huth, qemu-riscv, Eduardo Habkost, Michael S. Tsirkin, Philippe Mathieu-Daudé, Helge Deller, Richard Henderson, Greg Kurz, qemu-arm, qemu-ppc, Gerd Hoffmann, Paolo Bonzini, Mark Cave-Ayland, Laszlo Ersek, Artyom Tarasenko, David Gibson Beside the loongson3-virt machine (MIPS), the following machines also use the fw_cfg device: - ARM: virt & sbsa-ref - HPPA: generic machine - X86: ACPI based (pc & microvm) - PPC64: various - SPARC: sun4m & sun4u Add their FW_CFG Kconfig dependency. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> --- hw/arm/Kconfig | 2 ++ hw/hppa/Kconfig | 1 + hw/i386/Kconfig | 2 ++ hw/ppc/Kconfig | 1 + hw/sparc/Kconfig | 1 + hw/sparc64/Kconfig | 1 + 6 files changed, 8 insertions(+) diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 8c37cf00da7..3b2641e39dc 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -8,6 +8,7 @@ config ARM_VIRT imply TPM_TIS_SYSBUS select ARM_GIC select ACPI + select FW_CFG select ARM_SMMUV3 select GPIO_KEY select FW_CFG_DMA @@ -216,6 +217,7 @@ config SBSA_REF select PL061 # GPIO select USB_EHCI_SYSBUS select WDT_SBSA + select FW_CFG config SABRELITE bool diff --git a/hw/hppa/Kconfig b/hw/hppa/Kconfig index 22948db0256..45f40e09224 100644 --- a/hw/hppa/Kconfig +++ b/hw/hppa/Kconfig @@ -14,3 +14,4 @@ config DINO select LASIPS2 select PARALLEL select ARTIST + select FW_CFG diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig index 7f91f30877f..9e4039a2dce 100644 --- a/hw/i386/Kconfig +++ b/hw/i386/Kconfig @@ -52,6 +52,7 @@ config PC_ACPI select SMBUS_EEPROM select PFLASH_CFI01 depends on ACPI_SMBUS + select FW_CFG config I440FX bool @@ -106,6 +107,7 @@ config MICROVM select ACPI_HW_REDUCED select PCI_EXPRESS_GENERIC_BRIDGE select USB_XHCI_SYSBUS + select FW_CFG config X86_IOMMU bool diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig index d11dc30509d..a7ba8283bf1 100644 --- a/hw/ppc/Kconfig +++ b/hw/ppc/Kconfig @@ -131,6 +131,7 @@ config VIRTEX # Only used by 64-bit targets config FW_CFG_PPC bool + select FW_CFG config FDT_PPC bool diff --git a/hw/sparc/Kconfig b/hw/sparc/Kconfig index 8dcb10086fd..267bf45fa21 100644 --- a/hw/sparc/Kconfig +++ b/hw/sparc/Kconfig @@ -15,6 +15,7 @@ config SUN4M select STP2000 select CHRP_NVRAM select OR_IRQ + select FW_CFG config LEON3 bool diff --git a/hw/sparc64/Kconfig b/hw/sparc64/Kconfig index 980a201bb73..c17b34b9d5b 100644 --- a/hw/sparc64/Kconfig +++ b/hw/sparc64/Kconfig @@ -13,6 +13,7 @@ config SUN4U select PCKBD select SIMBA select CHRP_NVRAM + select FW_CFG config NIAGARA bool -- 2.26.3 ^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 5/7] hw: Have machines Kconfig-select FW_CFG @ 2021-04-26 19:35 ` Philippe Mathieu-Daudé 0 siblings, 0 replies; 34+ messages in thread From: Philippe Mathieu-Daudé @ 2021-04-26 19:35 UTC (permalink / raw) To: qemu-devel Cc: Gerd Hoffmann, qemu-riscv, Laszlo Ersek, qemu-ppc, qemu-arm, Thomas Huth, Philippe Mathieu-Daudé, Peter Maydell, Richard Henderson, Helge Deller, Michael S. Tsirkin, Marcel Apfelbaum, Paolo Bonzini, Eduardo Habkost, David Gibson, Greg Kurz, Mark Cave-Ayland, Artyom Tarasenko Beside the loongson3-virt machine (MIPS), the following machines also use the fw_cfg device: - ARM: virt & sbsa-ref - HPPA: generic machine - X86: ACPI based (pc & microvm) - PPC64: various - SPARC: sun4m & sun4u Add their FW_CFG Kconfig dependency. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> --- hw/arm/Kconfig | 2 ++ hw/hppa/Kconfig | 1 + hw/i386/Kconfig | 2 ++ hw/ppc/Kconfig | 1 + hw/sparc/Kconfig | 1 + hw/sparc64/Kconfig | 1 + 6 files changed, 8 insertions(+) diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 8c37cf00da7..3b2641e39dc 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -8,6 +8,7 @@ config ARM_VIRT imply TPM_TIS_SYSBUS select ARM_GIC select ACPI + select FW_CFG select ARM_SMMUV3 select GPIO_KEY select FW_CFG_DMA @@ -216,6 +217,7 @@ config SBSA_REF select PL061 # GPIO select USB_EHCI_SYSBUS select WDT_SBSA + select FW_CFG config SABRELITE bool diff --git a/hw/hppa/Kconfig b/hw/hppa/Kconfig index 22948db0256..45f40e09224 100644 --- a/hw/hppa/Kconfig +++ b/hw/hppa/Kconfig @@ -14,3 +14,4 @@ config DINO select LASIPS2 select PARALLEL select ARTIST + select FW_CFG diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig index 7f91f30877f..9e4039a2dce 100644 --- a/hw/i386/Kconfig +++ b/hw/i386/Kconfig @@ -52,6 +52,7 @@ config PC_ACPI select SMBUS_EEPROM select PFLASH_CFI01 depends on ACPI_SMBUS + select FW_CFG config I440FX bool @@ -106,6 +107,7 @@ config MICROVM select ACPI_HW_REDUCED select PCI_EXPRESS_GENERIC_BRIDGE select USB_XHCI_SYSBUS + select FW_CFG config X86_IOMMU bool diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig index d11dc30509d..a7ba8283bf1 100644 --- a/hw/ppc/Kconfig +++ b/hw/ppc/Kconfig @@ -131,6 +131,7 @@ config VIRTEX # Only used by 64-bit targets config FW_CFG_PPC bool + select FW_CFG config FDT_PPC bool diff --git a/hw/sparc/Kconfig b/hw/sparc/Kconfig index 8dcb10086fd..267bf45fa21 100644 --- a/hw/sparc/Kconfig +++ b/hw/sparc/Kconfig @@ -15,6 +15,7 @@ config SUN4M select STP2000 select CHRP_NVRAM select OR_IRQ + select FW_CFG config LEON3 bool diff --git a/hw/sparc64/Kconfig b/hw/sparc64/Kconfig index 980a201bb73..c17b34b9d5b 100644 --- a/hw/sparc64/Kconfig +++ b/hw/sparc64/Kconfig @@ -13,6 +13,7 @@ config SUN4U select PCKBD select SIMBA select CHRP_NVRAM + select FW_CFG config NIAGARA bool -- 2.26.3 ^ permalink raw reply related [flat|nested] 34+ messages in thread
* Re: [PATCH 5/7] hw: Have machines Kconfig-select FW_CFG 2021-04-26 19:35 ` Philippe Mathieu-Daudé @ 2021-04-26 22:03 ` BALATON Zoltan -1 siblings, 0 replies; 34+ messages in thread From: BALATON Zoltan @ 2021-04-26 22:03 UTC (permalink / raw) To: Philippe Mathieu-Daudé Cc: Peter Maydell, Thomas Huth, qemu-riscv, Eduardo Habkost, Michael S. Tsirkin, Helge Deller, Richard Henderson, qemu-devel, Greg Kurz, qemu-arm, qemu-ppc, Gerd Hoffmann, Paolo Bonzini, Laszlo Ersek, Artyom Tarasenko, David Gibson [-- Attachment #1: Type: text/plain, Size: 3466 bytes --] On Mon, 26 Apr 2021, Philippe Mathieu-Daudé wrote: > Beside the loongson3-virt machine (MIPS), the following machines > also use the fw_cfg device: > > - ARM: virt & sbsa-ref > - HPPA: generic machine > - X86: ACPI based (pc & microvm) > - PPC64: various > - SPARC: sun4m & sun4u > > Add their FW_CFG Kconfig dependency. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> > --- > hw/arm/Kconfig | 2 ++ > hw/hppa/Kconfig | 1 + > hw/i386/Kconfig | 2 ++ > hw/ppc/Kconfig | 1 + > hw/sparc/Kconfig | 1 + > hw/sparc64/Kconfig | 1 + > 6 files changed, 8 insertions(+) > > diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig > index 8c37cf00da7..3b2641e39dc 100644 > --- a/hw/arm/Kconfig > +++ b/hw/arm/Kconfig > @@ -8,6 +8,7 @@ config ARM_VIRT > imply TPM_TIS_SYSBUS > select ARM_GIC > select ACPI > + select FW_CFG > select ARM_SMMUV3 > select GPIO_KEY > select FW_CFG_DMA > @@ -216,6 +217,7 @@ config SBSA_REF > select PL061 # GPIO > select USB_EHCI_SYSBUS > select WDT_SBSA > + select FW_CFG > > config SABRELITE > bool > diff --git a/hw/hppa/Kconfig b/hw/hppa/Kconfig > index 22948db0256..45f40e09224 100644 > --- a/hw/hppa/Kconfig > +++ b/hw/hppa/Kconfig > @@ -14,3 +14,4 @@ config DINO > select LASIPS2 > select PARALLEL > select ARTIST > + select FW_CFG > diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig > index 7f91f30877f..9e4039a2dce 100644 > --- a/hw/i386/Kconfig > +++ b/hw/i386/Kconfig > @@ -52,6 +52,7 @@ config PC_ACPI > select SMBUS_EEPROM > select PFLASH_CFI01 > depends on ACPI_SMBUS > + select FW_CFG > > config I440FX > bool > @@ -106,6 +107,7 @@ config MICROVM > select ACPI_HW_REDUCED > select PCI_EXPRESS_GENERIC_BRIDGE > select USB_XHCI_SYSBUS > + select FW_CFG > > config X86_IOMMU > bool > diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig > index d11dc30509d..a7ba8283bf1 100644 > --- a/hw/ppc/Kconfig > +++ b/hw/ppc/Kconfig > @@ -131,6 +131,7 @@ config VIRTEX > # Only used by 64-bit targets > config FW_CFG_PPC > bool > + select FW_CFG Why do we need a separate config option here if all it does is select FW_CFG and also in meson.build it only seems to add fw_cfg.c? (Unlike FW_CFG_DMA which seems to add other files so another option makes sense for that case). Could we just use FW_CFG directly and drop the PPC specific option like you did for MIPS? Also the comment saying "Only used by 64-bit targets" seems to be wrong as it is also selected by MAC_OLDWORLD that's definitely a 32-bit machine (and MAC_NEWWORLD that can be both 32 or 64 bit) so maybe this option used to do something previously but now seems to be equivalent to just FW_CFG. So could it be dropped and use FW_CFG instead to simplify this or what's the reason to keep a PPC specific option for it? Regards, BALATON Zoltan > > config FDT_PPC > bool > diff --git a/hw/sparc/Kconfig b/hw/sparc/Kconfig > index 8dcb10086fd..267bf45fa21 100644 > --- a/hw/sparc/Kconfig > +++ b/hw/sparc/Kconfig > @@ -15,6 +15,7 @@ config SUN4M > select STP2000 > select CHRP_NVRAM > select OR_IRQ > + select FW_CFG > > config LEON3 > bool > diff --git a/hw/sparc64/Kconfig b/hw/sparc64/Kconfig > index 980a201bb73..c17b34b9d5b 100644 > --- a/hw/sparc64/Kconfig > +++ b/hw/sparc64/Kconfig > @@ -13,6 +13,7 @@ config SUN4U > select PCKBD > select SIMBA > select CHRP_NVRAM > + select FW_CFG > > config NIAGARA > bool > ^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 5/7] hw: Have machines Kconfig-select FW_CFG @ 2021-04-26 22:03 ` BALATON Zoltan 0 siblings, 0 replies; 34+ messages in thread From: BALATON Zoltan @ 2021-04-26 22:03 UTC (permalink / raw) To: Philippe Mathieu-Daudé Cc: qemu-devel, Peter Maydell, Thomas Huth, qemu-riscv, Eduardo Habkost, Michael S. Tsirkin, Helge Deller, Richard Henderson, Greg Kurz, qemu-arm, qemu-ppc, Gerd Hoffmann, Marcel Apfelbaum, Paolo Bonzini, Laszlo Ersek, Artyom Tarasenko, David Gibson [-- Attachment #1: Type: text/plain, Size: 3466 bytes --] On Mon, 26 Apr 2021, Philippe Mathieu-Daudé wrote: > Beside the loongson3-virt machine (MIPS), the following machines > also use the fw_cfg device: > > - ARM: virt & sbsa-ref > - HPPA: generic machine > - X86: ACPI based (pc & microvm) > - PPC64: various > - SPARC: sun4m & sun4u > > Add their FW_CFG Kconfig dependency. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> > --- > hw/arm/Kconfig | 2 ++ > hw/hppa/Kconfig | 1 + > hw/i386/Kconfig | 2 ++ > hw/ppc/Kconfig | 1 + > hw/sparc/Kconfig | 1 + > hw/sparc64/Kconfig | 1 + > 6 files changed, 8 insertions(+) > > diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig > index 8c37cf00da7..3b2641e39dc 100644 > --- a/hw/arm/Kconfig > +++ b/hw/arm/Kconfig > @@ -8,6 +8,7 @@ config ARM_VIRT > imply TPM_TIS_SYSBUS > select ARM_GIC > select ACPI > + select FW_CFG > select ARM_SMMUV3 > select GPIO_KEY > select FW_CFG_DMA > @@ -216,6 +217,7 @@ config SBSA_REF > select PL061 # GPIO > select USB_EHCI_SYSBUS > select WDT_SBSA > + select FW_CFG > > config SABRELITE > bool > diff --git a/hw/hppa/Kconfig b/hw/hppa/Kconfig > index 22948db0256..45f40e09224 100644 > --- a/hw/hppa/Kconfig > +++ b/hw/hppa/Kconfig > @@ -14,3 +14,4 @@ config DINO > select LASIPS2 > select PARALLEL > select ARTIST > + select FW_CFG > diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig > index 7f91f30877f..9e4039a2dce 100644 > --- a/hw/i386/Kconfig > +++ b/hw/i386/Kconfig > @@ -52,6 +52,7 @@ config PC_ACPI > select SMBUS_EEPROM > select PFLASH_CFI01 > depends on ACPI_SMBUS > + select FW_CFG > > config I440FX > bool > @@ -106,6 +107,7 @@ config MICROVM > select ACPI_HW_REDUCED > select PCI_EXPRESS_GENERIC_BRIDGE > select USB_XHCI_SYSBUS > + select FW_CFG > > config X86_IOMMU > bool > diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig > index d11dc30509d..a7ba8283bf1 100644 > --- a/hw/ppc/Kconfig > +++ b/hw/ppc/Kconfig > @@ -131,6 +131,7 @@ config VIRTEX > # Only used by 64-bit targets > config FW_CFG_PPC > bool > + select FW_CFG Why do we need a separate config option here if all it does is select FW_CFG and also in meson.build it only seems to add fw_cfg.c? (Unlike FW_CFG_DMA which seems to add other files so another option makes sense for that case). Could we just use FW_CFG directly and drop the PPC specific option like you did for MIPS? Also the comment saying "Only used by 64-bit targets" seems to be wrong as it is also selected by MAC_OLDWORLD that's definitely a 32-bit machine (and MAC_NEWWORLD that can be both 32 or 64 bit) so maybe this option used to do something previously but now seems to be equivalent to just FW_CFG. So could it be dropped and use FW_CFG instead to simplify this or what's the reason to keep a PPC specific option for it? Regards, BALATON Zoltan > > config FDT_PPC > bool > diff --git a/hw/sparc/Kconfig b/hw/sparc/Kconfig > index 8dcb10086fd..267bf45fa21 100644 > --- a/hw/sparc/Kconfig > +++ b/hw/sparc/Kconfig > @@ -15,6 +15,7 @@ config SUN4M > select STP2000 > select CHRP_NVRAM > select OR_IRQ > + select FW_CFG > > config LEON3 > bool > diff --git a/hw/sparc64/Kconfig b/hw/sparc64/Kconfig > index 980a201bb73..c17b34b9d5b 100644 > --- a/hw/sparc64/Kconfig > +++ b/hw/sparc64/Kconfig > @@ -13,6 +13,7 @@ config SUN4U > select PCKBD > select SIMBA > select CHRP_NVRAM > + select FW_CFG > > config NIAGARA > bool > ^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 5/7] hw: Have machines Kconfig-select FW_CFG 2021-04-26 22:03 ` BALATON Zoltan @ 2021-04-27 1:56 ` David Gibson -1 siblings, 0 replies; 34+ messages in thread From: David Gibson @ 2021-04-27 1:56 UTC (permalink / raw) To: BALATON Zoltan Cc: Peter Maydell, Thomas Huth, qemu-riscv, Eduardo Habkost, Michael S. Tsirkin, Laszlo Ersek, Helge Deller, Richard Henderson, qemu-devel, Greg Kurz, qemu-arm, qemu-ppc, Gerd Hoffmann, Paolo Bonzini, Philippe Mathieu-Daudé, Artyom Tarasenko [-- Attachment #1: Type: text/plain, Size: 4189 bytes --] On Tue, Apr 27, 2021 at 12:03:42AM +0200, BALATON Zoltan wrote: > On Mon, 26 Apr 2021, Philippe Mathieu-Daudé wrote: > > Beside the loongson3-virt machine (MIPS), the following machines > > also use the fw_cfg device: > > > > - ARM: virt & sbsa-ref > > - HPPA: generic machine > > - X86: ACPI based (pc & microvm) > > - PPC64: various > > - SPARC: sun4m & sun4u > > > > Add their FW_CFG Kconfig dependency. > > > > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> > > --- > > hw/arm/Kconfig | 2 ++ > > hw/hppa/Kconfig | 1 + > > hw/i386/Kconfig | 2 ++ > > hw/ppc/Kconfig | 1 + > > hw/sparc/Kconfig | 1 + > > hw/sparc64/Kconfig | 1 + > > 6 files changed, 8 insertions(+) > > > > diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig > > index 8c37cf00da7..3b2641e39dc 100644 > > --- a/hw/arm/Kconfig > > +++ b/hw/arm/Kconfig > > @@ -8,6 +8,7 @@ config ARM_VIRT > > imply TPM_TIS_SYSBUS > > select ARM_GIC > > select ACPI > > + select FW_CFG > > select ARM_SMMUV3 > > select GPIO_KEY > > select FW_CFG_DMA > > @@ -216,6 +217,7 @@ config SBSA_REF > > select PL061 # GPIO > > select USB_EHCI_SYSBUS > > select WDT_SBSA > > + select FW_CFG > > > > config SABRELITE > > bool > > diff --git a/hw/hppa/Kconfig b/hw/hppa/Kconfig > > index 22948db0256..45f40e09224 100644 > > --- a/hw/hppa/Kconfig > > +++ b/hw/hppa/Kconfig > > @@ -14,3 +14,4 @@ config DINO > > select LASIPS2 > > select PARALLEL > > select ARTIST > > + select FW_CFG > > diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig > > index 7f91f30877f..9e4039a2dce 100644 > > --- a/hw/i386/Kconfig > > +++ b/hw/i386/Kconfig > > @@ -52,6 +52,7 @@ config PC_ACPI > > select SMBUS_EEPROM > > select PFLASH_CFI01 > > depends on ACPI_SMBUS > > + select FW_CFG > > > > config I440FX > > bool > > @@ -106,6 +107,7 @@ config MICROVM > > select ACPI_HW_REDUCED > > select PCI_EXPRESS_GENERIC_BRIDGE > > select USB_XHCI_SYSBUS > > + select FW_CFG > > > > config X86_IOMMU > > bool > > diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig > > index d11dc30509d..a7ba8283bf1 100644 > > --- a/hw/ppc/Kconfig > > +++ b/hw/ppc/Kconfig > > @@ -131,6 +131,7 @@ config VIRTEX > > # Only used by 64-bit targets > > config FW_CFG_PPC > > bool > > + select FW_CFG > > Why do we need a separate config option here if all it does is select FW_CFG > and also in meson.build it only seems to add fw_cfg.c? (Unlike FW_CFG_DMA > which seems to add other files so another option makes sense for that case). > Could we just use FW_CFG directly and drop the PPC specific option like you > did for MIPS? > > Also the comment saying "Only used by 64-bit targets" seems to be wrong as > it is also selected by MAC_OLDWORLD that's definitely a 32-bit machine (and > MAC_NEWWORLD that can be both 32 or 64 bit) so maybe this option used to do > something previously but now seems to be equivalent to just FW_CFG. So could > it be dropped and use FW_CFG instead to simplify this or what's the reason > to keep a PPC specific option for it? Actually... good point. I don't see any reason for this config option either. > > Regards, > BALATON Zoltan > > > > > config FDT_PPC > > bool > > diff --git a/hw/sparc/Kconfig b/hw/sparc/Kconfig > > index 8dcb10086fd..267bf45fa21 100644 > > --- a/hw/sparc/Kconfig > > +++ b/hw/sparc/Kconfig > > @@ -15,6 +15,7 @@ config SUN4M > > select STP2000 > > select CHRP_NVRAM > > select OR_IRQ > > + select FW_CFG > > > > config LEON3 > > bool > > diff --git a/hw/sparc64/Kconfig b/hw/sparc64/Kconfig > > index 980a201bb73..c17b34b9d5b 100644 > > --- a/hw/sparc64/Kconfig > > +++ b/hw/sparc64/Kconfig > > @@ -13,6 +13,7 @@ config SUN4U > > select PCKBD > > select SIMBA > > select CHRP_NVRAM > > + select FW_CFG > > > > config NIAGARA > > bool > > -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 5/7] hw: Have machines Kconfig-select FW_CFG @ 2021-04-27 1:56 ` David Gibson 0 siblings, 0 replies; 34+ messages in thread From: David Gibson @ 2021-04-27 1:56 UTC (permalink / raw) To: BALATON Zoltan Cc: Philippe Mathieu-Daudé, qemu-devel, Peter Maydell, Thomas Huth, qemu-riscv, Eduardo Habkost, Michael S. Tsirkin, Helge Deller, Richard Henderson, Greg Kurz, qemu-arm, qemu-ppc, Gerd Hoffmann, Marcel Apfelbaum, Paolo Bonzini, Laszlo Ersek, Artyom Tarasenko [-- Attachment #1: Type: text/plain, Size: 4189 bytes --] On Tue, Apr 27, 2021 at 12:03:42AM +0200, BALATON Zoltan wrote: > On Mon, 26 Apr 2021, Philippe Mathieu-Daudé wrote: > > Beside the loongson3-virt machine (MIPS), the following machines > > also use the fw_cfg device: > > > > - ARM: virt & sbsa-ref > > - HPPA: generic machine > > - X86: ACPI based (pc & microvm) > > - PPC64: various > > - SPARC: sun4m & sun4u > > > > Add their FW_CFG Kconfig dependency. > > > > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> > > --- > > hw/arm/Kconfig | 2 ++ > > hw/hppa/Kconfig | 1 + > > hw/i386/Kconfig | 2 ++ > > hw/ppc/Kconfig | 1 + > > hw/sparc/Kconfig | 1 + > > hw/sparc64/Kconfig | 1 + > > 6 files changed, 8 insertions(+) > > > > diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig > > index 8c37cf00da7..3b2641e39dc 100644 > > --- a/hw/arm/Kconfig > > +++ b/hw/arm/Kconfig > > @@ -8,6 +8,7 @@ config ARM_VIRT > > imply TPM_TIS_SYSBUS > > select ARM_GIC > > select ACPI > > + select FW_CFG > > select ARM_SMMUV3 > > select GPIO_KEY > > select FW_CFG_DMA > > @@ -216,6 +217,7 @@ config SBSA_REF > > select PL061 # GPIO > > select USB_EHCI_SYSBUS > > select WDT_SBSA > > + select FW_CFG > > > > config SABRELITE > > bool > > diff --git a/hw/hppa/Kconfig b/hw/hppa/Kconfig > > index 22948db0256..45f40e09224 100644 > > --- a/hw/hppa/Kconfig > > +++ b/hw/hppa/Kconfig > > @@ -14,3 +14,4 @@ config DINO > > select LASIPS2 > > select PARALLEL > > select ARTIST > > + select FW_CFG > > diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig > > index 7f91f30877f..9e4039a2dce 100644 > > --- a/hw/i386/Kconfig > > +++ b/hw/i386/Kconfig > > @@ -52,6 +52,7 @@ config PC_ACPI > > select SMBUS_EEPROM > > select PFLASH_CFI01 > > depends on ACPI_SMBUS > > + select FW_CFG > > > > config I440FX > > bool > > @@ -106,6 +107,7 @@ config MICROVM > > select ACPI_HW_REDUCED > > select PCI_EXPRESS_GENERIC_BRIDGE > > select USB_XHCI_SYSBUS > > + select FW_CFG > > > > config X86_IOMMU > > bool > > diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig > > index d11dc30509d..a7ba8283bf1 100644 > > --- a/hw/ppc/Kconfig > > +++ b/hw/ppc/Kconfig > > @@ -131,6 +131,7 @@ config VIRTEX > > # Only used by 64-bit targets > > config FW_CFG_PPC > > bool > > + select FW_CFG > > Why do we need a separate config option here if all it does is select FW_CFG > and also in meson.build it only seems to add fw_cfg.c? (Unlike FW_CFG_DMA > which seems to add other files so another option makes sense for that case). > Could we just use FW_CFG directly and drop the PPC specific option like you > did for MIPS? > > Also the comment saying "Only used by 64-bit targets" seems to be wrong as > it is also selected by MAC_OLDWORLD that's definitely a 32-bit machine (and > MAC_NEWWORLD that can be both 32 or 64 bit) so maybe this option used to do > something previously but now seems to be equivalent to just FW_CFG. So could > it be dropped and use FW_CFG instead to simplify this or what's the reason > to keep a PPC specific option for it? Actually... good point. I don't see any reason for this config option either. > > Regards, > BALATON Zoltan > > > > > config FDT_PPC > > bool > > diff --git a/hw/sparc/Kconfig b/hw/sparc/Kconfig > > index 8dcb10086fd..267bf45fa21 100644 > > --- a/hw/sparc/Kconfig > > +++ b/hw/sparc/Kconfig > > @@ -15,6 +15,7 @@ config SUN4M > > select STP2000 > > select CHRP_NVRAM > > select OR_IRQ > > + select FW_CFG > > > > config LEON3 > > bool > > diff --git a/hw/sparc64/Kconfig b/hw/sparc64/Kconfig > > index 980a201bb73..c17b34b9d5b 100644 > > --- a/hw/sparc64/Kconfig > > +++ b/hw/sparc64/Kconfig > > @@ -13,6 +13,7 @@ config SUN4U > > select PCKBD > > select SIMBA > > select CHRP_NVRAM > > + select FW_CFG > > > > config NIAGARA > > bool > > -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 5/7] hw: Have machines Kconfig-select FW_CFG 2021-04-26 19:35 ` Philippe Mathieu-Daudé @ 2021-04-27 1:54 ` David Gibson -1 siblings, 0 replies; 34+ messages in thread From: David Gibson @ 2021-04-27 1:54 UTC (permalink / raw) To: Philippe Mathieu-Daudé Cc: Peter Maydell, Thomas Huth, qemu-riscv, Eduardo Habkost, Michael S. Tsirkin, Mark Cave-Ayland, Helge Deller, Richard Henderson, qemu-devel, Greg Kurz, qemu-arm, qemu-ppc, Gerd Hoffmann, Paolo Bonzini, Laszlo Ersek, Artyom Tarasenko [-- Attachment #1: Type: text/plain, Size: 3146 bytes --] On Mon, Apr 26, 2021 at 09:35:18PM +0200, Philippe Mathieu-Daudé wrote: > Beside the loongson3-virt machine (MIPS), the following machines > also use the fw_cfg device: > > - ARM: virt & sbsa-ref > - HPPA: generic machine > - X86: ACPI based (pc & microvm) > - PPC64: various > - SPARC: sun4m & sun4u > > Add their FW_CFG Kconfig dependency. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> ppc parts Acked-by: David Gibson <david@gibson.dropbear.id.au> > --- > hw/arm/Kconfig | 2 ++ > hw/hppa/Kconfig | 1 + > hw/i386/Kconfig | 2 ++ > hw/ppc/Kconfig | 1 + > hw/sparc/Kconfig | 1 + > hw/sparc64/Kconfig | 1 + > 6 files changed, 8 insertions(+) > > diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig > index 8c37cf00da7..3b2641e39dc 100644 > --- a/hw/arm/Kconfig > +++ b/hw/arm/Kconfig > @@ -8,6 +8,7 @@ config ARM_VIRT > imply TPM_TIS_SYSBUS > select ARM_GIC > select ACPI > + select FW_CFG > select ARM_SMMUV3 > select GPIO_KEY > select FW_CFG_DMA > @@ -216,6 +217,7 @@ config SBSA_REF > select PL061 # GPIO > select USB_EHCI_SYSBUS > select WDT_SBSA > + select FW_CFG > > config SABRELITE > bool > diff --git a/hw/hppa/Kconfig b/hw/hppa/Kconfig > index 22948db0256..45f40e09224 100644 > --- a/hw/hppa/Kconfig > +++ b/hw/hppa/Kconfig > @@ -14,3 +14,4 @@ config DINO > select LASIPS2 > select PARALLEL > select ARTIST > + select FW_CFG > diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig > index 7f91f30877f..9e4039a2dce 100644 > --- a/hw/i386/Kconfig > +++ b/hw/i386/Kconfig > @@ -52,6 +52,7 @@ config PC_ACPI > select SMBUS_EEPROM > select PFLASH_CFI01 > depends on ACPI_SMBUS > + select FW_CFG > > config I440FX > bool > @@ -106,6 +107,7 @@ config MICROVM > select ACPI_HW_REDUCED > select PCI_EXPRESS_GENERIC_BRIDGE > select USB_XHCI_SYSBUS > + select FW_CFG > > config X86_IOMMU > bool > diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig > index d11dc30509d..a7ba8283bf1 100644 > --- a/hw/ppc/Kconfig > +++ b/hw/ppc/Kconfig > @@ -131,6 +131,7 @@ config VIRTEX > # Only used by 64-bit targets > config FW_CFG_PPC > bool > + select FW_CFG > > config FDT_PPC > bool > diff --git a/hw/sparc/Kconfig b/hw/sparc/Kconfig > index 8dcb10086fd..267bf45fa21 100644 > --- a/hw/sparc/Kconfig > +++ b/hw/sparc/Kconfig > @@ -15,6 +15,7 @@ config SUN4M > select STP2000 > select CHRP_NVRAM > select OR_IRQ > + select FW_CFG > > config LEON3 > bool > diff --git a/hw/sparc64/Kconfig b/hw/sparc64/Kconfig > index 980a201bb73..c17b34b9d5b 100644 > --- a/hw/sparc64/Kconfig > +++ b/hw/sparc64/Kconfig > @@ -13,6 +13,7 @@ config SUN4U > select PCKBD > select SIMBA > select CHRP_NVRAM > + select FW_CFG > > config NIAGARA > bool -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 5/7] hw: Have machines Kconfig-select FW_CFG @ 2021-04-27 1:54 ` David Gibson 0 siblings, 0 replies; 34+ messages in thread From: David Gibson @ 2021-04-27 1:54 UTC (permalink / raw) To: Philippe Mathieu-Daudé Cc: qemu-devel, Gerd Hoffmann, qemu-riscv, Laszlo Ersek, qemu-ppc, qemu-arm, Thomas Huth, Peter Maydell, Richard Henderson, Helge Deller, Michael S. Tsirkin, Marcel Apfelbaum, Paolo Bonzini, Eduardo Habkost, Greg Kurz, Mark Cave-Ayland, Artyom Tarasenko [-- Attachment #1: Type: text/plain, Size: 3146 bytes --] On Mon, Apr 26, 2021 at 09:35:18PM +0200, Philippe Mathieu-Daudé wrote: > Beside the loongson3-virt machine (MIPS), the following machines > also use the fw_cfg device: > > - ARM: virt & sbsa-ref > - HPPA: generic machine > - X86: ACPI based (pc & microvm) > - PPC64: various > - SPARC: sun4m & sun4u > > Add their FW_CFG Kconfig dependency. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> ppc parts Acked-by: David Gibson <david@gibson.dropbear.id.au> > --- > hw/arm/Kconfig | 2 ++ > hw/hppa/Kconfig | 1 + > hw/i386/Kconfig | 2 ++ > hw/ppc/Kconfig | 1 + > hw/sparc/Kconfig | 1 + > hw/sparc64/Kconfig | 1 + > 6 files changed, 8 insertions(+) > > diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig > index 8c37cf00da7..3b2641e39dc 100644 > --- a/hw/arm/Kconfig > +++ b/hw/arm/Kconfig > @@ -8,6 +8,7 @@ config ARM_VIRT > imply TPM_TIS_SYSBUS > select ARM_GIC > select ACPI > + select FW_CFG > select ARM_SMMUV3 > select GPIO_KEY > select FW_CFG_DMA > @@ -216,6 +217,7 @@ config SBSA_REF > select PL061 # GPIO > select USB_EHCI_SYSBUS > select WDT_SBSA > + select FW_CFG > > config SABRELITE > bool > diff --git a/hw/hppa/Kconfig b/hw/hppa/Kconfig > index 22948db0256..45f40e09224 100644 > --- a/hw/hppa/Kconfig > +++ b/hw/hppa/Kconfig > @@ -14,3 +14,4 @@ config DINO > select LASIPS2 > select PARALLEL > select ARTIST > + select FW_CFG > diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig > index 7f91f30877f..9e4039a2dce 100644 > --- a/hw/i386/Kconfig > +++ b/hw/i386/Kconfig > @@ -52,6 +52,7 @@ config PC_ACPI > select SMBUS_EEPROM > select PFLASH_CFI01 > depends on ACPI_SMBUS > + select FW_CFG > > config I440FX > bool > @@ -106,6 +107,7 @@ config MICROVM > select ACPI_HW_REDUCED > select PCI_EXPRESS_GENERIC_BRIDGE > select USB_XHCI_SYSBUS > + select FW_CFG > > config X86_IOMMU > bool > diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig > index d11dc30509d..a7ba8283bf1 100644 > --- a/hw/ppc/Kconfig > +++ b/hw/ppc/Kconfig > @@ -131,6 +131,7 @@ config VIRTEX > # Only used by 64-bit targets > config FW_CFG_PPC > bool > + select FW_CFG > > config FDT_PPC > bool > diff --git a/hw/sparc/Kconfig b/hw/sparc/Kconfig > index 8dcb10086fd..267bf45fa21 100644 > --- a/hw/sparc/Kconfig > +++ b/hw/sparc/Kconfig > @@ -15,6 +15,7 @@ config SUN4M > select STP2000 > select CHRP_NVRAM > select OR_IRQ > + select FW_CFG > > config LEON3 > bool > diff --git a/hw/sparc64/Kconfig b/hw/sparc64/Kconfig > index 980a201bb73..c17b34b9d5b 100644 > --- a/hw/sparc64/Kconfig > +++ b/hw/sparc64/Kconfig > @@ -13,6 +13,7 @@ config SUN4U > select PCKBD > select SIMBA > select CHRP_NVRAM > + select FW_CFG > > config NIAGARA > bool -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 5/7] hw: Have machines Kconfig-select FW_CFG 2021-04-26 19:35 ` Philippe Mathieu-Daudé @ 2021-04-28 16:33 ` Laszlo Ersek -1 siblings, 0 replies; 34+ messages in thread From: Laszlo Ersek @ 2021-04-28 16:33 UTC (permalink / raw) To: Philippe Mathieu-Daudé, qemu-devel Cc: Peter Maydell, Thomas Huth, qemu-riscv, Eduardo Habkost, Michael S. Tsirkin, Mark Cave-Ayland, Helge Deller, Richard Henderson, Greg Kurz, qemu-arm, qemu-ppc, Gerd Hoffmann, Paolo Bonzini, Artyom Tarasenko, David Gibson On 04/26/21 21:35, Philippe Mathieu-Daudé wrote: > Beside the loongson3-virt machine (MIPS), the following machines > also use the fw_cfg device: > > - ARM: virt & sbsa-ref > - HPPA: generic machine > - X86: ACPI based (pc & microvm) It's correct, but the way this is formulated is confusing, for me anyway. Can you please write "(pc (i440fx, q35) & microvm)"? Because, we frequently use "pc" interchangeably with "i440fx", and so I was missing q35 from the list. Thanks Laszlo > - PPC64: various > - SPARC: sun4m & sun4u > > Add their FW_CFG Kconfig dependency. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> > --- > hw/arm/Kconfig | 2 ++ > hw/hppa/Kconfig | 1 + > hw/i386/Kconfig | 2 ++ > hw/ppc/Kconfig | 1 + > hw/sparc/Kconfig | 1 + > hw/sparc64/Kconfig | 1 + > 6 files changed, 8 insertions(+) > > diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig > index 8c37cf00da7..3b2641e39dc 100644 > --- a/hw/arm/Kconfig > +++ b/hw/arm/Kconfig > @@ -8,6 +8,7 @@ config ARM_VIRT > imply TPM_TIS_SYSBUS > select ARM_GIC > select ACPI > + select FW_CFG > select ARM_SMMUV3 > select GPIO_KEY > select FW_CFG_DMA > @@ -216,6 +217,7 @@ config SBSA_REF > select PL061 # GPIO > select USB_EHCI_SYSBUS > select WDT_SBSA > + select FW_CFG > > config SABRELITE > bool > diff --git a/hw/hppa/Kconfig b/hw/hppa/Kconfig > index 22948db0256..45f40e09224 100644 > --- a/hw/hppa/Kconfig > +++ b/hw/hppa/Kconfig > @@ -14,3 +14,4 @@ config DINO > select LASIPS2 > select PARALLEL > select ARTIST > + select FW_CFG > diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig > index 7f91f30877f..9e4039a2dce 100644 > --- a/hw/i386/Kconfig > +++ b/hw/i386/Kconfig > @@ -52,6 +52,7 @@ config PC_ACPI > select SMBUS_EEPROM > select PFLASH_CFI01 > depends on ACPI_SMBUS > + select FW_CFG > > config I440FX > bool > @@ -106,6 +107,7 @@ config MICROVM > select ACPI_HW_REDUCED > select PCI_EXPRESS_GENERIC_BRIDGE > select USB_XHCI_SYSBUS > + select FW_CFG > > config X86_IOMMU > bool > diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig > index d11dc30509d..a7ba8283bf1 100644 > --- a/hw/ppc/Kconfig > +++ b/hw/ppc/Kconfig > @@ -131,6 +131,7 @@ config VIRTEX > # Only used by 64-bit targets > config FW_CFG_PPC > bool > + select FW_CFG > > config FDT_PPC > bool > diff --git a/hw/sparc/Kconfig b/hw/sparc/Kconfig > index 8dcb10086fd..267bf45fa21 100644 > --- a/hw/sparc/Kconfig > +++ b/hw/sparc/Kconfig > @@ -15,6 +15,7 @@ config SUN4M > select STP2000 > select CHRP_NVRAM > select OR_IRQ > + select FW_CFG > > config LEON3 > bool > diff --git a/hw/sparc64/Kconfig b/hw/sparc64/Kconfig > index 980a201bb73..c17b34b9d5b 100644 > --- a/hw/sparc64/Kconfig > +++ b/hw/sparc64/Kconfig > @@ -13,6 +13,7 @@ config SUN4U > select PCKBD > select SIMBA > select CHRP_NVRAM > + select FW_CFG > > config NIAGARA > bool > ^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 5/7] hw: Have machines Kconfig-select FW_CFG @ 2021-04-28 16:33 ` Laszlo Ersek 0 siblings, 0 replies; 34+ messages in thread From: Laszlo Ersek @ 2021-04-28 16:33 UTC (permalink / raw) To: Philippe Mathieu-Daudé, qemu-devel Cc: Peter Maydell, Thomas Huth, qemu-riscv, Eduardo Habkost, Michael S. Tsirkin, Helge Deller, Richard Henderson, Greg Kurz, qemu-arm, qemu-ppc, Gerd Hoffmann, Paolo Bonzini, Mark Cave-Ayland, Artyom Tarasenko, David Gibson On 04/26/21 21:35, Philippe Mathieu-Daudé wrote: > Beside the loongson3-virt machine (MIPS), the following machines > also use the fw_cfg device: > > - ARM: virt & sbsa-ref > - HPPA: generic machine > - X86: ACPI based (pc & microvm) It's correct, but the way this is formulated is confusing, for me anyway. Can you please write "(pc (i440fx, q35) & microvm)"? Because, we frequently use "pc" interchangeably with "i440fx", and so I was missing q35 from the list. Thanks Laszlo > - PPC64: various > - SPARC: sun4m & sun4u > > Add their FW_CFG Kconfig dependency. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> > --- > hw/arm/Kconfig | 2 ++ > hw/hppa/Kconfig | 1 + > hw/i386/Kconfig | 2 ++ > hw/ppc/Kconfig | 1 + > hw/sparc/Kconfig | 1 + > hw/sparc64/Kconfig | 1 + > 6 files changed, 8 insertions(+) > > diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig > index 8c37cf00da7..3b2641e39dc 100644 > --- a/hw/arm/Kconfig > +++ b/hw/arm/Kconfig > @@ -8,6 +8,7 @@ config ARM_VIRT > imply TPM_TIS_SYSBUS > select ARM_GIC > select ACPI > + select FW_CFG > select ARM_SMMUV3 > select GPIO_KEY > select FW_CFG_DMA > @@ -216,6 +217,7 @@ config SBSA_REF > select PL061 # GPIO > select USB_EHCI_SYSBUS > select WDT_SBSA > + select FW_CFG > > config SABRELITE > bool > diff --git a/hw/hppa/Kconfig b/hw/hppa/Kconfig > index 22948db0256..45f40e09224 100644 > --- a/hw/hppa/Kconfig > +++ b/hw/hppa/Kconfig > @@ -14,3 +14,4 @@ config DINO > select LASIPS2 > select PARALLEL > select ARTIST > + select FW_CFG > diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig > index 7f91f30877f..9e4039a2dce 100644 > --- a/hw/i386/Kconfig > +++ b/hw/i386/Kconfig > @@ -52,6 +52,7 @@ config PC_ACPI > select SMBUS_EEPROM > select PFLASH_CFI01 > depends on ACPI_SMBUS > + select FW_CFG > > config I440FX > bool > @@ -106,6 +107,7 @@ config MICROVM > select ACPI_HW_REDUCED > select PCI_EXPRESS_GENERIC_BRIDGE > select USB_XHCI_SYSBUS > + select FW_CFG > > config X86_IOMMU > bool > diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig > index d11dc30509d..a7ba8283bf1 100644 > --- a/hw/ppc/Kconfig > +++ b/hw/ppc/Kconfig > @@ -131,6 +131,7 @@ config VIRTEX > # Only used by 64-bit targets > config FW_CFG_PPC > bool > + select FW_CFG > > config FDT_PPC > bool > diff --git a/hw/sparc/Kconfig b/hw/sparc/Kconfig > index 8dcb10086fd..267bf45fa21 100644 > --- a/hw/sparc/Kconfig > +++ b/hw/sparc/Kconfig > @@ -15,6 +15,7 @@ config SUN4M > select STP2000 > select CHRP_NVRAM > select OR_IRQ > + select FW_CFG > > config LEON3 > bool > diff --git a/hw/sparc64/Kconfig b/hw/sparc64/Kconfig > index 980a201bb73..c17b34b9d5b 100644 > --- a/hw/sparc64/Kconfig > +++ b/hw/sparc64/Kconfig > @@ -13,6 +13,7 @@ config SUN4U > select PCKBD > select SIMBA > select CHRP_NVRAM > + select FW_CFG > > config NIAGARA > bool > ^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 5/7] hw: Have machines Kconfig-select FW_CFG 2021-04-26 19:35 ` Philippe Mathieu-Daudé @ 2021-04-28 18:50 ` Eduardo Habkost -1 siblings, 0 replies; 34+ messages in thread From: Eduardo Habkost @ 2021-04-28 18:50 UTC (permalink / raw) To: Philippe Mathieu-Daudé Cc: Peter Maydell, Thomas Huth, qemu-riscv, Michael S. Tsirkin, Mark Cave-Ayland, Helge Deller, Richard Henderson, qemu-devel, Greg Kurz, qemu-arm, qemu-ppc, Gerd Hoffmann, Paolo Bonzini, Laszlo Ersek, Artyom Tarasenko, David Gibson On Mon, Apr 26, 2021 at 09:35:18PM +0200, Philippe Mathieu-Daudé wrote: > Beside the loongson3-virt machine (MIPS), the following machines > also use the fw_cfg device: > > - ARM: virt & sbsa-ref > - HPPA: generic machine > - X86: ACPI based (pc & microvm) > - PPC64: various > - SPARC: sun4m & sun4u > > Add their FW_CFG Kconfig dependency. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Eduardo Habkost <ehabkost@redhat.com> (i386) -- Eduardo ^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 5/7] hw: Have machines Kconfig-select FW_CFG @ 2021-04-28 18:50 ` Eduardo Habkost 0 siblings, 0 replies; 34+ messages in thread From: Eduardo Habkost @ 2021-04-28 18:50 UTC (permalink / raw) To: Philippe Mathieu-Daudé Cc: qemu-devel, Gerd Hoffmann, qemu-riscv, Laszlo Ersek, qemu-ppc, qemu-arm, Thomas Huth, Peter Maydell, Richard Henderson, Helge Deller, Michael S. Tsirkin, Marcel Apfelbaum, Paolo Bonzini, David Gibson, Greg Kurz, Mark Cave-Ayland, Artyom Tarasenko On Mon, Apr 26, 2021 at 09:35:18PM +0200, Philippe Mathieu-Daudé wrote: > Beside the loongson3-virt machine (MIPS), the following machines > also use the fw_cfg device: > > - ARM: virt & sbsa-ref > - HPPA: generic machine > - X86: ACPI based (pc & microvm) > - PPC64: various > - SPARC: sun4m & sun4u > > Add their FW_CFG Kconfig dependency. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Eduardo Habkost <ehabkost@redhat.com> (i386) -- Eduardo ^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 6/7] hw/{arm,hppa,riscv}: Add fw_cfg arch-specific stub 2021-04-26 19:35 ` Philippe Mathieu-Daudé @ 2021-04-26 19:35 ` Philippe Mathieu-Daudé -1 siblings, 0 replies; 34+ messages in thread From: Philippe Mathieu-Daudé @ 2021-04-26 19:35 UTC (permalink / raw) To: qemu-devel Cc: Peter Maydell, Thomas Huth, qemu-riscv, Sagar Karandikar, Philippe Mathieu-Daudé, Helge Deller, Richard Henderson, qemu-arm, qemu-ppc, Gerd Hoffmann, Bastian Koppelmann, Palmer Dabbelt, Alistair Francis, Laszlo Ersek The ARM, HPPA and RISC-V architectures don't declare any fw_cfg specific key. To simplify the buildsys machinery and allow building QEMU without the fw_cfg device (in the next commit), first add a per-architecture empty stub defining the fw_cfg_arch_key_name(). Update the MAINTAINERS section to cover the various target-specific fw_cfg.c files. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> --- hw/arm/fw_cfg.c | 19 +++++++++++++++++++ hw/hppa/fw_cfg.c | 19 +++++++++++++++++++ hw/riscv/fw_cfg.c | 19 +++++++++++++++++++ MAINTAINERS | 2 +- hw/arm/meson.build | 1 + hw/hppa/meson.build | 1 + hw/riscv/meson.build | 1 + 7 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 hw/arm/fw_cfg.c create mode 100644 hw/hppa/fw_cfg.c create mode 100644 hw/riscv/fw_cfg.c diff --git a/hw/arm/fw_cfg.c b/hw/arm/fw_cfg.c new file mode 100644 index 00000000000..de2bca9c76c --- /dev/null +++ b/hw/arm/fw_cfg.c @@ -0,0 +1,19 @@ +/* + * QEMU fw_cfg helpers (ARM specific) + * + * Copyright (c) 2021 Red Hat, Inc. + * + * Author: + * Philippe Mathieu-Daudé <philmd@redhat.com> + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "hw/mips/fw_cfg.h" +#include "hw/nvram/fw_cfg.h" + +const char *fw_cfg_arch_key_name(uint16_t key) +{ + return NULL; +} diff --git a/hw/hppa/fw_cfg.c b/hw/hppa/fw_cfg.c new file mode 100644 index 00000000000..322b03068c7 --- /dev/null +++ b/hw/hppa/fw_cfg.c @@ -0,0 +1,19 @@ +/* + * QEMU fw_cfg helpers (HPPA specific) + * + * Copyright (c) 2021 Red Hat, Inc. + * + * Author: + * Philippe Mathieu-Daudé <philmd@redhat.com> + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "hw/mips/fw_cfg.h" +#include "hw/nvram/fw_cfg.h" + +const char *fw_cfg_arch_key_name(uint16_t key) +{ + return NULL; +} diff --git a/hw/riscv/fw_cfg.c b/hw/riscv/fw_cfg.c new file mode 100644 index 00000000000..8e3d2a8bdea --- /dev/null +++ b/hw/riscv/fw_cfg.c @@ -0,0 +1,19 @@ +/* + * QEMU fw_cfg helpers (RISC-V specific) + * + * Copyright (c) 2021 Red Hat, Inc. + * + * Author: + * Philippe Mathieu-Daudé <philmd@redhat.com> + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "hw/mips/fw_cfg.h" +#include "hw/nvram/fw_cfg.h" + +const char *fw_cfg_arch_key_name(uint16_t key) +{ + return NULL; +} diff --git a/MAINTAINERS b/MAINTAINERS index 36055f14c59..ab8f030d4c0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2162,7 +2162,7 @@ R: Laszlo Ersek <lersek@redhat.com> R: Gerd Hoffmann <kraxel@redhat.com> S: Supported F: docs/specs/fw_cfg.txt -F: hw/nvram/fw_cfg*.c +F: hw/*/fw_cfg*.c F: stubs/fw_cfg.c F: include/hw/nvram/fw_cfg.h F: include/standard-headers/linux/qemu_fw_cfg.h diff --git a/hw/arm/meson.build b/hw/arm/meson.build index be39117b9b6..fd278de916f 100644 --- a/hw/arm/meson.build +++ b/hw/arm/meson.build @@ -1,6 +1,7 @@ arm_ss = ss.source_set() arm_ss.add(files('boot.c'), fdt) arm_ss.add(when: 'CONFIG_PLATFORM_BUS', if_true: files('sysbus-fdt.c')) +arm_ss.add(when: 'CONFIG_FW_CFG', if_true: files('fw_cfg.c')) arm_ss.add(when: 'CONFIG_ARM_VIRT', if_true: files('virt.c')) arm_ss.add(when: 'CONFIG_ACPI', if_true: files('virt-acpi-build.c')) arm_ss.add(when: 'CONFIG_DIGIC', if_true: files('digic_boards.c')) diff --git a/hw/hppa/meson.build b/hw/hppa/meson.build index 1deae83aee8..10494cc24b7 100644 --- a/hw/hppa/meson.build +++ b/hw/hppa/meson.build @@ -1,4 +1,5 @@ hppa_ss = ss.source_set() hppa_ss.add(when: 'CONFIG_DINO', if_true: files('pci.c', 'machine.c', 'dino.c', 'lasi.c')) +hppa_ss.add(when: 'CONFIG_FW_CFG', if_true: files('fw_cfg.c')) hw_arch += {'hppa': hppa_ss} diff --git a/hw/riscv/meson.build b/hw/riscv/meson.build index 275c0f7eb7c..ab4d3adb924 100644 --- a/hw/riscv/meson.build +++ b/hw/riscv/meson.build @@ -8,5 +8,6 @@ riscv_ss.add(when: 'CONFIG_SIFIVE_U', if_true: files('sifive_u.c')) riscv_ss.add(when: 'CONFIG_SPIKE', if_true: files('spike.c')) riscv_ss.add(when: 'CONFIG_MICROCHIP_PFSOC', if_true: files('microchip_pfsoc.c')) +riscv_ss.add(when: 'CONFIG_FW_CFG', if_true: files('fw_cfg.c')) hw_arch += {'riscv': riscv_ss} -- 2.26.3 ^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 6/7] hw/{arm,hppa,riscv}: Add fw_cfg arch-specific stub @ 2021-04-26 19:35 ` Philippe Mathieu-Daudé 0 siblings, 0 replies; 34+ messages in thread From: Philippe Mathieu-Daudé @ 2021-04-26 19:35 UTC (permalink / raw) To: qemu-devel Cc: Gerd Hoffmann, qemu-riscv, Laszlo Ersek, qemu-ppc, qemu-arm, Thomas Huth, Philippe Mathieu-Daudé, Peter Maydell, Richard Henderson, Helge Deller, Palmer Dabbelt, Alistair Francis, Sagar Karandikar, Bastian Koppelmann The ARM, HPPA and RISC-V architectures don't declare any fw_cfg specific key. To simplify the buildsys machinery and allow building QEMU without the fw_cfg device (in the next commit), first add a per-architecture empty stub defining the fw_cfg_arch_key_name(). Update the MAINTAINERS section to cover the various target-specific fw_cfg.c files. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> --- hw/arm/fw_cfg.c | 19 +++++++++++++++++++ hw/hppa/fw_cfg.c | 19 +++++++++++++++++++ hw/riscv/fw_cfg.c | 19 +++++++++++++++++++ MAINTAINERS | 2 +- hw/arm/meson.build | 1 + hw/hppa/meson.build | 1 + hw/riscv/meson.build | 1 + 7 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 hw/arm/fw_cfg.c create mode 100644 hw/hppa/fw_cfg.c create mode 100644 hw/riscv/fw_cfg.c diff --git a/hw/arm/fw_cfg.c b/hw/arm/fw_cfg.c new file mode 100644 index 00000000000..de2bca9c76c --- /dev/null +++ b/hw/arm/fw_cfg.c @@ -0,0 +1,19 @@ +/* + * QEMU fw_cfg helpers (ARM specific) + * + * Copyright (c) 2021 Red Hat, Inc. + * + * Author: + * Philippe Mathieu-Daudé <philmd@redhat.com> + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "hw/mips/fw_cfg.h" +#include "hw/nvram/fw_cfg.h" + +const char *fw_cfg_arch_key_name(uint16_t key) +{ + return NULL; +} diff --git a/hw/hppa/fw_cfg.c b/hw/hppa/fw_cfg.c new file mode 100644 index 00000000000..322b03068c7 --- /dev/null +++ b/hw/hppa/fw_cfg.c @@ -0,0 +1,19 @@ +/* + * QEMU fw_cfg helpers (HPPA specific) + * + * Copyright (c) 2021 Red Hat, Inc. + * + * Author: + * Philippe Mathieu-Daudé <philmd@redhat.com> + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "hw/mips/fw_cfg.h" +#include "hw/nvram/fw_cfg.h" + +const char *fw_cfg_arch_key_name(uint16_t key) +{ + return NULL; +} diff --git a/hw/riscv/fw_cfg.c b/hw/riscv/fw_cfg.c new file mode 100644 index 00000000000..8e3d2a8bdea --- /dev/null +++ b/hw/riscv/fw_cfg.c @@ -0,0 +1,19 @@ +/* + * QEMU fw_cfg helpers (RISC-V specific) + * + * Copyright (c) 2021 Red Hat, Inc. + * + * Author: + * Philippe Mathieu-Daudé <philmd@redhat.com> + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "hw/mips/fw_cfg.h" +#include "hw/nvram/fw_cfg.h" + +const char *fw_cfg_arch_key_name(uint16_t key) +{ + return NULL; +} diff --git a/MAINTAINERS b/MAINTAINERS index 36055f14c59..ab8f030d4c0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2162,7 +2162,7 @@ R: Laszlo Ersek <lersek@redhat.com> R: Gerd Hoffmann <kraxel@redhat.com> S: Supported F: docs/specs/fw_cfg.txt -F: hw/nvram/fw_cfg*.c +F: hw/*/fw_cfg*.c F: stubs/fw_cfg.c F: include/hw/nvram/fw_cfg.h F: include/standard-headers/linux/qemu_fw_cfg.h diff --git a/hw/arm/meson.build b/hw/arm/meson.build index be39117b9b6..fd278de916f 100644 --- a/hw/arm/meson.build +++ b/hw/arm/meson.build @@ -1,6 +1,7 @@ arm_ss = ss.source_set() arm_ss.add(files('boot.c'), fdt) arm_ss.add(when: 'CONFIG_PLATFORM_BUS', if_true: files('sysbus-fdt.c')) +arm_ss.add(when: 'CONFIG_FW_CFG', if_true: files('fw_cfg.c')) arm_ss.add(when: 'CONFIG_ARM_VIRT', if_true: files('virt.c')) arm_ss.add(when: 'CONFIG_ACPI', if_true: files('virt-acpi-build.c')) arm_ss.add(when: 'CONFIG_DIGIC', if_true: files('digic_boards.c')) diff --git a/hw/hppa/meson.build b/hw/hppa/meson.build index 1deae83aee8..10494cc24b7 100644 --- a/hw/hppa/meson.build +++ b/hw/hppa/meson.build @@ -1,4 +1,5 @@ hppa_ss = ss.source_set() hppa_ss.add(when: 'CONFIG_DINO', if_true: files('pci.c', 'machine.c', 'dino.c', 'lasi.c')) +hppa_ss.add(when: 'CONFIG_FW_CFG', if_true: files('fw_cfg.c')) hw_arch += {'hppa': hppa_ss} diff --git a/hw/riscv/meson.build b/hw/riscv/meson.build index 275c0f7eb7c..ab4d3adb924 100644 --- a/hw/riscv/meson.build +++ b/hw/riscv/meson.build @@ -8,5 +8,6 @@ riscv_ss.add(when: 'CONFIG_SIFIVE_U', if_true: files('sifive_u.c')) riscv_ss.add(when: 'CONFIG_SPIKE', if_true: files('spike.c')) riscv_ss.add(when: 'CONFIG_MICROCHIP_PFSOC', if_true: files('microchip_pfsoc.c')) +riscv_ss.add(when: 'CONFIG_FW_CFG', if_true: files('fw_cfg.c')) hw_arch += {'riscv': riscv_ss} -- 2.26.3 ^ permalink raw reply related [flat|nested] 34+ messages in thread
* Re: [PATCH 6/7] hw/{arm,hppa,riscv}: Add fw_cfg arch-specific stub 2021-04-26 19:35 ` Philippe Mathieu-Daudé @ 2021-04-28 16:44 ` Laszlo Ersek -1 siblings, 0 replies; 34+ messages in thread From: Laszlo Ersek @ 2021-04-28 16:44 UTC (permalink / raw) To: Philippe Mathieu-Daudé, qemu-devel Cc: Peter Maydell, Thomas Huth, qemu-riscv, Sagar Karandikar, Bastian Koppelmann, Helge Deller, Richard Henderson, qemu-arm, qemu-ppc, Gerd Hoffmann, Palmer Dabbelt, Alistair Francis On 04/26/21 21:35, Philippe Mathieu-Daudé wrote: > The ARM, HPPA and RISC-V architectures don't declare any fw_cfg > specific key. To simplify the buildsys machinery and allow building > QEMU without the fw_cfg device (in the next commit), first add a > per-architecture empty stub defining the fw_cfg_arch_key_name(). > > Update the MAINTAINERS section to cover the various target-specific > fw_cfg.c files. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> > --- > hw/arm/fw_cfg.c | 19 +++++++++++++++++++ > hw/hppa/fw_cfg.c | 19 +++++++++++++++++++ > hw/riscv/fw_cfg.c | 19 +++++++++++++++++++ > MAINTAINERS | 2 +- > hw/arm/meson.build | 1 + > hw/hppa/meson.build | 1 + > hw/riscv/meson.build | 1 + > 7 files changed, 61 insertions(+), 1 deletion(-) > create mode 100644 hw/arm/fw_cfg.c > create mode 100644 hw/hppa/fw_cfg.c > create mode 100644 hw/riscv/fw_cfg.c So, I haven't commented on the Kconfig symbol wrangling yet (my comment would be a blanket "Acked-by" anyway... sorry, not really my cup of tea), but at this point: I don't understand why we need to add *more code* (stubs / boilerplate) if our goal is (apparently) to build QEMU with *fewer* devices. Sorry for being dense. My total knowledge about stubs in QEMU is this: for some QMP methods (and for some QGA methods, dependent on OS), we need stubs. When they are invoked, they report "sorry, not implemented". That's it: all I know about stubs. So... the commit message here says "simplify the buildsys", and the next commit message says, paraphrased, "don't build fw_cfg unless we need it" -- but why does that require more C-language code? It seems like we have some function *calls* that shouldn't exist in an fw-cfg-less machine, in the first place. Again, sorry, I'm totally dense on this. Thanks Laszlo > > diff --git a/hw/arm/fw_cfg.c b/hw/arm/fw_cfg.c > new file mode 100644 > index 00000000000..de2bca9c76c > --- /dev/null > +++ b/hw/arm/fw_cfg.c > @@ -0,0 +1,19 @@ > +/* > + * QEMU fw_cfg helpers (ARM specific) > + * > + * Copyright (c) 2021 Red Hat, Inc. > + * > + * Author: > + * Philippe Mathieu-Daudé <philmd@redhat.com> > + * > + * SPDX-License-Identifier: GPL-2.0-or-later > + */ > + > +#include "qemu/osdep.h" > +#include "hw/mips/fw_cfg.h" > +#include "hw/nvram/fw_cfg.h" > + > +const char *fw_cfg_arch_key_name(uint16_t key) > +{ > + return NULL; > +} > diff --git a/hw/hppa/fw_cfg.c b/hw/hppa/fw_cfg.c > new file mode 100644 > index 00000000000..322b03068c7 > --- /dev/null > +++ b/hw/hppa/fw_cfg.c > @@ -0,0 +1,19 @@ > +/* > + * QEMU fw_cfg helpers (HPPA specific) > + * > + * Copyright (c) 2021 Red Hat, Inc. > + * > + * Author: > + * Philippe Mathieu-Daudé <philmd@redhat.com> > + * > + * SPDX-License-Identifier: GPL-2.0-or-later > + */ > + > +#include "qemu/osdep.h" > +#include "hw/mips/fw_cfg.h" > +#include "hw/nvram/fw_cfg.h" > + > +const char *fw_cfg_arch_key_name(uint16_t key) > +{ > + return NULL; > +} > diff --git a/hw/riscv/fw_cfg.c b/hw/riscv/fw_cfg.c > new file mode 100644 > index 00000000000..8e3d2a8bdea > --- /dev/null > +++ b/hw/riscv/fw_cfg.c > @@ -0,0 +1,19 @@ > +/* > + * QEMU fw_cfg helpers (RISC-V specific) > + * > + * Copyright (c) 2021 Red Hat, Inc. > + * > + * Author: > + * Philippe Mathieu-Daudé <philmd@redhat.com> > + * > + * SPDX-License-Identifier: GPL-2.0-or-later > + */ > + > +#include "qemu/osdep.h" > +#include "hw/mips/fw_cfg.h" > +#include "hw/nvram/fw_cfg.h" > + > +const char *fw_cfg_arch_key_name(uint16_t key) > +{ > + return NULL; > +} > diff --git a/MAINTAINERS b/MAINTAINERS > index 36055f14c59..ab8f030d4c0 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -2162,7 +2162,7 @@ R: Laszlo Ersek <lersek@redhat.com> > R: Gerd Hoffmann <kraxel@redhat.com> > S: Supported > F: docs/specs/fw_cfg.txt > -F: hw/nvram/fw_cfg*.c > +F: hw/*/fw_cfg*.c > F: stubs/fw_cfg.c > F: include/hw/nvram/fw_cfg.h > F: include/standard-headers/linux/qemu_fw_cfg.h > diff --git a/hw/arm/meson.build b/hw/arm/meson.build > index be39117b9b6..fd278de916f 100644 > --- a/hw/arm/meson.build > +++ b/hw/arm/meson.build > @@ -1,6 +1,7 @@ > arm_ss = ss.source_set() > arm_ss.add(files('boot.c'), fdt) > arm_ss.add(when: 'CONFIG_PLATFORM_BUS', if_true: files('sysbus-fdt.c')) > +arm_ss.add(when: 'CONFIG_FW_CFG', if_true: files('fw_cfg.c')) > arm_ss.add(when: 'CONFIG_ARM_VIRT', if_true: files('virt.c')) > arm_ss.add(when: 'CONFIG_ACPI', if_true: files('virt-acpi-build.c')) > arm_ss.add(when: 'CONFIG_DIGIC', if_true: files('digic_boards.c')) > diff --git a/hw/hppa/meson.build b/hw/hppa/meson.build > index 1deae83aee8..10494cc24b7 100644 > --- a/hw/hppa/meson.build > +++ b/hw/hppa/meson.build > @@ -1,4 +1,5 @@ > hppa_ss = ss.source_set() > hppa_ss.add(when: 'CONFIG_DINO', if_true: files('pci.c', 'machine.c', 'dino.c', 'lasi.c')) > +hppa_ss.add(when: 'CONFIG_FW_CFG', if_true: files('fw_cfg.c')) > > hw_arch += {'hppa': hppa_ss} > diff --git a/hw/riscv/meson.build b/hw/riscv/meson.build > index 275c0f7eb7c..ab4d3adb924 100644 > --- a/hw/riscv/meson.build > +++ b/hw/riscv/meson.build > @@ -8,5 +8,6 @@ > riscv_ss.add(when: 'CONFIG_SIFIVE_U', if_true: files('sifive_u.c')) > riscv_ss.add(when: 'CONFIG_SPIKE', if_true: files('spike.c')) > riscv_ss.add(when: 'CONFIG_MICROCHIP_PFSOC', if_true: files('microchip_pfsoc.c')) > +riscv_ss.add(when: 'CONFIG_FW_CFG', if_true: files('fw_cfg.c')) > > hw_arch += {'riscv': riscv_ss} > ^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 6/7] hw/{arm,hppa,riscv}: Add fw_cfg arch-specific stub @ 2021-04-28 16:44 ` Laszlo Ersek 0 siblings, 0 replies; 34+ messages in thread From: Laszlo Ersek @ 2021-04-28 16:44 UTC (permalink / raw) To: Philippe Mathieu-Daudé, qemu-devel Cc: Peter Maydell, Thomas Huth, qemu-riscv, Sagar Karandikar, Helge Deller, Richard Henderson, qemu-arm, qemu-ppc, Gerd Hoffmann, Bastian Koppelmann, Palmer Dabbelt, Alistair Francis On 04/26/21 21:35, Philippe Mathieu-Daudé wrote: > The ARM, HPPA and RISC-V architectures don't declare any fw_cfg > specific key. To simplify the buildsys machinery and allow building > QEMU without the fw_cfg device (in the next commit), first add a > per-architecture empty stub defining the fw_cfg_arch_key_name(). > > Update the MAINTAINERS section to cover the various target-specific > fw_cfg.c files. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> > --- > hw/arm/fw_cfg.c | 19 +++++++++++++++++++ > hw/hppa/fw_cfg.c | 19 +++++++++++++++++++ > hw/riscv/fw_cfg.c | 19 +++++++++++++++++++ > MAINTAINERS | 2 +- > hw/arm/meson.build | 1 + > hw/hppa/meson.build | 1 + > hw/riscv/meson.build | 1 + > 7 files changed, 61 insertions(+), 1 deletion(-) > create mode 100644 hw/arm/fw_cfg.c > create mode 100644 hw/hppa/fw_cfg.c > create mode 100644 hw/riscv/fw_cfg.c So, I haven't commented on the Kconfig symbol wrangling yet (my comment would be a blanket "Acked-by" anyway... sorry, not really my cup of tea), but at this point: I don't understand why we need to add *more code* (stubs / boilerplate) if our goal is (apparently) to build QEMU with *fewer* devices. Sorry for being dense. My total knowledge about stubs in QEMU is this: for some QMP methods (and for some QGA methods, dependent on OS), we need stubs. When they are invoked, they report "sorry, not implemented". That's it: all I know about stubs. So... the commit message here says "simplify the buildsys", and the next commit message says, paraphrased, "don't build fw_cfg unless we need it" -- but why does that require more C-language code? It seems like we have some function *calls* that shouldn't exist in an fw-cfg-less machine, in the first place. Again, sorry, I'm totally dense on this. Thanks Laszlo > > diff --git a/hw/arm/fw_cfg.c b/hw/arm/fw_cfg.c > new file mode 100644 > index 00000000000..de2bca9c76c > --- /dev/null > +++ b/hw/arm/fw_cfg.c > @@ -0,0 +1,19 @@ > +/* > + * QEMU fw_cfg helpers (ARM specific) > + * > + * Copyright (c) 2021 Red Hat, Inc. > + * > + * Author: > + * Philippe Mathieu-Daudé <philmd@redhat.com> > + * > + * SPDX-License-Identifier: GPL-2.0-or-later > + */ > + > +#include "qemu/osdep.h" > +#include "hw/mips/fw_cfg.h" > +#include "hw/nvram/fw_cfg.h" > + > +const char *fw_cfg_arch_key_name(uint16_t key) > +{ > + return NULL; > +} > diff --git a/hw/hppa/fw_cfg.c b/hw/hppa/fw_cfg.c > new file mode 100644 > index 00000000000..322b03068c7 > --- /dev/null > +++ b/hw/hppa/fw_cfg.c > @@ -0,0 +1,19 @@ > +/* > + * QEMU fw_cfg helpers (HPPA specific) > + * > + * Copyright (c) 2021 Red Hat, Inc. > + * > + * Author: > + * Philippe Mathieu-Daudé <philmd@redhat.com> > + * > + * SPDX-License-Identifier: GPL-2.0-or-later > + */ > + > +#include "qemu/osdep.h" > +#include "hw/mips/fw_cfg.h" > +#include "hw/nvram/fw_cfg.h" > + > +const char *fw_cfg_arch_key_name(uint16_t key) > +{ > + return NULL; > +} > diff --git a/hw/riscv/fw_cfg.c b/hw/riscv/fw_cfg.c > new file mode 100644 > index 00000000000..8e3d2a8bdea > --- /dev/null > +++ b/hw/riscv/fw_cfg.c > @@ -0,0 +1,19 @@ > +/* > + * QEMU fw_cfg helpers (RISC-V specific) > + * > + * Copyright (c) 2021 Red Hat, Inc. > + * > + * Author: > + * Philippe Mathieu-Daudé <philmd@redhat.com> > + * > + * SPDX-License-Identifier: GPL-2.0-or-later > + */ > + > +#include "qemu/osdep.h" > +#include "hw/mips/fw_cfg.h" > +#include "hw/nvram/fw_cfg.h" > + > +const char *fw_cfg_arch_key_name(uint16_t key) > +{ > + return NULL; > +} > diff --git a/MAINTAINERS b/MAINTAINERS > index 36055f14c59..ab8f030d4c0 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -2162,7 +2162,7 @@ R: Laszlo Ersek <lersek@redhat.com> > R: Gerd Hoffmann <kraxel@redhat.com> > S: Supported > F: docs/specs/fw_cfg.txt > -F: hw/nvram/fw_cfg*.c > +F: hw/*/fw_cfg*.c > F: stubs/fw_cfg.c > F: include/hw/nvram/fw_cfg.h > F: include/standard-headers/linux/qemu_fw_cfg.h > diff --git a/hw/arm/meson.build b/hw/arm/meson.build > index be39117b9b6..fd278de916f 100644 > --- a/hw/arm/meson.build > +++ b/hw/arm/meson.build > @@ -1,6 +1,7 @@ > arm_ss = ss.source_set() > arm_ss.add(files('boot.c'), fdt) > arm_ss.add(when: 'CONFIG_PLATFORM_BUS', if_true: files('sysbus-fdt.c')) > +arm_ss.add(when: 'CONFIG_FW_CFG', if_true: files('fw_cfg.c')) > arm_ss.add(when: 'CONFIG_ARM_VIRT', if_true: files('virt.c')) > arm_ss.add(when: 'CONFIG_ACPI', if_true: files('virt-acpi-build.c')) > arm_ss.add(when: 'CONFIG_DIGIC', if_true: files('digic_boards.c')) > diff --git a/hw/hppa/meson.build b/hw/hppa/meson.build > index 1deae83aee8..10494cc24b7 100644 > --- a/hw/hppa/meson.build > +++ b/hw/hppa/meson.build > @@ -1,4 +1,5 @@ > hppa_ss = ss.source_set() > hppa_ss.add(when: 'CONFIG_DINO', if_true: files('pci.c', 'machine.c', 'dino.c', 'lasi.c')) > +hppa_ss.add(when: 'CONFIG_FW_CFG', if_true: files('fw_cfg.c')) > > hw_arch += {'hppa': hppa_ss} > diff --git a/hw/riscv/meson.build b/hw/riscv/meson.build > index 275c0f7eb7c..ab4d3adb924 100644 > --- a/hw/riscv/meson.build > +++ b/hw/riscv/meson.build > @@ -8,5 +8,6 @@ > riscv_ss.add(when: 'CONFIG_SIFIVE_U', if_true: files('sifive_u.c')) > riscv_ss.add(when: 'CONFIG_SPIKE', if_true: files('spike.c')) > riscv_ss.add(when: 'CONFIG_MICROCHIP_PFSOC', if_true: files('microchip_pfsoc.c')) > +riscv_ss.add(when: 'CONFIG_FW_CFG', if_true: files('fw_cfg.c')) > > hw_arch += {'riscv': riscv_ss} > ^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 6/7] hw/{arm,hppa,riscv}: Add fw_cfg arch-specific stub 2021-04-28 16:44 ` Laszlo Ersek @ 2021-04-28 17:23 ` Philippe Mathieu-Daudé -1 siblings, 0 replies; 34+ messages in thread From: Philippe Mathieu-Daudé @ 2021-04-28 17:23 UTC (permalink / raw) To: Laszlo Ersek, qemu-devel Cc: Peter Maydell, Thomas Huth, qemu-riscv, Sagar Karandikar, Bastian Koppelmann, Helge Deller, Richard Henderson, qemu-arm, qemu-ppc, Gerd Hoffmann, Palmer Dabbelt, Alistair Francis On 4/28/21 6:44 PM, Laszlo Ersek wrote: > On 04/26/21 21:35, Philippe Mathieu-Daudé wrote: >> The ARM, HPPA and RISC-V architectures don't declare any fw_cfg >> specific key. To simplify the buildsys machinery and allow building >> QEMU without the fw_cfg device (in the next commit), first add a >> per-architecture empty stub defining the fw_cfg_arch_key_name(). >> >> Update the MAINTAINERS section to cover the various target-specific >> fw_cfg.c files. >> >> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> >> --- >> hw/arm/fw_cfg.c | 19 +++++++++++++++++++ >> hw/hppa/fw_cfg.c | 19 +++++++++++++++++++ >> hw/riscv/fw_cfg.c | 19 +++++++++++++++++++ >> MAINTAINERS | 2 +- >> hw/arm/meson.build | 1 + >> hw/hppa/meson.build | 1 + >> hw/riscv/meson.build | 1 + >> 7 files changed, 61 insertions(+), 1 deletion(-) >> create mode 100644 hw/arm/fw_cfg.c >> create mode 100644 hw/hppa/fw_cfg.c >> create mode 100644 hw/riscv/fw_cfg.c > > So, I haven't commented on the Kconfig symbol wrangling yet (my comment > would be a blanket "Acked-by" anyway... sorry, not really my cup of > tea), but at this point: > > I don't understand why we need to add *more code* (stubs / boilerplate) > if our goal is (apparently) to build QEMU with *fewer* devices. > > Sorry for being dense. My total knowledge about stubs in QEMU is this: > for some QMP methods (and for some QGA methods, dependent on OS), we > need stubs. When they are invoked, they report "sorry, not implemented". > That's it: all I know about stubs. > > So... the commit message here says "simplify the buildsys", and the next > commit message says, paraphrased, "don't build fw_cfg unless we need it" > -- but why does that require more C-language code? It seems like we have > some function *calls* that shouldn't exist in an fw-cfg-less machine, in > the first place. > > Again, sorry, I'm totally dense on this. Eh no problem, I don't like this neither. If you don't mind I'll reply in the patch 7/7. ^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 6/7] hw/{arm,hppa,riscv}: Add fw_cfg arch-specific stub @ 2021-04-28 17:23 ` Philippe Mathieu-Daudé 0 siblings, 0 replies; 34+ messages in thread From: Philippe Mathieu-Daudé @ 2021-04-28 17:23 UTC (permalink / raw) To: Laszlo Ersek, qemu-devel Cc: Peter Maydell, Thomas Huth, qemu-riscv, Sagar Karandikar, Helge Deller, Richard Henderson, qemu-arm, qemu-ppc, Gerd Hoffmann, Bastian Koppelmann, Palmer Dabbelt, Alistair Francis On 4/28/21 6:44 PM, Laszlo Ersek wrote: > On 04/26/21 21:35, Philippe Mathieu-Daudé wrote: >> The ARM, HPPA and RISC-V architectures don't declare any fw_cfg >> specific key. To simplify the buildsys machinery and allow building >> QEMU without the fw_cfg device (in the next commit), first add a >> per-architecture empty stub defining the fw_cfg_arch_key_name(). >> >> Update the MAINTAINERS section to cover the various target-specific >> fw_cfg.c files. >> >> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> >> --- >> hw/arm/fw_cfg.c | 19 +++++++++++++++++++ >> hw/hppa/fw_cfg.c | 19 +++++++++++++++++++ >> hw/riscv/fw_cfg.c | 19 +++++++++++++++++++ >> MAINTAINERS | 2 +- >> hw/arm/meson.build | 1 + >> hw/hppa/meson.build | 1 + >> hw/riscv/meson.build | 1 + >> 7 files changed, 61 insertions(+), 1 deletion(-) >> create mode 100644 hw/arm/fw_cfg.c >> create mode 100644 hw/hppa/fw_cfg.c >> create mode 100644 hw/riscv/fw_cfg.c > > So, I haven't commented on the Kconfig symbol wrangling yet (my comment > would be a blanket "Acked-by" anyway... sorry, not really my cup of > tea), but at this point: > > I don't understand why we need to add *more code* (stubs / boilerplate) > if our goal is (apparently) to build QEMU with *fewer* devices. > > Sorry for being dense. My total knowledge about stubs in QEMU is this: > for some QMP methods (and for some QGA methods, dependent on OS), we > need stubs. When they are invoked, they report "sorry, not implemented". > That's it: all I know about stubs. > > So... the commit message here says "simplify the buildsys", and the next > commit message says, paraphrased, "don't build fw_cfg unless we need it" > -- but why does that require more C-language code? It seems like we have > some function *calls* that shouldn't exist in an fw-cfg-less machine, in > the first place. > > Again, sorry, I'm totally dense on this. Eh no problem, I don't like this neither. If you don't mind I'll reply in the patch 7/7. ^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH 7/7] hw/nvram: Do not build FW_CFG if not required 2021-04-26 19:35 ` Philippe Mathieu-Daudé @ 2021-04-26 19:35 ` Philippe Mathieu-Daudé -1 siblings, 0 replies; 34+ messages in thread From: Philippe Mathieu-Daudé @ 2021-04-26 19:35 UTC (permalink / raw) To: qemu-devel Cc: Thomas Huth, qemu-riscv, Philippe Mathieu-Daudé, qemu-arm, qemu-ppc, Gerd Hoffmann, Paolo Bonzini, Laszlo Ersek If the Kconfig 'FW_CFG' symbol is not selected, it is pointless to build the fw_cfg device. Update the stubs. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> --- stubs/fw_cfg.c | 49 ++++++++++++++++++++++++++++++++++++++++++-- hw/nvram/meson.build | 2 +- 2 files changed, 48 insertions(+), 3 deletions(-) diff --git a/stubs/fw_cfg.c b/stubs/fw_cfg.c index bb1e3c8aa95..ac1e539c93f 100644 --- a/stubs/fw_cfg.c +++ b/stubs/fw_cfg.c @@ -1,7 +1,7 @@ /* * fw_cfg stubs * - * Copyright (c) 2019 Red Hat, Inc. + * Copyright (c) 2019,2021 Red Hat, Inc. * * Author: * Philippe Mathieu-Daudé <philmd@redhat.com> @@ -13,9 +13,54 @@ */ #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/nvram/fw_cfg.h" -const char *fw_cfg_arch_key_name(uint16_t key) +FWCfgState *fw_cfg_find(void) { return NULL; } + +bool fw_cfg_add_from_generator(FWCfgState *s, const char *filename, + const char *gen_id, Error **errp) +{ + error_setg(errp, "fw-cfg device not built in"); + + return true; +} + +void fw_cfg_add_file(FWCfgState *s, const char *filename, + void *data, size_t len) +{ + g_assert_not_reached(); +} + +void fw_cfg_add_file_callback(FWCfgState *s, const char *filename, + FWCfgCallback select_cb, + FWCfgWriteCallback write_cb, + void *callback_opaque, + void *data, size_t len, bool read_only) +{ + g_assert_not_reached(); +} + +void *fw_cfg_modify_file(FWCfgState *s, const char *filename, + void *data, size_t len) +{ + g_assert_not_reached(); +} + +void fw_cfg_set_order_override(FWCfgState *s, int order) +{ + g_assert_not_reached(); +} + +void fw_cfg_reset_order_override(FWCfgState *s) +{ + g_assert_not_reached(); +} + +bool fw_cfg_dma_enabled(void *opaque) +{ + g_assert_not_reached(); +} diff --git a/hw/nvram/meson.build b/hw/nvram/meson.build index fd2951a860f..99e12224483 100644 --- a/hw/nvram/meson.build +++ b/hw/nvram/meson.build @@ -1,7 +1,7 @@ # QOM interfaces must be available anytime QOM is used. qom_ss.add(files('fw_cfg-interface.c')) -softmmu_ss.add(files('fw_cfg.c')) +softmmu_ss.add(when: 'CONFIG_FW_CFG', if_true: files('fw_cfg.c')) softmmu_ss.add(when: 'CONFIG_CHRP_NVRAM', if_true: files('chrp_nvram.c')) softmmu_ss.add(when: 'CONFIG_DS1225Y', if_true: files('ds1225y.c')) softmmu_ss.add(when: 'CONFIG_NMC93XX_EEPROM', if_true: files('eeprom93xx.c')) -- 2.26.3 ^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH 7/7] hw/nvram: Do not build FW_CFG if not required @ 2021-04-26 19:35 ` Philippe Mathieu-Daudé 0 siblings, 0 replies; 34+ messages in thread From: Philippe Mathieu-Daudé @ 2021-04-26 19:35 UTC (permalink / raw) To: qemu-devel Cc: Gerd Hoffmann, qemu-riscv, Laszlo Ersek, qemu-ppc, qemu-arm, Thomas Huth, Philippe Mathieu-Daudé, Paolo Bonzini If the Kconfig 'FW_CFG' symbol is not selected, it is pointless to build the fw_cfg device. Update the stubs. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> --- stubs/fw_cfg.c | 49 ++++++++++++++++++++++++++++++++++++++++++-- hw/nvram/meson.build | 2 +- 2 files changed, 48 insertions(+), 3 deletions(-) diff --git a/stubs/fw_cfg.c b/stubs/fw_cfg.c index bb1e3c8aa95..ac1e539c93f 100644 --- a/stubs/fw_cfg.c +++ b/stubs/fw_cfg.c @@ -1,7 +1,7 @@ /* * fw_cfg stubs * - * Copyright (c) 2019 Red Hat, Inc. + * Copyright (c) 2019,2021 Red Hat, Inc. * * Author: * Philippe Mathieu-Daudé <philmd@redhat.com> @@ -13,9 +13,54 @@ */ #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/nvram/fw_cfg.h" -const char *fw_cfg_arch_key_name(uint16_t key) +FWCfgState *fw_cfg_find(void) { return NULL; } + +bool fw_cfg_add_from_generator(FWCfgState *s, const char *filename, + const char *gen_id, Error **errp) +{ + error_setg(errp, "fw-cfg device not built in"); + + return true; +} + +void fw_cfg_add_file(FWCfgState *s, const char *filename, + void *data, size_t len) +{ + g_assert_not_reached(); +} + +void fw_cfg_add_file_callback(FWCfgState *s, const char *filename, + FWCfgCallback select_cb, + FWCfgWriteCallback write_cb, + void *callback_opaque, + void *data, size_t len, bool read_only) +{ + g_assert_not_reached(); +} + +void *fw_cfg_modify_file(FWCfgState *s, const char *filename, + void *data, size_t len) +{ + g_assert_not_reached(); +} + +void fw_cfg_set_order_override(FWCfgState *s, int order) +{ + g_assert_not_reached(); +} + +void fw_cfg_reset_order_override(FWCfgState *s) +{ + g_assert_not_reached(); +} + +bool fw_cfg_dma_enabled(void *opaque) +{ + g_assert_not_reached(); +} diff --git a/hw/nvram/meson.build b/hw/nvram/meson.build index fd2951a860f..99e12224483 100644 --- a/hw/nvram/meson.build +++ b/hw/nvram/meson.build @@ -1,7 +1,7 @@ # QOM interfaces must be available anytime QOM is used. qom_ss.add(files('fw_cfg-interface.c')) -softmmu_ss.add(files('fw_cfg.c')) +softmmu_ss.add(when: 'CONFIG_FW_CFG', if_true: files('fw_cfg.c')) softmmu_ss.add(when: 'CONFIG_CHRP_NVRAM', if_true: files('chrp_nvram.c')) softmmu_ss.add(when: 'CONFIG_DS1225Y', if_true: files('ds1225y.c')) softmmu_ss.add(when: 'CONFIG_NMC93XX_EEPROM', if_true: files('eeprom93xx.c')) -- 2.26.3 ^ permalink raw reply related [flat|nested] 34+ messages in thread
* Re: [PATCH 7/7] hw/nvram: Do not build FW_CFG if not required 2021-04-26 19:35 ` Philippe Mathieu-Daudé @ 2021-04-28 17:29 ` Philippe Mathieu-Daudé -1 siblings, 0 replies; 34+ messages in thread From: Philippe Mathieu-Daudé @ 2021-04-28 17:29 UTC (permalink / raw) To: qemu-devel, Laszlo Ersek, Paolo Bonzini Cc: qemu-ppc, Thomas Huth, qemu-arm, qemu-riscv, Gerd Hoffmann On 4/26/21 9:35 PM, Philippe Mathieu-Daudé wrote: > If the Kconfig 'FW_CFG' symbol is not selected, it is pointless > to build the fw_cfg device. Update the stubs. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> > --- > stubs/fw_cfg.c | 49 ++++++++++++++++++++++++++++++++++++++++++-- > hw/nvram/meson.build | 2 +- > 2 files changed, 48 insertions(+), 3 deletions(-) Answering here to Laszlo's comment from: https://lists.gnu.org/archive/html/qemu-devel/2021-04/msg05858.html On 4/28/21 6:44 PM, Laszlo Ersek wrote: > I don't understand why we need to add *more code* (stubs / boilerplate) > if our goal is (apparently) to build QEMU with *fewer* devices. The list of callers: hw/acpi/bios-linker-loader.c:177: return fw_cfg && fw_cfg_dma_enabled(fw_cfg); hw/acpi/core.c:640: fw_cfg_add_file(fw_cfg, "etc/system-states", g_memdup(suspend, 6), 6); hw/acpi/ghes.c:383: fw_cfg_add_file(s, ACPI_GHES_ERRORS_FW_CFG_FILE, hardware_error->data, hw/acpi/ghes.c:387: fw_cfg_add_file_callback(s, ACPI_GHES_DATA_ADDR_FW_CFG_FILE, NULL, NULL, hw/acpi/nvdimm.c:912: fw_cfg_add_file(fw_cfg, NVDIMM_DSM_MEM_FILE, state->dsm_mem->data, hw/acpi/vmgenid.c:128: fw_cfg_add_file(s, VMGENID_GUID_FW_CFG_FILE, guid->data, hw/acpi/vmgenid.c:131: fw_cfg_add_file_callback(s, VMGENID_ADDR_FW_CFG_FILE, NULL, NULL, NULL, hw/arm/virt-acpi-build.c:870: fw_cfg_add_file(vms->fw_cfg, ACPI_BUILD_TPMLOG_FILE, tables.tcpalog->data, hw/arm/virt.c:1531: fw_cfg_add_file(vms->fw_cfg, "etc/smbios/smbios-tables", hw/arm/virt.c:1533: fw_cfg_add_file(vms->fw_cfg, "etc/smbios/smbios-anchor", hw/core/loader.c:1017: fw_cfg_add_file(fw_cfg, fw_file_name, data, rom->romsize); hw/core/loader.c:1074: fw_cfg_add_file_callback(fw_cfg, fw_file_name, hw/core/loader.c:1254: fw_cfg_set_order_override(fw_cfg, order); hw/core/loader.c:1261: fw_cfg_reset_order_override(fw_cfg); hw/core/loader.c:919: fw_cfg_modify_file(fw_cfg, id + strlen("/rom@"), host, length); hw/display/ramfb.c:131: fw_cfg_add_file_callback(fw_cfg, "etc/ramfb", hw/hppa/machine.c:104: fw_cfg_add_file(fw_cfg, "/etc/firmware-min-version", hw/hppa/machine.c:108: fw_cfg_add_file(fw_cfg, "/etc/cpu/tlb_entries", hw/hppa/machine.c:112: fw_cfg_add_file(fw_cfg, "/etc/cpu/btlb_entries", hw/hppa/machine.c:116: fw_cfg_add_file(fw_cfg, "/etc/power-button-addr", hw/i386/acpi-build.c:2638: fw_cfg_add_file(x86ms->fw_cfg, ACPI_BUILD_TPMLOG_FILE, hw/i386/acpi-build.c:2648: fw_cfg_add_file(x86ms->fw_cfg, "etc/tpm/config", hw/i386/acpi-build.c:2667: fw_cfg_add_file_callback(x86ms->fw_cfg, ACPI_BUILD_RSDP_FILE, hw/i386/fw_cfg.c:130: fw_cfg_add_file(fw_cfg, "etc/e820", e820_table, hw/i386/fw_cfg.c:181: fw_cfg_add_file(fw_cfg, "etc/msr_feature_control", val, sizeof(*val)); hw/i386/fw_cfg.c:85: fw_cfg_add_file(fw_cfg, "etc/smbios/smbios-tables", hw/i386/fw_cfg.c:87: fw_cfg_add_file(fw_cfg, "etc/smbios/smbios-anchor", hw/i386/microvm.c:329: fw_cfg_add_file(fw_cfg, "etc/e820", e820_table, hw/i386/pc.c:977: fw_cfg_add_file(fw_cfg, "etc/reserved-memory-end", val, sizeof(*val)); hw/i386/x86.c:1078: if (linuxboot_dma_enabled && fw_cfg_dma_enabled(fw_cfg)) { hw/isa/lpc_ich9.c:421: fw_cfg_add_file(fw_cfg, "etc/smi/supported-features", hw/isa/lpc_ich9.c:428: fw_cfg_add_file_callback(fw_cfg, "etc/smi/requested-features", hw/isa/lpc_ich9.c:433: fw_cfg_add_file_callback(fw_cfg, "etc/smi/features-ok", hw/misc/pvpanic-isa.c:60: fw_cfg_add_file(fw_cfg, "etc/pvpanic-port", pvpanic_port, hw/misc/vmcoreinfo.c:60: fw_cfg_add_file_callback(fw_cfg, FW_CFG_VMCOREINFO_FILENAME, hw/ppc/mac_newworld.c:526: fw_cfg_add_file(fw_cfg, "ndrv/qemu_vga.ndrv", ndrv_file, ndrv_size); hw/ppc/mac_oldworld.c:371: fw_cfg_add_file(fw_cfg, "ndrv/qemu_vga.ndrv", ndrv_file, ndrv_size); hw/vfio/igd.c:565: fw_cfg_add_file(fw_cfg_find(), "etc/igd-bdsm-size", hw/vfio/pci-quirks.c:1201: fw_cfg_add_file(fw_cfg_find(), "etc/igd-opregion", softmmu/vl.c:1183: if (!fw_cfg_add_from_generator(fw_cfg, name, gen_id, errp)) { softmmu/vl.c:1196: fw_cfg_set_order_override(fw_cfg, FW_CFG_ORDER_OVERRIDE_USER); softmmu/vl.c:1197: fw_cfg_add_file(fw_cfg, name, buf, size); softmmu/vl.c:1198: fw_cfg_reset_order_override(fw_cfg); From this list, I'd like to simplify hw/acpi/bios-linker-loader.c, but later. The remaining core components are hw/core/loader.c and softmmu/vl.c: hw/core/loader.c:1017: fw_cfg_add_file(fw_cfg, fw_file_name, data, rom->romsize); hw/core/loader.c:1074: fw_cfg_add_file_callback(fw_cfg, fw_file_name, hw/core/loader.c:1254: fw_cfg_set_order_override(fw_cfg, order); hw/core/loader.c:1261: fw_cfg_reset_order_override(fw_cfg); hw/core/loader.c:919: fw_cfg_modify_file(fw_cfg, id + strlen("/rom@"), host, length); softmmu/vl.c:1183: if (!fw_cfg_add_from_generator(fw_cfg, name, gen_id, errp)) { softmmu/vl.c:1196: fw_cfg_set_order_override(fw_cfg, FW_CFG_ORDER_OVERRIDE_USER); softmmu/vl.c:1197: fw_cfg_add_file(fw_cfg, name, buf, size); softmmu/vl.c:1198: fw_cfg_reset_order_override(fw_cfg); Bah, I thought vl.c was generic code, but it is target-specific, so we could add '#include CONFIG_DEVICES' and add more #ifdef'ry on CONFIG_FW_CFG. Less stubs VS more #ifdef'ry... It is not clear to me how to modularize this from the core code. TBC... Thanks, Phil. ^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH 7/7] hw/nvram: Do not build FW_CFG if not required @ 2021-04-28 17:29 ` Philippe Mathieu-Daudé 0 siblings, 0 replies; 34+ messages in thread From: Philippe Mathieu-Daudé @ 2021-04-28 17:29 UTC (permalink / raw) To: qemu-devel, Laszlo Ersek, Paolo Bonzini Cc: Gerd Hoffmann, qemu-riscv, qemu-ppc, qemu-arm, Thomas Huth On 4/26/21 9:35 PM, Philippe Mathieu-Daudé wrote: > If the Kconfig 'FW_CFG' symbol is not selected, it is pointless > to build the fw_cfg device. Update the stubs. > > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> > --- > stubs/fw_cfg.c | 49 ++++++++++++++++++++++++++++++++++++++++++-- > hw/nvram/meson.build | 2 +- > 2 files changed, 48 insertions(+), 3 deletions(-) Answering here to Laszlo's comment from: https://lists.gnu.org/archive/html/qemu-devel/2021-04/msg05858.html On 4/28/21 6:44 PM, Laszlo Ersek wrote: > I don't understand why we need to add *more code* (stubs / boilerplate) > if our goal is (apparently) to build QEMU with *fewer* devices. The list of callers: hw/acpi/bios-linker-loader.c:177: return fw_cfg && fw_cfg_dma_enabled(fw_cfg); hw/acpi/core.c:640: fw_cfg_add_file(fw_cfg, "etc/system-states", g_memdup(suspend, 6), 6); hw/acpi/ghes.c:383: fw_cfg_add_file(s, ACPI_GHES_ERRORS_FW_CFG_FILE, hardware_error->data, hw/acpi/ghes.c:387: fw_cfg_add_file_callback(s, ACPI_GHES_DATA_ADDR_FW_CFG_FILE, NULL, NULL, hw/acpi/nvdimm.c:912: fw_cfg_add_file(fw_cfg, NVDIMM_DSM_MEM_FILE, state->dsm_mem->data, hw/acpi/vmgenid.c:128: fw_cfg_add_file(s, VMGENID_GUID_FW_CFG_FILE, guid->data, hw/acpi/vmgenid.c:131: fw_cfg_add_file_callback(s, VMGENID_ADDR_FW_CFG_FILE, NULL, NULL, NULL, hw/arm/virt-acpi-build.c:870: fw_cfg_add_file(vms->fw_cfg, ACPI_BUILD_TPMLOG_FILE, tables.tcpalog->data, hw/arm/virt.c:1531: fw_cfg_add_file(vms->fw_cfg, "etc/smbios/smbios-tables", hw/arm/virt.c:1533: fw_cfg_add_file(vms->fw_cfg, "etc/smbios/smbios-anchor", hw/core/loader.c:1017: fw_cfg_add_file(fw_cfg, fw_file_name, data, rom->romsize); hw/core/loader.c:1074: fw_cfg_add_file_callback(fw_cfg, fw_file_name, hw/core/loader.c:1254: fw_cfg_set_order_override(fw_cfg, order); hw/core/loader.c:1261: fw_cfg_reset_order_override(fw_cfg); hw/core/loader.c:919: fw_cfg_modify_file(fw_cfg, id + strlen("/rom@"), host, length); hw/display/ramfb.c:131: fw_cfg_add_file_callback(fw_cfg, "etc/ramfb", hw/hppa/machine.c:104: fw_cfg_add_file(fw_cfg, "/etc/firmware-min-version", hw/hppa/machine.c:108: fw_cfg_add_file(fw_cfg, "/etc/cpu/tlb_entries", hw/hppa/machine.c:112: fw_cfg_add_file(fw_cfg, "/etc/cpu/btlb_entries", hw/hppa/machine.c:116: fw_cfg_add_file(fw_cfg, "/etc/power-button-addr", hw/i386/acpi-build.c:2638: fw_cfg_add_file(x86ms->fw_cfg, ACPI_BUILD_TPMLOG_FILE, hw/i386/acpi-build.c:2648: fw_cfg_add_file(x86ms->fw_cfg, "etc/tpm/config", hw/i386/acpi-build.c:2667: fw_cfg_add_file_callback(x86ms->fw_cfg, ACPI_BUILD_RSDP_FILE, hw/i386/fw_cfg.c:130: fw_cfg_add_file(fw_cfg, "etc/e820", e820_table, hw/i386/fw_cfg.c:181: fw_cfg_add_file(fw_cfg, "etc/msr_feature_control", val, sizeof(*val)); hw/i386/fw_cfg.c:85: fw_cfg_add_file(fw_cfg, "etc/smbios/smbios-tables", hw/i386/fw_cfg.c:87: fw_cfg_add_file(fw_cfg, "etc/smbios/smbios-anchor", hw/i386/microvm.c:329: fw_cfg_add_file(fw_cfg, "etc/e820", e820_table, hw/i386/pc.c:977: fw_cfg_add_file(fw_cfg, "etc/reserved-memory-end", val, sizeof(*val)); hw/i386/x86.c:1078: if (linuxboot_dma_enabled && fw_cfg_dma_enabled(fw_cfg)) { hw/isa/lpc_ich9.c:421: fw_cfg_add_file(fw_cfg, "etc/smi/supported-features", hw/isa/lpc_ich9.c:428: fw_cfg_add_file_callback(fw_cfg, "etc/smi/requested-features", hw/isa/lpc_ich9.c:433: fw_cfg_add_file_callback(fw_cfg, "etc/smi/features-ok", hw/misc/pvpanic-isa.c:60: fw_cfg_add_file(fw_cfg, "etc/pvpanic-port", pvpanic_port, hw/misc/vmcoreinfo.c:60: fw_cfg_add_file_callback(fw_cfg, FW_CFG_VMCOREINFO_FILENAME, hw/ppc/mac_newworld.c:526: fw_cfg_add_file(fw_cfg, "ndrv/qemu_vga.ndrv", ndrv_file, ndrv_size); hw/ppc/mac_oldworld.c:371: fw_cfg_add_file(fw_cfg, "ndrv/qemu_vga.ndrv", ndrv_file, ndrv_size); hw/vfio/igd.c:565: fw_cfg_add_file(fw_cfg_find(), "etc/igd-bdsm-size", hw/vfio/pci-quirks.c:1201: fw_cfg_add_file(fw_cfg_find(), "etc/igd-opregion", softmmu/vl.c:1183: if (!fw_cfg_add_from_generator(fw_cfg, name, gen_id, errp)) { softmmu/vl.c:1196: fw_cfg_set_order_override(fw_cfg, FW_CFG_ORDER_OVERRIDE_USER); softmmu/vl.c:1197: fw_cfg_add_file(fw_cfg, name, buf, size); softmmu/vl.c:1198: fw_cfg_reset_order_override(fw_cfg); From this list, I'd like to simplify hw/acpi/bios-linker-loader.c, but later. The remaining core components are hw/core/loader.c and softmmu/vl.c: hw/core/loader.c:1017: fw_cfg_add_file(fw_cfg, fw_file_name, data, rom->romsize); hw/core/loader.c:1074: fw_cfg_add_file_callback(fw_cfg, fw_file_name, hw/core/loader.c:1254: fw_cfg_set_order_override(fw_cfg, order); hw/core/loader.c:1261: fw_cfg_reset_order_override(fw_cfg); hw/core/loader.c:919: fw_cfg_modify_file(fw_cfg, id + strlen("/rom@"), host, length); softmmu/vl.c:1183: if (!fw_cfg_add_from_generator(fw_cfg, name, gen_id, errp)) { softmmu/vl.c:1196: fw_cfg_set_order_override(fw_cfg, FW_CFG_ORDER_OVERRIDE_USER); softmmu/vl.c:1197: fw_cfg_add_file(fw_cfg, name, buf, size); softmmu/vl.c:1198: fw_cfg_reset_order_override(fw_cfg); Bah, I thought vl.c was generic code, but it is target-specific, so we could add '#include CONFIG_DEVICES' and add more #ifdef'ry on CONFIG_FW_CFG. Less stubs VS more #ifdef'ry... It is not clear to me how to modularize this from the core code. TBC... Thanks, Phil. ^ permalink raw reply [flat|nested] 34+ messages in thread
end of thread, other threads:[~2021-04-28 18:52 UTC | newest] Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-04-26 19:35 [PATCH 0/7] hw/nvram/fw_cfg: Do not build device if not needed (Spring cleanup) Philippe Mathieu-Daudé 2021-04-26 19:35 ` Philippe Mathieu-Daudé 2021-04-26 19:35 ` [PATCH 1/7] stubs: Restrict fw_cfg stubs to sysemu Philippe Mathieu-Daudé 2021-04-26 19:35 ` Philippe Mathieu-Daudé 2021-04-28 16:23 ` Laszlo Ersek 2021-04-26 19:35 ` [PATCH 2/7] hw/nvram: Rename FW_CFG_MIPS as generic FW_CFG Kconfig symbol Philippe Mathieu-Daudé 2021-04-26 19:35 ` Philippe Mathieu-Daudé 2021-04-26 19:35 ` [PATCH 3/7] hw/nvram: Declare FW_CFG_DMA Kconfig symbol in hw/nvram/ Philippe Mathieu-Daudé 2021-04-26 19:35 ` Philippe Mathieu-Daudé 2021-04-26 19:35 ` [PATCH 4/7] hw/acpi/vmgenid: Make ACPI_VMGENID depends on FW_CFG Kconfig Philippe Mathieu-Daudé 2021-04-26 19:35 ` Philippe Mathieu-Daudé 2021-04-28 16:25 ` Laszlo Ersek 2021-04-26 19:35 ` [PATCH 5/7] hw: Have machines Kconfig-select FW_CFG Philippe Mathieu-Daudé 2021-04-26 19:35 ` Philippe Mathieu-Daudé 2021-04-26 22:03 ` BALATON Zoltan 2021-04-26 22:03 ` BALATON Zoltan 2021-04-27 1:56 ` David Gibson 2021-04-27 1:56 ` David Gibson 2021-04-27 1:54 ` David Gibson 2021-04-27 1:54 ` David Gibson 2021-04-28 16:33 ` Laszlo Ersek 2021-04-28 16:33 ` Laszlo Ersek 2021-04-28 18:50 ` Eduardo Habkost 2021-04-28 18:50 ` Eduardo Habkost 2021-04-26 19:35 ` [PATCH 6/7] hw/{arm,hppa,riscv}: Add fw_cfg arch-specific stub Philippe Mathieu-Daudé 2021-04-26 19:35 ` Philippe Mathieu-Daudé 2021-04-28 16:44 ` Laszlo Ersek 2021-04-28 16:44 ` Laszlo Ersek 2021-04-28 17:23 ` Philippe Mathieu-Daudé 2021-04-28 17:23 ` Philippe Mathieu-Daudé 2021-04-26 19:35 ` [PATCH 7/7] hw/nvram: Do not build FW_CFG if not required Philippe Mathieu-Daudé 2021-04-26 19:35 ` Philippe Mathieu-Daudé 2021-04-28 17:29 ` Philippe Mathieu-Daudé 2021-04-28 17:29 ` 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.