From fb2a1a36a292f0fb673aae344f5446134a1b0bf5 Mon Sep 17 00:00:00 2001 From: Tom Lendacky Date: Fri, 6 Nov 2020 11:53:09 -0600 Subject: UefiCpuPkg/MpInitLib: Set the SW exit fields when performing VMGEXIT BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3008 All fields that are set in the GHCB should have their associated bit in the GHCB ValidBitmap field set. Add support to set the bits for the software exit information fields when performing a VMGEXIT (SwExitCode, SwExitInfo1, SwExitInfo2). Fixes: 20da7ca42a33d3ef767ce4129f11496af7f67c9f Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Cc: Rahul Kumar Acked-by: Ray Ni Signed-off-by: Tom Lendacky Message-Id: <6e11dd7e161bddeacc3fb4817467cef24510c31c.1604685192.git.thomas.lendacky@amd.com> --- UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm b/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm index 5d30f35b20..5532a1d391 100644 --- a/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm +++ b/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm @@ -533,6 +533,12 @@ BITS 64 mov rax, 0x80000004 ; VMGEXIT AP_RESET_HOLD mov [rdx + 0x390], rax + mov rax, 114 ; Set SwExitCode valid bit + bts [rdx + 0x3f0], rax + inc rax ; Set SwExitInfo1 valid bit + bts [rdx + 0x3f0], rax + inc rax ; Set SwExitInfo2 valid bit + bts [rdx + 0x3f0], rax pop rdx pop rcx -- cgit v1.2.3