Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/ttm: add pgprot handling for RISC-V

The RISC-V Svpbmt privileged extension provides support for overriding
page memory coherency attributes, and, along with vendor extensions like
Xtheadmae, supports pgprot_{writecombine,noncached} on RISC-V.

Adapt the codepath that maps ttm_write_combined to pgprot_writecombine
and ttm_noncached to pgprot_noncached to RISC-V, to allow proper page
access attributes.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Tested-by: Han Gao <rabenda.cn@gmail.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://lore.kernel.org/r/20251020053523.731353-1-uwu@icenowy.me

authored by

Icenowy Zheng and committed by
Christian König
4f9ffd2c a80c98b6

+2 -1
+2 -1
drivers/gpu/drm/ttm/ttm_module.c
··· 74 74 #endif /* CONFIG_UML */ 75 75 #endif /* __i386__ || __x86_64__ */ 76 76 #if defined(__ia64__) || defined(__arm__) || defined(__aarch64__) || \ 77 - defined(__powerpc__) || defined(__mips__) || defined(__loongarch__) 77 + defined(__powerpc__) || defined(__mips__) || defined(__loongarch__) || \ 78 + defined(__riscv) 78 79 if (caching == ttm_write_combined) 79 80 tmp = pgprot_writecombine(tmp); 80 81 else