* + arm-arm64-add-support-for-folded-p4d-page-tables-fix-fix.patch added to -mm tree
@ 2020-03-02 22:27 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2020-03-02 22:27 UTC (permalink / raw)
To: anders.roxell, anshuman.khandual, arnd, bcain, benh,
catalin.marinas, christophe.leroy, dalias, fenghua.yu,
geert+renesas, gxt, james.morse, jonas, julien.thierry.kdev,
ley.foon.tan, linux, maz, mm-commits, mpe, naresh.kamboju,
paulus, rppt, sfr, shorne, stefan.kristiansson, suzuki.poulose,
tony.luck, will, ysato
The patch titled
Subject: arm-arm64-add-support-for-folded-p4d-page-tables-fix-fix
has been added to the -mm tree. Its filename is
arm-arm64-add-support-for-folded-p4d-page-tables-fix-fix.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/arm-arm64-add-support-for-folded-p4d-page-tables-fix-fix.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/arm-arm64-add-support-for-folded-p4d-page-tables-fix-fix.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Catalin Marinas <catalin.marinas@arm.com>
Subject: arm-arm64-add-support-for-folded-p4d-page-tables-fix-fix
Link: http://lkml.kernel.org/r/20200302174553.GC4166275@arrakis.emea.arm.com
Cc: Anders Roxell <anders.roxell@linaro.org>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Brian Cain <bcain@codeaurora.org>
Cc: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Guan Xuetao <gxt@pku.edu.cn>
Cc: James Morse <james.morse@arm.com>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Julien Thierry <julien.thierry.kdev@gmail.com>
Cc: Ley Foon Tan <ley.foon.tan@intel.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Mike Rapoport <rppt@linux.ibm.com>
Cc: Naresh Kamboju <naresh.kamboju@linaro.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Rich Felker <dalias@libc.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Stafford Horne <shorne@gmail.com>
Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Cc: Stephen Rothwell<sfr@canb.auug.org.au>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Will Deacon <will@kernel.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
arch/arm64/mm/mmu.c | 41 ++++++++++++++++++++++++++++++-----------
1 file changed, 30 insertions(+), 11 deletions(-)
--- a/arch/arm64/mm/mmu.c~arm-arm64-add-support-for-folded-p4d-page-tables-fix-fix
+++ a/arch/arm64/mm/mmu.c
@@ -816,7 +816,7 @@ static void unmap_hotplug_pmd_range(pud_
} while (addr = next, addr < end);
}
-static void unmap_hotplug_pud_range(pgd_t *pgdp, unsigned long addr,
+static void unmap_hotplug_pud_range(p4d_t *p4dp, unsigned long addr,
unsigned long end, bool free_mapped)
{
unsigned long next;
@@ -824,7 +824,7 @@ static void unmap_hotplug_pud_range(pgd_
do {
next = pud_addr_end(addr, end);
- pudp = pud_offset(pgdp, addr);
+ pudp = pud_offset(p4dp, addr);
pud = READ_ONCE(*pudp);
if (pud_none(pud))
continue;
@@ -848,15 +848,15 @@ static void unmap_hotplug_pud_range(pgd_
} while (addr = next, addr < end);
}
-static void unmap_hotplug_p4d_range(pgd_t *pgd, unsigned long addr,
- unsigned long end, bool free_mapped)
+static void unmap_hotplug_p4d_range(pgd_t *pgdp, unsigned long addr,
+ unsigned long end, bool free_mapped)
{
unsigned long next;
- pgd_t *p4dp, p4d;
+ p4d_t *p4dp, p4d;
do {
next = p4d_addr_end(addr, end);
- p4dp = p4d_offset(pgd, addr);
+ p4dp = p4d_offset(pgdp, addr);
p4d = READ_ONCE(*p4dp);
if (p4d_none(p4d))
continue;
@@ -961,7 +961,7 @@ static void free_empty_pmd_table(pud_t *
free_hotplug_pgtable_page(virt_to_page(pmdp));
}
-static void free_empty_pud_table(pgd_t *pgdp, unsigned long addr,
+static void free_empty_pud_table(p4d_t *p4dp, unsigned long addr,
unsigned long end, unsigned long floor,
unsigned long ceiling)
{
@@ -970,7 +970,7 @@ static void free_empty_pud_table(pgd_t *
do {
next = pud_addr_end(addr, end);
- pudp = pud_offset(pgdp, addr);
+ pudp = pud_offset(p4dp, addr);
pud = READ_ONCE(*pudp);
if (pud_none(pud))
continue;
@@ -990,17 +990,36 @@ static void free_empty_pud_table(pgd_t *
* entries are empty. Overlap with other regions have been
* handled by the floor/ceiling check.
*/
- pudp = pud_offset(pgdp, 0UL);
+ pudp = pud_offset(p4dp, 0UL);
for (i = 0; i < PTRS_PER_PUD; i++) {
if (!pud_none(READ_ONCE(pudp[i])))
return;
}
- pgd_clear(pgdp);
+ p4d_clear(p4dp);
__flush_tlb_kernel_pgtable(start);
free_hotplug_pgtable_page(virt_to_page(pudp));
}
+static void free_empty_p4d_table(pgd_t *pgdp, unsigned long addr,
+ unsigned long end, unsigned long floor,
+ unsigned long ceiling)
+{
+ p4d_t *p4dp, p4d;
+ unsigned long next;
+
+ do {
+ next = p4d_addr_end(addr, end);
+ p4dp = p4d_offset(pgdp, addr);
+ p4d = READ_ONCE(*p4dp);
+ if (p4d_none(p4d))
+ continue;
+
+ WARN_ON(!p4d_present(p4d));
+ free_empty_pud_table(p4dp, addr, next, floor, ceiling);
+ } while (addr = next, addr < end);
+}
+
static void free_empty_tables(unsigned long addr, unsigned long end,
unsigned long floor, unsigned long ceiling)
{
@@ -1015,7 +1034,7 @@ static void free_empty_tables(unsigned l
continue;
WARN_ON(!pgd_present(pgd));
- free_empty_pud_table(pgdp, addr, next, floor, ceiling);
+ free_empty_p4d_table(pgdp, addr, next, floor, ceiling);
} while (addr = next, addr < end);
}
#endif
_
Patches currently in -mm which might be from catalin.marinas@arm.com are
arm-arm64-add-support-for-folded-p4d-page-tables-fix-fix.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-03-02 22:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-02 22:27 + arm-arm64-add-support-for-folded-p4d-page-tables-fix-fix.patch added to -mm tree akpm
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).