yes 

thanks,
ray

From: Attar, AbdulLateef (Abdul Lateef) <AbdulLateef.Attar@amd.com>
Sent: Tuesday, April 11, 2023 7:17:03 PM
To: Ni, Ray <ray.ni@intel.com>; devel@edk2.groups.io <devel@edk2.groups.io>; kraxel@redhat.com <kraxel@redhat.com>
Cc: Grimes, Paul <Paul.Grimes@amd.com>; Kirkendall, Garrett <Garrett.Kirkendall@amd.com>; Chang, Abner <Abner.Chang@amd.com>; Dong, Eric <eric.dong@intel.com>; Kumar, Rahul R <rahul.r.kumar@intel.com>; Ard Biesheuvel <ardb+tianocore@kernel.org>; Yao, Jiewen <jiewen.yao@intel.com>; Justen, Jordan L <jordan.l.justen@intel.com>
Subject: RE: [edk2-devel] [PATCH v8 9/9] OvmfPkg: Uses SmmSmramSaveStateLib library
 
[AMD Official Use Only - General]

Hi Ray,
        You mean directly call the SmramSaveStateReadRegister instead of below code from edk2/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c ?

  Status = SmmCpuFeaturesReadSaveStateRegister (CpuIndex, Register, Width, Buffer);
  if (Status == EFI_UNSUPPORTED) {
    Status = SmramSaveStateReadRegister (CpuIndex, Register, Width, Buffer);
  }

Thanks
AbduL

-----Original Message-----
From: Ni, Ray <ray.ni@intel.com>
Sent: 11 April 2023 15:40
To: devel@edk2.groups.io; kraxel@redhat.com; Attar, AbdulLateef (Abdul Lateef) <AbdulLateef.Attar@amd.com>
Cc: Attar, AbdulLateef (Abdul Lateef) <AbdulLateef.Attar@amd.com>; Grimes, Paul <Paul.Grimes@amd.com>; Kirkendall, Garrett <Garrett.Kirkendall@amd.com>; Chang, Abner <Abner.Chang@amd.com>; Dong, Eric <eric.dong@intel.com>; Kumar, Rahul R <rahul.r.kumar@intel.com>; Ard Biesheuvel <ardb+tianocore@kernel.org>; Yao, Jiewen <jiewen.yao@intel.com>; Justen, Jordan L <jordan.l.justen@intel.com>
Subject: RE: [edk2-devel] [PATCH v8 9/9] OvmfPkg: Uses SmmSmramSaveStateLib library

Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.


Gerd,
I am asking Abdul to directly call SaveStateLib from CpuSmm driver.
I don't think SmmCpuFeaturesLib should be in the middle of CpuSmm driver and SaveStateLib regarding the save state access.

Thanks,
Ray

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Gerd
> Hoffmann
> Sent: Tuesday, April 11, 2023 5:43 PM
> To: Abdul Lateef Attar <abdattar@amd.com>
> Cc: devel@edk2.groups.io; Abdul Lateef Attar
> <AbdulLateef.Attar@amd.com>; Paul Grimes <paul.grimes@amd.com>;
> Garrett Kirkendall <garrett.kirkendall@amd.com>; Abner Chang
> <abner.chang@amd.com>; Dong, Eric <eric.dong@intel.com>; Ni, Ray
> <ray.ni@intel.com>; Kumar, Rahul R <rahul.r.kumar@intel.com>; Ard
> Biesheuvel <ardb+tianocore@kernel.org>; Yao, Jiewen
> <jiewen.yao@intel.com>; Justen, Jordan L <jordan.l.justen@intel.com>
> Subject: Re: [edk2-devel] [PATCH v8 9/9] OvmfPkg: Uses
> SmmSmramSaveStateLib library
>
> > Uses new SmmSmramSaveStateLib library, which fix the CI failure.
>
> What is the exact failure you are seeing?
>
> > +
> SmmSmramSaveStateLib|UefiCpuPkg/Library/SmmSmramSaveStateLib/Intel
> SmmSmramSaveStateLib.inf
>
> This should be the AMD version.  KVM uses the AMD smram state.
>
> Also: OvmfPkg/Library/SmmCpuFeaturesLib should be updated to use
> actually use the new SmmSmramSaveStateLib library, and once this has
> been done it should be possible to remove
> OvmfPkg/Include/Register/QemuSmramSaveStateMap.h
>
> take care,
>   Gerd
>
>
>
>
>