Re: [edk2-devel] [PATCH V2 07/28] UefiCpuPkg: Support TDX in BaseXApicX2ApicLib

2021-10-14 Thread Min Xu
On October 13, 2021 1:31 PM, Ray Ni wrote: > Min, > Comments below: > > +**/ > +BOOLEAN > +EFIAPI > > 1. EFIAPI is for public lib API. Is this a public API? No, it is not a public API. The EFIAPI will be removed. Thanks for reminder. > > +BaseXApicIsTdxGuest ( > + VOID > + ) > +{ > + UINT32

Re: [edk2-devel] [PATCH V2 07/28] UefiCpuPkg: Support TDX in BaseXApicX2ApicLib

2021-10-13 Thread Min Xu
On October 12, 2021 6:16 PM, Gerd Hoffman wrote: > Hi, > > > + do { > > +AsmCpuid (0, &LargestEax, &Ebx, &Ecx, &Edx); > > Use ConfidentialComputing PCD ? BaseXApicX2ApicLib (LocalApicLib) is included by the drivers/libs not only in DXE phase, but also in SEC/PEI. For example, SecPeiCpuExc

Re: [edk2-devel] [PATCH V2 07/28] UefiCpuPkg: Support TDX in BaseXApicX2ApicLib

2021-10-12 Thread Ni, Ray
Min, Comments below: -Original Message- From: Xu, Min M Sent: Tuesday, October 5, 2021 11:39 AM To: devel@edk2.groups.io Cc: Xu, Min M ; Dong, Eric ; Ni, Ray ; Kumar, Rahul1 ; Brijesh Singh ; Erdem Aktas ; James Bottomley ; Yao, Jiewen ; Tom Lendacky Subject: [PATCH V2 07/28] UefiCp

Re: [edk2-devel] [PATCH V2 07/28] UefiCpuPkg: Support TDX in BaseXApicX2ApicLib

2021-10-12 Thread Gerd Hoffmann
Hi, > + do { > +AsmCpuid (0, &LargestEax, &Ebx, &Ecx, &Edx); Use ConfidentialComputing PCD ? > +BOOLEAN > +EFIAPI > +AccessMsrNative ( I'd suggest to reverse the logic, i.e. have a AccessMsrTdxCall() which returns true in case (a) tdx is active and (b) the msr is not on the white list fo

[edk2-devel] [PATCH V2 07/28] UefiCpuPkg: Support TDX in BaseXApicX2ApicLib

2021-10-04 Thread Min Xu
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 MSR is accessed in BaseXApicX2ApicLib. In TDX some MSRs are accessed directly from/to CPU. Some should be accessed via explicit requests from the host VMM using TDCALL(TDG.VP.VMCALL). This is done by the help of TdxLib. Cc: Eric Dong Cc: R