diff options
author | Dave Young <dyoung@redhat.com> | 2014-08-17 21:30:07 -0400 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2014-10-03 13:40:59 -0400 |
commit | 6632210f50530ea53dd21f786f2854609d928689 (patch) | |
tree | d7b81d1cec03e959fb87fdcfb5c46a8506461ff3 /arch/arm64 | |
parent | 88f8abd594082b9c08789e8527e4e38116a963ec (diff) |
arm64/efi: Do not enter virtual mode if booting with efi=noruntime or noefi
In case efi runtime disabled via noefi kernel cmdline
arm64_enter_virtual_mode should error out.
At the same time move early_memunmap(memmap.map, mapsize) to the
beginning of the function or it will leak early mem.
Signed-off-by: Dave Young <dyoung@redhat.com>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'arch/arm64')
-rw-r--r-- | arch/arm64/kernel/efi.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c index 6ed0362dd579..8f5db4a3c9d9 100644 --- a/arch/arm64/kernel/efi.c +++ b/arch/arm64/kernel/efi.c | |||
@@ -392,11 +392,16 @@ static int __init arm64_enter_virtual_mode(void) | |||
392 | return -1; | 392 | return -1; |
393 | } | 393 | } |
394 | 394 | ||
395 | pr_info("Remapping and enabling EFI services.\n"); | ||
396 | |||
397 | /* replace early memmap mapping with permanent mapping */ | ||
398 | mapsize = memmap.map_end - memmap.map; | 395 | mapsize = memmap.map_end - memmap.map; |
399 | early_memunmap(memmap.map, mapsize); | 396 | early_memunmap(memmap.map, mapsize); |
397 | |||
398 | if (efi_runtime_disabled()) { | ||
399 | pr_info("EFI runtime services will be disabled.\n"); | ||
400 | return -1; | ||
401 | } | ||
402 | |||
403 | pr_info("Remapping and enabling EFI services.\n"); | ||
404 | /* replace early memmap mapping with permanent mapping */ | ||
400 | memmap.map = (__force void *)ioremap_cache((phys_addr_t)memmap.phys_map, | 405 | memmap.map = (__force void *)ioremap_cache((phys_addr_t)memmap.phys_map, |
401 | mapsize); | 406 | mapsize); |
402 | memmap.map_end = memmap.map + mapsize; | 407 | memmap.map_end = memmap.map + mapsize; |