linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Nicholas Piggin <npiggin@gmail.com>, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2 14/16] powerpc/64s: Make hash MMU support configurable
Date: Thu, 21 Oct 2021 07:44:07 +0200	[thread overview]
Message-ID: <2359b5b8-493b-1fc7-4d6e-c6065c3e4e9a@csgroup.eu> (raw)
In-Reply-To: <20211021035417.2157804-15-npiggin@gmail.com>



Le 21/10/2021 à 05:54, Nicholas Piggin a écrit :
> Thisa adds Kconfig selection which allows the 64s hash MMU code to be
> compiled out if radix is selected and the minimum supported CPU type is
> POWER9 or higher, and KVM is not selected.
> 
> This saves 128kB kernel image size (90kB text) on powernv_defconfig
> minus KVM, 350kB on pseries_defconfig minus KVM, 40kB on a tiny config.
> 
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
>   arch/powerpc/Kconfig                     |  1 +
>   arch/powerpc/kvm/Kconfig                 |  1 +
>   arch/powerpc/platforms/Kconfig.cputype   | 21 ++++++++++++++++++---
>   arch/powerpc/platforms/cell/Kconfig      |  1 +
>   arch/powerpc/platforms/maple/Kconfig     |  1 +
>   arch/powerpc/platforms/microwatt/Kconfig |  2 +-
>   arch/powerpc/platforms/pasemi/Kconfig    |  1 +
>   arch/powerpc/platforms/powermac/Kconfig  |  1 +
>   arch/powerpc/platforms/powernv/Kconfig   |  2 +-
>   9 files changed, 26 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 4b34e408a3e6..5e122c67f6ca 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -936,6 +936,7 @@ config PPC_MEM_KEYS
>   	prompt "PowerPC Memory Protection Keys"
>   	def_bool y
>   	depends on PPC_BOOK3S_64
> +	depends on PPC_64S_HASH_MMU
>   	select ARCH_USES_HIGH_VMA_FLAGS
>   	select ARCH_HAS_PKEYS
>   	help
> diff --git a/arch/powerpc/kvm/Kconfig b/arch/powerpc/kvm/Kconfig
> index ff581d70f20c..4801424614be 100644
> --- a/arch/powerpc/kvm/Kconfig
> +++ b/arch/powerpc/kvm/Kconfig
> @@ -69,6 +69,7 @@ config KVM_BOOK3S_64
>   	select KVM_BOOK3S_64_HANDLER
>   	select KVM
>   	select KVM_BOOK3S_PR_POSSIBLE if !KVM_BOOK3S_HV_POSSIBLE
> +	select PPC_64S_HASH_MMU
>   	select SPAPR_TCE_IOMMU if IOMMU_SUPPORT && (PPC_PSERIES || PPC_POWERNV)
>   	help
>   	  Support running unmodified book3s_64 and book3s_32 guest kernels
> diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
> index 01726e7f2c7f..1834cdd9626e 100644
> --- a/arch/powerpc/platforms/Kconfig.cputype
> +++ b/arch/powerpc/platforms/Kconfig.cputype
> @@ -105,10 +105,9 @@ config PPC_BOOK3S_64
>   	select HAVE_MOVE_PMD
>   	select HAVE_MOVE_PUD
>   	select IRQ_WORK
> -	select PPC_64S_HASH_MMU
> -	select PPC_MM_SLICES
>   	select PPC_HAVE_KUEP
>   	select PPC_HAVE_KUAP
> +	select PPC_64S_HASH_MMU if !PPC_RADIX_MMU
>   
>   config PPC_BOOK3E_64
>   	bool "Embedded processors"
> @@ -131,11 +130,13 @@ choice
>   config GENERIC_CPU
>   	bool "Generic (POWER4 and above)"
>   	depends on PPC64 && !CPU_LITTLE_ENDIAN
> +	select PPC_64S_HASH_MMU if PPC_BOOK3S_64
>   
>   config GENERIC_CPU
>   	bool "Generic (POWER8 and above)"
>   	depends on PPC64 && CPU_LITTLE_ENDIAN
>   	select ARCH_HAS_FAST_MULTIPLIER
> +	select PPC_64S_HASH_MMU
>   
>   config GENERIC_CPU
>   	bool "Generic 32 bits powerpc"
> @@ -144,24 +145,29 @@ config GENERIC_CPU
>   config CELL_CPU
>   	bool "Cell Broadband Engine"
>   	depends on PPC_BOOK3S_64 && !CPU_LITTLE_ENDIAN
> +	select PPC_64S_HASH_MMU
>   
>   config POWER5_CPU
>   	bool "POWER5"
>   	depends on PPC_BOOK3S_64 && !CPU_LITTLE_ENDIAN
> +	select PPC_64S_HASH_MMU
>   
>   config POWER6_CPU
>   	bool "POWER6"
>   	depends on PPC_BOOK3S_64 && !CPU_LITTLE_ENDIAN
> +	select PPC_64S_HASH_MMU
>   
>   config POWER7_CPU
>   	bool "POWER7"
>   	depends on PPC_BOOK3S_64
>   	select ARCH_HAS_FAST_MULTIPLIER
> +	select PPC_64S_HASH_MMU
>   
>   config POWER8_CPU
>   	bool "POWER8"
>   	depends on PPC_BOOK3S_64
>   	select ARCH_HAS_FAST_MULTIPLIER
> +	select PPC_64S_HASH_MMU
>   
>   config POWER9_CPU
>   	bool "POWER9"
> @@ -366,7 +372,15 @@ config SPE
>   	  If in doubt, say Y here.
>   
>   config PPC_64S_HASH_MMU
> -	bool
> +	bool "Hash MMU Support"
> +	depends on PPC_BOOK3S_64

