From 17e829129d60d7d178d47ecbd8990e705690d352 Mon Sep 17 00:00:00 2001 From: Alvin Chang Date: Tue, 16 Apr 2024 13:02:13 +0800 Subject: sbi: sbi_domain_context: Add spinlock for updating domain assigned_harts Add spinlock protection to avoid race condition on assigned_harts during domain context switching. Also, rename/add variables for accessing the corresponding domain of target/current context. Signed-off-by: Alvin Chang Reviewed-by: Yu Chien Peter Lin Reviewed-by: Anup Patel --- include/sbi/sbi_domain.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/sbi/sbi_domain.h b/include/sbi/sbi_domain.h index 4706cfca..a6e99c63 100644 --- a/include/sbi/sbi_domain.h +++ b/include/sbi/sbi_domain.h @@ -10,6 +10,7 @@ #ifndef __SBI_DOMAIN_H__ #define __SBI_DOMAIN_H__ +#include #include #include #include @@ -173,6 +174,8 @@ struct sbi_domain { * in the coldboot path */ struct sbi_hartmask assigned_harts; + /** Spinlock for accessing assigned_harts */ + spinlock_t assigned_harts_lock; /** Name of this domain */ char name[64]; /** Possible HARTs in this domain */ -- cgit v1.2.3