[RFC PATCH 01/34] ARM: mm: make nommu pgd_t a scalar
Yeoreum Yun
yeoreum.yun at arm.com
Mon Jul 13 06:55:40 PDT 2026
From: "David Hildenbrand (Arm)" <david at kernel.org>
We don't want pgd_t to be an array, as it prohibits returning it from a
function, like ptep_get().
There is no need to match the actual arm page tables, because with nommu
there are no page tables. It's all just in place to make the compiler
happy. Making it a scalar will make the compiler happy.
So let's just use an u32.
Signed-off-by: David Hildenbrand (Arm) <david at kernel.org>
Signed-off-by: Yeoreum Yun <yeoreum.yun at arm.com>
---
arch/arm/include/asm/page-nommu.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/include/asm/page-nommu.h b/arch/arm/include/asm/page-nommu.h
index e74415c959bea..88659b38e2364 100644
--- a/arch/arm/include/asm/page-nommu.h
+++ b/arch/arm/include/asm/page-nommu.h
@@ -18,12 +18,12 @@
*/
typedef unsigned long pte_t;
typedef unsigned long pmd_t;
-typedef unsigned long pgd_t[2];
+typedef unsigned long pgd_t;
typedef unsigned long pgprot_t;
#define pte_val(x) (x)
#define pmd_val(x) (x)
-#define pgd_val(x) ((x)[0])
+#define pgd_val(x) (x)
#define pgprot_val(x) (x)
#define __pte(x) (x)
--
LEVI:{C3F47F37-75D8-414A-A8BA-3980EC8A46D7}
More information about the kvm-riscv
mailing list