Should already be in previous patch

> +	select PPC_MM_SLICES
> +	default y

Should already be in previous patch

> +	help
> +	  Enable support for the Power ISA Hash style MMU. This is implemented
> +	  by all IBM Power and other Book3S CPUs.
> +
> +	  If you're unsure, say Y.
>   
>   config PPC_RADIX_MMU
>   	bool "Radix MMU Support"
> @@ -381,6 +395,7 @@ config PPC_RADIX_MMU
>   config PPC_RADIX_MMU_DEFAULT
>   	bool "Default to using the Radix MMU when possible"
>   	depends on PPC_RADIX_MMU
> +	depends on PPC_64S_HASH_MMU
>   	default y
>   	help
>   	  When the hardware supports the Radix MMU, default to using it unless
> diff --git a/arch/powerpc/platforms/cell/Kconfig b/arch/powerpc/platforms/cell/Kconfig
> index db4465c51b56..faa894714a2a 100644
> --- a/arch/powerpc/platforms/cell/Kconfig
> +++ b/arch/powerpc/platforms/cell/Kconfig
> @@ -8,6 +8,7 @@ config PPC_CELL_COMMON
>   	select PPC_DCR_MMIO
>   	select PPC_INDIRECT_PIO
>   	select PPC_INDIRECT_MMIO
> +	select PPC_64S_HASH_MMU
>   	select PPC_HASH_MMU_NATIVE
>   	select PPC_RTAS
>   	select IRQ_EDGE_EOI_HANDLER
> diff --git a/arch/powerpc/platforms/maple/Kconfig b/arch/powerpc/platforms/maple/Kconfig
> index 7fd84311ade5..4c058cc57c90 100644
> --- a/arch/powerpc/platforms/maple/Kconfig
> +++ b/arch/powerpc/platforms/maple/Kconfig
> @@ -9,6 +9,7 @@ config PPC_MAPLE
>   	select GENERIC_TBSYNC
>   	select PPC_UDBG_16550
>   	select PPC_970_NAP
> +	select PPC_64S_HASH_MMU
>   	select PPC_HASH_MMU_NATIVE
>   	select PPC_RTAS
>   	select MMIO_NVRAM
> diff --git a/arch/powerpc/platforms/microwatt/Kconfig b/arch/powerpc/platforms/microwatt/Kconfig
> index 62b51e37fc05..823192e9d38a 100644
> --- a/arch/powerpc/platforms/microwatt/Kconfig
> +++ b/arch/powerpc/platforms/microwatt/Kconfig
> @@ -5,7 +5,7 @@ config PPC_MICROWATT
>   	select PPC_XICS
>   	select PPC_ICS_NATIVE
>   	select PPC_ICP_NATIVE
> -	select PPC_HASH_MMU_NATIVE
> +	select PPC_HASH_MMU_NATIVE if PPC_64S_HASH_MMU
>   	select PPC_UDBG_16550
>   	select ARCH_RANDOM
>   	help
> diff --git a/arch/powerpc/platforms/pasemi/Kconfig b/arch/powerpc/platforms/pasemi/Kconfig
> index bc7137353a7f..85ae18ddd911 100644
> --- a/arch/powerpc/platforms/pasemi/Kconfig
> +++ b/arch/powerpc/platforms/pasemi/Kconfig
> @@ -5,6 +5,7 @@ config PPC_PASEMI
>   	select MPIC
>   	select FORCE_PCI
>   	select PPC_UDBG_16550
> +	select PPC_64S_HASH_MMU
>   	select PPC_HASH_MMU_NATIVE
>   	select MPIC_BROKEN_REGREAD
>   	help
> diff --git a/arch/powerpc/platforms/powermac/Kconfig b/arch/powerpc/platforms/powermac/Kconfig
> index 2b56df145b82..130707ec9f99 100644
> --- a/arch/powerpc/platforms/powermac/Kconfig
> +++ b/arch/powerpc/platforms/powermac/Kconfig
> @@ -6,6 +6,7 @@ config PPC_PMAC
>   	select FORCE_PCI
>   	select PPC_INDIRECT_PCI if PPC32
>   	select PPC_MPC106 if PPC32
> +	select PPC_64S_HASH_MMU if PPC64
>   	select PPC_HASH_MMU_NATIVE
>   	select ZONE_DMA if PPC32
>   	default y
> diff --git a/arch/powerpc/platforms/powernv/Kconfig b/arch/powerpc/platforms/powernv/Kconfig
> index cd754e116184..161dfe024085 100644
> --- a/arch/powerpc/platforms/powernv/Kconfig
> +++ b/arch/powerpc/platforms/powernv/Kconfig
> @@ -2,7 +2,7 @@
>   config PPC_POWERNV
>   	depends on PPC64 && PPC_BOOK3S
>   	bool "IBM PowerNV (Non-Virtualized) platform support"
> -	select PPC_HASH_MMU_NATIVE
> +	select PPC_HASH_MMU_NATIVE if PPC_64S_HASH_MMU
>   	select PPC_XICS
>   	select PPC_ICP_NATIVE
>   	select PPC_XIVE_NATIVE
> 

  reply	other threads:[~2021-10-21  5:44 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-21  3:54 [PATCH v2 00/16] powerpc: Make hash MMU code build configurable Nicholas Piggin
2021-10-21  3:54 ` [PATCH v2 01/16] powerpc: Remove unused FW_FEATURE_NATIVE references Nicholas Piggin
2021-10-21  3:54 ` [PATCH v2 02/16] powerpc: Rename PPC_NATIVE to PPC_HASH_MMU_NATIVE Nicholas Piggin
2021-10-21  3:54 ` [PATCH v2 03/16] powerpc/pseries: Stop selecting PPC_HASH_MMU_NATIVE Nicholas Piggin
2021-10-21  3:54 ` [PATCH v2 04/16] powerpc/64s: Move and rename do_bad_slb_fault as it is not hash specific Nicholas Piggin
2021-10-21  3:54 ` [PATCH v2 05/16] powerpc/pseries: move pseries_lpar_register_process_table() out from hash specific code Nicholas Piggin
2021-10-21  3:54 ` [PATCH v2 06/16] powerpc/pseries: lparcfg don't include slb_size line in radix mode Nicholas Piggin
2021-10-21  3:54 ` [PATCH v2 07/16] powerpc/64s: move THP trace point creation out of hash specific file Nicholas Piggin
2021-10-21  3:54 ` [PATCH v2 08/16] powerpc/64s: Make flush_and_reload_slb a no-op when radix is enabled Nicholas Piggin
2021-10-21  3:54 ` [PATCH v2 09/16] powerpc/64s: move page size definitions from hash specific file Nicholas Piggin
2021-10-21  3:54 ` [PATCH v2 10/16] powerpc/64s: Rename hash_hugetlbpage.c to hugetlbpage.c Nicholas Piggin
2021-10-21  3:54 ` [PATCH v2 11/16] powerpc/64: pcpu setup avoid reading mmu_linear_psize on 64e or radix Nicholas Piggin
2021-10-21  4:52   ` Christophe Leroy
2021-10-21  7:13     ` Nicholas Piggin
2021-10-21  3:54 ` [PATCH v2 12/16] powerpc/64e: remove mmu_linear_psize Nicholas Piggin
2021-10-21  5:03   ` Christophe Leroy
2021-10-21  7:15     ` Nicholas Piggin
2021-10-21  3:54 ` [PATCH v2 13/16] powerpc/64s: Move hash MMU code under a new Kconfig name Nicholas Piggin
2021-10-21  5:43   ` Christophe Leroy
2021-10-21  7:33     ` Nicholas Piggin
2021-10-21  3:54 ` [PATCH v2 14/16] powerpc/64s: Make hash MMU support configurable Nicholas Piggin
2021-10-21  5:44   ` Christophe Leroy [this message]
2021-10-21  3:54 ` [PATCH v2 15/16] powerpc/configs/microwatt: add POWER9_CPU Nicholas Piggin
2021-10-21  3:54 ` [PATCH v2 16/16] powerpc/microwatt: Don't select the hash MMU code Nicholas Piggin
2021-10-21  5:19   ` Joel Stanley
2021-10-21  7:38     ` Nicholas Piggin
2021-10-21  5:47   ` Christophe Leroy

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=2359b5b8-493b-1fc7-4d6e-c6065c3e4e9a@csgroup.eu \
    --to=christophe.leroy@csgroup.eu \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=npiggin@gmail.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).