public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: Tom Lendacky <thomas.lendacky@amd.com>, devel@edk2.groups.io
Cc: Brijesh Singh <brijesh.singh@amd.com>,
	Ard Biesheuvel <ard.biesheuvel@arm.com>,
	Eric Dong <eric.dong@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	Jordan Justen <jordan.l.justen@intel.com>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Rahul Kumar <rahul1.kumar@intel.com>,
	Zhiguang Liu <zhiguang.liu@intel.com>, Ray Ni <ray.ni@intel.com>
Subject: Re: [PATCH v3 00/11] SEV-ES guest support fixes and cleanup
Date: Mon, 2 Nov 2020 17:46:51 +0100	[thread overview]
Message-ID: <64513342-24e7-0705-bbd1-301e621f63ad@redhat.com> (raw)
In-Reply-To: <cover.1603981082.git.thomas.lendacky@amd.com>

On 10/29/20 15:17, Tom Lendacky wrote:
> From: Tom Lendacky <thomas.lendacky@amd.com>
> 
> This patch series provides some fixes, updates and cleanup to the SEV-ES
> guest support:
> 
> - Update the calculation of the qword offset of fields within the GHCB
>   by removing the hardcoding of the offsets and using the OFFSET_OF ()
>   and sizeof () functions to calculate the values. Remove unused values
>   and add values that will be used in later patches.
> 
> - Set the SwExitCode, SwExitInfo1, SwExitInfo2 and SwScratch valid bits
>   in the GHCB ValidBitmap area when these fields are for a VMGEXIT. This
>   is done by adding two new interfaces to the VmgExitLib library to set
>   and test the bits of the GHCB ValidBitmap. This reduces code duplication
>   and keeps access to the ValidBitmap field within the VmgExitLib library.
> 
> - Update the Qemu flash drive services support to add SEV-ES support for
>   erasing blocks.
> 
> - Disable interrupts when using the GHCB.
> 
> - Use the processor number for setting the AP stack pointer instead of the
>   APIC ID by calling GetProcessorNumber().
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3008
> 
> ---
> 
> These patches are based on commit:
> 6ad819c1abe3 ("FmpDevicePkg/FmpDeviceLib: Add Last Attempt Status to Check/Set API")
> 
> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Rahul Kumar <rahul1.kumar@intel.com>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Tom Lendacky <thomas.lendacky@amd.com>
> Cc: Brijesh Singh <brijesh.singh@amd.com>
> 
> Changes since v2:
> - Don't rename the GHCB_REGISTER enum type.

I've got this queued for review. I'll need some time for getting to it,
as I've just returned after some absence, and everything seems to have
collapsed on my head (as usual).

Laszlo

