[PATCH] lib: sbi: warning when PMP is not present.
Xiang W
wxjstz at 126.com
Thu Jan 8 08:03:16 PST 2026
We need to output a warning message if PMP is not present.
Signed-off-by: Xiang W <wangxiang at iscas.ac.cn>
---
lib/sbi/sbi_hart_protection.c | 2 +-
lib/sbi/sbi_init.c | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/sbi/sbi_hart_protection.c b/lib/sbi/sbi_hart_protection.c
index fbebfd1a..1965eb20 100644
--- a/lib/sbi/sbi_hart_protection.c
+++ b/lib/sbi/sbi_hart_protection.c
@@ -54,7 +54,7 @@ int sbi_hart_protection_configure(struct sbi_scratch *scratch)
struct sbi_hart_protection *hprot = sbi_hart_protection_best();
if (!hprot)
- return 0;
+ return SBI_ENODEV;
if (!hprot->configure)
return SBI_ENOSYS;
diff --git a/lib/sbi/sbi_init.c b/lib/sbi/sbi_init.c
index 5259064b..34880b5f 100644
--- a/lib/sbi/sbi_init.c
+++ b/lib/sbi/sbi_init.c
@@ -397,7 +397,8 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid)
if (rc) {
sbi_printf("%s: hart isolation configure failed (error %d)\n",
__func__, rc);
- sbi_hart_hang();
+ if (rc != SBI_ENODEV)
+ sbi_hart_hang();
}
count = sbi_scratch_offset_ptr(scratch, init_count_offset);
--
2.47.3
More information about the opensbi
mailing list