summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Ghiti <alexghiti@rivosinc.com>2024-03-04 09:02:47 +0100
committerSasha Levin <sashal@kernel.org>2024-03-26 18:18:55 -0400
commit191cefaac8099aad8554f3a3f43b4bb25fc37d2a (patch)
tree34d1d7b152fcba9e644bc1de679c9dc9b97113e2
parentcc67ef53bfae809af34ded5007758fd2de800597 (diff)
downloadlinux-stable-191cefaac8099aad8554f3a3f43b4bb25fc37d2a.tar.gz
linux-stable-191cefaac8099aad8554f3a3f43b4bb25fc37d2a.tar.bz2
linux-stable-191cefaac8099aad8554f3a3f43b4bb25fc37d2a.zip
riscv: Fix compilation error with FAST_GUP and rv32
[ Upstream commit 2bb7e0c49302feec1c2f777bbfe8726169986ed8 ] By surrounding the definition of pte_leaf_size() with a ifdef napot as it should have been. Fixes: e0fe5ab4192c ("riscv: Fix pte_leaf_size() for NAPOT") Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com> Reviewed-by: Randy Dunlap <rdunlap@infradead.org> Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested Link: https://lore.kernel.org/r/20240304080247.387710-1-alexghiti@rivosinc.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--arch/riscv/include/asm/pgtable.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h
index 76b131e7bbca..a66845e31aba 100644
--- a/arch/riscv/include/asm/pgtable.h
+++ b/arch/riscv/include/asm/pgtable.h
@@ -439,9 +439,11 @@ static inline pte_t pte_mkhuge(pte_t pte)
return pte;
}
+#ifdef CONFIG_RISCV_ISA_SVNAPOT
#define pte_leaf_size(pte) (pte_napot(pte) ? \
napot_cont_size(napot_cont_order(pte)) :\
PAGE_SIZE)
+#endif
#ifdef CONFIG_NUMA_BALANCING
/*