Linux-mm Archive on
 help / color / Atom feed
* [patch 050/158] mips: mm: add p?d_leaf() definitions
@ 2019-12-01  1:51 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2019-12-01  1:51 UTC (permalink / raw)
  To: akpm, alex, aou, ard.biesheuvel, arnd, aryabinin, benh,
	borntraeger, bp, catalin.marinas, dave.hansen, dave.jiang, davem,
	dvyukov, glider, gor, heiko.carstens, hpa, james.morse, jhogan,
	kan.liang, linux-mm, linux, luto, mark.rutland, mawilcox, mingo,
	mm-commits, mpe, n-horiguchi, palmer, paul.burton, paul.walmsley,
	paulus, peterz, ralf, shashim, steven.price, tglx, torvalds,
	vgupta, will,

From: Steven Price <>
Subject: mips: mm: add p?d_leaf() definitions

walk_page_range() is going to be allowed to walk page tables other than
those of user space.  For this it needs to know when it has reached a
'leaf' entry in the page tables.  This information is provided by the
p?d_leaf() functions/macros.

If _PAGE_HUGE is defined we can simply look for it.  When not defined we
can be confident that there are no leaf pages in existence and fall back
on the generic implementation (added in a later patch) which returns 0.

Signed-off-by: Steven Price <>
Acked-by: Paul Burton <>
Cc: Ralf Baechle <>
Cc: Paul Burton <>
Cc: James Hogan <>
Cc: Albert Ou <>
Cc: Alexander Potapenko <>
Cc: Alexandre Ghiti <>
Cc: Andrey Ryabinin <>
Cc: Andy Lutomirski <>
Cc: Ard Biesheuvel <>
Cc: Arnd Bergmann <>
Cc: Benjamin Herrenschmidt <>
Cc: Borislav Petkov <>
Cc: Catalin Marinas <>
Cc: Christian Borntraeger <>
Cc: Dave Hansen <>
Cc: Dave Jiang <>
Cc: David S. Miller <>
Cc: Dmitry Vyukov <>
Cc: Heiko Carstens <>
Cc: "H. Peter Anvin" <>
Cc: Ingo Molnar <>
Cc: James Morse <>
Cc: "Liang, Kan" <>
Cc: Mark Rutland <>
Cc: Matthew Wilcox <>
Cc: Michael Ellerman <>
Cc: Naoya Horiguchi <>
Cc: Palmer Dabbelt <>
Cc: Paul Mackerras <>
Cc: Paul Walmsley <>
Cc: Peter Zijlstra <>
Cc: Russell King <>
Cc: Shiraz Hashim <>
Cc: Thomas Gleixner <>
Cc: Vasily Gorbik <>
Cc: Vineet Gupta <>
Cc: Will Deacon <>
Cc: Zong Li <>
Signed-off-by: Andrew Morton <>

 arch/mips/include/asm/pgtable.h |    5 +++++
 1 file changed, 5 insertions(+)

--- a/arch/mips/include/asm/pgtable.h~mips-mm-add-pd_leaf-definitions
+++ a/arch/mips/include/asm/pgtable.h
@@ -639,6 +639,11 @@ static inline pmd_t pmdp_huge_get_and_cl
+#ifdef _PAGE_HUGE
+#define pmd_leaf(pmd)	((pmd_val(pmd) & _PAGE_HUGE) != 0)
+#define pud_leaf(pud)	((pud_val(pud) & _PAGE_HUGE) != 0)
 #define gup_fast_permitted(start, end)	(!cpu_has_dc_aliases)
 #include <asm-generic/pgtable.h>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-01  1:51 [patch 050/158] mips: mm: add p?d_leaf() definitions akpm

Linux-mm Archive on

Archives are clonable:
	git clone --mirror linux-mm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mm linux-mm/ \
	public-inbox-index linux-mm

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone