[Qemu-devel] [RFC PATCH v3 28/43] hw/pci/Makefile.objs: make pcie configurable

Yang Zhong posted 43 patches 6 years, 9 months ago
There is a newer version of this series
[Qemu-devel] [RFC PATCH v3 28/43] hw/pci/Makefile.objs: make pcie configurable
Posted by Yang Zhong 6 years, 9 months ago
Make pcie splited from pci and make it configurable.

Signed-off-by: Yang Zhong <yang.zhong@intel.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
---
 default-configs/pci.mak | 1 +
 hw/pci/Kconfig          | 3 +++
 hw/pci/Makefile.objs    | 5 +++--
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/default-configs/pci.mak b/default-configs/pci.mak
index c1b64922b9..553b1905de 100644
--- a/default-configs/pci.mak
+++ b/default-configs/pci.mak
@@ -1,4 +1,5 @@
 CONFIG_PCI=y
+CONFIG_PCIE=y
 # For now, CONFIG_IDE_CORE requires ISA, so we enable it here
 CONFIG_ISA_BUS=y
 CONFIG_VIRTIO_PCI=y
diff --git a/hw/pci/Kconfig b/hw/pci/Kconfig
index d3d2205577..a717a26995 100644
--- a/hw/pci/Kconfig
+++ b/hw/pci/Kconfig
@@ -1,2 +1,5 @@
 config PCI
     bool
+
+config PCIE
+    bool
diff --git a/hw/pci/Makefile.objs b/hw/pci/Makefile.objs
index 9f905e6344..a995795a47 100644
--- a/hw/pci/Makefile.objs
+++ b/hw/pci/Makefile.objs
@@ -2,8 +2,9 @@ common-obj-$(CONFIG_PCI) += pci.o pci_bridge.o
 common-obj-$(CONFIG_PCI) += msix.o msi.o
 common-obj-$(CONFIG_PCI) += shpc.o
 common-obj-$(CONFIG_PCI) += slotid_cap.o
-common-obj-$(CONFIG_PCI) += pci_host.o pcie_host.o
-common-obj-$(CONFIG_PCI) += pcie.o pcie_aer.o pcie_port.o
+common-obj-$(CONFIG_PCI) += pci_host.o
+common-obj-$(CONFIG_PCIE) += pcie.o pcie_aer.o
+common-obj-$(CONFIG_PCIE) += pcie_port.o pcie_host.o
 
 common-obj-$(call lnot,$(CONFIG_PCI)) += pci-stub.o
 common-obj-$(CONFIG_ALL) += pci-stub.o
-- 
2.17.1


Re: [Qemu-devel] [RFC PATCH v3 28/43] hw/pci/Makefile.objs: make pcie configurable
Posted by Michael S. Tsirkin 6 years, 9 months ago
On Fri, Jan 18, 2019 at 07:23:55PM +0800, Yang Zhong wrote:
> Make pcie splited from pci and make it configurable.
> 
> Signed-off-by: Yang Zhong <yang.zhong@intel.com>
> Reviewed-by: Thomas Huth <thuth@redhat.com>




> ---
>  default-configs/pci.mak | 1 +
>  hw/pci/Kconfig          | 3 +++
>  hw/pci/Makefile.objs    | 5 +++--
>  3 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/default-configs/pci.mak b/default-configs/pci.mak
> index c1b64922b9..553b1905de 100644
> --- a/default-configs/pci.mak
> +++ b/default-configs/pci.mak
> @@ -1,4 +1,5 @@
>  CONFIG_PCI=y
> +CONFIG_PCIE=y
>  # For now, CONFIG_IDE_CORE requires ISA, so we enable it here
>  CONFIG_ISA_BUS=y
>  CONFIG_VIRTIO_PCI=y
> diff --git a/hw/pci/Kconfig b/hw/pci/Kconfig
> index d3d2205577..a717a26995 100644
> --- a/hw/pci/Kconfig
> +++ b/hw/pci/Kconfig
> @@ -1,2 +1,5 @@
>  config PCI
>      bool
> +
> +config PCIE
> +    bool

I think PCIE should depend on PCI or something like this.
That's because there are places in code that test CONFIG_PCI,
you want PCIE to enable them as well.


> diff --git a/hw/pci/Makefile.objs b/hw/pci/Makefile.objs
> index 9f905e6344..a995795a47 100644
> --- a/hw/pci/Makefile.objs
> +++ b/hw/pci/Makefile.objs
> @@ -2,8 +2,9 @@ common-obj-$(CONFIG_PCI) += pci.o pci_bridge.o
>  common-obj-$(CONFIG_PCI) += msix.o msi.o
>  common-obj-$(CONFIG_PCI) += shpc.o
>  common-obj-$(CONFIG_PCI) += slotid_cap.o
> -common-obj-$(CONFIG_PCI) += pci_host.o pcie_host.o
> -common-obj-$(CONFIG_PCI) += pcie.o pcie_aer.o pcie_port.o
> +common-obj-$(CONFIG_PCI) += pci_host.o
> +common-obj-$(CONFIG_PCIE) += pcie.o pcie_aer.o
> +common-obj-$(CONFIG_PCIE) += pcie_port.o pcie_host.o
>  
>  common-obj-$(call lnot,$(CONFIG_PCI)) += pci-stub.o
>  common-obj-$(CONFIG_ALL) += pci-stub.o
> -- 
> 2.17.1
> 

