linux/arch/x86/kernel/acpi/madt_playdead.S
Peter Zijlstra 582077c940 x86/cfi: Clean up linkage
With the introduction of kCFI the addition of ENDBR to
SYM_FUNC_START* no longer suffices to make the function indirectly
callable. This now requires the use of SYM_TYPED_FUNC_START.

As such, remove the implicit ENDBR from SYM_FUNC_START* and add some
explicit annotations to fix things up again.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Link: https://lore.kernel.org/r/20250207122546.409116003@infradead.org
2025-02-14 10:32:05 +01:00

29 lines
691 B
ArmAsm

/* SPDX-License-Identifier: GPL-2.0 */
#include <linux/linkage.h>
#include <asm/nospec-branch.h>
#include <asm/page_types.h>
#include <asm/processor-flags.h>
.text
.align PAGE_SIZE
/*
* asm_acpi_mp_play_dead() - Hand over control of the CPU to the BIOS
*
* rdi: Address of the ACPI MADT MPWK ResetVector
* rsi: PGD of the identity mapping
*/
SYM_FUNC_START(asm_acpi_mp_play_dead)
ANNOTATE_NOENDBR
/* Turn off global entries. Following CR3 write will flush them. */
movq %cr4, %rdx
andq $~(X86_CR4_PGE), %rdx
movq %rdx, %cr4
/* Switch to identity mapping */
movq %rsi, %cr3
/* Jump to reset vector */
ANNOTATE_RETPOLINE_SAFE
jmp *%rdi
SYM_FUNC_END(asm_acpi_mp_play_dead)