public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Taylor Beebe" <taylor.d.beebe@gmail.com>
To: 'Ard Biesheuvel' <ardb@kernel.org>, 'Ray Ni' <ray.ni@intel.com>,
	'Leif Lindholm' <quic_llindhol@quicinc.com>,
	'Jiewen Yao' <jiewen.yao@intel.com>,
	'Sami Mujawar' <sami.mujawar@arm.com>,
	'Gerd Hoffmann' <kraxel@redhat.com>,
	'Andrew Fish' <afish@apple.com>,
	'Jordan Justen' <jordan.l.justen@intel.com>,
	'Rahul Kumar' <rahul1.kumar@intel.com>,
	'Eric Dong' <eric.dong@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Subject: Re: 回复: 回复: [edk2-devel] [PATCH v4 00/14] Add ImagePropertiesRecordLib and Fix MAT Bugs
Date: Fri, 13 Oct 2023 15:43:02 -0700	[thread overview]
Message-ID: <9a75aa43-4e02-4789-aca7-e0409283bdde@gmail.com> (raw)
In-Reply-To: <002c01d9fbe8$aca3f130$05ebd390$@byosoft.com.cn>

[-- Attachment #1: Type: text/plain, Size: 7182 bytes --]

Thank you Liming :)

Patches 2, 3, 4, 5, and 11 still need reviews -- 4 of them are just 
adding the new library to the package DSC files.


This bug has cost me a significant amount of hours to debug, fix, and 
unit-test. I have been

specific in the cases which cause issues and demonstrated the problem 
via testing yet this

patch has now been in flight for over 2 months. In fact, there have been 
no significant functional

changes to the series since it was originally submitted almost 3 months 
ago. I complied with

Ray's request to reshuffle the commit structure to ease the review 
burden but am still

waiting for feedback or even acknowledgement that it's being looked at.


Everyone in the "To" line of this email has the authority to push this 
toward the finish line.

Can I please get some help?

Reference: Add ImagePropertiesRecordLib and Fix MAT Bugs by TaylorBeebe 
· Pull Request #4900 · tianocore/edk2 (github.com) 
<https://github.com/tianocore/edk2/pull/4900>

Bugzilla: 4492 – MAT Logic Incorrectly Reports Runtime Images 
(tianocore.org) <https://bugzilla.tianocore.org/show_bug.cgi?id=4492>

-Taylor

