All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: <linuxppc-dev@ozlabs.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	aneesh.kumar@linux.vnet.ibm.com, haokexin@gmail.com
Subject: [PATCH v3 12/21] powerpc/mm: Convert early cpu/mmu feature check to use the new helpers
Date: Thu, 28 Jul 2016 00:18:08 +1000	[thread overview]
Message-ID: <1469629097-30859-12-git-send-email-mpe@ellerman.id.au> (raw)
In-Reply-To: <1469629097-30859-1-git-send-email-mpe@ellerman.id.au>

From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>

This switches early feature checks to use the non static key variant of
the function. In later patches we will be switching cpu_has_feature()
and mmu_has_feature() to use static keys and we can use them only after
static key/jump label is initialized. Any check for feature before jump
label init should be done using this new helper.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/include/asm/book3s/64/mmu.h | 4 ++--
 arch/powerpc/kernel/paca.c               | 2 +-
 arch/powerpc/kernel/setup_64.c           | 4 ++--
 arch/powerpc/mm/hash_utils_64.c          | 6 +++---
 arch/powerpc/mm/init_64.c                | 2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)

v3: Add/remove some sites now that we're rebased on the early MMU init series.

diff --git a/arch/powerpc/include/asm/book3s/64/mmu.h b/arch/powerpc/include/asm/book3s/64/mmu.h
index 70c995870297..6deda6ecc4f7 100644
--- a/arch/powerpc/include/asm/book3s/64/mmu.h
+++ b/arch/powerpc/include/asm/book3s/64/mmu.h
@@ -116,7 +116,7 @@ extern void hash__early_init_mmu_secondary(void);
 extern void radix__early_init_mmu_secondary(void);
 static inline void early_init_mmu_secondary(void)
 {
-	if (radix_enabled())
+	if (__radix_enabled())
 		return radix__early_init_mmu_secondary();
 	return hash__early_init_mmu_secondary();
 }
