diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2015-11-30 07:28:17 -0500 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2015-12-09 11:57:23 -0500 |
commit | 4dffbfc48d65e5d8157a634fd670065d237a9377 (patch) | |
tree | 9b0101b04106dcfcaa3e825d5e7cf6399d31c474 | |
parent | 68709f45385aeddb0ca96a060c0c8259944f321b (diff) |
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 <matt@codeblueprint.co.uk>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r-- | arch/arm64/kernel/efi.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c index 4eeb17198cfa..04531d35f1df 100644 --- a/arch/arm64/kernel/efi.c +++ b/arch/arm64/kernel/efi.c | |||
@@ -187,7 +187,7 @@ static __init void reserve_regions(void) | |||
187 | early_init_dt_add_memory_arch(paddr, size); | 187 | early_init_dt_add_memory_arch(paddr, size); |
188 | 188 | ||
189 | if (is_reserve_region(md)) { | 189 | if (is_reserve_region(md)) { |
190 | memblock_reserve(paddr, size); | 190 | memblock_mark_nomap(paddr, size); |
191 | if (efi_enabled(EFI_DBG)) | 191 | if (efi_enabled(EFI_DBG)) |
192 | pr_cont("*"); | 192 | pr_cont("*"); |
193 | } | 193 | } |
@@ -209,8 +209,6 @@ void __init efi_init(void) | |||
209 | 209 | ||
210 | efi_system_table = params.system_table; | 210 | efi_system_table = params.system_table; |
211 | 211 | ||
212 | memblock_reserve(params.mmap & PAGE_MASK, | ||
213 | PAGE_ALIGN(params.mmap_size + (params.mmap & ~PAGE_MASK))); | ||
214 | memmap.phys_map = params.mmap; | 212 | memmap.phys_map = params.mmap; |
215 | memmap.map = early_memremap(params.mmap, params.mmap_size); | 213 | memmap.map = early_memremap(params.mmap, params.mmap_size); |
216 | if (memmap.map == NULL) { | 214 | if (memmap.map == NULL) { |
@@ -230,6 +228,9 @@ void __init efi_init(void) | |||
230 | 228 | ||
231 | reserve_regions(); | 229 | reserve_regions(); |
232 | early_memunmap(memmap.map, params.mmap_size); | 230 | 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))); | ||
233 | } | 234 | } |
234 | 235 | ||
235 | static bool __init efi_virtmap_init(void) | 236 | static bool __init efi_virtmap_init(void) |