History

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fix from Catalin Marinas: "A previous commit to prevent AML memory opregions from accessing the kernel memory turned out to be too restrictive. Relax the permission check to permit the ACPI core to map kernel memory used for table overrides" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: permit ACPI core to map kernel memory used for table overrides

Linus Torvalds committed 6 years ago

Commit eed2ef42 parents fcadab7 a509a662 files · +21 −3Browse files

Unified · Split

2 files
  1. arch/arm64/kernel/acpi.c +20 −2
  2. include/linux/acpi.h +1 −1
arch/arm64/kernel/acpi.c+20−2
@@ -298,8 +298,21 @@ void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size) · 297 unmodified lines
298298 case EFI_BOOT_SERVICES_DATA:
299299 case EFI_CONVENTIONAL_MEMORY:
300300 case EFI_PERSISTENT_MEMORY:
301− pr_warn(FW_BUG "requested region covers kernel memory @ %pa\n", &phys);
302− return NULL;
301+ if (memblock_is_map_memory(phys) ||
302+ !memblock_is_region_memory(phys, size)) {
303+ pr_warn(FW_BUG "requested region covers kernel memory @ %pa\n", &phys);
304+ return NULL;
305+ }
306+ /*
307+ * Mapping kernel memory is permitted if the region in
308+ * question is covered by a single memblock with the
309+ * NOMAP attribute set: this enables the use of ACPI
310+ * table overrides passed via initramfs, which are
311+ * reserved in memory using arch_reserve_mem_area()
312+ * below. As this particular use case only requires
313+ * read access, fall through to the R/O mapping case.
314+ */
315+ fallthrough;
303316
304317 case EFI_RUNTIME_SERVICES_CODE:
305318 /*
@@ -388,3 +401,8 @@ int apei_claim_sea(struct pt_regs *regs) · 82 unmodified lines
388401
389402 return err;
390403 }
404+
405+void arch_reserve_mem_area(acpi_physical_address addr, size_t size)
406+{
407+ memblock_mark_nomap(addr, size);
408+}
include/linux/acpi.h+1−1
@@ -958,7 +958,7 @@ void acpi_os_set_prepare_extended_sleep(int (*func)(u8 sleep_state, · 957 unmodified lines
958958 acpi_status acpi_os_prepare_extended_sleep(u8 sleep_state,
959959 u32 val_a, u32 val_b);
960960
961−#ifdef CONFIG_X86
961+#ifndef CONFIG_IA64
962962 void arch_reserve_mem_area(acpi_physical_address addr, size_t size);
963963 #else
964964 static inline void arch_reserve_mem_area(acpi_physical_address addr,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t