Nicholas Piggin
63350c6ea6
lib: sbi: Add hart_ prefix to PMP functions
...
PMP functions that deal with hart PMP CSRs are given a sbi_hart_ prefix,
to distinguish from RISC-V PMP encoding functions.
The is_pmp_entry_mapped() function is changed a little more, to align
with other PMP conventions, and made to return a bool to make it more
obvious that it returns a bool and not an SBI_ return code.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com >
Reviewed-by: Anup Patel <anup@brainfault.org >
Link: https://lore.kernel.org/r/20260430045528.420437-8-npiggin@gmail.com
Signed-off-by: Anup Patel <anup@brainfault.org >
2026-06-10 17:37:49 +05:30
Vladimir Kondratiev
ea45923765
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 >
2026-02-25 18:49:03 +05:30
Bo Gan
2c1bf5bb73
lib: sbi_domain: add sbi_domain_get_oldpmp_flags
...
Factor out logic in `sbi_hart_oldpmp_configure` into function
`sbi_domain_get_oldpmp_flags`, analogous to `sbi_domain_get_smepmp_flags`.
Platform specific hart-protection implementation can now leverage it.
Signed-off-by: Bo Gan <ganboing@gmail.com >
Reviewed-by: Anup Patel <anup@brainfault.org >
Link: https://lore.kernel.org/r/20251218104243.562667-3-ganboing@gmail.com
Signed-off-by: Anup Patel <anup@brainfault.org >
2025-12-21 20:33:18 +05:30
Bo Gan
707aa3231a
lib: sbi_hart_pmp: make sbi_hart_pmp_fence public
...
sbi_hart_pmp_fence can now be utilized by other hart-protection
implementation.
Signed-off-by: Bo Gan <ganboing@gmail.com >
Reviewed-by: Anup Patel <anup@brainfault.org >
Link: https://lore.kernel.org/r/20251218104243.562667-2-ganboing@gmail.com
Signed-off-by: Anup Patel <anup@brainfault.org >
2025-12-21 20:33:16 +05:30
Andrew Waterman
843e916dca
lib: sbi: Expose __sbi_sfence_vma_all() function
...
The __sbi_sfence_vma_all() can be shared by different parts of
OpenSBI so rename __tlb_flush_all() to __sbi_sfence_vma_all()
and make it global function.
Signed-off-by: Andrew Waterman <andrew@sifive.com >
Signed-off-by: Anup Patel <apatel@ventanamicro.com >
Link: https://lore.kernel.org/r/20251127112121.334023-2-apatel@ventanamicro.com
Signed-off-by: Anup Patel <anup@brainfault.org >
2025-12-16 20:19:21 +05:30
Anup Patel
5eec86eec8
lib: sbi: Factor-out PMP programming into separate sources
...
The PMP programming is a significant part of sbi_hart.c so factor-out
this into separate sources sbi_hart_pmp.c and sbi_hart_pmp.h for better
maintainability.
Signed-off-by: Anup Patel <apatel@ventanamicro.com >
Link: https://lore.kernel.org/r/20251209135235.423391-6-apatel@ventanamicro.com
Signed-off-by: Anup Patel <anup@brainfault.org >
2025-12-16 20:16:47 +05:30