sbi: sbi_domain_context: Fix trap context for domain context switching

Save/restore sbi_trap_context during domain context switching to
ensure proper trap handling and isolation. This maintains correct
domain-specific state, avoiding context corruption.

Fixes: abea949721 ("lib: sbi: Introduce trap context")
Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
Reviewed-by: Alvin Chang <alvinga@andestech.com>
Tested-by: Alvin Chang <alvinga@andestech.com>
Reviewed-by: Yong Li <yong.li@intel.com>
Tested-by: Yong Li <yong.li@intel.com>
This commit is contained in:
Yu Chien Peter Lin
2024-06-07 19:39:28 +08:00
committed by Anup Patel
parent a73ff043e9
commit 3a94a32580
2 changed files with 5 additions and 6 deletions

View File

@@ -14,7 +14,7 @@
/** Context representation for a hart within a domain */
struct sbi_context {
/** Trap-related states such as GPRs, mepc, and mstatus */
struct sbi_trap_regs regs;
struct sbi_trap_context trap_ctx;
/** Supervisor status register */
unsigned long sstatus;