Re: [edk2-devel] [RFC PATCH v3 28/43] OvmfPkg: Create GHCB pages for use during Pei and Dxe phase

2019-12-12 Thread Lendacky, Thomas
On 12/12/19 12:54 AM, Ni, Ray wrote: >> + // Allocate GHCB and per-CPU variable pages. >> + // >> + GhcbPageCount = mMaxCpuCount * 2; >> + GhcbBase = AllocatePages (GhcbPageCount); >> + ASSERT (GhcbBase != NULL); >> + >> + GhcbBasePa = (PHYSICAL_ADDRESS)(UINTN) GhcbBase; >> + >> + DecryptSta

Re: [edk2-devel] [RFC PATCH v3 28/43] OvmfPkg: Create GHCB pages for use during Pei and Dxe phase

2019-12-11 Thread Ni, Ray
> + // Allocate GHCB and per-CPU variable pages. > + // > + GhcbPageCount = mMaxCpuCount * 2; > + GhcbBase = AllocatePages (GhcbPageCount); > + ASSERT (GhcbBase != NULL); > + > + GhcbBasePa = (PHYSICAL_ADDRESS)(UINTN) GhcbBase; > + > + DecryptStatus = MemEncryptSevClearPageEncMask ( > +0

[edk2-devel] [RFC PATCH v3 28/43] OvmfPkg: Create GHCB pages for use during Pei and Dxe phase

2019-11-20 Thread Lendacky, Thomas
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 Allocate memory for the GHCB pages and the per-CPU variable pages during SEV initialization for use during Pei and Dxe phases. The GHCB page(s) must be shared pages, so clear the encryption mask from the current page table entries. Upon succe