> 
> Changes since v1:
> - For the GHCB savearea changes, create a new reserved area name instead
>   of "renumbering" the reserved areas.
> - Rework the ValidBitmap set/test support to be part of the VmgExitLib
>   library. Create two new interfaces for setting and testing bits in the
>   GHCB ValidBitmap field and adjust all existing code and the new code in
>   this series to use these interfaces for the ValidBitmap updates/checks.
> - Don't disable interrupts for just the Qemu flash services support, but
>   rather, cover all users of the GHCB by disabling interrupts in VmgInit()
>   and restoring them in VmgDone(). This requires changes to those
>   interaces.
> 
> Tom Lendacky (11):
>   MdePkg: Clean up GHCB field offsets and save area
>   UefiCpuPkg/VmgExitLib: Add interfaces to set/read GHCB ValidBitmap
>     bits
>   OvmfPkg/VmgExitLib: Implement new VmgExitLib interfaces
>   OvmfPkg/VmgExitLib: Set the SW exit fields when performing VMGEXIT
>   OvmfPkg/VmgExitLib: Set the SwScratch valid bit for IOIO events
>   OvmfPkg/VmgExitLib: Set the SwScratch valid bit for MMIO events
>   UefiCpuPkg/MpInitLib: Set the SW exit fields when performing VMGEXIT
>   OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Set the SwScratch valid bit
>   OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Fix erase blocks for SEV-ES
>   UefiCpuPkg, OvmfPkg: Disable interrupts when using the GHCB
>   UefiCpuPkg/MpInitLib: For SEV-ES guest, set stack based on processor
>     number
> 
>  MdePkg/Include/Register/Amd/Ghcb.h                    |  40 +++---
>  UefiCpuPkg/Include/Library/VmgExitLib.h               |  51 +++++++-
>  OvmfPkg/Library/VmgExitLib/VmgExitLib.c               |  84 ++++++++++++-
>  OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c         | 129 ++++++--------------
>  OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c    |   4 +-
>  OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlashDxe.c |   6 +-
>  UefiCpuPkg/Library/MpInitLib/DxeMpLib.c               |   5 +-
>  UefiCpuPkg/Library/MpInitLib/MpLib.c                  |  14 ++-
>  UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.c    |  60 +++++++--
>  UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm         |   6 +
>  10 files changed, 258 insertions(+), 141 deletions(-)
> 


  parent reply	other threads:[~2020-11-02 16:47 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-29 14:17 [PATCH v3 00/11] SEV-ES guest support fixes and cleanup Lendacky, Thomas
2020-10-29 14:17 ` [PATCH v3 01/11] MdePkg: Clean up GHCB field offsets and save area Lendacky, Thomas
2020-10-30  1:03   ` 回复: " gaoliming
2020-10-29 14:17 ` [PATCH v3 02/11] UefiCpuPkg/VmgExitLib: Add interfaces to set/read GHCB ValidBitmap bits Lendacky, Thomas
2020-11-03 16:22   ` [edk2-devel] " Laszlo Ersek
2020-11-03 16:38   ` Laszlo Ersek
2020-11-04  8:19   ` Dong, Eric
2020-10-29 14:17 ` [PATCH v3 03/11] OvmfPkg/VmgExitLib: Implement new VmgExitLib interfaces Lendacky, Thomas
2020-11-03 16:26   ` [edk2-devel] " Laszlo Ersek
2020-10-29 14:17 ` [PATCH v3 04/11] OvmfPkg/VmgExitLib: Set the SW exit fields when performing VMGEXIT Lendacky, Thomas
2020-10-29 14:17 ` [PATCH v3 05/11] OvmfPkg/VmgExitLib: Set the SwScratch valid bit for IOIO events Lendacky, Thomas
2020-10-29 14:17 ` [PATCH v3 06/11] OvmfPkg/VmgExitLib: Set the SwScratch valid bit for MMIO events Lendacky, Thomas
2020-10-29 14:17 ` [PATCH v3 07/11] UefiCpuPkg/MpInitLib: Set the SW exit fields when performing VMGEXIT Lendacky, Thomas
2020-10-29 14:17 ` [PATCH v3 08/11] OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Set the SwScratch valid bit Lendacky, Thomas
2020-10-29 14:18 ` [PATCH v3 09/11] OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Fix erase blocks for SEV-ES Lendacky, Thomas
2020-10-29 14:18 ` [PATCH v3 10/11] UefiCpuPkg, OvmfPkg: Disable interrupts when using the GHCB Lendacky, Thomas
2020-11-03 16:38   ` [edk2-devel] " Laszlo Ersek
2020-11-04  8:20   ` Dong, Eric
2020-10-29 14:18 ` [PATCH v3 11/11] UefiCpuPkg/MpInitLib: For SEV-ES guest, set stack based on processor number Lendacky, Thomas
2020-11-02 16:46 ` Laszlo Ersek [this message]
2020-11-05  3:29 ` [edk2-devel] [PATCH v3 00/11] SEV-ES guest support fixes and cleanup Laszlo Ersek
2020-11-05 14:34   ` Lendacky, Thomas
2020-11-06  6:29     ` Lendacky, Thomas
2020-11-06 16:46       ` Laszlo Ersek
2020-11-06 17:48         ` Lendacky, Thomas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=64513342-24e7-0705-bbd1-301e621f63ad@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox