mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-09-20 15:21:42 +01:00
lib: sbi_domain: add TSA annotations
Add Thread Safety Analysis (TSA) annotations for the domain handling code. This includes indicating which fields are protected by a spinlock, and annotating which functions acquire a spinlock, in order to prevent nesting. Exclude sbi_domain_register() from analysis, as it initializes a domain's spinlock. Signed-off-by: Carlos López <carlos.lopezr4096@gmail.com> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20260909162322.29778-11-carlos.lopezr4096@gmail.com Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
@@ -61,6 +61,7 @@ void sbi_update_hartindex_to_domain(u32 hartindex, struct sbi_domain *dom)
|
||||
}
|
||||
|
||||
bool sbi_domain_is_assigned_hart(const struct sbi_domain *dom, u32 hartindex)
|
||||
MUST_NOT_HOLD(&dom->assigned_harts_lock)
|
||||
{
|
||||
bool ret;
|
||||
struct sbi_domain *tdom = (struct sbi_domain *)dom;
|
||||
@@ -77,6 +78,7 @@ bool sbi_domain_is_assigned_hart(const struct sbi_domain *dom, u32 hartindex)
|
||||
|
||||
int sbi_domain_get_assigned_hartmask(const struct sbi_domain *dom,
|
||||
struct sbi_hartmask *mask)
|
||||
MUST_NOT_HOLD(&dom->assigned_harts_lock)
|
||||
{
|
||||
ulong ret = 0;
|
||||
struct sbi_domain *tdom = (struct sbi_domain *)dom;
|
||||
@@ -630,6 +632,7 @@ void sbi_domain_dump_all(const char *suffix)
|
||||
}
|
||||
|
||||
int sbi_domain_register(struct sbi_domain *dom)
|
||||
NO_THREAD_SAFETY_ANALYSIS
|
||||
{
|
||||
u32 i, cold_hartid = current_hartid();
|
||||
struct sbi_domain *tdom;
|
||||
|
||||
Reference in New Issue
Block a user