@@ -515,4 +515,8 @@ void asm_offsets(void)
DEFINE(FREGS_A6, offsetof(struct __arch_ftrace_regs, a6));
DEFINE(FREGS_A7, offsetof(struct __arch_ftrace_regs, a7));
#endif
+ DEFINE(SBI_EXT_FWFT, SBI_EXT_FWFT);
+ DEFINE(SBI_EXT_FWFT_SET, SBI_EXT_FWFT_SET);
+ DEFINE(SBI_FWFT_SHADOW_STACK, SBI_FWFT_SHADOW_STACK);
+ DEFINE(SBI_FWFT_SET_FLAG_LOCK, SBI_FWFT_SET_FLAG_LOCK);
}
@@ -164,6 +164,12 @@ secondary_start_sbi:
call relocate_enable_mmu
#endif
call .Lsetup_trap_vector
+ li a7, SBI_EXT_FWFT
+ li a6, SBI_EXT_FWFT_SET
+ li a0, SBI_FWFT_SHADOW_STACK
+ li a1, 1 /* enable supervisor to access shadow stack access */
+ li a2, SBI_FWFT_SET_FLAG_LOCK
+ ecall
scs_load_current
call smp_callin
#endif /* CONFIG_SMP */
@@ -320,6 +326,12 @@ SYM_CODE_START(_start_kernel)
la tp, init_task
la sp, init_thread_union + THREAD_SIZE
addi sp, sp, -PT_SIZE_ON_STACK
+ li a7, SBI_EXT_FWFT
+ li a6, SBI_EXT_FWFT_SET
+ li a0, SBI_FWFT_SHADOW_STACK
+ li a1, 1 /* enable supervisor to access shadow stack access */
+ li a2, SBI_FWFT_SET_FLAG_LOCK
+ ecall
scs_load_current
#ifdef CONFIG_KASAN