);\r
\r
\r
+/**\r
+ Executes a VMGEXIT instruction (VMMCALL with a REP prefix)\r
+\r
+ Executes a VMGEXIT instruction. This function is only available on IA-32 and\r
+ x64.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmVmgExit (\r
+ VOID\r
+ );\r
+\r
+\r
/**\r
Patch the immediate operand of an IA32 or X64 instruction such that the byte,\r
word, dword or qword operand is encoded at the end of the instruction's\r
Ia32/DisableCache.nasm| GCC\r
Ia32/RdRand.nasm\r
Ia32/XGetBv.nasm\r
+ Ia32/VmgExit.nasm\r
\r
Ia32/DivS64x64Remainder.c\r
Ia32/InternalSwitchStack.c | MSFT\r
X64/DisablePaging64.nasm\r
X64/RdRand.nasm\r
X64/XGetBv.nasm\r
+ X64/VmgExit.nasm\r
ChkStkGcc.c | GCC\r
\r
[Sources.EBC]\r
--- /dev/null
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (C) 2020, Advanced Micro Devices, Inc. All rights reserved.<BR>\r
+; SPDX-License-Identifier: BSD-2-Clause-Patent\r
+;\r
+; Module Name:\r
+;\r
+; VmgExit.Asm\r
+;\r
+; Abstract:\r
+;\r
+; AsmVmgExit function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+ SECTION .text\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; AsmVmgExit (\r
+; VOID\r
+; );\r
+;------------------------------------------------------------------------------\r
+global ASM_PFX(AsmVmgExit)\r
+ASM_PFX(AsmVmgExit):\r
+;\r
+; NASM doesn't support the vmmcall instruction in 32-bit mode and NASM versions\r
+; before 2.12 cannot translate the 64-bit "rep vmmcall" instruction into elf32\r
+; format. Given that VMGEXIT does not make sense on IA32, provide a stub\r
+; implementation that is identical to CpuBreakpoint(). In practice, AsmVmgExit()\r
+; should never be called on IA32.\r
+;\r
+ int 3\r
+ ret\r
+\r
--- /dev/null
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (C) 2020, Advanced Micro Devices, Inc. All rights reserved.<BR>\r
+; SPDX-License-Identifier: BSD-2-Clause-Patent\r
+;\r
+; Module Name:\r
+;\r
+; VmgExit.Asm\r
+;\r
+; Abstract:\r
+;\r
+; AsmVmgExit function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+ DEFAULT REL\r
+ SECTION .text\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; AsmVmgExit (\r
+; VOID\r
+; );\r
+;------------------------------------------------------------------------------\r
+global ASM_PFX(AsmVmgExit)\r
+ASM_PFX(AsmVmgExit):\r
+ rep vmmcall\r
+ ret\r
+\r