Hi Ashish, I missed the v8 and replied on v7.
On 4/5/2022 11:02 PM, Ashish Kalra via groups.io wrote: > From: Ashish Kalra <[email protected]> > > 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 <[email protected]> > Cc: Ard Biesheuvel <[email protected]> > Signed-off-by: Ashish Kalra <[email protected]> > --- > OvmfPkg/PlatformPei/AmdSev.c | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/OvmfPkg/PlatformPei/AmdSev.c b/OvmfPkg/PlatformPei/AmdSev.c > index 385562b44c..cd96fc23bd 100644 > --- a/OvmfPkg/PlatformPei/AmdSev.c > +++ b/OvmfPkg/PlatformPei/AmdSev.c > @@ -223,6 +223,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 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#90112): https://edk2.groups.io/g/devel/message/90112 Mute This Topic: https://groups.io/mt/90271239/21656 Group Owner: [email protected] Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
