
From: Jian Zhang <zhangjian210@huawei.com> In this case, if the memory has been maped, we just return it's virtual memory address. Signed-off-by: Jian Zhang <zhangjian210@huawei.com> Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com> Reviewed-by: Weilong Chen <chenweilong@huawei.com> --- arch/arm64/kernel/acpi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c index a81105cfe57e..203e3c95097f 100644 --- a/arch/arm64/kernel/acpi.c +++ b/arch/arm64/kernel/acpi.c @@ -25,6 +25,7 @@ #include <linux/smp.h> #include <linux/serial_core.h> #include <linux/pgtable.h> +#include <acpi/dt_apei.h> #include <acpi/ghes.h> #include <acpi/processor.h> @@ -268,6 +269,10 @@ void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size) efi_memory_desc_t *md, *region = NULL; pgprot_t prot; + /* For normal memory we already have a cacheable mapping. */ + if (memblock_is_map_memory(phys) && enable_acpi_dt_apei) + return (void __iomem *)__phys_to_virt(phys); + if (WARN_ON_ONCE(!efi_enabled(EFI_MEMMAP))) return NULL; -- 2.17.1