From: "Lendacky, Thomas" <thomas.lendacky@amd.com>
To: Michael Roth <michael.roth@amd.com>, devel@edk2.groups.io
Cc: "Ni, Ray" <ray.ni@intel.com>
Subject: Re: [PATCH v3 4/4] UefiCpuPkg: Store SEV-SNP AP jump table in the secrets page
Date: Mon, 23 May 2022 08:57:52 -0500 [thread overview]
Message-ID: <d4611dcd-13b2-188f-67d6-9f2d0fe60e07@amd.com> (raw)
In-Reply-To: <20220520152730.7924-5-michael.roth@amd.com>
On 5/20/22 10:27, 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. Implement the store side of this for OVMF.
>
> Suggested-by: Tom Lendacky <thomas.lendacky@amd.com>
> Signed-off-by: Michael Roth <michael.roth@amd.com>
> ---
> UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf | 1 +
> UefiCpuPkg/Library/MpInitLib/DxeMpLib.c | 10 ++++++++++
> 2 files changed, 11 insertions(+)
>
> diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf b/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
> index e1cd0b3500..d8cfddcd82 100644
> --- a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
> +++ b/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
> @@ -80,3 +80,4 @@
> gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard ## CONSUMES
> gEfiMdeModulePkgTokenSpaceGuid.PcdGhcbBase ## CONSUMES
> gEfiMdePkgTokenSpaceGuid.PcdConfidentialComputingGuestAttr ## CONSUMES
> + gEfiMdePkgTokenSpaceGuid.PcdSevSnpSecretsAddress ## CONSUMES
> diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
> index 60d14a5a0e..4d6f7643db 100644
> --- a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
> +++ b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
> @@ -15,6 +15,7 @@
> #include <Library/VmgExitLib.h>
> #include <Register/Amd/Fam17Msr.h>
> #include <Register/Amd/Ghcb.h>
> +#include <Register/Amd/SnpSecretsPage.h>
>
> #include <Protocol/Timer.h>
>
> @@ -216,6 +217,15 @@ GetSevEsAPMemory (
>
> DEBUG ((DEBUG_INFO, "Dxe: SevEsAPMemory = %lx\n", (UINTN)StartAddress));
>
> + if (ConfidentialComputingGuestHas (CCAttrAmdSevSnp)) {
> + SNP_SECRETS_PAGE *Secrets;
> +
> + Secrets = (SNP_SECRETS_PAGE *)(INTN)PcdGet64 (PcdSevSnpSecretsAddress);
> + Secrets->OsArea.ApJumpTablePa = (UINT64)(UINTN)StartAddress;
> +
> + return (UINTN)StartAddress;
> + }
> +
Just a nit, but I probably would have still put this under the comment
below, because you are still saving the SevEsAPMemory as the AP jump table.
It might look cleaner with the non-SNP path as the else and have the
single return.
Probably not worth another version, but up to you.
Thanks,
Tom
> //
> // Save the SevEsAPMemory as the AP jump table.
> //
next prev parent reply other threads:[~2022-05-23 13:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-20 15:27 [PATCH v3 0/4] Fix AP Jump Table Handling for SEV-SNP Michael Roth
2022-05-20 15:27 ` [PATCH v3 1/4] MdePkg: Add header for SEV-SNP secrets page struct Michael Roth
2022-05-20 15:27 ` [PATCH v3 2/4] MdePkg: Add PcdSevSnpSecretsAddress to export SEV-SNP secrets page Michael Roth
2022-05-20 15:27 ` [PATCH v3 3/4] OvmfPkg: Initialize the PcdSevSnpSecretsAddress PCD during PEI phase Michael Roth
2022-05-20 15:27 ` [PATCH v3 4/4] UefiCpuPkg: Store SEV-SNP AP jump table in the secrets page Michael Roth
2022-05-23 13:57 ` Lendacky, Thomas [this message]
2022-05-23 13:58 ` [PATCH v3 0/4] Fix AP Jump Table Handling for SEV-SNP 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=d4611dcd-13b2-188f-67d6-9f2d0fe60e07@amd.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