Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Commit 4dffbfc

Browse files
Ard Biesheuvelwildea01
Ard Biesheuvel
authored andcommitted
arm64/efi: mark UEFI reserved regions as MEMBLOCK_NOMAP
Change the EFI memory reservation logic to use memblock_mark_nomap() rather than memblock_reserve() to mark UEFI reserved regions as occupied. In addition to reserving them against allocations done by memblock, this will also prevent them from being covered by the linear mapping. Reviewed-by: Matt Fleming <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent 68709f4 commit 4dffbfc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: arch/arm64/kernel/efi.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ static __init void reserve_regions(void)
187187
early_init_dt_add_memory_arch(paddr, size);
188188

189189
if (is_reserve_region(md)) {
190-
memblock_reserve(paddr, size);
190+
memblock_mark_nomap(paddr, size);
191191
if (efi_enabled(EFI_DBG))
192192
pr_cont("*");
193193
}
@@ -209,8 +209,6 @@ void __init efi_init(void)
209209

210210
efi_system_table = params.system_table;
211211

212-
memblock_reserve(params.mmap & PAGE_MASK,
213-
PAGE_ALIGN(params.mmap_size + (params.mmap & ~PAGE_MASK)));
214212
memmap.phys_map = params.mmap;
215213
memmap.map = early_memremap(params.mmap, params.mmap_size);
216214
if (memmap.map == NULL) {
@@ -230,6 +228,9 @@ void __init efi_init(void)
230228

231229
reserve_regions();
232230
early_memunmap(memmap.map, params.mmap_size);
231+
memblock_mark_nomap(params.mmap & PAGE_MASK,
232+
PAGE_ALIGN(params.mmap_size +
233+
(params.mmap & ~PAGE_MASK)));
233234
}
234235

235236
static bool __init efi_virtmap_init(void)

0 commit comments

Comments
 (0)