mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-02-27 18:01:45 +00:00
lib: sbi_hart_pmp: disable unconfigured PMP entries
Disable PMP entries not configured in domain. These entries may contain values configured by the boot loader; disabling it to be certain PMP configuration is exactly as configured by the openSBI Signed-off-by: Vladimir Kondratiev <vladimir.kondratiev@mobileye.com> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20260223-for-upstream-eyeq7h-v3-2-621d004d1a21@mobileye.com Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
committed by
Anup Patel
parent
e58d528702
commit
ea45923765
@@ -204,6 +204,9 @@ static int sbi_hart_smepmp_configure(struct sbi_scratch *scratch)
|
||||
sbi_hart_smepmp_set(scratch, dom, reg, pmp_idx++, pmp_flags,
|
||||
pmp_log2gran, pmp_addr_max);
|
||||
}
|
||||
/* Disable remaining PMP entries */
|
||||
for(; pmp_idx < pmp_count; pmp_idx++)
|
||||
pmp_disable(pmp_idx);
|
||||
|
||||
/*
|
||||
* All entries are programmed.
|
||||
@@ -286,6 +289,9 @@ static int sbi_hart_oldpmp_configure(struct sbi_scratch *scratch)
|
||||
reg->order);
|
||||
}
|
||||
}
|
||||
/* Disable remaining PMP entries */
|
||||
for(; pmp_idx < pmp_count; pmp_idx++)
|
||||
pmp_disable(pmp_idx);
|
||||
|
||||
sbi_hart_pmp_fence();
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user