summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorYu-Chien Peter Lin <[email protected]>2025-10-08 16:44:42 +0800
committerAnup Patel <[email protected]>2025-11-02 16:35:19 +0530
commit631efeeb4913f278b8f5e5920b8c233ac250ff28 (patch)
treee9d5c05dd9d200abfc88d6e19c61b210e86531c6 /include
parentb34caeef815f2e3b54a13e69c8d163bc218712b9 (diff)
lib: sbi_domain: ensure consistent firmware PMP entries
During domain context switches, all PMP entries are reconfigured which can clear firmware access permissions, causing M-mode access faults under SmePMP. Sort domain regions to place firmware regions first, ensuring consistent firmware PMP entries so they won't be revoked during domain context switches. Signed-off-by: Yu-Chien Peter Lin <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/sbi/sbi_domain.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/sbi/sbi_domain.h b/include/sbi/sbi_domain.h
index 9193feb0..1196d609 100644
--- a/include/sbi/sbi_domain.h
+++ b/include/sbi/sbi_domain.h
@@ -121,6 +121,9 @@ struct sbi_domain_memregion {
((__flags & SBI_DOMAIN_MEMREGION_SU_ACCESS_MASK) && \
!(__flags & SBI_DOMAIN_MEMREGION_M_ACCESS_MASK))
+#define SBI_DOMAIN_MEMREGION_IS_FIRMWARE(__flags) \
+ ((__flags & SBI_DOMAIN_MEMREGION_FW) ? true : false) \
+
/** Bit to control if permissions are enforced on all modes */
#define SBI_DOMAIN_MEMREGION_ENF_PERMISSIONS (1UL << 6)