Skip to content

Commit 20d12cf

Browse files
AKASHI Takahirowildea01
authored andcommitted
efi/arm: map UEFI memory map even w/o runtime services enabled
Under the current implementation, UEFI memory map will be mapped and made available in virtual mappings only if runtime services are enabled. But in a later patch, we want to use UEFI memory map in acpi_os_ioremap() to create mappings of ACPI tables using memory attributes described in UEFI memory map. See the following commit: arm64: acpi: fix alignment fault in accessing ACPI tables So, as a first step, arm_enter_runtime_services() is modified, alongside Ard's patch[1], so that UEFI memory map will not be freed even if efi=noruntime. [1] https://marc.info/?l=linux-efi&m=152930773507524&w=2 Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Will Deacon <will.deacon@arm.com>
1 parent 3ea8649 commit 20d12cf

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

‎drivers/firmware/efi/arm-runtime.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ static int __init arm_enable_runtime_services(void)
117117

118118
efi_memmap_unmap();
119119

120+
mapsize = efi.memmap.desc_size * efi.memmap.nr_map;
121+
122+
if (efi_memmap_init_late(efi.memmap.phys_map, mapsize)) {
123+
pr_err("Failed to remap EFI memory map\n");
124+
return 0;
125+
}
126+
120127
if (efi_runtime_disabled()) {
121128
pr_info("EFI runtime services will be disabled.\n");
122129
return 0;
@@ -129,13 +136,6 @@ static int __init arm_enable_runtime_services(void)
129136

130137
pr_info("Remapping and enabling EFI services.\n");
131138

132-
mapsize = efi.memmap.desc_size * efi.memmap.nr_map;
133-
134-
if (efi_memmap_init_late(efi.memmap.phys_map, mapsize)) {
135-
pr_err("Failed to remap EFI memory map\n");
136-
return -ENOMEM;
137-
}
138-
139139
if (!efi_virtmap_init()) {
140140
pr_err("UEFI virtual mapping missing or invalid -- runtime services will not be available\n");
141141
return -ENOMEM;

0 commit comments

Comments
 (0)