[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190731183553.klqcwrvannde5vd7@pburton-laptop>
Date: Wed, 31 Jul 2019 18:35:54 +0000
From: Paul Burton <paul.burton@...s.com>
To: Steven Price <steven.price@....com>
CC: "linux-mm@...ck.org" <linux-mm@...ck.org>,
Andy Lutomirski <luto@...nel.org>,
Ard Biesheuvel <ard.biesheuvel@...aro.org>,
Arnd Bergmann <arnd@...db.de>, Borislav Petkov <bp@...en8.de>,
Catalin Marinas <catalin.marinas@....com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Ingo Molnar <mingo@...hat.com>,
James Morse <james.morse@....com>,
Jérôme Glisse <jglisse@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Will Deacon <will@...nel.org>,
"x86@...nel.org" <x86@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Mark Rutland <Mark.Rutland@....com>,
"Liang, Kan" <kan.liang@...ux.intel.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Ralf Baechle <ralf@...ux-mips.org>,
James Hogan <jhogan@...nel.org>,
"linux-mips@...r.kernel.org" <linux-mips@...r.kernel.org>
Subject: Re: [PATCH v10 05/22] mips: mm: Add p?d_leaf() definitions
Hi Steven,
On Wed, Jul 31, 2019 at 04:45:46PM +0100, Steven Price wrote:
> 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.
>
> CC: Ralf Baechle <ralf@...ux-mips.org>
> CC: Paul Burton <paul.burton@...s.com>
> CC: James Hogan <jhogan@...nel.org>
> CC: linux-mips@...r.kernel.org
> Signed-off-by: Steven Price <steven.price@....com>
Acked-by: Paul Burton <paul.burton@...s.com>
Thanks,
Paul
> ---
> arch/mips/include/asm/pgtable.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h
> index 7d27194e3b45..238ca243ad31 100644
> --- a/arch/mips/include/asm/pgtable.h
> +++ b/arch/mips/include/asm/pgtable.h
> @@ -627,6 +627,11 @@ static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,
>
> #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
>
> +#ifdef _PAGE_HUGE
> +#define pmd_leaf(pmd) ((pmd_val(pmd) & _PAGE_HUGE) != 0)
> +#define pud_leaf(pud) ((pud_val(pud) & _PAGE_HUGE) != 0)
> +#endif
> +
> #define gup_fast_permitted(start, end) (!cpu_has_dc_aliases)
>
> #include <asm-generic/pgtable.h>
> --
> 2.20.1
>
Powered by blists - more mailing lists