summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDave Patel <dave.patel@riscstar.com>2026-05-18 14:00:23 +0530
committerAnup Patel <anup@brainfault.org>2026-05-18 14:02:28 +0530
commit22d7e99ed2f9c66012a05a82318785d80dd451a0 (patch)
treeb52fc051cdf3879c865b6eb65a1027020147950e /include
parent718e1d194f5a41c657dfe094392abdeb02356680 (diff)
downloadopensbi-22d7e99ed2f9c66012a05a82318785d80dd451a0.tar.gz
opensbi-22d7e99ed2f9c66012a05a82318785d80dd451a0.zip
lib: sbi: domain FP/Vector context support for context switch
This patch adds proper support for per-domain floating-point (FP) and vector (V) contexts in the domain context switch logic. Each domain now maintains its own FP and vector state, which is saved and restored during domain switches. Conditionalize FP and Vector save/restore based on extensions, unconditional save and restore of floating-point (FP) and Vector registers fails on generic platform firmware. This firmware must run on multiple platforms that may lack these extensions. Address this by conditionally executing FP save/restore only if the underlying hart supports the F or D extensions. Similarly, perform Vector save/restore only if the hart supports the Vector extension. This improves support for multi-domain systems with FP and Vector extensions, and prevents corruption of FP/Vector state during domain switches. Signed-off-by: Dave Patel <dave.patel@riscstar.com> Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260518083023.997323-4-anup.patel@oss.qualcomm.com Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'include')
-rw-r--r--include/sbi/sbi_hart.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/sbi/sbi_hart.h b/include/sbi/sbi_hart.h
index 937cdf29..543393bb 100644
--- a/include/sbi/sbi_hart.h
+++ b/include/sbi/sbi_hart.h
@@ -89,6 +89,12 @@ enum sbi_hart_extensions {
SBI_HART_EXT_XSIFIVE_CEASE,
/** Hart has Smrnmi extension */
SBI_HART_EXT_SMRNMI,
+ /** Hart has V extension */
+ SBI_HART_EXT_V,
+ /** Hart has F extension */
+ SBI_HART_EXT_F,
+ /** Hart has D extension */
+ SBI_HART_EXT_D,
/** Maximum index of Hart extension */
SBI_HART_EXT_MAX,