On 10/10/2023 7:14 PM, gaoliming via groups.io wrote:
>
> Taylor:
>
>  Thanks for your detail information. I understand more in the detail. 
> The changes is good to me. Reviewed-by: Liming Gao 
> <gaoliming@byosoft.com.cn>
>
> Thanks
>
> Liming
>
> *发件人:*devel@edk2.groups.io <devel@edk2.groups.io> *代表 *Taylor Beebe
> *发送时间:*2023年10月9日3:21
> *收件人:*devel@edk2.groups.io; gaoliming@byosoft.com.cn; 'Ard Biesheuvel' 
> <ardb@kernel.org>
> *抄送:*'Andrew Fish' <afish@apple.com>; 'Ard Biesheuvel' 
> <ardb+tianocore@kernel.org>; 'Dandan Bi' <dandan.bi@intel.com>; 'Eric 
> Dong' <eric.dong@intel.com>; 'Gerd Hoffmann' <kraxel@redhat.com>; 'Guo 
> Dong' <guo.dong@intel.com>; 'Gua Guo' <gua.guo@intel.com>; 'James Lu' 
> <james.lu@intel.com>; 'Jian J Wang' <jian.j.wang@intel.com>; 'Jiewen 
> Yao' <jiewen.yao@intel.com>; 'Jordan Justen' 
> <jordan.l.justen@intel.com>; 'Leif Lindholm' 
> <quic_llindhol@quicinc.com>; 'Rahul Kumar' <rahul1.kumar@intel.com>; 
> 'Ray Ni' <ray.ni@intel.com>; 'Sami Mujawar' <sami.mujawar@arm.com>; 
> 'Sean Rhodes' <sean@starlabs.systems>
> *主题:*Re: 回复: [edk2-devel] [PATCH v4 00/14] Add 
> ImagePropertiesRecordLib and Fix MAT Bugs
>
> On 10/6/2023 10:57 PM, gaoliming via groups.io wrote:
>
>     Taylor:
>
>       I agree to add new ImagePropertiesRecordLib library for DxeCore
>     and SmmCore. The impact is that platform needs to update their DSC
>     with new library.
>
>       Frankly, I have not understood MAT code in detail. So, I have no
>     comments on this part.
>
>       Last, what test have been done to verify the current functionality?
>
> TLDR: Patch 8 adds the unit test which invokes the lions share of the 
> new library. The remaining functional changes were tested by output 
> comparison.
>
> To provide context on how best to review this series, where the 
> functional changes are, and how they were validated, here's a 
> breakdown of each patch:
>
> Patch 1: Add the ImagePropertiesRecordLib definition and "blank" 
> implementation.
>
> Patches 2-5: Add instances of the library to the platform DSC files.
>
> Patch 6: Updates the logic in Dxe/Misc/MemoryAttributesTable.c to use 
> parameters passed in instead of referencing directly the global variables.
>
>                 This functionally changes nothing but allows the logic 
> to be moved to a library.
>
> Patch 7: Move the Dxe/Misc/MemoryAttributesTable.c Image Properties 
> Record manipulation logic to ImagePropertiesRecordLib -- still no 
> functional changes.
>
> ------------ FUNCTIONAL CHANGES START ------------
>
> Patch 8: Add ImagePropertiesRecordLibHostBasedUnitTest which tests the 
> logic now in ImagePropertiesRecordLib and 3/4 of the tests fail to 
> show that the logic is incorrect.
>
>                The test calls into the SplitTable() routine which is 
> the most complex and invokes almost every other function in 
> ImagePropertiesRecordLib.
>
> Patch 9: Fixes the issues in the logic resulting in 
> ImagePropertiesRecordLibHostBasedUnitTest passing fully. The fixes 
> change some logic in SpitTable() and SplitRecord() (which are tested 
> by the unit test)
>
>                And increases the buffer size for the split table in 
> Dxe/Misc/MemoryAttributesTable.c to fix another edge case. The rest of 
> the exposed functions in ImagePropertiesRecordLib.h
>
>                are unchanged through this patch.
>
> Patch 10: Simply updates function headers, adds return status values 
> to some functions, and adds NULL checks to sanity check the caller input.
>
> Patch 11: Makes a minor change to the SMM memory attribute logic to 
> use the attributes present in the memory map created by the 
> SplitTable() routine. This needs to be done because the original
>
>                   SMM MAT logic would manipulate the split memory map 
> to change the memory type of loaded runtime image data sections to 
> EfiRuntimeServicesData so it could apply XP and RO based
>
>                   on each entry EFI type. This process is unecessary, 
> though, because the SplitTable() routine in 
> PiSmmCore/MemoryAttributesTable.c already sets the XP and RO attributes
>
>                   appropriately on PE images, and 
> EnforceMemoryMapAttribute() in PiSmmCore/MemoryAttributesTable.c sets 
> the XP and RO attributes on the non PE runtime regions. All that to 
> say, this
>
>                   is still output-wise the same as it was before.
>
> Patch 12: Update the SMM MAT logic to use ImagePropertiesRecordLib. If 
> a direct comparison was done between the original DXE and SMM MAT 
> logic, you would see many differences. Some bugs
>
>                  on the DXE side were actually fixed on the SMM side. 
> For the rest, as best I can tell, there was no reason for the 
> remaining differences. I also checked the SMM MAT table pre and post this
>
>                  patch series on OvmfPkg and found output the same.
>
> Patch 13: This patch consolidates the DXE and SMM logic for creating 
> Image Properties Records into the library which is extremely close to 
> the ProtectUefiImage() logic in MemoryProtection.c. If you're
>
>                   familiar to that logic, this should be easy to review.
>
> Patch 14: Just updates the DumpImageRecord() routine to be more 
> helpful and print the loaded image .efi name. This info will be dumped 
> for both DXE and SMM debug output and will help us find
>
>                  MAT issues easier in the future.
>
> Hope this helps :)
>
> -Taylor
>
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109611): https://edk2.groups.io/g/devel/message/109611
Mute This Topic: https://groups.io/mt/101889424/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 16281 bytes --]

  reply	other threads:[~2023-10-13 22:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <177845D072580598.19347@groups.io>
2023-08-16 18:14 ` [edk2-devel] [PATCH v4 00/14] Add ImagePropertiesRecordLib and Fix MAT Bugs Taylor Beebe
     [not found] ` <177BEFB7EF58B50B.8497@groups.io>
2023-08-28 16:27   ` Taylor Beebe
2023-08-28 16:38     ` Ard Biesheuvel
2023-09-26 16:02       ` Taylor Beebe
     [not found]       ` <17887E55BF3885BC.16687@groups.io>
2023-10-03 17:56         ` Taylor Beebe
2023-10-03 18:57           ` Ard Biesheuvel
2023-10-03 19:04             ` Taylor Beebe
2023-10-07  5:57               ` 回复: " gaoliming via groups.io
2023-10-08 19:20                 ` Taylor Beebe
2023-10-11  2:14                   ` 回复: " gaoliming via groups.io
2023-10-13 22:43                     ` Taylor Beebe [this message]
2023-10-24  0:14                       ` Michael D Kinney
2023-10-24  0:36                         ` Taylor Beebe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9a75aa43-4e02-4789-aca7-e0409283bdde@gmail.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox