forked from Mirrors/opensbi
lib: utils/irqchip: Add shared MMIO region for PLIC in root domain
On platforms with Smepmp, the MMIO regions accessed by M-mode need to be explicitly marked with M-mode only read/write or shared (both (M-mode and S-mode) read/write permission. If the above is not done then runtime PLIC access from M-mode on platforms with Smepmp will result in access fault when further results in CPU hotplug not working. Signed-off-by: Anup Patel <apatel@ventanamicro.com>
This commit is contained in:
@@ -10,7 +10,9 @@
|
||||
|
||||
#include <sbi/riscv_io.h>
|
||||
#include <sbi/riscv_encoding.h>
|
||||
#include <sbi/sbi_bitops.h>
|
||||
#include <sbi/sbi_console.h>
|
||||
#include <sbi/sbi_domain.h>
|
||||
#include <sbi/sbi_error.h>
|
||||
#include <sbi/sbi_string.h>
|
||||
#include <sbi_utils/irqchip/plic.h>
|
||||
@@ -171,5 +173,7 @@ int plic_cold_irqchip_init(const struct plic_data *plic)
|
||||
for (i = 1; i <= plic->num_src; i++)
|
||||
plic_set_priority(plic, i, 0);
|
||||
|
||||
return 0;
|
||||
return sbi_domain_root_add_memrange(plic->addr, plic->size, BIT(20),
|
||||
(SBI_DOMAIN_MEMREGION_MMIO |
|
||||
SBI_DOMAIN_MEMREGION_SHARED_SURW_MRW));
|
||||
}
|
||||
|
Reference in New Issue
Block a user