]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - UefiCpuPkg/PiSmmCpuDxeSmm/X64/Cet.nasm
UefiCpuPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / UefiCpuPkg / PiSmmCpuDxeSmm / X64 / Cet.nasm
... / ...
CommitLineData
1;------------------------------------------------------------------------------ ;\r
2; Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>\r
3; SPDX-License-Identifier: BSD-2-Clause-Patent\r
4;\r
5;-------------------------------------------------------------------------------\r
6\r
7%include "Nasm.inc"\r
8\r
9DEFAULT REL\r
10SECTION .text\r
11\r
12global ASM_PFX(DisableCet)\r
13ASM_PFX(DisableCet):\r
14\r
15 ; Skip the pushed data for call\r
16 mov rax, 1\r
17 INCSSP_RAX\r
18\r
19 mov rax, cr4\r
20 btr eax, 23 ; clear CET\r
21 mov cr4, rax\r
22 ret\r
23\r
24global ASM_PFX(EnableCet)\r
25ASM_PFX(EnableCet):\r
26\r
27 mov rax, cr4\r
28 bts eax, 23 ; set CET\r
29 mov cr4, rax\r
30\r
31 ; use jmp to skip the check for ret\r
32 pop rax\r
33 jmp rax\r
34\r