Commit Graph
5 Commits
Author SHA1 Message Date
Anup Patel 337c23dd66 lib: sbi: Print list of all hart protection mechanisms at boot time
Instead of printing only the best hart memory protection name at
boot time let's print a list of all hart projection mechanisms.

Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
Reviewed-by: Rahul Pathak <rahul.pathak@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260727042504.1743250-6-anup.patel@oss.qualcomm.com
Signed-off-by: Anup Patel <anup@brainfault.org>
2026-08-02 15:17:12 +05:30
Anup Patel 2636a9c2a8 lib: sbi: Extend hart protection abstraction to allow ID configuration
There are various ID configuration ISA extensions such as RISC-V Worlds,
Supervisor domain ID, QoS ID, etc which need to be re-configured upon
domain context switch on a hart. Extend hart protection abstraction to
support both memory protection and ID configuration ISA extensions.

Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
Reviewed-by: Rahul Pathak <rahul.pathak@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260727042504.1743250-5-anup.patel@oss.qualcomm.com
Signed-off-by: Anup Patel <anup@brainfault.org>
2026-08-02 15:17:12 +05:30
Anup Patel 5053774c2f lib: sbi: Add domain parameter to hart protection (un)configure()
The switch_to_next_domain_context() already has the pointers to current
and next domains so pass them as parameters to hart protection configure()
and unconfigure() callbacks.

Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
Reviewed-by: Rahul Pathak <rahul.pathak@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260727042504.1743250-4-anup.patel@oss.qualcomm.com
Signed-off-by: Anup Patel <anup@brainfault.org>
2026-08-02 15:17:12 +05:30
Anup Patel 48725e95b4 lib: sbi: Introduce sbi_hart_protection_reconfigure() function
Instead of assuming that hart protection reconfiguration is unconfigure
followed by configure, introduce a separate sbi_hart_protection_reconfigure()
function and use it in switch_to_next_domain_context().

Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
Reviewed-by: Rahul Pathak <rahul.pathak@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260727042504.1743250-3-anup.patel@oss.qualcomm.com
Signed-off-by: Anup Patel <anup@brainfault.org>
2026-08-02 15:17:12 +05:30
Anup Patel 809df05c35 lib: sbi: Introduce hart protection abstraction
Currently, PMP and ePMP are the only hart protection mechanisms
available in OpenSBI but new protection mechanisms (such as Smmpt)
will be added in the near future.

To allow multiple hart protection mechanisms, introduce hart
protection abstraction and related APIs.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Link: https://lore.kernel.org/r/20251209135235.423391-3-apatel@ventanamicro.com
Signed-off-by: Anup Patel <anup@brainfault.org>
2025-12-16 20:16:47 +05:30