Hi Ray,

Thanks you for all your comments.

On 11/11/21 7:48 PM, Ni, Ray wrote:
1 comment:

Can you please group the SevEsIsEnabled/SevSnpIsEnabled to a "2 boolean" struct 
or
just one UINT8 field "SevEsEnable"?


I think using the SevEsEnabled will create a bit more confusion. I can certainly follow up patch to combining the fields in structure after this code is merged. I am thinking is we need is actually pass the full CCAttribute in the CpuMetaData, use that to determine the type of the guest. That will require me looking at Min's TDX series and see what I can do to come up with an approach that works for all CC types and keep the code separate.

With that said, if I can get your Ack on what we have then it will be great.

thanks

Through this way, MpLib.c can know less knowledge of SEV-ES.
(I appreciate your effort to group the SEV-ES logic to separate files😊)



    BOOLEAN                        SevEsIsEnabled;
+  BOOLEAN                        SevSnpIsEnabled;
    UINTN                          SevEsAPBuffer;
    UINTN                          SevEsAPResetStackStart;


    ExchangeInfo->SevEsIsEnabled  = CpuMpData->SevEsIsEnabled;
+  ExchangeInfo->SevSnpIsEnabled = CpuMpData->SevSnpIsEnabled;
    ExchangeInfo->GhcbBase        = (UINTN) CpuMpData->GhcbBase;


    InitializeSpinLock(&CpuMpData->MpLock);
    CpuMpData->SevEsIsEnabled = ConfidentialComputingGuestHas (CCAttrAmdSevEs);
+  CpuMpData->SevSnpIsEnabled = ConfidentialComputingGuestHas (CCAttrAmdSevSnp);
    CpuMpData->SevEsAPBuffer  = (UINTN) -1;

    .Enable5LevelPaging:           CTYPE_BOOLEAN 1
    .SevEsIsEnabled:               CTYPE_BOOLEAN 1
+  .SevSnpIsEnabled               CTYPE_BOOLEAN 1
    .GhcbBase:                     CTYPE_UINTN 1




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#83697): https://edk2.groups.io/g/devel/message/83697
Mute This Topic: https://groups.io/mt/86969147/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to