From: "Ashish Kalra" <ashish.kalra@amd.com>
To: "Dadhania, Nikunj" <NikunjAmritlal.Dadhania@amd.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "dovmurik@linux.vnet.ibm.com" <dovmurik@linux.vnet.ibm.com>,
"brijesh.singh@amd.com" <brijesh.singh@amd.com>,
"tobin@ibm.com" <tobin@ibm.com>,
"Lendacky, Thomas" <Thomas.Lendacky@amd.com>,
"jejb@linux.ibm.com" <jejb@linux.ibm.com>,
"erdemaktas@google.com" <erdemaktas@google.com>,
"jiewen.yao@intel.com" <jiewen.yao@intel.com>,
"min.m.xu@intel.com" <min.m.xu@intel.com>,
"jordan.l.justen@intel.com" <jordan.l.justen@intel.com>,
"ard.biesheuvel@arm.com" <ard.biesheuvel@arm.com>
Subject: Re: [edk2-devel] [PATCH v7 5/6] OvmfPkg/PlatformPei: Mark SEC GHCB page as unencrypted via hypercall
Date: Tue, 31 May 2022 20:05:43 +0000 [thread overview]
Message-ID: <SN6PR12MB2767D00EB64AC18FBE0A1C678EDC9@SN6PR12MB2767.namprd12.prod.outlook.com> (raw)
In-Reply-To: <SN6PR12MB2767AD371D1D91788D5707BC8EDC9@SN6PR12MB2767.namprd12.prod.outlook.com>
[AMD Official Use Only - General]
Hello Nikunj,
But, yes this needs to be fixed.
Thanks,
Ashish
-----Original Message-----
From: Kalra, Ashish
Sent: Tuesday, May 31, 2022 12:51 PM
To: Dadhania, Nikunj <NikunjAmritlal.Dadhania@amd.com>; devel@edk2.groups.io
Cc: dovmurik@linux.vnet.ibm.com; brijesh.singh@amd.com; tobin@ibm.com; Lendacky, Thomas <Thomas.Lendacky@amd.com>; jejb@linux.ibm.com; erdemaktas@google.com; jiewen.yao@intel.com; min.m.xu@intel.com; jordan.l.justen@intel.com; ard.biesheuvel@arm.com
Subject: RE: [edk2-devel] [PATCH v7 5/6] OvmfPkg/PlatformPei: Mark SEC GHCB page as unencrypted via hypercall
[AMD Official Use Only - General]
Hello Nikunj,
That is true, but there is no SEV live migration happening before GHCB pages are re-setup and the hypercalls are invoked again for GHCB pages from the guest kernel after it checks the live migration runtime environment flag setup by OVMF.
Thanks,
Ashish
-----Original Message-----
From: Dadhania, Nikunj <NikunjAmritlal.Dadhania@amd.com>
Sent: Tuesday, May 31, 2022 10:14 AM
To: devel@edk2.groups.io; Kalra, Ashish <Ashish.Kalra@amd.com>
Cc: dovmurik@linux.vnet.ibm.com; brijesh.singh@amd.com; tobin@ibm.com; Lendacky, Thomas <Thomas.Lendacky@amd.com>; jejb@linux.ibm.com; erdemaktas@google.com; jiewen.yao@intel.com; min.m.xu@intel.com; jordan.l.justen@intel.com; ard.biesheuvel@arm.com
Subject: Re: [edk2-devel] [PATCH v7 5/6] OvmfPkg/PlatformPei: Mark SEC GHCB page as unencrypted via hypercall
Hi Ashish,
On 8/19/2021 7:36 PM, Ashish Kalra via groups.io wrote:
> From: Ashish Kalra <ashish.kalra@amd.com>
>
> Mark the SEC GHCB page (that is mapped as unencrypted in ResetVector
> code) in the hypervisor's guest page encryption state tracking.
>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
> Signed-off-by: Ashish Kalra <ashish.kalra@amd.com>
> ---
> OvmfPkg/PlatformPei/AmdSev.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/OvmfPkg/PlatformPei/AmdSev.c
> b/OvmfPkg/PlatformPei/AmdSev.c index a8bf610022..1d38056ec0 100644
> --- a/OvmfPkg/PlatformPei/AmdSev.c
> +++ b/OvmfPkg/PlatformPei/AmdSev.c
> @@ -52,6 +52,17 @@ AmdSevEsInitialize (
> PcdStatus = PcdSetBoolS (PcdSevEsIsEnabled, TRUE);
> ASSERT_RETURN_ERROR (PcdStatus);
>
> + //
> + // The SEC Ghcb setup during reset-vector needs to be marked as //
> + decrypted in the hypervisor's guest page encryption state //
> + tracking.
> + //
> + SetMemoryEncDecHypercall3 (
> + FixedPcdGet32 (PcdOvmfSecGhcbBase),
> + EFI_SIZE_TO_PAGES(FixedPcdGet32 (PcdOvmfSecGhcbSize)),
> + FALSE
> + );
PcdOvmfSecGhcbSize is set to 2 pages (8192 bytes). AFAIU, only first page needs to be change to shared, second page should be kept private.
> //
> // Allocate GHCB and per-CPU variable pages.
> // Since the pages must survive across the UEFI to OS transition
>
Regards
Nikunj
next prev parent reply other threads:[~2022-05-31 20:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-19 14:02 [PATCH v7 0/6] SEV Live Migration support for OVMF Ashish Kalra
2021-08-19 14:03 ` [PATCH v7 1/6] OvmfPkg/BaseMemEncryptLib: Detect SEV live migration feature Ashish Kalra
2021-08-19 14:04 ` [PATCH v7 2/6] OvmfPkg/BaseMemEncryptLib: Hypercall API for page encryption state change Ashish Kalra
2021-08-19 14:04 ` [PATCH v7 3/6] OvmfPkg/BaseMemEncryptLib: Invoke page encryption state change hypercall Ashish Kalra
2021-08-19 14:05 ` [PATCH v7 4/6] OvmfPkg/VmgExitLib: Encryption state change hypercall support in VC handler Ashish Kalra
2021-08-19 14:06 ` [PATCH v7 5/6] OvmfPkg/PlatformPei: Mark SEC GHCB page as unencrypted via hypercall Ashish Kalra
2022-05-31 15:14 ` [edk2-devel] " Nikunj A. Dadhania
2022-05-31 17:50 ` Ashish Kalra
2022-05-31 20:05 ` Ashish Kalra [this message]
2021-08-19 14:06 ` [PATCH v7 6/6] OvmfPkg/AmdSevDxe: Add support for SEV live migration Ashish Kalra
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=SN6PR12MB2767D00EB64AC18FBE0A1C678EDC9@SN6PR12MB2767.namprd12.prod.outlook.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