[edk2-devel] [PATCH v4 0/4] Fix AP Jump Table Handling for SEV-SNP

Roth, Michael via groups.io posted 4 patches 1 year, 4 months ago
Failed in applying to current master (apply log)
MdePkg/Include/Register/Amd/SnpSecretsPage.h  | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++
MdePkg/MdePkg.dec                             |  4 ++++
OvmfPkg/AmdSev/AmdSevX64.dsc                  |  3 +++
OvmfPkg/CloudHv/CloudHvX64.dsc                |  3 +++
OvmfPkg/IntelTdx/IntelTdxX64.dsc              |  3 +++
OvmfPkg/Microvm/MicrovmX64.dsc                |  3 +++
OvmfPkg/OvmfPkgIa32.dsc                       |  3 +++
OvmfPkg/OvmfPkgIa32X64.dsc                    |  3 +++
OvmfPkg/OvmfPkgX64.dsc                        |  3 +++
OvmfPkg/PlatformPei/AmdSev.c                  |  5 +++++
OvmfPkg/PlatformPei/PlatformPei.inf           |  1 +
UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf |  1 +
UefiCpuPkg/Library/MpInitLib/DxeMpLib.c       | 10 ++++++++++
13 files changed, 98 insertions(+)
create mode 100644 MdePkg/Include/Register/Amd/SnpSecretsPage.h
[edk2-devel] [PATCH v4 0/4] Fix AP Jump Table Handling for SEV-SNP
Posted by Roth, Michael via groups.io 1 year, 4 months ago
A full-featured SEV-SNP guest will not rely on the AP jump table, and
will instead use the AP Creation interface defined by the GHCB. However,
a guest is still allowed to use the AP jump table if desired.

However, unlike with SEV-ES guests, SEV-SNP guests should not
store/retrieve the jump table address via GHCB requests to the
hypervisor, they should instead store/retrieve it via the SEV-SNP
secrets page.

This series implements the store side of this for OVMF by introducing a
PCD that can be used to pass the SEV-SNP secrets page address to
UefiCpuPkg, where the jump table address is allocated. It also
introduces a struct that defines the SEV-SNP secrets page format
according to the GHCB v2.01 and SEV-SNP FW ABI specifications.

v4:
 - Move storing of jump table address after relevant comment rather
   than before it. (Tom)

v3:
 - Break up single patch into a set of patches containing the specific
   changes for each package. (Ray)

v2:
 - Update Secrets OS area to match latest GHCB 2.01 spec (Tom)
 - Move Secrets header file into ./Register/AMD subdirectory (Tom)
 - Fix CI EccCheck due to assignment in variable declaration

