xref: /linux/arch/x86/kernel/acpi/madt_playdead.S (revision 96f30c8f0aa9923aa39b30bcaefeacf88b490231)
1/* SPDX-License-Identifier: GPL-2.0 */
2#include <linux/linkage.h>
3#include <asm/nospec-branch.h>
4#include <asm/page_types.h>
5#include <asm/processor-flags.h>
6
7	.text
8	.align PAGE_SIZE
9
10/*
11 * asm_acpi_mp_play_dead() - Hand over control of the CPU to the BIOS
12 *
13 * rdi: Address of the ACPI MADT MPWK ResetVector
14 * rsi: PGD of the identity mapping
15 */
16SYM_FUNC_START(asm_acpi_mp_play_dead)
17	/* Turn off global entries. Following CR3 write will flush them. */
18	movq	%cr4, %rdx
19	andq	$~(X86_CR4_PGE), %rdx
20	movq	%rdx, %cr4
21
22	/* Switch to identity mapping */
23	movq	%rsi, %cr3
24
25	/* Jump to reset vector */
26	ANNOTATE_RETPOLINE_SAFE
27	jmp	*%rdi
28SYM_FUNC_END(asm_acpi_mp_play_dead)
29