lib: sbi: Add initial domain context management support

The domain context management component in OpenSBI provides basic CPU
context management routines for existing OpenSBI domain. As domain
extension, it was initially designed to facilitate the suspension
and resumption of domains, enabling secure domains to efficiently
share CPU resources.

The patch also provides an addition to the OpenSBI domain to provide
updates on hart-domain assignment and declarations of contexts within
the domain.

Signed-off-by: Qingyu Shang <2931013282@sjtu.edu.cn>
Reviewed-by: Yu Chien Peter Lin <peterlin@andestech.com>
Tested-by: Yu Chien Peter Lin <peterlin@andestech.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Qingyu Shang authored and Anup Patel committed 2024-03-10 10:26:42 +05:30
1 parent 87d8fe7865
commit e11025c52d
6 files changed
+242 -2

No files matched your search

+2 -2
View File
@@ -51,7 +51,7 @@ struct sbi_domain *sbi_hartindex_to_domain(u32 hartindex)
return sbi_scratch_read_type(scratch, void *, domain_hart_ptr_offset);
}
static void update_hartindex_to_domain(u32 hartindex, struct sbi_domain *dom)
void sbi_update_hartindex_to_domain(u32 hartindex, struct sbi_domain *dom)
{
struct sbi_scratch *scratch;
@@ -567,7 +567,7 @@ int sbi_domain_register(struct sbi_domain *dom,
if (tdom)
sbi_hartmask_clear_hartindex(i,
&tdom->assigned_harts);
update_hartindex_to_domain(i, dom);
sbi_update_hartindex_to_domain(i, dom);
sbi_hartmask_set_hartindex(i, &dom->assigned_harts);
/*