linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu,
	christoffer.dall@arm.com, maz@kernel.org,
	Robert Richter <rrichter@marvell.com>,
	linux-pci@vger.kernel.org
Subject: Re: [PATCH  v1 1/3] arm64: allow de-selection of ThunderX PCI controllers
Date: Mon, 17 Aug 2020 12:11:59 -0500	[thread overview]
Message-ID: <20200817171159.GA1426023@bjorn-Precision-5520> (raw)
In-Reply-To: <20200804124417.27102-2-alex.bennee@linaro.org>

On Tue, Aug 04, 2020 at 01:44:15PM +0100, Alex Bennée wrote:
> For a pure VirtIO guest bringing in all the PCI quirk handling adds a
> significant amount of bloat to kernel we don't need. Solve this by
> adding a CONFIG symbol for the ThunderX PCI devices and allowing it to
> be turned off. Saving over 300k from the uncompressed vmlinux:

It *looks* like just turning off CONFIG_PCI_QUIRKS should be
sufficient because pci-thunder-ecam.c and pci-thunder-pem.c are
wrapped with:

  #if defined(CONFIG_PCI_HOST_THUNDER_PEM) || (defined(CONFIG_ACPI) && defined(CONFIG_PCI_QUIRKS))

so if you turn off CONFIG_PCI_HOST_THUNDER_ECAM,
CONFIG_PCI_HOST_THUNDER_PEM, and CONFIG_PCI_QUIRKS that should omit
pci-thunder-ecam.o and pci-thunder-pem.o.  But I must be missing
something.

>   -rwxr-xr-x 1 alex alex  85652472 Aug  3 16:48 vmlinux*
>   -rwxr-xr-x 1 alex alex  86033880 Aug  3 16:39 vmlinux.orig*
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Cc: Robert Richter <rrichter@marvell.com>
> Cc: linux-pci@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> ---
>  arch/arm64/Kconfig.platforms    | 2 ++
>  arch/arm64/configs/defconfig    | 1 +
>  drivers/pci/controller/Kconfig  | 7 +++++++
>  drivers/pci/controller/Makefile | 4 ++--
>  4 files changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
> index 8dd05b2a925c..a328eebdaa59 100644
> --- a/arch/arm64/Kconfig.platforms
> +++ b/arch/arm64/Kconfig.platforms
> @@ -253,12 +253,14 @@ config ARCH_SPRD
>  
>  config ARCH_THUNDER
>  	bool "Cavium Inc. Thunder SoC Family"
> +        select PCI_THUNDER
>  	help
>  	  This enables support for Cavium's Thunder Family of SoCs.
>  
>  config ARCH_THUNDER2
>  	bool "Cavium ThunderX2 Server Processors"
>  	select GPIOLIB
> +        select PCI_THUNDER

Indent these with tabs, not spaces, to be consistent with other
whitespace usage in this file.

>  	help
>  	  This enables support for Cavium's ThunderX2 CN99XX family of
>  	  server processors.
> diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
> index 2ca7ba69c318..d840cba99941 100644
> --- a/arch/arm64/configs/defconfig
> +++ b/arch/arm64/configs/defconfig
> @@ -199,6 +199,7 @@ CONFIG_PCI_HOST_GENERIC=y
>  CONFIG_PCI_XGENE=y
>  CONFIG_PCIE_ALTERA=y
>  CONFIG_PCIE_ALTERA_MSI=y
> +CONFIG_PCI_THUNDER=y
>  CONFIG_PCI_HOST_THUNDER_PEM=y
>  CONFIG_PCI_HOST_THUNDER_ECAM=y
>  CONFIG_PCIE_ROCKCHIP_HOST=m
> diff --git a/drivers/pci/controller/Kconfig b/drivers/pci/controller/Kconfig
> index adddf21fa381..28335ffa5d48 100644
> --- a/drivers/pci/controller/Kconfig
> +++ b/drivers/pci/controller/Kconfig
> @@ -286,6 +286,13 @@ config PCI_LOONGSON
>  	  Say Y here if you want to enable PCI controller support on
>  	  Loongson systems.
>  
> +config PCI_THUNDER
> +       bool "Thunder X PCIE controllers"
> +       depends on ARM64
> +       select PCI_QUIRKS
> +       help
> +          Say Y here to enable ThunderX ECAM and PEM PCI controllers.

Indent with tabs, not spaces.

The existing Kconfig help text refers to simply "Thunder", not
"Thunder X", so both of these references should probably follow suit.

s/PCIE controllers/PCIe controllers/

>  source "drivers/pci/controller/dwc/Kconfig"
>  source "drivers/pci/controller/mobiveil/Kconfig"
>  source "drivers/pci/controller/cadence/Kconfig"
> diff --git a/drivers/pci/controller/Makefile b/drivers/pci/controller/Makefile
> index efd9733ead26..8fad4781a5d3 100644
> --- a/drivers/pci/controller/Makefile
> +++ b/drivers/pci/controller/Makefile
> @@ -45,8 +45,8 @@ obj-y				+= mobiveil/
>  # ARM64 and use internal ifdefs to only build the pieces we need
>  # depending on whether ACPI, the DT driver, or both are enabled.
>  
> +obj-$(CONFIG_PCI_THUNDER) += pci-thunder-ecam.o
> +obj-$(CONFIG_PCI_THUNDER) += pci-thunder-pem.o
>  ifdef CONFIG_PCI
> -obj-$(CONFIG_ARM64) += pci-thunder-ecam.o
> -obj-$(CONFIG_ARM64) += pci-thunder-pem.o
>  obj-$(CONFIG_ARM64) += pci-xgene.o
>  endif
> -- 
> 2.20.1
> 

  reply	other threads:[~2020-08-17 17:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-04 12:44 [RFC PATCH v1 0/3] put arm64 kvm_config on a diet Alex Bennée
2020-08-04 12:44 ` [PATCH v1 1/3] arm64: allow de-selection of ThunderX PCI controllers Alex Bennée
2020-08-17 17:11   ` Bjorn Helgaas [this message]
2020-08-04 12:44 ` [PATCH v1 2/3] arm64: gate the whole of pci-xgene on CONFIG_PCI_XGENE Alex Bennée
2020-08-04 12:44 ` [PATCH v1 3/3] kernel/configs: don't include PCI_QUIRKS in KVM guest configs Alex Bennée
2020-08-04 13:46   ` Marc Zyngier
2020-08-04 14:44     ` Alex Bennée
2020-08-04 14:59       ` Marc Zyngier
2020-08-04 15:40         ` Alex Bennée
2020-08-04 17:16           ` Marc Zyngier
2020-08-04 13:18 ` [RFC PATCH v1 0/3] put arm64 kvm_config on a diet Ard Biesheuvel
2020-08-04 14:47   ` Alex Bennée

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200817171159.GA1426023@bjorn-Precision-5520 \
    --to=helgaas@kernel.org \
    --cc=alex.bennee@linaro.org \
    --cc=christoffer.dall@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=rrichter@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).