diff options
-rw-r--r-- | UefiCpuPkg/Include/StuffRsbNasm.inc (renamed from UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/StuffRsb.inc) | 3 | ||||
-rw-r--r-- | UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.nasm | 2 | ||||
-rw-r--r-- | UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiException.nasm | 2 | ||||
-rw-r--r-- | UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.nasm | 2 | ||||
-rw-r--r-- | UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiException.nasm | 2 | ||||
-rw-r--r-- | UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/StuffRsb.inc | 55 | ||||
-rw-r--r-- | UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiEntry.nasm | 2 | ||||
-rw-r--r-- | UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmmInit.nasm | 2 | ||||
-rw-r--r-- | UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/StuffRsb.inc | 55 | ||||
-rw-r--r-- | UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm | 2 | ||||
-rw-r--r-- | UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmmInit.nasm | 2 | ||||
-rw-r--r-- | UefiCpuPkg/PiSmmCpuDxeSmm/X64/StuffRsb.inc | 55 |
12 files changed, 10 insertions, 174 deletions
diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/StuffRsb.inc b/UefiCpuPkg/Include/StuffRsbNasm.inc index 14267c3..276baea 100644 --- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/StuffRsb.inc +++ b/UefiCpuPkg/Include/StuffRsbNasm.inc @@ -11,7 +11,8 @@ ;
; Abstract:
;
-; This file provides macro definitions for stuffing the Return Stack Buffer (RSB).
+; This file provides macro definitions for stuffing the Return Stack Buffer (RSB)
+; for NASM files.
;
;------------------------------------------------------------------------------
diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.nasm b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.nasm index 3175473..8c1242f 100644 --- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.nasm +++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.nasm @@ -18,7 +18,7 @@ ;
;-------------------------------------------------------------------------------
-%include "StuffRsb.inc"
+%include "StuffRsbNasm.inc"
%define MSR_IA32_MISC_ENABLE 0x1A0
%define MSR_EFER 0xc0000080
diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiException.nasm b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiException.nasm index bc8dbfe..398347c 100644 --- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiException.nasm +++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiException.nasm @@ -18,7 +18,7 @@ ;
;-------------------------------------------------------------------------------
-%include "StuffRsb.inc"
+%include "StuffRsbNasm.inc"
global ASM_PFX(gcStmPsd)
diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.nasm b/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.nasm index c0a0f98..4ca05bb 100644 --- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.nasm +++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.nasm @@ -18,7 +18,7 @@ ;
;-------------------------------------------------------------------------------
-%include "StuffRsb.inc"
+%include "StuffRsbNasm.inc"
;
; Variables referrenced by C code
diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiException.nasm b/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiException.nasm index 3e52959..644d895 100644 --- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiException.nasm +++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiException.nasm @@ -18,7 +18,7 @@ ;
;-------------------------------------------------------------------------------
-%include "StuffRsb.inc"
+%include "StuffRsbNasm.inc"
global ASM_PFX(gcStmPsd)
diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/StuffRsb.inc b/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/StuffRsb.inc deleted file mode 100644 index 14267c3..0000000 --- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/StuffRsb.inc +++ /dev/null @@ -1,55 +0,0 @@ -;------------------------------------------------------------------------------
-;
-; Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Abstract:
-;
-; This file provides macro definitions for stuffing the Return Stack Buffer (RSB).
-;
-;------------------------------------------------------------------------------
-
-%define RSB_STUFF_ENTRIES 0x20
-
-;
-; parameters:
-; @param 1: register to use as counter (e.g. IA32:eax, X64:rax)
-; @param 2: stack pointer to restore (IA32:esp, X64:rsp)
-; @param 3: the size of a stack frame (IA32:4, X64:8)
-;
-%macro StuffRsb 3
- mov %1, RSB_STUFF_ENTRIES / 2
- %%Unroll1:
- call %%Unroll2
- %%SpecTrap1:
- pause
- lfence
- jmp %%SpecTrap1
- %%Unroll2:
- call %%StuffLoop
- %%SpecTrap2:
- pause
- lfence
- jmp %%SpecTrap2
- %%StuffLoop:
- dec %1
- jnz %%Unroll1
- add %2, RSB_STUFF_ENTRIES * %3 ; Restore the stack pointer
-%endmacro
-
-;
-; RSB stuffing macros for IA32 and X64
-;
-%macro StuffRsb32 0
- StuffRsb eax, esp, 4
-%endmacro
-
-%macro StuffRsb64 0
- StuffRsb rax, rsp, 8
-%endmacro
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiEntry.nasm b/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiEntry.nasm index 6bbc339..3791cfa 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiEntry.nasm +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiEntry.nasm @@ -18,7 +18,7 @@ ;
;-------------------------------------------------------------------------------
-%include "StuffRsb.inc"
+%include "StuffRsbNasm.inc"
%define MSR_IA32_MISC_ENABLE 0x1A0
%define MSR_EFER 0xc0000080
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmmInit.nasm b/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmmInit.nasm index 322b1ab..01ab7ab 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmmInit.nasm +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmmInit.nasm @@ -18,7 +18,7 @@ ;
;-------------------------------------------------------------------------------
-%include "StuffRsb.inc"
+%include "StuffRsbNasm.inc"
extern ASM_PFX(SmmInitHandler)
extern ASM_PFX(mRebasedFlag)
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/StuffRsb.inc b/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/StuffRsb.inc deleted file mode 100644 index 14267c3..0000000 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/StuffRsb.inc +++ /dev/null @@ -1,55 +0,0 @@ -;------------------------------------------------------------------------------
-;
-; Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Abstract:
-;
-; This file provides macro definitions for stuffing the Return Stack Buffer (RSB).
-;
-;------------------------------------------------------------------------------
-
-%define RSB_STUFF_ENTRIES 0x20
-
-;
-; parameters:
-; @param 1: register to use as counter (e.g. IA32:eax, X64:rax)
-; @param 2: stack pointer to restore (IA32:esp, X64:rsp)
-; @param 3: the size of a stack frame (IA32:4, X64:8)
-;
-%macro StuffRsb 3
- mov %1, RSB_STUFF_ENTRIES / 2
- %%Unroll1:
- call %%Unroll2
- %%SpecTrap1:
- pause
- lfence
- jmp %%SpecTrap1
- %%Unroll2:
- call %%StuffLoop
- %%SpecTrap2:
- pause
- lfence
- jmp %%SpecTrap2
- %%StuffLoop:
- dec %1
- jnz %%Unroll1
- add %2, RSB_STUFF_ENTRIES * %3 ; Restore the stack pointer
-%endmacro
-
-;
-; RSB stuffing macros for IA32 and X64
-;
-%macro StuffRsb32 0
- StuffRsb eax, esp, 4
-%endmacro
-
-%macro StuffRsb64 0
- StuffRsb rax, rsp, 8
-%endmacro
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm index 414b5ab..807b309 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm @@ -18,7 +18,7 @@ ;
;-------------------------------------------------------------------------------
-%include "StuffRsb.inc"
+%include "StuffRsbNasm.inc"
;
; Variables referrenced by C code
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmmInit.nasm b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmmInit.nasm index 24357d5..5ba45cd 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmmInit.nasm +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmmInit.nasm @@ -18,7 +18,7 @@ ;
;-------------------------------------------------------------------------------
-%include "StuffRsb.inc"
+%include "StuffRsbNasm.inc"
extern ASM_PFX(SmmInitHandler)
extern ASM_PFX(mRebasedFlag)
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/StuffRsb.inc b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/StuffRsb.inc deleted file mode 100644 index 14267c3..0000000 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/StuffRsb.inc +++ /dev/null @@ -1,55 +0,0 @@ -;------------------------------------------------------------------------------
-;
-; Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
-; This program and the accompanying materials
-; are licensed and made available under the terms and conditions of the BSD License
-; which accompanies this distribution. The full text of the license may be found at
-; http://opensource.org/licenses/bsd-license.php.
-;
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-; Abstract:
-;
-; This file provides macro definitions for stuffing the Return Stack Buffer (RSB).
-;
-;------------------------------------------------------------------------------
-
-%define RSB_STUFF_ENTRIES 0x20
-
-;
-; parameters:
-; @param 1: register to use as counter (e.g. IA32:eax, X64:rax)
-; @param 2: stack pointer to restore (IA32:esp, X64:rsp)
-; @param 3: the size of a stack frame (IA32:4, X64:8)
-;
-%macro StuffRsb 3
- mov %1, RSB_STUFF_ENTRIES / 2
- %%Unroll1:
- call %%Unroll2
- %%SpecTrap1:
- pause
- lfence
- jmp %%SpecTrap1
- %%Unroll2:
- call %%StuffLoop
- %%SpecTrap2:
- pause
- lfence
- jmp %%SpecTrap2
- %%StuffLoop:
- dec %1
- jnz %%Unroll1
- add %2, RSB_STUFF_ENTRIES * %3 ; Restore the stack pointer
-%endmacro
-
-;
-; RSB stuffing macros for IA32 and X64
-;
-%macro StuffRsb32 0
- StuffRsb eax, esp, 4
-%endmacro
-
-%macro StuffRsb64 0
- StuffRsb rax, rsp, 8
-%endmacro
|