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. -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE5RElWfyWxS+3PLO2a9axLQDIXvEFAl92EsYACgkQa9axLQDI XvEQgg/+PXA8mjVvRzgeEIWggJJWJOgStTuiyynSSLO8KiBXUXYs2MHCib8aNvAM z3GwJnoRUY1Le5gt69PTDC3Aka8ZEz+fij+kXp94H0BtotKLtB4dEeeac/2dKOTE mzmPnWbG6JMCiuTs7Ce0ItBCF+Pvwv/1BtUf12NTHCXXo156zUcYr7y2UztF7hLm 8Hb4kbYDDiy4a3tBvu99u4OUqaimXc8vmXsD1Hl/Op+riGU/oEoZ5+PcsC3s5jz0 eLO3RQDB36IQXoXSXMGJ59UO5IkXV5V9TadmuzlOeVjuejFSJWkLGA/CQoUWQ+Kq lcdwYwBqCrQvsVl1d/kyQDHbdEq409XTpQlsExlX/mh4fAV1He7TWTtCIhbGnz/x 2YP/vV0FNBKNv/mtcBvH/BJKNlXZy5xdYLin+iCJtHby9lIt1bV0nFCLwSvQnDC4 wm/Lo68gOoaCm0uHuledU1VSqmRQb9zJiGywgzVnB4PXycrdIGGRZOPxCGUfMACk fJE3t4MmenLgbPLa4gCUiMAxipIHiBc3prNE/4dFNH/PpUyHoXiZodVGdkff3GYy o9q691GwR352T5dc+jQx7t7ng1NqZqa6DZA4+oMfQbStXeM0m4AoDSqX0j6CAg9c JyReQ8BxqZ/jNzbCZaFoqNSbJwvWewvNNiSzBkHtZXrOZfi8H7U= =wQ+N -----END PGP SIGNATURE----- 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
This commit is contained in:
Коммит
eed2ef4403
|
@ -298,8 +298,21 @@ void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
|
||||||
case EFI_BOOT_SERVICES_DATA:
|
case EFI_BOOT_SERVICES_DATA:
|
||||||
case EFI_CONVENTIONAL_MEMORY:
|
case EFI_CONVENTIONAL_MEMORY:
|
||||||
case EFI_PERSISTENT_MEMORY:
|
case EFI_PERSISTENT_MEMORY:
|
||||||
pr_warn(FW_BUG "requested region covers kernel memory @ %pa\n", &phys);
|
if (memblock_is_map_memory(phys) ||
|
||||||
return NULL;
|
!memblock_is_region_memory(phys, size)) {
|
||||||
|
pr_warn(FW_BUG "requested region covers kernel memory @ %pa\n", &phys);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Mapping kernel memory is permitted if the region in
|
||||||
|
* question is covered by a single memblock with the
|
||||||
|
* NOMAP attribute set: this enables the use of ACPI
|
||||||
|
* table overrides passed via initramfs, which are
|
||||||
|
* reserved in memory using arch_reserve_mem_area()
|
||||||
|
* below. As this particular use case only requires
|
||||||
|
* read access, fall through to the R/O mapping case.
|
||||||
|
*/
|
||||||
|
fallthrough;
|
||||||
|
|
||||||
case EFI_RUNTIME_SERVICES_CODE:
|
case EFI_RUNTIME_SERVICES_CODE:
|
||||||
/*
|
/*
|
||||||
|
@ -388,3 +401,8 @@ int apei_claim_sea(struct pt_regs *regs)
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void arch_reserve_mem_area(acpi_physical_address addr, size_t size)
|
||||||
|
{
|
||||||
|
memblock_mark_nomap(addr, size);
|
||||||
|
}
|
||||||
|
|
|
@ -958,7 +958,7 @@ void acpi_os_set_prepare_extended_sleep(int (*func)(u8 sleep_state,
|
||||||
acpi_status acpi_os_prepare_extended_sleep(u8 sleep_state,
|
acpi_status acpi_os_prepare_extended_sleep(u8 sleep_state,
|
||||||
u32 val_a, u32 val_b);
|
u32 val_a, u32 val_b);
|
||||||
|
|
||||||
#ifdef CONFIG_X86
|
#ifndef CONFIG_IA64
|
||||||
void arch_reserve_mem_area(acpi_physical_address addr, size_t size);
|
void arch_reserve_mem_area(acpi_physical_address addr, size_t size);
|
||||||
#else
|
#else
|
||||||
static inline void arch_reserve_mem_area(acpi_physical_address addr,
|
static inline void arch_reserve_mem_area(acpi_physical_address addr,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче