Last change
on this file since 105670 was 105670, checked in by vboxsync, 7 months ago |
Devices/EFI/FirmwareNew: Merge edk2-stable-202405 and make it build on aarch64, bugref:4643
|
-
Property svn:eol-style
set to
native
-
Property svn:mime-type
set to
text/x-asm
|
File size:
792 bytes
|
Line | |
---|
1 | ;------------------------------------------------------------------------------ ;
|
---|
2 | ; Copyright (c) 2019 - 2023, Intel Corporation. All rights reserved.<BR>
|
---|
3 | ; SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
4 | ;
|
---|
5 | ;-------------------------------------------------------------------------------
|
---|
6 |
|
---|
7 | %include "Nasm.inc"
|
---|
8 | %include "Cet.inc"
|
---|
9 |
|
---|
10 | DEFAULT REL
|
---|
11 | SECTION .text
|
---|
12 |
|
---|
13 | global ASM_PFX(DisableCet)
|
---|
14 | ASM_PFX(DisableCet):
|
---|
15 |
|
---|
16 | ; Skip the pushed data for call
|
---|
17 | mov rax, 1
|
---|
18 | incsspq rax
|
---|
19 |
|
---|
20 | mov rax, cr4
|
---|
21 | btr eax, CR4_CET_BIT ; clear CET
|
---|
22 | mov cr4, rax
|
---|
23 | ret
|
---|
24 |
|
---|
25 | global ASM_PFX(EnableCet)
|
---|
26 | ASM_PFX(EnableCet):
|
---|
27 |
|
---|
28 | mov rax, cr4
|
---|
29 | bts eax, CR4_CET_BIT ; set CET
|
---|
30 | mov cr4, rax
|
---|
31 |
|
---|
32 | ; use jmp to skip the check for ret
|
---|
33 | pop rax
|
---|
34 | jmp rax
|
---|
35 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.