On Mon, Sep 13, 2021 at 9:20 PM Brijesh Singh <brijesh.si...@amd.com> wrote:
> +*/
> +STATIC
> +VOID
> +SevSnpGhcbRegister (
> +  UINTN   Address
> +  )
> +{
> +  MSR_SEV_ES_GHCB_REGISTER  Msr;
> +  MSR_SEV_ES_GHCB_REGISTER  CurrentMsr;
> +  EFI_PHYSICAL_ADDRESS      GuestFrameNumber;
> +
> +  GuestFrameNumber = Address >> EFI_PAGE_SHIFT;
> +
> +  //
> +  // Save the current MSR Value
> +  //
> +  CurrentMsr.GhcbPhysicalAddress = AsmReadMsr64 (MSR_SEV_ES_GHCB);

We are backing the current MSR value but when was it initialized
before ? Also is not this function supposed to set the Address as the
GHCB address? If it is, do we care about the old value?


> +  // Restore the MSR
> +  //
> +  AsmWriteMsr64 (MSR_SEV_ES_GHCB, CurrentMsr.GhcbPhysicalAddress);

Why are we restoring the old value? I may have misunderstood but I
thought this function will set Address as the new GHCB address?

Thanks
-Erdem


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


Reply via email to