diff options
| author | Vladimir Kondratiev <vladimir.kondratiev@mobileye.com> | 2026-02-23 16:54:41 +0200 |
|---|---|---|
| committer | Anup Patel <anup@brainfault.org> | 2026-02-25 18:49:03 +0530 |
| commit | ea45923765de4145d174b98abc6b945c8407265e (patch) | |
| tree | 2841457668d35ef32d51105236a1c16be8cdc5c6 /lib | |
| parent | e58d5287020a4a474a6d04c7bcab800825d1a294 (diff) | |
| download | opensbi-ea45923765de4145d174b98abc6b945c8407265e.zip opensbi-ea45923765de4145d174b98abc6b945c8407265e.tar.gz opensbi-ea45923765de4145d174b98abc6b945c8407265e.tar.bz2 | |
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>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sbi/sbi_hart_pmp.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/sbi/sbi_hart_pmp.c b/lib/sbi/sbi_hart_pmp.c index be45912..02a3b3c 100644 --- a/lib/sbi/sbi_hart_pmp.c +++ b/lib/sbi/sbi_hart_pmp.c @@ -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; |
