BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 VMGEXIT is a new instruction used for Hypervisor/Guest communication when running as an SEV-ES guest. A VMGEXIT will cause an automatic exit (AE) to occur, resulting in a #VMEXIT with an exit code value of 0x403. Since SEV-ES is only supported in X64, provide the necessary X64 support to execute the VMGEXIT instruction, which is coded as "rep vmmcall". For IA32, since "vmmcall" is not supported in NASM 32-bit mode and VMGEXIT should never be called, provide a stub implementation that is identical to CpuBreakpoint(). Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
		
			
				
	
	
		
			39 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			NASM
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			NASM
		
	
	
	
	
	
| ;------------------------------------------------------------------------------
 | |
| ;
 | |
| ; Copyright (C) 2020, Advanced Micro Devices, Inc. All rights reserved.<BR>
 | |
| ; SPDX-License-Identifier: BSD-2-Clause-Patent
 | |
| ;
 | |
| ; Module Name:
 | |
| ;
 | |
| ;   VmgExit.Asm
 | |
| ;
 | |
| ; Abstract:
 | |
| ;
 | |
| ;   AsmVmgExit function
 | |
| ;
 | |
| ; Notes:
 | |
| ;
 | |
| ;------------------------------------------------------------------------------
 | |
| 
 | |
|     SECTION .text
 | |
| 
 | |
| ;------------------------------------------------------------------------------
 | |
| ; VOID
 | |
| ; EFIAPI
 | |
| ; AsmVmgExit (
 | |
| ;   VOID
 | |
| ;   );
 | |
| ;------------------------------------------------------------------------------
 | |
| global ASM_PFX(AsmVmgExit)
 | |
| ASM_PFX(AsmVmgExit):
 | |
| ;
 | |
| ; NASM doesn't support the vmmcall instruction in 32-bit mode and NASM versions
 | |
| ; before 2.12 cannot translate the 64-bit "rep vmmcall" instruction into elf32
 | |
| ; format. Given that VMGEXIT does not make sense on IA32, provide a stub
 | |
| ; implementation that is identical to CpuBreakpoint(). In practice, AsmVmgExit()
 | |
| ; should never be called on IA32.
 | |
| ;
 | |
|     int  3
 | |
|     ret
 | |
| 
 |