@@ -221,12 +221,8 @@ void *setup_mmu(phys_addr_t phys_end, void *unused)
mmu_idmap = alloc_page();
for (r = mem_regions; r->end; ++r) {
- if (r->flags & MR_F_IO) {
+ if (r->flags & (MR_F_IO | MR_F_RESERVED)) {
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,
@@ -309,8 +309,8 @@ static efi_status_t efi_mem_init(efi_bootinfo_t *efi_bootinfo)
data->flags &= ~MR_F_CODE;
for (struct mem_region *m = mem_regions; m->end; ++m) {
- if (m != code && (m->flags & MR_F_CODE))
- m->flags = MR_F_RESERVED;
+ if (m != code)
+ assert(!(m->flags & MR_F_CODE));
if (!(m->flags & MR_F_IO)) {
if (m->start < __phys_offset)
@@ -112,6 +112,14 @@ void memregions_efi_init(struct efi_boot_memmap *mem_map,
case EFI_LOADER_CODE:
r.flags = MR_F_CODE;
break;
+ case EFI_LOADER_DATA:
+ break;
+ case EFI_BOOT_SERVICES_DATA:
+ /*
+ * FIXME: This would ideally be MR_F_RESERVED, but the
+ * primary stack is in a region of this EFI type.
+ */
+ break;
case EFI_PERSISTENT_MEMORY:
r.flags = MR_F_PERSISTENT;
break;