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 ANNOTATE_NOENDBR
18 /* Turn off global entries. Following CR3 write will flush them. */
19 movq %cr4, %rdx
20 andq $~(X86_CR4_PGE), %rdx
21 movq %rdx, %cr4
22
23 /* Switch to identity mapping */
24 movq %rsi, %cr3
25
26 /* Jump to reset vector */
27 ANNOTATE_RETPOLINE_SAFE
28 jmp *%rdi
29SYM_FUNC_END(asm_acpi_mp_play_dead)
30