@@ -15,6 +15,7 @@ extern int nr_cpus;
#define MR_F_IO (1U << 0)
#define MR_F_CODE (1U << 1)
+#define MR_F_RESERVED (1U << 2)
#define MR_F_UNKNOWN (1U << 31)
struct mem_region {
@@ -222,6 +222,10 @@ void *setup_mmu(phys_addr_t phys_end, void *unused)
for (r = mem_regions; r->end; ++r) {
if (r->flags & MR_F_IO) {
continue;
+ } else if (r->flags & MR_F_RESERVED) {
+ /* Reserved pages need to be writable for whatever reserved them */
+ mmu_set_range_ptes(mmu_idmap, r->start, r->start, r->end,
+ __pgprot(PTE_WBWA));
} else if (r->flags & MR_F_CODE) {
/* armv8 requires code shared between EL1 and EL0 to be read-only */
mmu_set_range_ptes(mmu_idmap, r->start, r->start, r->end,