]> git.proxmox.com Git - mirror_edk2.git/commit
MdePkg/BaseLib: Add support for the VMGEXIT instruction
authorTom Lendacky <thomas.lendacky@amd.com>
Wed, 12 Aug 2020 20:21:35 +0000 (15:21 -0500)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sun, 16 Aug 2020 16:45:42 +0000 (16:45 +0000)
commitf8422f1e0be2654ca253630e0a9996ad87f89c9e
treedfe07320acce57ce75de13cf4c148d0e66af5f42
parent9b3ca509abd4e45439bbdfe2c2fa8780c950320a
MdePkg/BaseLib: Add support for the VMGEXIT instruction

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>
MdePkg/Include/Library/BaseLib.h
MdePkg/Library/BaseLib/BaseLib.inf
MdePkg/Library/BaseLib/Ia32/VmgExit.nasm [new file with mode: 0644]
MdePkg/Library/BaseLib/X64/VmgExit.nasm [new file with mode: 0644]