From: Reza Arbab <arbab@linux.vnet.ibm.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>,
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
Balbir Singh <bsingharora@gmail.com>,
linuxppc-dev@lists.ozlabs.org
Subject: [RFC v2 2/2] powerpc/mm: add radix__{create, remove}_section_mapping()
Date: Wed, 17 Aug 2016 10:51:23 -0500 [thread overview]
Message-ID: <1471449083-15931-3-git-send-email-arbab@linux.vnet.ibm.com> (raw)
In-Reply-To: <1471449083-15931-1-git-send-email-arbab@linux.vnet.ibm.com>
Add radix variants of the memory hotplug mapping functions.
Signed-off-by: Reza Arbab <arbab@linux.vnet.ibm.com>
---
arch/powerpc/include/asm/book3s/64/radix.h | 5 +++++
arch/powerpc/include/asm/sparsemem.h | 8 ++++++++
arch/powerpc/mm/pgtable-radix.c | 23 +++++++++++++++++++++++
3 files changed, 36 insertions(+)
diff --git a/arch/powerpc/include/asm/book3s/64/radix.h b/arch/powerpc/include/asm/book3s/64/radix.h
index df29422..97e71cb 100644
--- a/arch/powerpc/include/asm/book3s/64/radix.h
+++ b/arch/powerpc/include/asm/book3s/64/radix.h
@@ -229,6 +229,11 @@ extern void radix__vmemmap_remove_mapping(unsigned long start,
extern int radix__map_kernel_page(unsigned long ea, unsigned long pa,
pgprot_t flags, unsigned int psz);
+#ifdef CONFIG_MEMORY_HOTPLUG
+int radix__create_section_mapping(unsigned long start, unsigned long end);
+void radix__remove_section_mapping(unsigned long start, unsigned long end);
+#endif /* CONFIG_MEMORY_HOTPLUG */
+
static inline unsigned long radix__get_tree_size(void)
{
unsigned long rts_field;
diff --git a/arch/powerpc/include/asm/sparsemem.h b/arch/powerpc/include/asm/sparsemem.h
index 5014e0d..42fe87e 100644
--- a/arch/powerpc/include/asm/sparsemem.h
+++ b/arch/powerpc/include/asm/sparsemem.h
@@ -19,12 +19,20 @@
static inline int create_section_mapping(unsigned long start,
unsigned long end)
{
+ if (radix_enabled())
+ return radix__create_section_mapping(start, end);
+
return hash__create_section_mapping(start, end);
}
static inline int remove_section_mapping(unsigned long start,
unsigned long end)
{
+ if (radix_enabled()) {
+ radix__remove_section_mapping(start, end);
+ return 0;
+ }
+
return hash__remove_section_mapping(start, end);
}
diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c
index af897d9..ee0286c 100644
--- a/arch/powerpc/mm/pgtable-radix.c
+++ b/arch/powerpc/mm/pgtable-radix.c
@@ -527,3 +527,26 @@ int radix__has_transparent_hugepage(void)
return 0;
}
#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
+
+#ifdef CONFIG_MEMORY_HOTPLUG
+int radix__create_section_mapping(unsigned long start, unsigned long end)
+{
+ unsigned long page_size = 1 << mmu_psize_defs[mmu_linear_psize].shift;
+
+ /* Align to the page size of the linear mapping. */
+ start = _ALIGN_DOWN(start, page_size);
+
+ for (; start < end; start += page_size) {
+ int rc = radix__map_kernel_page(start, __pa(start),
+ PAGE_KERNEL, page_size);
+ if (rc)
+ return rc;
+ }
+
+ return 0;
+}
+
+void radix__remove_section_mapping(unsigned long start, unsigned long end)
+{
+}
+#endif /* CONFIG_MEMORY_HOTPLUG */
--
1.8.3.1
next prev parent reply other threads:[~2016-08-17 15:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-17 15:51 [RFC v2 0/2] powerpc/mm: enable memory hotplug on radix Reza Arbab
2016-08-17 15:51 ` [RFC v2 1/2] powerpc/mm: refactor {create,remove}_section_mapping() Reza Arbab
2016-08-17 15:51 ` Reza Arbab [this message]
2016-08-21 16:15 ` [RFC v2 0/2] powerpc/mm: enable memory hotplug on radix 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=1471449083-15931-3-git-send-email-arbab@linux.vnet.ibm.com \
--to=arbab@linux.vnet.ibm.com \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=bsingharora@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--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 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.