[RFC PATCH v2 0/7] Extend the reserved PMP entries
Yu-Chien Peter Lin
peter.lin at sifive.com
Sat Oct 25 02:18:04 PDT 2025
This series extends the number of reserved PMP entry.
The capabilities of the reserved PMP entries include:
- Highest priority
- Allow TOR mode for platform-specific use cases
- Can be consistent across domain context switches
- Allow runtime PMP allocation
A potential use case for reserved PMP entries is to enforce
PMA_UNSAFE regions [1] parsed from the device tree. These
regions may not be exactly covered by one or two NAPOT entries,
so reserved entries can be allocated and configured in TOR mode
to optimize PMP usage. In addition, they do not require
reconfiguration across domains and should remain unchanged
until the hart is reset.
[1] https://lore.kernel.org/all/20251009015839.3460231-16-samuel.holland@sifive.com/
Yu-Chien Peter Lin (7):
lib: utils: fdt_helper: add fdt_has_isa_extension() helper
include: sbi: sbi_platform: add reserved_pmp_count field
platform: generic: introduce fw_platform_get_reserved_pmp_count()
lib: sbi_init: print total and reserved PMP counts
lib: sbi: riscv_asm: support reserved PMP allocator
lib: sbi: sbi_hart: extend PMP handling to support multiple reserved
entries
docs: opensbi_config: add description for reserved-pmp-count
docs/opensbi_config.md | 9 +++
include/sbi/riscv_asm.h | 6 ++
include/sbi/sbi_hart.h | 15 -----
include/sbi/sbi_platform.h | 10 ++--
include/sbi_utils/fdt/fdt_helper.h | 2 +
lib/sbi/riscv_asm.c | 92 ++++++++++++++++++++++++++++++
lib/sbi/sbi_domain_context.c | 4 +-
lib/sbi/sbi_hart.c | 56 ++++++++++++------
lib/sbi/sbi_init.c | 6 +-
lib/utils/fdt/fdt_helper.c | 62 ++++++++++++++++++++
platform/generic/platform.c | 31 ++++++++++
11 files changed, 254 insertions(+), 39 deletions(-)
--
2.39.3
More information about the opensbi
mailing list