@@ -128,7 +128,7 @@ extern void radix__setup_initial_memory_limit(phys_addr_t first_memblock_base,
 static inline void setup_initial_memory_limit(phys_addr_t first_memblock_base,
 					      phys_addr_t first_memblock_size)
 {
-	if (radix_enabled())
+	if (__radix_enabled())
 		return radix__setup_initial_memory_limit(first_memblock_base,
 						   first_memblock_size);
 	return hash__setup_initial_memory_limit(first_memblock_base,
diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c
index 93dae296b6be..1b0b89e80824 100644
--- a/arch/powerpc/kernel/paca.c
+++ b/arch/powerpc/kernel/paca.c
@@ -184,7 +184,7 @@ void setup_paca(struct paca_struct *new_paca)
 	 * if we do a GET_PACA() before the feature fixups have been
 	 * applied
 	 */
-	if (cpu_has_feature(CPU_FTR_HVMODE))
+	if (__cpu_has_feature(CPU_FTR_HVMODE))
 		mtspr(SPRN_SPRG_HPACA, local_paca);
 #endif
 	mtspr(SPRN_SPRG_PACA, local_paca);
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 984696136f96..86ffab4c427b 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -227,8 +227,8 @@ static void __init configure_exceptions(void)
 			opal_configure_cores();
 
 		/* Enable AIL if supported, and we are in hypervisor mode */
-		if (cpu_has_feature(CPU_FTR_HVMODE) &&
-		    cpu_has_feature(CPU_FTR_ARCH_207S)) {
+		if (__cpu_has_feature(CPU_FTR_HVMODE) &&
+		    __cpu_has_feature(CPU_FTR_ARCH_207S)) {
 			unsigned long lpcr = mfspr(SPRN_LPCR);
 			mtspr(SPRN_LPCR, lpcr | LPCR_AIL_3);
 		}
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index 5f922e93af25..3aad12fb9d2f 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -530,7 +530,7 @@ static bool might_have_hea(void)
 	 * we will never see an HEA ethernet device.
 	 */
 #ifdef CONFIG_IBMEBUS
-	return !cpu_has_feature(CPU_FTR_ARCH_207S) &&
+	return !__cpu_has_feature(CPU_FTR_ARCH_207S) &&
 		!firmware_has_feature(FW_FEATURE_SPLPAR);
 #else
 	return false;
@@ -561,7 +561,7 @@ static void __init htab_init_page_sizes(void)
 	 * Not in the device-tree, let's fallback on known size
 	 * list for 16M capable GP & GR
 	 */
-	if (mmu_has_feature(MMU_FTR_16M_PAGE))
+	if (__mmu_has_feature(MMU_FTR_16M_PAGE))
 		memcpy(mmu_psize_defs, mmu_psize_defaults_gp,
 		       sizeof(mmu_psize_defaults_gp));
 found:
@@ -591,7 +591,7 @@ found:
 		mmu_vmalloc_psize = MMU_PAGE_64K;
 		if (mmu_linear_psize == MMU_PAGE_4K)
 			mmu_linear_psize = MMU_PAGE_64K;
-		if (mmu_has_feature(MMU_FTR_CI_LARGE_PAGE)) {
+		if (__mmu_has_feature(MMU_FTR_CI_LARGE_PAGE)) {
 			/*
 			 * When running on pSeries using 64k pages for ioremap
 			 * would stop us accessing the HEA ethernet. So if we
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index 6259f5db525b..c21d160088fa 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -427,7 +427,7 @@ void __init mmu_early_init_devtree(void)
 	if (disable_radix)
 		cur_cpu_spec->mmu_features &= ~MMU_FTR_TYPE_RADIX;
 
-	if (radix_enabled())
+	if (__radix_enabled())
 		radix__early_init_devtree();
 	else
 		hash__early_init_devtree();
-- 
2.7.4

  parent reply	other threads:[~2016-07-27 14:18 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-27 14:17 [PATCH v3 01/21] powerpc/mm: Add mmu_early_init_devtree() Michael Ellerman
2016-07-27 14:17 ` [PATCH v3 02/21] powerpc/mm: Move disable_radix handling into mmu_early_init_devtree() Michael Ellerman
2016-07-28  3:14   ` Balbir Singh
2016-07-27 14:17 ` [PATCH v3 03/21] powerpc/mm: Do hash device tree scanning earlier Michael Ellerman
2016-07-28 12:40   ` [PATCH v4] " Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 04/21] powerpc/mm: Do radix " Michael Ellerman
2016-07-28  3:48   ` Balbir Singh
2016-07-28  8:11     ` Michael Ellerman
2016-07-28 11:55       ` Balbir Singh
2016-07-27 14:18 ` [PATCH v3 05/21] powerpc/64: Do feature patching before MMU init Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 06/21] powerpc/kernel: Check features don't change after patching Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 07/21] powerpc/mm: Make MMU_FTR_RADIX a MMU family feature Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 08/21] powerpc/kernel: Convert mmu_has_feature() to returning bool Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 09/21] powerpc/kernel: Convert cpu_has_feature() " Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 10/21] powerpc/mm: Define radix_enabled() in one place & use static inline Michael Ellerman
2016-07-28  7:46   ` Nicholas Piggin
2016-07-29 11:42     ` Michael Ellerman
2016-07-29 12:54       ` Balbir Singh
2016-07-30 10:08         ` Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 11/21] powerpc/mm: Add __cpu/__mmu_has_feature() Michael Ellerman
2016-07-27 14:18 ` Michael Ellerman [this message]
2016-07-27 21:37   ` [PATCH v3 12/21] powerpc/mm: Convert early cpu/mmu feature check to use the new helpers Benjamin Herrenschmidt
2016-07-28 11:24     ` Michael Ellerman
2016-07-27 21:42   ` Benjamin Herrenschmidt
2016-07-28  7:49   ` Nicholas Piggin
2016-07-28 13:04     ` Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 13/21] jump_label: Make it possible for arches to invoke jump_label_init() earlier Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 14/21] powerpc: Call jump_label_init() in apply_feature_fixups() Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 15/21] powerpc: Remove mfvtb() Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 16/21] powerpc: Move cpu_has_feature() to a separate file Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 17/21] powerpc: Add kconfig option to use jump labels for cpu/mmu_has_feature() Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 18/21] powerpc: Add option to use jump label for cpu_has_feature() Michael Ellerman
2016-07-28  7:51   ` Nicholas Piggin
2016-07-27 14:18 ` [PATCH v3 19/21] powerpc: Add option to use jump label for mmu_has_feature() Michael Ellerman
2016-07-28  7:52   ` Nicholas Piggin
2016-08-08  0:59   ` Anton Blanchard
2016-08-08  7:35     ` Anton Blanchard
2016-07-27 14:18 ` [PATCH v3 20/21] powerpc/mm: Catch usage of cpu/mmu_has_feature() before jump label init Michael Ellerman
2016-07-27 14:18 ` [PATCH v3 21/21] powerpc/jump_label: Annotate jump label assembly Michael Ellerman
2016-07-28  7:56   ` Nicholas Piggin
     [not found] ` <1469629097-30859-14-git-send-email-mpe__30163.7288918302$1469630223$gmane$org@ellerman.id.au>
2016-08-13 23:55   ` [PATCH v3 14/21] powerpc: Call jump_label_init() in apply_feature_fixups() Andreas Schwab
2016-08-14  4:44     ` Michael Ellerman

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=1469629097-30859-12-git-send-email-mpe@ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=haokexin@gmail.com \
    --cc=linuxppc-dev@ozlabs.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.