On 10/31/23 11:43, Attar, AbdulLateef (Abdul Lateef) via groups.io wrote: > [Public] > > Hi Laszlo and @Lin, Jacque > Please find my response inline. > Thanks > AbduL > -----Original Message----- > From: Laszlo Ersek <ler...@redhat.com> > Sent: Monday, October 30, 2023 7:34 PM > To: devel@edk2.groups.io; Lin, Jacque <hsienchieh....@amd.com> > Cc: Attar, AbdulLateef (Abdul Lateef) <abdullateef.at...@amd.com>; Chang, > Abner <abner.ch...@amd.com>; Gerd Hoffmann <kra...@redhat.com>; Paolo Bonzini > <pbonz...@redhat.com> > Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg/MmSaveStateLib: Remove checking > Smm Rev ID in AMD MmSaveStateLib
> Are you saying that the > > SmmRevId < AMD_SMM_MIN_REV_ID_X64 > > check will always evaluate to FALSE, and so the "return EFI_NOT_FOUND" > branch is dead code? > [Attar, AbdulLateef (Abdul Lateef)] that's right it always evaluate to FALSE > If that's the case, then the patch seems right, but *why* is SmmRevId always > greater than or equal to AMD_SMM_MIN_REV_ID_X64? > [Attar, AbdulLateef (Abdul Lateef)] as per AMD64 Programmer's manual 10.2.4 > SMM-Revision Identifier. > First 16bit contains the version, which 0x64 for 64bit architecture. > Bit 16 and bit 17 always set 1. > Hence SmmRevId is always equal to AMD_SMM_MIN_REV_ID_X64. That may apply to physical hardware platforms, but does not apply to QEMU/KVM, and this library instance is also used in OVMF (on QEMU/KVM), since commit commit f2188fe5d155 ("OvmfPkg: Uses MmSaveStateLib library", 2023-07-03). Therefore, whatever you do in this library instance, must consider the impact on OVMF on QEMU/KVM. Thanks Laszlo -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110432): https://edk2.groups.io/g/devel/message/110432 Mute This Topic: https://groups.io/mt/102269908/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-