[RFC PATCH v2 0/8] Preserve more architectural state across domain switches

Theodorus Wensan Februanto theodoruswensanfebruanto025 at gmail.com
Fri Oct 23 00:09:17 PDT 2026


This RFC series extends OpenSBI domain context switching to preserve
additional hypervisor, virtual supervisor, supervisor timer,
counter configuration, AIA priority, CTR, and vector state.

Changes since v1:
- Group hypervisor and VS state in hart_context_hext.
- Fold HCOUNTEREN and HTIMEDELTA preservation into the core patch.
- Group STIMECMP and VSTIMECMP in hart_context_sstc.
- Move Sstc after H-extension state preservation.
- Detect CTR capacity in sbi_hart.c and store it in hart features.
- Include vector VL and VTYPE preservation.

Link: https://github.com/riscv-software-src/opensbi/issues/433
Link: https://github.com/riscv-software-src/opensbi/issues/434

Theodorus Wensan Februanto (8):
  lib: sbi: Preserve hypervisor state across domain switches
  lib: sbi: Preserve optional H-extension state across domain switches
  lib: sbi: Preserve Sstc timer state across domain switches
  lib: sbi: Preserve supervisor count inhibit configuration
  lib: sbi: Preserve the supervisor indirect CSR selector
  lib: sbi: Preserve supervisor AIA interrupt priorities
  lib: sbi: Preserve supervisor CTR records across domain switches
  lib: sbi: Preserve vl and vtype during domain switches

 include/sbi/riscv_encoding.h |   2 +
 include/sbi/sbi_hart.h       |   2 +
 include/sbi/sbi_vector.h     |   2 +
 lib/sbi/sbi_domain_context.c | 239 +++++++++++++++++++++++++++++++++++
 lib/sbi/sbi_hart.c           |  11 ++
 lib/sbi/sbi_vector.c         |  11 ++
 6 files changed, 267 insertions(+)

-- 
2.43.0




More information about the opensbi mailing list