summaryrefslogtreecommitdiff
path: root/arch/riscv/include/asm/vmalloc.h
diff options
context:
space:
mode:
authorLiu Shixin <liushixin2@huawei.com>2022-10-12 15:00:37 +0300
committerPalmer Dabbelt <palmer@rivosinc.com>2022-10-29 03:10:01 +0300
commit310f541a027b1d5dc68f44f176cde618e6ee9691 (patch)
treef6c172cc923df0bbea5acaf6de24829448ce1bb2 /arch/riscv/include/asm/vmalloc.h
parent3558927fc2b2fd0af309648f4071035e08719866 (diff)
downloadlinux-310f541a027b1d5dc68f44f176cde618e6ee9691.tar.xz
riscv: Enable HAVE_ARCH_HUGE_VMAP for 64BIT
This sets the HAVE_ARCH_HUGE_VMAP option, and defines the required page table functions. With this feature, ioremap area will be mapped with huge page granularity according to its actual size. This feature can be disabled by kernel parameter "nohugeiomap". Signed-off-by: Liu Shixin <liushixin2@huawei.com> Reviewed-by: Björn Töpel <bjorn@kernel.org> Tested-by: Björn Töpel <bjorn@kernel.org> Link: https://lore.kernel.org/r/20221012120038.1034354-2-liushixin2@huawei.com [Palmer: minor formatting] Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'arch/riscv/include/asm/vmalloc.h')
-rw-r--r--arch/riscv/include/asm/vmalloc.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/riscv/include/asm/vmalloc.h b/arch/riscv/include/asm/vmalloc.h
index ff9abc00d139..48da5371f1e9 100644
--- a/arch/riscv/include/asm/vmalloc.h
+++ b/arch/riscv/include/asm/vmalloc.h
@@ -1,4 +1,22 @@
#ifndef _ASM_RISCV_VMALLOC_H
#define _ASM_RISCV_VMALLOC_H
+#ifdef CONFIG_HAVE_ARCH_HUGE_VMAP
+
+#define IOREMAP_MAX_ORDER (PUD_SHIFT)
+
+#define arch_vmap_pud_supported arch_vmap_pud_supported
+static inline bool arch_vmap_pud_supported(pgprot_t prot)
+{
+ return true;
+}
+
+#define arch_vmap_pmd_supported arch_vmap_pmd_supported
+static inline bool arch_vmap_pmd_supported(pgprot_t prot)
+{
+ return true;
+}
+
+#endif
+
#endif /* _ASM_RISCV_VMALLOC_H */