lib: sbi: Extend hart protection abstraction to allow ID configuration

There are various ID configuration ISA extensions such as RISC-V Worlds,
Supervisor domain ID, QoS ID, etc which need to be re-configured upon
domain context switch on a hart. Extend hart protection abstraction to
support both memory protection and ID configuration ISA extensions.

Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
Reviewed-by: Rahul Pathak <rahul.pathak@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260727042504.1743250-5-anup.patel@oss.qualcomm.com
Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Anup Patel
2026-08-02 15:17:12 +05:30
committed by Anup Patel
parent 5053774c2f
commit 2636a9c2a8
5 changed files with 103 additions and 15 deletions
+2
View File
@@ -425,6 +425,7 @@ static void sbi_hart_pmp_unconfigure(struct sbi_scratch *scratch,
static struct sbi_hart_protection pmp_protection = {
.name = "pmp",
.rating = 100,
.type = SBI_HART_PROTECTION_TYPE_MEMORY,
.configure = sbi_hart_oldpmp_configure,
.unconfigure = sbi_hart_pmp_unconfigure,
};
@@ -432,6 +433,7 @@ static struct sbi_hart_protection pmp_protection = {
static struct sbi_hart_protection epmp_protection = {
.name = "epmp",
.rating = 200,
.type = SBI_HART_PROTECTION_TYPE_MEMORY,
.configure = sbi_hart_smepmp_configure,
.unconfigure = sbi_hart_pmp_unconfigure,
.map_range = sbi_hart_smepmp_map_range,