diff mbox series

[04/14] hw/i386: Restrict fw_cfg to the PC machines

Message ID 20191231183216.6781-5-philmd@redhat.com (mailing list archive)
State New, archived
Headers show
Series hw: Fix various --without-default-devices issues | expand

Commit Message

Philippe Mathieu-Daudé Dec. 31, 2019, 6:32 p.m. UTC
Only the PC-based machines use the fw_cfg device. In particular,
the MicroVM machine does not use it. Only compile/link it when
machines require it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
Cc: Sergio Lopez <slp@redhat.com>
---
 hw/i386/Makefile.objs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paolo Bonzini Jan. 7, 2020, 10 a.m. UTC | #1
On 31/12/19 19:32, Philippe Mathieu-Daudé wrote:
> Only the PC-based machines use the fw_cfg device. In particular,
> the MicroVM machine does not use it. Only compile/link it when
> machines require it.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> Cc: Sergio Lopez <slp@redhat.com>
> ---
>  hw/i386/Makefile.objs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
> index 6ebb6d0cf0..48f2693546 100644
> --- a/hw/i386/Makefile.objs
> +++ b/hw/i386/Makefile.objs
> @@ -5,7 +5,7 @@ obj-$(CONFIG_PC) += pc.o pc_sysfw.o
>  obj-$(CONFIG_I440FX) += pc_piix.o
>  obj-$(CONFIG_Q35) += pc_q35.o
>  obj-$(CONFIG_MICROVM) += microvm.o
> -obj-y += fw_cfg.o
> +obj-$(CONFIG_PC) += fw_cfg.o
>  obj-$(CONFIG_X86_IOMMU) += x86-iommu.o
>  obj-$(CONFIG_VTD) += intel_iommu.o
>  obj-$(CONFIG_AMD_IOMMU) += amd_iommu.o
> 

It does use it, it calls fw_cfg_init_io_dma.

Paolo
Paolo Bonzini Jan. 7, 2020, 10:01 a.m. UTC | #2
On 31/12/19 19:32, Philippe Mathieu-Daudé wrote:
> Only the PC-based machines use the fw_cfg device. In particular,
> the MicroVM machine does not use it. Only compile/link it when
> machines require it.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> Cc: Sergio Lopez <slp@redhat.com>
> ---
>  hw/i386/Makefile.objs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
> index 6ebb6d0cf0..48f2693546 100644
> --- a/hw/i386/Makefile.objs
> +++ b/hw/i386/Makefile.objs
> @@ -5,7 +5,7 @@ obj-$(CONFIG_PC) += pc.o pc_sysfw.o
>  obj-$(CONFIG_I440FX) += pc_piix.o
>  obj-$(CONFIG_Q35) += pc_q35.o
>  obj-$(CONFIG_MICROVM) += microvm.o
> -obj-y += fw_cfg.o
> +obj-$(CONFIG_PC) += fw_cfg.o
>  obj-$(CONFIG_X86_IOMMU) += x86-iommu.o
>  obj-$(CONFIG_VTD) += intel_iommu.o
>  obj-$(CONFIG_AMD_IOMMU) += amd_iommu.o
> 

Ah no, this is hw/i386/fw_cfg.c; of course hw/nvram/fw_cfg.c has its own
Kconfig symbol.  Can you rename the file to pc-fwcfg.c and adjust the
commit message?

Paolo
Philippe Mathieu-Daudé Jan. 7, 2020, 10:07 a.m. UTC | #3
On 1/7/20 11:01 AM, Paolo Bonzini wrote:
> On 31/12/19 19:32, Philippe Mathieu-Daudé wrote:
>> Only the PC-based machines use the fw_cfg device. In particular,
>> the MicroVM machine does not use it. Only compile/link it when
>> machines require it.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>> Cc: Sergio Lopez <slp@redhat.com>
>> ---
>>   hw/i386/Makefile.objs | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
>> index 6ebb6d0cf0..48f2693546 100644
>> --- a/hw/i386/Makefile.objs
>> +++ b/hw/i386/Makefile.objs
>> @@ -5,7 +5,7 @@ obj-$(CONFIG_PC) += pc.o pc_sysfw.o
>>   obj-$(CONFIG_I440FX) += pc_piix.o
>>   obj-$(CONFIG_Q35) += pc_q35.o
>>   obj-$(CONFIG_MICROVM) += microvm.o
>> -obj-y += fw_cfg.o
>> +obj-$(CONFIG_PC) += fw_cfg.o
>>   obj-$(CONFIG_X86_IOMMU) += x86-iommu.o
>>   obj-$(CONFIG_VTD) += intel_iommu.o
>>   obj-$(CONFIG_AMD_IOMMU) += amd_iommu.o
>>
> 
> Ah no, this is hw/i386/fw_cfg.c; of course hw/nvram/fw_cfg.c has its own
> Kconfig symbol.  Can you rename the file to pc-fwcfg.c and adjust the
> commit message?

