Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: 1fb6462c67912aa287a6f431475cece2659383b7
      
https://github.com/tianocore/edk2/commit/1fb6462c67912aa287a6f431475cece2659383b7
  Author: Oliver Smith-Denny <[email protected]>
  Date:   2024-03-29 (Fri, 29 Mar 2024)

  Changed paths:
    M MdeModulePkg/Library/ImagePropertiesRecordLib/ImagePropertiesRecordLib.c

  Log Message:
  -----------
  MdeModulePkg: ImagePropertiesRecordLib: Use SectionAlignment for CodeSize

When an ImageRecord is stored by ImagePropertiesRecordLib, it reports the
CodeSegmentSize as the SizeOfRawData from the image. However, the image
as loaded into memory is aligned to the SectionAlignment, so
SizeOfRawData is under the actual size in memory. This is important,
because the memory attributes table uses these image records to create
its entries and it will report that the alignment of an image is
incorrect, even though the actual image is correct.

This was discovered on ARM64, which has a 64k runtime page granularity
alignment, which is backed by a 64k section alignment for
DXE_RUNTIME_DRIVERs. The runtime code and data was correctly being
loaded into memory, however the memory attribute table was incorrectly
reporting misaligned ranges to the OS, causing attributes to be
ignored for these sections for OSes using greater than 4k pages.

This patch correctly aligns the CodeSegmentSize to the SectionAlignment
and the corresponding memory attribute table entries are now correctly
aligned and pointing to the right places in memory.

Cc: Liming Gao <[email protected]>
Cc: Leif Lindholm <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Sami Mujawar <[email protected]>
Cc: Taylor Beebe <[email protected]>

Acked-by: Michael D Kinney <[email protected]>
Reviewed-by: Ard Biesheuvel <[email protected]>
Reviewed-by: Marvin H?user <[email protected]>
Signed-off-by: Oliver Smith-Denny <[email protected]>


  Commit: 596f856c13fb9f3a6afb17573a762c6f02654a92
      
https://github.com/tianocore/edk2/commit/596f856c13fb9f3a6afb17573a762c6f02654a92
  Author: Oliver Smith-Denny <[email protected]>
  Date:   2024-03-29 (Fri, 29 Mar 2024)

  Changed paths:
    M MdeModulePkg/Library/ImagePropertiesRecordLib/ImagePropertiesRecordLib.c

  Log Message:
  -----------
  MdeModulePkg: ImagePropertiesRecordLib: Consolidate Usage

Currently, there are multiple instances of code create image
records. ImagePropertiesRecordLib was created to only have
this code in one place. Update the lib to use additional
logic from the copy in MemoryProtection.c before converging
that code to use the lib.

Cc: Liming Gao <[email protected]>
Cc: Taylor Beebe <[email protected]>

Acked-by: Michael D Kinney <[email protected]>
Reviewed-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Oliver Smith-Denny <[email protected]>


  Commit: 37f63deeefa89b7ac28285bc59eca22a5c00eb92
      
https://github.com/tianocore/edk2/commit/37f63deeefa89b7ac28285bc59eca22a5c00eb92
  Author: Oliver Smith-Denny <[email protected]>
  Date:   2024-03-29 (Fri, 29 Mar 2024)

  Changed paths:
    M MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c

  Log Message:
  -----------
  MdeModulePkg: MemoryProtection: Use ImageRecordPropertiesLib

The functionality to create and delete Image Records has been
consolidated in a library and ensured that MemoryProtection.c's
usage is encapsulated there.

This patch moves MemoryProtection.c to reuse the code in the lib
and to prevent issues in the future where code is updated in one
place but not the other.

Cc: Liming Gao <[email protected]>
Cc: Taylor Beebe <[email protected]>

Acked-by: Michael D Kinney <[email protected]>
Reviewed-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Oliver Smith-Denny <[email protected]>


Compare: https://github.com/tianocore/edk2/compare/7fde22823d64...37f63deeefa8

To unsubscribe from these emails, change your notification settings at 
https://github.com/tianocore/edk2/settings/notifications


_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to