From ecdb6c90c83dfc89964e55d7c2a94a5c0f6bc437 Mon Sep 17 00:00:00 2001 From: Xiang W Date: Sun, 4 Jan 2026 13:18:10 +0800 Subject: firmware: Initialize stack guard via Zkr Try to initialize stack protection guard via the zkr extension. Signed-off-by: Xiang W Reviewed-by: Anup Patel Link: https://lore.kernel.org/r/20260104051812.128496-1-wxjstz@126.com Signed-off-by: Anup Patel --- include/sbi/riscv_encoding.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/sbi/riscv_encoding.h b/include/sbi/riscv_encoding.h index b5a4ce81..3c1d5256 100644 --- a/include/sbi/riscv_encoding.h +++ b/include/sbi/riscv_encoding.h @@ -261,6 +261,16 @@ #define CSR_FRM 0x002 #define CSR_FCSR 0x003 +/* User entropy source */ +#define CSR_SEED 0x015 +#define SEED_OPTS_SHIFT 30 +#define SEED_OPTS_MASK (_UL(3) << SEED_OPTS_SHIFT) +#define SEED_OPTS_BIST (_UL(0) << SEED_OPTS_SHIFT) +#define SEED_OPTS_WAIT (_UL(1) << SEED_OPTS_SHIFT) +#define SEED_OPTS_ES16 (_UL(2) << SEED_OPTS_SHIFT) +#define SEED_OPTS_DEAD (_UL(3) << SEED_OPTS_SHIFT) +#define SEED_ENTROPY_MASK 0xffff + /* User Counters/Timers */ #define CSR_CYCLE 0xc00 #define CSR_TIME 0xc01 -- cgit v1.3.1