Skip to content

Commit 10128f8

Browse files
RISC-V: Provide pgtable_l5_enabled on rv32
A few of the other page table level helpers are defined on rv32, but not pgtable_l5_enabled. This adds the definition as a constant and converts pgtable_l4_enabled to a constant as well. Link: https://lore.kernel.org/r/20230830044129.11481-2-palmer@rivosinc.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent 60c4687 commit 10128f8

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

arch/riscv/include/asm/pgtable-32.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,7 @@
3333
_PAGE_WRITE | _PAGE_EXEC | \
3434
_PAGE_USER | _PAGE_GLOBAL))
3535

36+
static const __maybe_unused int pgtable_l4_enabled;
37+
static const __maybe_unused int pgtable_l5_enabled;
38+
3639
#endif /* _ASM_RISCV_PGTABLE_32_H */

arch/riscv/include/asm/pgtable.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,6 @@ extern uintptr_t _dtb_early_pa;
914914
#define dtb_early_pa _dtb_early_pa
915915
#endif /* CONFIG_XIP_KERNEL */
916916
extern u64 satp_mode;
917-
extern bool pgtable_l4_enabled;
918917

919918
void paging_init(void);
920919
void misc_mem_init(void);

arch/riscv/mm/init.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ u64 satp_mode __ro_after_init = SATP_MODE_32;
4949
#endif
5050
EXPORT_SYMBOL(satp_mode);
5151

52+
#ifdef CONFIG_64BIT
5253
bool pgtable_l4_enabled = IS_ENABLED(CONFIG_64BIT) && !IS_ENABLED(CONFIG_XIP_KERNEL);
5354
bool pgtable_l5_enabled = IS_ENABLED(CONFIG_64BIT) && !IS_ENABLED(CONFIG_XIP_KERNEL);
5455
EXPORT_SYMBOL(pgtable_l4_enabled);
5556
EXPORT_SYMBOL(pgtable_l5_enabled);
57+
#endif
5658

5759
phys_addr_t phys_ram_base __ro_after_init;
5860
EXPORT_SYMBOL(phys_ram_base);

0 commit comments

Comments
 (0)