Yes, will do (I'll try to post a new series with only patches you 
haven't picked already).
Michael S. Tsirkin Jan. 7, 2020, 10:16 a.m. UTC | #4
On Tue, Jan 07, 2020 at 11:01:48AM +0100, Paolo Bonzini wrote:
> On 31/12/19 19:32, Philippe Mathieu-Daudé wrote:
> > Only the PC-based machines use the fw_cfg device. In particular,
> > the MicroVM machine does not use it. Only compile/link it when
> > machines require it.
> > 
> > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> > ---
> > Cc: Sergio Lopez <slp@redhat.com>
> > ---
> >  hw/i386/Makefile.objs | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
> > index 6ebb6d0cf0..48f2693546 100644
> > --- a/hw/i386/Makefile.objs
> > +++ b/hw/i386/Makefile.objs
> > @@ -5,7 +5,7 @@ obj-$(CONFIG_PC) += pc.o pc_sysfw.o
> >  obj-$(CONFIG_I440FX) += pc_piix.o
> >  obj-$(CONFIG_Q35) += pc_q35.o
> >  obj-$(CONFIG_MICROVM) += microvm.o
> > -obj-y += fw_cfg.o
> > +obj-$(CONFIG_PC) += fw_cfg.o
> >  obj-$(CONFIG_X86_IOMMU) += x86-iommu.o
> >  obj-$(CONFIG_VTD) += intel_iommu.o
> >  obj-$(CONFIG_AMD_IOMMU) += amd_iommu.o
> > 
> 
> Ah no, this is hw/i386/fw_cfg.c; of course hw/nvram/fw_cfg.c has its own
> Kconfig symbol.

Sorry couldn't find it. Which symbol is that?

>  Can you rename the file to pc-fwcfg.c and adjust the
> commit message?
> 
> Paolo

Yea hw/i386/fw_cfg.c are helpers for use of fw cfg in pc,
it's not a fw cfg device as the commit message seems to
imply.

If there is a fw cfg symbol, would it be cleaner to make pc-fwcfg.c
depend on it?
Paolo Bonzini Jan. 7, 2020, 12:22 p.m. UTC | #5
On 07/01/20 11:16, Michael S. Tsirkin wrote:
> On Tue, Jan 07, 2020 at 11:01:48AM +0100, Paolo Bonzini wrote:
>> On 31/12/19 19:32, Philippe Mathieu-Daudé wrote:
>>> Only the PC-based machines use the fw_cfg device. In particular,
>>> the MicroVM machine does not use it. Only compile/link it when
>>> machines require it.
>>>
>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>> ---
>>> Cc: Sergio Lopez <slp@redhat.com>
>>> ---
>>>  hw/i386/Makefile.objs | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
>>> index 6ebb6d0cf0..48f2693546 100644
>>> --- a/hw/i386/Makefile.objs
>>> +++ b/hw/i386/Makefile.objs
>>> @@ -5,7 +5,7 @@ obj-$(CONFIG_PC) += pc.o pc_sysfw.o
>>>  obj-$(CONFIG_I440FX) += pc_piix.o
>>>  obj-$(CONFIG_Q35) += pc_q35.o
>>>  obj-$(CONFIG_MICROVM) += microvm.o
>>> -obj-y += fw_cfg.o
>>> +obj-$(CONFIG_PC) += fw_cfg.o
>>>  obj-$(CONFIG_X86_IOMMU) += x86-iommu.o
>>>  obj-$(CONFIG_VTD) += intel_iommu.o
>>>  obj-$(CONFIG_AMD_IOMMU) += amd_iommu.o
>>>
>>
>> Ah no, this is hw/i386/fw_cfg.c; of course hw/nvram/fw_cfg.c has its own
>> Kconfig symbol.
> 
> Sorry couldn't find it. Which symbol is that?

None. :)  fw_cfg has a bunch of uses in vl.c, it's not really going to
be easy to stub it out and probably pointless because it's an easy way
for firmware to get QEMU-specific information.

Paolo
diff mbox series

Patch

diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
index 6ebb6d0cf0..48f2693546 100644
--- a/hw/i386/Makefile.objs
+++ b/hw/i386/Makefile.objs
@@ -5,7 +5,7 @@  obj-$(CONFIG_PC) += pc.o pc_sysfw.o
 obj-$(CONFIG_I440FX) += pc_piix.o
 obj-$(CONFIG_Q35) += pc_q35.o
 obj-$(CONFIG_MICROVM) += microvm.o
-obj-y += fw_cfg.o
+obj-$(CONFIG_PC) += fw_cfg.o
 obj-$(CONFIG_X86_IOMMU) += x86-iommu.o
 obj-$(CONFIG_VTD) += intel_iommu.o
 obj-$(CONFIG_AMD_IOMMU) += amd_iommu.o