From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 235C1740038 for ; Sat, 7 Oct 2023 05:58:32 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=pfl4pLnCvD7cc6drnjh5fKXhcOEQV2WTaQeLYJkNn9w=; c=relaxed/simple; d=groups.io; h=From:To:Cc:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Thread-Index:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding:Content-Language; s=20140610; t=1696658311; v=1; b=sxWpXcqPvkXBj6NdqvJNgNxVVEdmN5lGsTOs5QDGAk2dkSGxeb87izqZCuor8VjZMnBM0tzN /u9HLLXC+MLhM3V/ep2UPmDW1cmUH8NYugY/Bq6Wd9g5UKmDTTuMlD3EPotwEjAmezQv9NV6uUO iut/dBOGwaI47Dv/s01sOG38= X-Received: by 127.0.0.2 with SMTP id 2D48YY7687511xMkOGqX61RU; Fri, 06 Oct 2023 22:58:31 -0700 X-Received: from cxsh.intel-email.com (cxsh.intel-email.com [121.46.250.151]) by mx.groups.io with SMTP id smtpd.web10.13186.1696658310021271139 for ; Fri, 06 Oct 2023 22:58:30 -0700 X-Received: from cxsh.intel-email.com (localhost [127.0.0.1]) by cxsh.intel-email.com (Postfix) with ESMTP id 5288BDDA7F7 for ; Sat, 7 Oct 2023 13:58:27 +0800 (CST) X-Received: from localhost (localhost [127.0.0.1]) by cxsh.intel-email.com (Postfix) with ESMTP id 4E33BDDA7B8 for ; Sat, 7 Oct 2023 13:58:27 +0800 (CST) X-Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by cxsh.intel-email.com (Postfix) with SMTP id A5142DDA7E3 for ; Sat, 7 Oct 2023 13:58:24 +0800 (CST) X-Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP(SSL) for ; Sat, 07 Oct 2023 13:57:34 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming via groups.io" To: , , "'Ard Biesheuvel'" Cc: "'Andrew Fish'" , "'Ard Biesheuvel'" , "'Dandan Bi'" , "'Eric Dong'" , "'Gerd Hoffmann'" , "'Guo Dong'" , "'Gua Guo'" , "'James Lu'" , "'Jian J Wang'" , "'Jiewen Yao'" , "'Jordan Justen'" , "'Leif Lindholm'" , "'Rahul Kumar'" , "'Ray Ni'" , "'Sami Mujawar'" , "'Sean Rhodes'" References: <177845D072580598.19347@groups.io> <177BEFB7EF58B50B.8497@groups.io> <17887E55BF3885BC.16687@groups.io> <83c03b0c-c8e8-44cf-8b45-761f31577153@gmail.com> In-Reply-To: <83c03b0c-c8e8-44cf-8b45-761f31577153@gmail.com> Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIIHY0IDAwLzE0XSBBZGQgSW1hZ2VQcm9wZXJ0aWVzUmVjb3JkTGliIGFuZCBGaXggTUFUIEJ1Z3M=?= Date: Sat, 7 Oct 2023 13:57:32 +0800 Message-ID: <081601d9f8e3$2ac79d90$8056d8b0$@byosoft.com.cn> MIME-Version: 1.0 Thread-Index: AQFdgWnAcGHDUewmrqk8JTotDZU7EQLmu+JAArORhA4CK9SolwGS8ZGdAg2BCgUCsuxnPAFDO9B6sLvYzaA= Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,gaoliming@byosoft.com.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: Z2pFqLCX2QTmFuvY3IcE9jcwx7686176AA= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=sxWpXcqP; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Taylor: I agree to add new ImagePropertiesRecordLib library for DxeCore and SmmCo= re. The impact is that platform needs to update their DSC with new library.= =20 Frankly, I have not understood MAT code in detail. So, I have no comments= on this part.=20 Last, what test have been done to verify the current functionality? Thanks Liming > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > =E5=8F=91=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io = =E4=BB=A3=E8=A1=A8 Taylor Beebe > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2023=E5=B9=B410=E6=9C=884=E6=97=A5 = 3:05 > =E6=94=B6=E4=BB=B6=E4=BA=BA: Ard Biesheuvel > =E6=8A=84=E9=80=81: devel@edk2.groups.io; Andrew Fish ; = Ard > Biesheuvel ; Dandan Bi ; > Eric Dong ; Gerd Hoffmann ; Guo > Dong ; Gua Guo ; James Lu > ; Jian J Wang ; Jiewen Yao > ; Jordan Justen ; Leif > Lindholm ; Liming Gao > ; Rahul Kumar ; Ray > Ni ; Sami Mujawar ; Sean > Rhodes > =E4=B8=BB=E9=A2=98: Re: [edk2-devel] [PATCH v4 00/14] Add ImageProperties= RecordLib and > Fix MAT Bugs >=20 > Thank you , Ard. I very much appreciate your responsiveness. >=20 > The majority of these patches fall under MdeModulePkg maintainers so > I'll also need help from them to drive this forward. >=20 > On 10/3/2023 11:57 AM, Ard Biesheuvel wrote: > > On Tue, 3 Oct 2023 at 17:56, Taylor Beebe > wrote: > >> Have we given up on this patch series and Bug 4492? > >> > > I haven't, I promise. I will get to this on Thursday or Friday. > > > > > >> On 9/26/2023 9:02 AM, Taylor Beebe via groups.io wrote: > >>> Reviews on this patch series would be much appreciated :) > >>> > >>> On 8/28/23 9:38 AM, Ard Biesheuvel wrote: > >>>> I was hoping to get around to this before the end of the week (but I > >>>> am not a MdeModulePkg maintainer) > >>>> > >>>> > >>>> On Mon, 28 Aug 2023 at 18:27, Taylor Beebe > > >>>> wrote: > >>>>> Can I please get reviews/feedback on this patch series? > >>>>> > >>>>> On 8/16/23 11:14 AM, Taylor Beebe via groups.io wrote: > >>>>>> Can I please get reviews/feedback on this patch series? > >>>>>> > >>>>>> On 8/4/2023 12:46 PM, Taylor Beebe via groups.io wrote: > >>>>>>> From: Taylor Beebe > >>>>>>> > >>>>>>> v4: > >>>>>>> - Expose additional functions in the Library API > >>>>>>> - Add NULL checks to library functions and return a > >>>>>>> status where applicable. > >>>>>>> > >>>>>>> v3: > >>>>>>> - Refactor patch series so the transition of logic from the DXE > >>>>>>> MAT logic to the new library is more clear. > >>>>>>> - Update function headers to improve clarity and follow EDK2 > >>>>>>> standards. > >>>>>>> - Add Create and Delete functions for Image Properties Records > >>>>>>> and redirect some of the SMM and DXE MAT code to use > these > >>>>>>> functions. > >>>>>>> - Update/Add DumpImageRecords() to print the image name and > code > >>>>>>> sections of each runtime image which will be put in the MAT. > >>>>>>> The DXE and SMM MAT logic will now invoke the > DumpImageRecords() > >>>>>>> on DEBUG builds at the EndOfDxe event to install the MAT. > >>>>>>> > >>>>>>> v2: > >>>>>>> - A one-line change in patch 3 was moved to patch 9 for correctne= ss. > >>>>>>> > >>>>>>> Reference: https://github.com/tianocore/edk2/pull/4590 > >>>>>>> Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4492 > >>>>>>> > >>>>>>> The UEFI and SMM MAT logic contains duplicate logic for > manipulating > >>>>>>> image > >>>>>>> properties records which is used to track runtime images. > >>>>>>> This patch series adds a new library, ImagePropertiesRecordLib, > >>>>>>> which consolidates this logic and fixes the bugs which currently > >>>>>>> exist in > >>>>>>> the MAT logic. > >>>>>>> > >>>>>>> The first patch adds the ImagePropertiesRecordLib implementation > >>>>>>> which > >>>>>>> is a copy of the UEFI MAT logic with minor modifications to remov= e > >>>>>>> the > >>>>>>> reliance on globabl variables and make the code unit testable. > >>>>>>> > >>>>>>> The second patch adds a unit test for the > >>>>>>> ImagePropertiesRecordLib. The > >>>>>>> logic tests various potential layouts of the EFI memory map and > >>>>>>> runtime > >>>>>>> images. 3/4 of these tests will fail which demonstrates the MAT l= ogic > >>>>>>> bugs. > >>>>>>> > >>>>>>> The third patch fixes the logic in the ImagePropertiesRecordLib s= o > >>>>>>> that all of the unit tests pass and the MAT logic can be fixed by > >>>>>>> using the library. > >>>>>>> > >>>>>>> The remaining patches add library instances to DSC files and remo= ve > >>>>>>> the image properties record logic from the SMM and UEFI MAT logic= . > >>>>>>> > >>>>>>> Cc: Andrew Fish > >>>>>>> Cc: Ard Biesheuvel > >>>>>>> Cc: Dandan Bi > >>>>>>> Cc: Eric Dong > >>>>>>> Cc: Gerd Hoffmann > >>>>>>> Cc: Guo Dong > >>>>>>> Cc: Gua Guo > >>>>>>> Cc: James Lu > >>>>>>> Cc: Jian J Wang > >>>>>>> Cc: Jiewen Yao > >>>>>>> Cc: Jordan Justen > >>>>>>> Cc: Leif Lindholm > >>>>>>> Cc: Liming Gao > >>>>>>> Cc: Rahul Kumar > >>>>>>> Cc: Ray Ni > >>>>>>> Cc: Sami Mujawar > >>>>>>> Cc: Sean Rhodes > >>>>>>> > >>>>>>> Taylor Beebe (14): > >>>>>>> MdeModulePkg: Add ImagePropertiesRecordLib > >>>>>>> ArmVirtPkg: Add ImagePropertiesRecordLib Instance > >>>>>>> EmulatorPkg: Add ImagePropertiesRecordLib Instance > >>>>>>> OvmfPkg: Add ImagePropertiesRecordLib Instance > >>>>>>> UefiPayloadPkg: Add ImagePropertiesRecordLib Instance > >>>>>>> MdeModulePkg: Update MemoryAttributesTable.c to Reduce > Global > >>>>>>> Variable > >>>>>>> Use > >>>>>>> MdeModulePkg: Move Some DXE MAT Logic to > ImagePropertiesRecordLib > >>>>>>> MdeModulePkg: Add ImagePropertiesRecordLib Host-Based > Unit Test > >>>>>>> MdeModulePkg: Fix Bugs in MAT Logic > >>>>>>> MdeModulePkg: Add NULL checks and Return Status to > >>>>>>> ImagePropertiesRecordLib > >>>>>>> UefiCpuPkg: Use Attribute From SMM > MemoryAttributesTable if > >>>>>>> Nonzero > >>>>>>> MdeModulePkg: Transition SMM MAT Logic to Use > >>>>>>> ImagePropertiesRecordLib > >>>>>>> MdeModulePkg: Add Logic to Create/Delete Image Properties > Records > >>>>>>> MdeModulePkg: Update DumpImageRecord() in > >>>>>>> ImagePropertiesRecordLib > >>>>>>> > >>>>>>> MdeModulePkg/Core/Dxe/Misc/MemoryAttributesTable.c | 967 > >>>>>>> +---------------- > >>>>>>> MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c | 24 +- > >>>>>>> MdeModulePkg/Core/PiSmmCore/MemoryAttributesTable.c | 958 > >>>>>>> +--------------- > >>>>>>> > MdeModulePkg/Library/ImagePropertiesRecordLib/ImagePropertiesRecordLi > b.c > >>>>>>> > >>>>>>> | 1144 ++++++++++++++++++++ > >>>>>>> > MdeModulePkg/Library/ImagePropertiesRecordLib/UnitTest/ImageProperties > RecordLibUnitTestHost.c > >>>>>>> > >>>>>>> | 938 ++++++++++++++++ > >>>>>>> UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c | > 19 +- > >>>>>>> ArmVirtPkg/ArmVirt.dsc.inc | 1 + > >>>>>>> EmulatorPkg/EmulatorPkg.dsc | 1 + > >>>>>>> MdeModulePkg/Core/Dxe/DxeMain.h | 20 - > >>>>>>> MdeModulePkg/Core/Dxe/DxeMain.inf | 1 + > >>>>>>> MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf | 1 + > >>>>>>> MdeModulePkg/Include/Library/ImagePropertiesRecordLib.h | 234 > ++++ > >>>>>>> > MdeModulePkg/Library/ImagePropertiesRecordLib/ImagePropertiesRecordLi > b.inf > >>>>>>> > >>>>>>> | 31 + > >>>>>>> > MdeModulePkg/Library/ImagePropertiesRecordLib/UnitTest/ImageProperties > RecordLibUnitTestHost.inf > >>>>>>> > >>>>>>> | 35 + > >>>>>>> MdeModulePkg/MdeModulePkg.dec | 5 + > >>>>>>> MdeModulePkg/MdeModulePkg.dsc | 2 + > >>>>>>> MdeModulePkg/Test/MdeModulePkgHostTest.dsc | 6 + > >>>>>>> OvmfPkg/AmdSev/AmdSevX64.dsc | 1 + > >>>>>>> OvmfPkg/Bhyve/BhyveX64.dsc | 1 + > >>>>>>> OvmfPkg/CloudHv/CloudHvX64.dsc | 1 + > >>>>>>> OvmfPkg/IntelTdx/IntelTdxX64.dsc | 1 + > >>>>>>> OvmfPkg/Microvm/MicrovmX64.dsc | 1 + > >>>>>>> OvmfPkg/OvmfPkgIa32.dsc | 1 + > >>>>>>> OvmfPkg/OvmfPkgIa32X64.dsc | 1 + > >>>>>>> OvmfPkg/OvmfPkgX64.dsc | 1 + > >>>>>>> OvmfPkg/OvmfXen.dsc | 1 + > >>>>>>> OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc | 1 + > >>>>>>> UefiPayloadPkg/UefiPayloadPkg.dsc | 1 + > >>>>>>> 28 files changed, 2524 insertions(+), 1874 deletions(-) > >>>>>>> create mode 100644 > >>>>>>> > MdeModulePkg/Library/ImagePropertiesRecordLib/ImagePropertiesRecordLi > b.c > >>>>>>> > >>>>>>> create mode 100644 > >>>>>>> > MdeModulePkg/Library/ImagePropertiesRecordLib/UnitTest/ImageProperties > RecordLibUnitTestHost.c > >>>>>>> > >>>>>>> create mode 100644 > >>>>>>> MdeModulePkg/Include/Library/ImagePropertiesRecordLib.h > >>>>>>> create mode 100644 > >>>>>>> > MdeModulePkg/Library/ImagePropertiesRecordLib/ImagePropertiesRecordLi > b.inf > >>>>>>> > >>>>>>> create mode 100644 > >>>>>>> > MdeModulePkg/Library/ImagePropertiesRecordLib/UnitTest/ImageProperties > RecordLibUnitTestHost.inf > >>>>>>> > >>>>>>> > >>> > >>> > >>> > >>> >=20 >=20 >=20 >=20 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109381): https://edk2.groups.io/g/devel/message/109381 Mute This Topic: https://groups.io/mt/101812772/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-