----------------------------------------------------------------
Michael Roth (4):
      MdePkg: Add header for SEV-SNP secrets page struct
      MdePkg: Add PcdSevSnpSecretsAddress to export SEV-SNP secrets page
      OvmfPkg: Initialize the PcdSevSnpSecretsAddress PCD during PEI phase
      UefiCpuPkg: Store SEV-SNP AP jump table in the secrets page

 MdePkg/Include/Register/Amd/SnpSecretsPage.h  | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 MdePkg/MdePkg.dec                             |  4 ++++
 OvmfPkg/AmdSev/AmdSevX64.dsc                  |  3 +++
 OvmfPkg/CloudHv/CloudHvX64.dsc                |  3 +++
 OvmfPkg/IntelTdx/IntelTdxX64.dsc              |  3 +++
 OvmfPkg/Microvm/MicrovmX64.dsc                |  3 +++
 OvmfPkg/OvmfPkgIa32.dsc                       |  3 +++
 OvmfPkg/OvmfPkgIa32X64.dsc                    |  3 +++
 OvmfPkg/OvmfPkgX64.dsc                        |  3 +++
 OvmfPkg/PlatformPei/AmdSev.c                  |  5 +++++
 OvmfPkg/PlatformPei/PlatformPei.inf           |  1 +
 UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf |  1 +
 UefiCpuPkg/Library/MpInitLib/DxeMpLib.c       | 10 ++++++++++
 13 files changed, 98 insertions(+)
 create mode 100644 MdePkg/Include/Register/Amd/SnpSecretsPage.h




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97696): https://edk2.groups.io/g/devel/message/97696
Mute This Topic: https://groups.io/mt/95815534/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v4 0/4] Fix AP Jump Table Handling for SEV-SNP
Posted by Roth, Michael via groups.io 1 year, 4 months ago
On Wed, Dec 21, 2022 at 09:50:43AM -0600, Michael Roth wrote:
> A full-featured SEV-SNP guest will not rely on the AP jump table, and
> will instead use the AP Creation interface defined by the GHCB. However,
> a guest is still allowed to use the AP jump table if desired.
> 
> However, unlike with SEV-ES guests, SEV-SNP guests should not
> store/retrieve the jump table address via GHCB requests to the
> hypervisor, they should instead store/retrieve it via the SEV-SNP
> secrets page.
> 
> This series implements the store side of this for OVMF by introducing a
> PCD that can be used to pass the SEV-SNP secrets page address to
> UefiCpuPkg, where the jump table address is allocated. It also
> introduces a struct that defines the SEV-SNP secrets page format
> according to the GHCB v2.01 and SEV-SNP FW ABI specifications.
> 
> v4:
>  - Move storing of jump table address after relevant comment rather
>    than before it. (Tom)
> 
> v3:
>  - Break up single patch into a set of patches containing the specific
>    changes for each package. (Ray)
> 
> v2:
>  - Update Secrets OS area to match latest GHCB 2.01 spec (Tom)
>  - Move Secrets header file into ./Register/AMD subdirectory (Tom)
>  - Fix CI EccCheck due to assignment in variable declaration
> 
> ----------------------------------------------------------------
> Michael Roth (4):
>       MdePkg: Add header for SEV-SNP secrets page struct
>       MdePkg: Add PcdSevSnpSecretsAddress to export SEV-SNP secrets page
>       OvmfPkg: Initialize the PcdSevSnpSecretsAddress PCD during PEI phase
>       UefiCpuPkg: Store SEV-SNP AP jump table in the secrets page

Adding some Cc's from Maintainers.txt that I should have included originally:

Patch 1/2:
  Michael D Kinney <michael.d.kinney@intel.com>
  Liming Gao <gaoliming@byosoft.com.cn>
  Zhiguang Liu <zhiguang.liu@intel.com>

Patch 3:
  Ard Biesheuvel <ardb+tianocore@kernel.org>
  Jiewen Yao <jiewen.yao@intel.com>
  Gerd Hoffmann <kraxel@redhat.com>

Patch 4:
  Eric Dong <eric.dong@intel.com>
  Rahul Kumar <rahul1.kumar@intel.com>

Thanks,

Mike

> 
>  MdePkg/Include/Register/Amd/SnpSecretsPage.h  | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++
>  MdePkg/MdePkg.dec                             |  4 ++++
>  OvmfPkg/AmdSev/AmdSevX64.dsc                  |  3 +++
>  OvmfPkg/CloudHv/CloudHvX64.dsc                |  3 +++
>  OvmfPkg/IntelTdx/IntelTdxX64.dsc              |  3 +++
>  OvmfPkg/Microvm/MicrovmX64.dsc                |  3 +++
>  OvmfPkg/OvmfPkgIa32.dsc                       |  3 +++
>  OvmfPkg/OvmfPkgIa32X64.dsc                    |  3 +++
>  OvmfPkg/OvmfPkgX64.dsc                        |  3 +++
>  OvmfPkg/PlatformPei/AmdSev.c                  |  5 +++++
>  OvmfPkg/PlatformPei/PlatformPei.inf           |  1 +
>  UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf |  1 +
>  UefiCpuPkg/Library/MpInitLib/DxeMpLib.c       | 10 ++++++++++
>  13 files changed, 98 insertions(+)
>  create mode 100644 MdePkg/Include/Register/Amd/SnpSecretsPage.h
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97707): https://edk2.groups.io/g/devel/message/97707
Mute This Topic: https://groups.io/mt/95815534/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-