[RFC PATCH v2 16/21] riscv: mm: Adjust FIX_FDT_SIZE for variable PMD_SIZE

From: Xu Lu
Date: Thu Dec 05 2024 - 05:41:07 EST


Signed-off-by: Xu Lu <luxu.kernel@xxxxxxxxxxxxx>
---
arch/riscv/include/asm/pgtable.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h
index 07d557bc8b39..5b2ca92ad833 100644
--- a/arch/riscv/include/asm/pgtable.h
+++ b/arch/riscv/include/asm/pgtable.h
@@ -108,10 +108,10 @@
#define PCI_IO_END VMEMMAP_START
#define PCI_IO_START (PCI_IO_END - PCI_IO_SIZE)

-#define FIXADDR_TOP PCI_IO_START
+#define FIXADDR_TOP (PCI_IO_START & PMD_MASK)
#ifdef CONFIG_64BIT
#define MAX_FDT_SIZE PMD_SIZE
-#define FIX_FDT_SIZE (MAX_FDT_SIZE + SZ_2M)
+#define FIX_FDT_SIZE (MAX_FDT_SIZE + PMD_SIZE)
#define FIXADDR_SIZE (PMD_SIZE + FIX_FDT_SIZE)
#else
#define MAX_FDT_SIZE PGDIR_SIZE
--
2.20.1