From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: Re: [edk2-devel] [PATCH v2 15/16] UefiCpuPkg: CpuIo2Smm: Support of CpuIo driver under StandaloneMm To: Laszlo Ersek ,devel@edk2.groups.io From: "Kun Qin" X-Originating-Location: Kirkland, Washington, US (50.35.88.161) X-Originating-Platform: Windows Chrome 87 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Wed, 06 Jan 2021 11:02:16 -0800 References: <93505c34-3161-26eb-5feb-f916988f5f1b@redhat.com> In-Reply-To: <93505c34-3161-26eb-5feb-f916988f5f1b@redhat.com> Message-ID: <10604.1609959736066754079@groups.io> Content-Type: multipart/alternative; boundary="CU55HiktG5jBzeNxeq82" --CU55HiktG5jBzeNxeq82 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Laszlo, I did the patch mostly following the pattern of this commit: MdeModulePkg/= FaultTolerantWriteDxe: factor out boot service accesses =C2=B7 tianocore/ed= k2@22cedf5 (github.com) ( https://github.com/tianocore/edk2/commit/22cedf5b= bde616e0369e9f8649964f175a0cb95e ). The extra step I made was renaming the = CpuIo2Smm.c to CpuIo2Common.c for semantic reason. The needed changes here are: 1. Replacing gSmst with gMmst. Because SmmServicesTableLib does not exist = for MM_STANDALONE type drivers, but MmServicesTableLib has library instance= s for both MM_STANDALONE and DXE_SMM_DRIVER as is. Both MmServicesTableLib = and SmmServicesTableLib retrieve services table through the same protocol G= UID, reference to substantially the same data structure. 2. Abstract the driver entry point for Traditional MM and Standalone MM in= stances. Because these drivers have different entry point interface definit= ions. I will update the commit message to fix the typo. In addition, I can rever= t the file renaming change and break the above 2 changes into 2 patches, if= that make the git history and review process cleaner. Regards, Kun --CU55HiktG5jBzeNxeq82 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Laszlo,

I did the= patch mostly following the pattern of this commit:
MdeModulePkg/FaultTolerantWriteDxe: factor out boot service accesses &mi= ddot; tianocore/edk2@22cedf5 (github.com). The extra step I made was re= naming the CpuIo2Smm.c to CpuIo2Common.c for semantic reason= .

The needed chang= es here are:
1. Replacing gSmst with gMmst. Because
SmmServicesTableLib does not exist for MM_STAN= DALONE type drivers, but MmServicesTableLib has library instances fo= r both MM_STANDALONE and DXE_SM= M_DRIVER as is. Both MmServic= esTableLib and SmmServicesTab= leLib retrieve services table= through the same protocol GUID, reference to substantially the same data s= tructure.
2. Abstract th= e driver entry point for Traditional MM and Standalone MM instances. Becaus= e these drivers have different entry point interface definitions.
I will update the commit me= ssage to fix the typo. In addition, I can revert the file renaming change a= nd break the above 2 changes into 2 patches, if that make the git history a= nd review process cleaner.

Regards,
Kun
--CU55HiktG5jBzeNxeq82--