aboutsummaryrefslogtreecommitdiff
path: root/rust/helpers/build_bug.c
diff options
context:
space:
mode:
authorSamuel Holland <[email protected]>2024-08-14 01:10:55 -0700
committerPalmer Dabbelt <[email protected]>2024-10-05 08:51:14 -0700
commit5fc7355f01376e69964bb21b685025b042c37acc (patch)
treef29389431b1104aa1d951fbf0312c0fc4604f306 /rust/helpers/build_bug.c
parent1b57747e978f920fb2affd1952ed913276019115 (diff)
riscv: Add support for per-thread envcfg CSR values
Some bits in the [ms]envcfg CSR, such as the CFI state and pointer masking mode, need to be controlled on a per-thread basis. Support this by keeping a copy of the CSR value in struct thread_struct and writing it during context switches. It is safe to discard the old CSR value during the context switch because the CSR is modified only by software, so the CSR will remain in sync with the copy in thread_struct. Use ALTERNATIVE directly instead of riscv_has_extension_unlikely() to minimize branchiness in the context switching code. Since thread_struct is copied during fork(), setting the value for the init task sets the default value for all other threads. Reviewed-by: Andrew Jones <[email protected]> Reviewed-by: Deepak Gupta <[email protected]> Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Charlie Jenkins <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
Diffstat (limited to 'rust/helpers/build_bug.c')
0 files changed, 0 insertions, 0 deletions