@@ -14,6 +14,8 @@ extern void efi_init(void);
int efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md);
+#define efi_set_mapping_permissions efi_create_mapping
+
#define efi_call_virt(f, ...) \
({ \
efi_##f##_t *__f; \
@@ -206,6 +206,7 @@ void __init efi_init(void)
return;
reserve_regions();
+ efi_memattr_init();
early_memunmap(efi.memmap.map, params.mmap_size);
if (IS_ENABLED(CONFIG_ARM)) {
@@ -77,9 +77,15 @@ static bool __init efi_virtmap_init(void)
systab_found = true;
}
}
- if (!systab_found)
+ if (!systab_found) {
pr_err("No virtual mapping found for the UEFI System Table\n");
- return systab_found;
+ return false;
+ }
+
+ if (efi_memattr_apply_permissions(&efi_mm, efi_set_mapping_permissions))
+ return false;
+
+ return true;
}
/*