From 977c0ac09f737542b300d01e7939466f0bd8b88c Mon Sep 17 00:00:00 2001 From: Sami Tolvanen Date: Thu, 4 Feb 2021 14:28:43 -0800 Subject: [PATCH] ANDROID: arm64: kernel: use __pa_function for secondary_entry With CONFIG_CFI_CLANG, the compiler replaces function pointers with jump table addresses, which results in __pa_symbol returning the physical address of the jump table entry. As the jump table contains an immediate jump to an EL1 virtual address, this typically won't work as intended. Use __pa_function instead to get the address of secondary_entry. Bug: 178005287 Change-Id: I90aea4cacd66ac224aae5c1a577decda1d922c22 Signed-off-by: Sami Tolvanen --- arch/arm64/kernel/acpi_parking_protocol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kernel/acpi_parking_protocol.c b/arch/arm64/kernel/acpi_parking_protocol.c index e7c941d8340d..e7f3af6043c5 100644 --- a/arch/arm64/kernel/acpi_parking_protocol.c +++ b/arch/arm64/kernel/acpi_parking_protocol.c @@ -99,7 +99,7 @@ static int acpi_parking_protocol_cpu_boot(unsigned int cpu) * that read this address need to convert this address to the * Boot-Loader's endianness before jumping. */ - writeq_relaxed(__pa_symbol(secondary_entry), &mailbox->entry_point); + writeq_relaxed(__pa_function(secondary_entry), &mailbox->entry_point); writel_relaxed(cpu_entry->gic_cpu_id, &mailbox->cpu_id); arch_send_wakeup_ipi_mask(cpumask_of(cpu));