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

Configure Feed

Select the types of activity you want to include in your feed.

mm: add VM_SHADOW_STACK definition for riscv

VM_HIGH_ARCH_5 is used for riscv.

Reviewed-by: Zong Li <zong.li@sifive.com>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Acked-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Deepak Gupta <debug@rivosinc.com>
Tested-by: Andreas Korb <andreas.korb@aisec.fraunhofer.de> # QEMU, custom CVA6
Tested-by: Valentin Haudiquet <valentin.haudiquet@canonical.com>
Link: https://patch.msgid.link/20251112-v5_user_cfi_series-v23-1-b55691eacf4f@rivosinc.com
[pjw@kernel.org: clarify subject; update to apply]
Signed-off-by: Paul Walmsley <pjw@kernel.org>

authored by

Deepak Gupta and committed by
Paul Walmsley
98036587 3127718a

+3 -2
+3 -2
include/linux/mm.h
··· 359 359 DECLARE_VMA_BIT_ALIAS(PKEY_BIT2, HIGH_ARCH_2), 360 360 DECLARE_VMA_BIT_ALIAS(PKEY_BIT3, HIGH_ARCH_3), 361 361 DECLARE_VMA_BIT_ALIAS(PKEY_BIT4, HIGH_ARCH_4), 362 - #if defined(CONFIG_X86_USER_SHADOW_STACK) 362 + #if defined(CONFIG_X86_USER_SHADOW_STACK) || defined(CONFIG_RISCV_USER_CFI) 363 363 /* 364 364 * VM_SHADOW_STACK should not be set with VM_SHARED because of lack of 365 365 * support core mm. ··· 460 460 #define VM_PKEY_BIT4 VM_NONE 461 461 #endif /* CONFIG_ARCH_PKEY_BITS > 4 */ 462 462 #endif /* CONFIG_ARCH_HAS_PKEYS */ 463 - #if defined(CONFIG_X86_USER_SHADOW_STACK) || defined(CONFIG_ARM64_GCS) 463 + #if defined(CONFIG_X86_USER_SHADOW_STACK) || defined(CONFIG_ARM64_GCS) || \ 464 + defined(CONFIG_RISCV_USER_CFI) 464 465 #define VM_SHADOW_STACK INIT_VM_FLAG(SHADOW_STACK) 465 466 #else 466 467 #define VM_SHADOW_STACK VM_NONE