riscv: mm: fix NOCACHE_THEAD does not set bit[61] correctly 27/316027/1
authorMichal Wilczynski <m.wilczynski@samsung.com>
Wed, 21 Feb 2024 03:02:31 +0000 (11:02 +0800)
committerMichal Wilczynski <m.wilczynski@samsung.com>
Mon, 12 Aug 2024 15:18:09 +0000 (17:18 +0200)
Previous commit dbfbda3bd6bf ("riscv: mm: update T-Head memory type
definitions") from patch [1] missed a `<` for bit shifting, result in
bit(61) does not set in _PAGE_NOCACHE_THEAD and leaves bit(0) set instead.
This patch get this fixed.

Link: https://lore.kernel.org/linux-riscv/20230912072510.2510-1-jszhang@kernel.org/
Fixes: dbfbda3bd6bf ("riscv: mm: update T-Head memory type definitions")
Signed-off-by: Yangyu Chen <cyy@cyyself.name>
Reviewed-by: Guo Ren <guoren@kernel.org>
Reviewed-by: Jisheng Zhang <jszhang@kernel.org>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/r/tencent_E19FA1A095768063102E654C6FC858A32F06@qq.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
[ need this commit for GPU to work as the GPU driver is manually setting
page properties ]
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
Change-Id: I59b1d7d18be9e8f43606f494a0b8b5f834b30189

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

index 9a2c780a11e9530bcad95a677553dabeba67bb5f..783837bbd8783cb395b98c01e6698ec66eeb04e4 100644 (file)
@@ -136,7 +136,7 @@ enum napot_cont_order {
  * 10010 - IO   Strongly-ordered, Non-cacheable, Non-bufferable, Shareable, Non-trustable
  */
 #define _PAGE_PMA_THEAD                ((1UL << 62) | (1UL << 61) | (1UL << 60))
-#define _PAGE_NOCACHE_THEAD    ((1UL < 61) | (1UL << 60))
+#define _PAGE_NOCACHE_THEAD    ((1UL << 61) | (1UL << 60))
 #define _PAGE_IO_THEAD         ((1UL << 63) | (1UL << 60))
 #define _PAGE_MTMASK_THEAD     (_PAGE_PMA_THEAD | _PAGE_IO_THEAD | (1UL << 59))