diff mbox series

[5/7] hw: Have machines Kconfig-select FW_CFG

Message ID 20210426193520.4115528-6-philmd@redhat.com (mailing list archive)
State New, archived
Headers show
Series hw/nvram/fw_cfg: Do not build device if not needed (Spring cleanup) | expand

Commit Message

Philippe Mathieu-Daudé April 26, 2021, 7:35 p.m. UTC
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(+)

Comments

BALATON Zoltan April 26, 2021, 10:03 p.m. UTC | #1
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
>
David Gibson April 27, 2021, 1:54 a.m. UTC | #2
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 April 27, 2021, 1:56 a.m. UTC | #3
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
> >
Laszlo Ersek April 28, 2021, 4:33 p.m. UTC | #4
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
>
Eduardo Habkost April 28, 2021, 6:50 p.m. UTC | #5
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)
diff mbox series

Patch

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