Re: [Qemu-devel] [RFC PATCH v3 28/43] hw/pci/Makefile.objs: make pcie configurable
Posted by Paolo Bonzini 6 years, 9 months ago
>
>
>
> I think PCIE should depend on PCI or something like this.
> That's because there are places in code that test CONFIG_PCI,
> you want PCIE to enable them as well.
>

I agree, it should select PCI, so that PCIe bridges only need to select
PCIE (the model in QEMU is that you enable boards and pluggable devices;
everything else, especially buses, is then selected automatically based on
whether any controllers/bridges are enabled for those buses).

Paolo

>
Re: [Qemu-devel] [RFC PATCH v3 28/43] hw/pci/Makefile.objs: make pcie configurable
Posted by Michael S. Tsirkin 6 years, 9 months ago
On Fri, Jan 18, 2019 at 06:28:37PM +0100, Paolo Bonzini wrote:
> 
> 
>     I think PCIE should depend on PCI or something like this.
>     That's because there are places in code that test CONFIG_PCI,
>     you want PCIE to enable them as well.
> 
> 
> I agree, it should select PCI, so that PCIe bridges only need to select PCIE
> (the model in QEMU is that you enable boards and pluggable devices; everything
> else, especially buses, is then selected automatically based on whether any
> controllers/bridges are enabled for those buses).
> 
> Paolo
> 

OK, and I also think we should rename it PCIE -> PCI_EXPRESS_, this way
everything PCI starts with PCI.

-- 
MST

Re: [Qemu-devel] [RFC PATCH v3 28/43] hw/pci/Makefile.objs: make pcie configurable
Posted by Paolo Bonzini 6 years, 9 months ago
On 18/01/19 20:28, Michael S. Tsirkin wrote:
> OK, and I also think we should rename it PCIE -> PCI_EXPRESS_, this way
> everything PCI starts with PCI.

I have no preference for PCIE vs. PCI_EXPRESS (PCIE is universally known
and shorter, but it's okay either way), but I agree it makes sense to
rename everything that selects PCIE so that it starts with either PCIE
or PCI_EXPRESS.  Yang, can you place a patch to do that before your
series to do the rename?

Thanks,

Paolo

Re: [Qemu-devel] [RFC PATCH v3 28/43] hw/pci/Makefile.objs: make pcie configurable
Posted by Yang Zhong 6 years, 9 months ago
On Mon, Jan 21, 2019 at 11:25:57AM +0100, Paolo Bonzini wrote:
> On 18/01/19 20:28, Michael S. Tsirkin wrote:
> > OK, and I also think we should rename it PCIE -> PCI_EXPRESS_, this way
> > everything PCI starts with PCI.
> 
> I have no preference for PCIE vs. PCI_EXPRESS (PCIE is universally known
> and shorter, but it's okay either way), but I agree it makes sense to
> rename everything that selects PCIE so that it starts with either PCIE
> or PCI_EXPRESS.  Yang, can you place a patch to do that before your
> series to do the rename?
>
  Hello Paolo,

  Yes, i can change PCIE to PCI_EXPRESS per Michael's comments. How can i share
  this patch ?, or i will send this patches with another changes(patch 41) in v4 ?  thanks!

  Regards,

  Yang  
 
> Thanks,
> 
> Paolo

Re: [Qemu-devel] [RFC PATCH v3 28/43] hw/pci/Makefile.objs: make pcie configurable
Posted by Paolo Bonzini 6 years, 9 months ago
On 21/01/19 12:26, Yang Zhong wrote:
> On Mon, Jan 21, 2019 at 11:25:57AM +0100, Paolo Bonzini wrote:
>> On 18/01/19 20:28, Michael S. Tsirkin wrote:
>>> OK, and I also think we should rename it PCIE -> PCI_EXPRESS_, this way
>>> everything PCI starts with PCI.
>>
>> I have no preference for PCIE vs. PCI_EXPRESS (PCIE is universally known
>> and shorter, but it's okay either way), but I agree it makes sense to
>> rename everything that selects PCIE so that it starts with either PCIE
>> or PCI_EXPRESS.  Yang, can you place a patch to do that before your
>> series to do the rename?
>>
>   Hello Paolo,
> 
>   Yes, i can change PCIE to PCI_EXPRESS per Michael's comments. How can i share
>   this patch ?, or i will send this patches with another changes(patch 41) in v4 ?  thanks!

You can place it as patch 1 in v4.

Paolo