lkml.org 
[lkml]   [2022]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] powerpc: Use swapper_pg_dir instead of init_mm->pgd
Date
init_mm->pgd is always swapper_pg_dir[] which is known
at build time.

Directly use the later instead of loading it from init_mm
struct at every time.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
arch/powerpc/include/asm/pgtable.h | 3 +++
1 file changed, 3 insertions(+)

diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h
index 283f40d05a4d..f6843e6294d9 100644
--- a/arch/powerpc/include/asm/pgtable.h
+++ b/arch/powerpc/include/asm/pgtable.h
@@ -48,6 +48,9 @@ struct mm_struct;
/* Keep these as a macros to avoid include dependency mess */
#define pte_page(x) pfn_to_page(pte_pfn(x))
#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
+
+#define pgd_offset_k(address) pgd_offset_pgd(swapper_pg_dir, (address))
+
/*
* Select all bits except the pfn
*/
--
2.37.1
\
 
 \ /
  Last update: 2022-10-09 19:32    [W:0.043 / U:0.828 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site