From: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
To: npiggin@gmail.com, paulus@samba.org, mpe@ellerman.id.au,
Christophe Leroy <christophe.leroy@c-s.fr>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
linuxppc-dev@lists.ozlabs.org
Subject: [PATCH v3 4/6] powerpc/mm: Move slb_addr_linit to early_init_mmu
Date: Wed, 17 Apr 2019 18:33:49 +0530 [thread overview]
Message-ID: <20190417130351.3805-5-aneesh.kumar@linux.ibm.com> (raw)
In-Reply-To: <20190417130351.3805-1-aneesh.kumar@linux.ibm.com>
Avoid #ifdef in generic code. Also enables us to do this specific to
MMU translation mode on book3s64
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
---
arch/powerpc/kernel/setup-common.c | 11 -----------
arch/powerpc/mm/hash_utils_64.c | 2 ++
arch/powerpc/mm/tlb_nohash.c | 6 ++++++
3 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 2e5dfb6e0823..a07de8608484 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -947,17 +947,6 @@ void __init setup_arch(char **cmdline_p)
init_mm.end_data = (unsigned long) _edata;
init_mm.brk = klimit;
-#ifdef CONFIG_PPC_MM_SLICES
-#ifdef CONFIG_PPC64
- if (!radix_enabled())
- init_mm.context.slb_addr_limit = DEFAULT_MAP_WINDOW_USER64;
-#elif defined(CONFIG_PPC_8xx)
- init_mm.context.slb_addr_limit = DEFAULT_MAP_WINDOW;
-#else
-#error "context.addr_limit not initialized."
-#endif
-#endif
-
#ifdef CONFIG_SPAPR_TCE_IOMMU
mm_iommu_init(&init_mm);
#endif
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index 5a2bd132f92e..2cb3a456f5b5 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -1041,6 +1041,8 @@ void __init hash__early_init_mmu(void)
*/
htab_initialize();
+ init_mm.context.slb_addr_limit = DEFAULT_MAP_WINDOW_USER64;
+
pr_info("Initializing hash mmu with SLB\n");
/* Initialize SLB management */
slb_initialize();
diff --git a/arch/powerpc/mm/tlb_nohash.c b/arch/powerpc/mm/tlb_nohash.c
index ac23dc1c6535..088e0a6b5ade 100644
--- a/arch/powerpc/mm/tlb_nohash.c
+++ b/arch/powerpc/mm/tlb_nohash.c
@@ -800,5 +800,11 @@ void __init early_init_mmu(void)
#ifdef CONFIG_PPC_47x
early_init_mmu_47x();
#endif
+
+#ifdef CONFIG_PPC_MM_SLICES
+#if defined(CONFIG_PPC_8xx)
+ init_mm.context.slb_addr_limit = DEFAULT_MAP_WINDOW;
+#endif
+#endif
}
#endif /* CONFIG_PPC64 */
--
2.20.1
next prev parent reply other threads:[~2019-04-17 13:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-17 13:03 [PATCH v3 0/6] Reduce memory usage for mm_context_t Aneesh Kumar K.V
2019-04-17 13:03 ` [PATCH v3 1/6] powerpc/mm/radix: Do slb preload only with hash translation mode Aneesh Kumar K.V
2019-04-17 13:03 ` [PATCH v3 2/6] powerpc/mm: Remove PPC_MM_SLICES #ifdef for book3s64 Aneesh Kumar K.V
2019-04-21 14:19 ` [v3,2/6] " Michael Ellerman
2019-04-17 13:03 ` [PATCH v3 3/6] powerpc/mm: Add helpers for accessing hash translation related variables Aneesh Kumar K.V
2019-04-24 10:16 ` Christophe Leroy
2019-04-17 13:03 ` Aneesh Kumar K.V [this message]
2019-04-17 13:03 ` [PATCH v3 5/6] powerpc/mm: Reduce memory usage for mm_context_t for radix Aneesh Kumar K.V
2019-04-24 12:54 ` Christophe Leroy
2019-04-26 4:50 ` Aneesh Kumar K.V
2019-04-17 13:03 ` [PATCH v3 6/6] powerc/mm/hash: Reduce hash_mm_context size Aneesh Kumar K.V
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=20190417130351.3805-5-aneesh.kumar@linux.ibm.com \
--to=aneesh.kumar@linux.ibm.com \
--cc=christophe.leroy@c-s.fr \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=paulus@samba.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 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).