<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Tianocore/edk2.git/MdeModulePkg/Library/ImagePropertiesRecordLib, branch trunk</title>
<subtitle>EDK II (mirror)</subtitle>
<id>https://git.radix-linux.su/Tianocore/edk2.git/atom?h=trunk</id>
<link rel='self' href='https://git.radix-linux.su/Tianocore/edk2.git/atom?h=trunk'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/'/>
<updated>2024-06-04T03:43:08+00:00</updated>
<entry>
<title>Renormalized end-of-lines from master@27b044605cd5f6b33a3d231576003850b3fe305b</title>
<updated>2024-06-04T03:43:08+00:00</updated>
<author>
<name>kx</name>
<email>kx@radix.pro</email>
</author>
<published>2024-06-04T03:43:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=7e2ccccace24636f29ddc210b94606abd4c7e42b'/>
<id>urn:sha1:7e2ccccace24636f29ddc210b94606abd4c7e42b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>MdeModulePkg: ImagePropertiesRecordLib: Consolidate Usage</title>
<updated>2024-03-29T23:56:16+00:00</updated>
<author>
<name>Oliver Smith-Denny</name>
<email>osde@linux.microsoft.com</email>
</author>
<published>2024-03-29T20:21:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=596f856c13fb9f3a6afb17573a762c6f02654a92'/>
<id>urn:sha1:596f856c13fb9f3a6afb17573a762c6f02654a92</id>
<content type='text'>
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 &lt;gaoliming@byosoft.com.cn&gt;
Cc: Taylor Beebe &lt;taylor.d.beebe@gmail.com&gt;

Acked-by: Michael D Kinney &lt;michael.d.kinney@intel.com&gt;
Reviewed-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Signed-off-by: Oliver Smith-Denny &lt;osde@linux.microsoft.com&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg: ImagePropertiesRecordLib: Use SectionAlignment for CodeSize</title>
<updated>2024-03-29T23:56:16+00:00</updated>
<author>
<name>Oliver Smith-Denny</name>
<email>osde@linux.microsoft.com</email>
</author>
<published>2024-03-29T20:21:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=1fb6462c67912aa287a6f431475cece2659383b7'/>
<id>urn:sha1:1fb6462c67912aa287a6f431475cece2659383b7</id>
<content type='text'>
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 &lt;gaoliming@byosoft.com.cn&gt;
Cc: Leif Lindholm &lt;quic_llindhol@quicinc.com&gt;
Cc: Ard Biesheuvel &lt;ardb+tianocore@kernel.org&gt;
Cc: Sami Mujawar &lt;sami.mujawar@arm.com&gt;
Cc: Taylor Beebe &lt;taylor.d.beebe@gmail.com&gt;

Acked-by: Michael D Kinney &lt;michael.d.kinney@intel.com&gt;
Reviewed-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Reviewed-by: Marvin H?user &lt;mhaeuser@posteo.de&gt;
Signed-off-by: Oliver Smith-Denny &lt;osde@linux.microsoft.com&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg: Update DumpImageRecord() in ImagePropertiesRecordLib</title>
<updated>2023-11-27T18:55:18+00:00</updated>
<author>
<name>Taylor Beebe</name>
<email>taylor.d.beebe@gmail.com</email>
</author>
<published>2023-11-03T15:29:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=4ec2fab279fc69d15f69ee8fd8ce52045f788102'/>
<id>urn:sha1:4ec2fab279fc69d15f69ee8fd8ce52045f788102</id>
<content type='text'>
Update DumpImageRecord() to be DumpImageRecords(), and improve
the debug output. The function will output at DEBUG_INFO instead,
and the function will be run in DXE and SMM
MAT logic when the MAT is installed at EndOfDxe on DEBUG builds.

Cc: Jian J Wang &lt;jian.j.wang@intel.com&gt;
Cc: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
Cc: Dandan Bi &lt;dandan.bi@intel.com&gt;
Cc: Jiaxin Wu &lt;jiaxin.wu@intel.com&gt;
Cc: Ray Ni &lt;ray.ni@intel.com&gt;
Signed-off-by: Taylor Beebe &lt;taylor.d.beebe@gmail.com&gt;
Reviewed-by: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg: Add Logic to Create/Delete Image Properties Records</title>
<updated>2023-11-27T18:55:18+00:00</updated>
<author>
<name>Taylor Beebe</name>
<email>taylor.d.beebe@gmail.com</email>
</author>
<published>2023-11-03T15:29:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=3565ee6c29ffcb2d4d500e857bc3501b5247aeee'/>
<id>urn:sha1:3565ee6c29ffcb2d4d500e857bc3501b5247aeee</id>
<content type='text'>
Add logic to create and delete image properties records. Where
applicable, redirect existing code to use the new library.

Cc: Jian J Wang &lt;jian.j.wang@intel.com&gt;
Cc: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
Cc: Dandan Bi &lt;dandan.bi@intel.com&gt;
Cc: Jiaxin Wu &lt;jiaxin.wu@intel.com&gt;
Cc: Ray Ni &lt;ray.ni@intel.com&gt;
Signed-off-by: Taylor Beebe &lt;taylor.d.beebe@gmail.com&gt;
Reviewed-by: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg: Transition SMM MAT Logic to Use ImagePropertiesRecordLib</title>
<updated>2023-11-27T18:55:18+00:00</updated>
<author>
<name>Taylor Beebe</name>
<email>taylor.d.beebe@gmail.com</email>
</author>
<published>2023-11-03T15:29:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=aa77dac3fb2c2861ee841809075b615359bf6352'/>
<id>urn:sha1:aa77dac3fb2c2861ee841809075b615359bf6352</id>
<content type='text'>
Now that the bugs are fixed in the MAT logic, we can remove the
duplicate logic from PiSmmCore/MemoryAttributesTable.c and use
ImagePropertiesRecordLib instead.

Cc: Jian J Wang &lt;jian.j.wang@intel.com&gt;
Cc: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
Cc: Dandan Bi &lt;dandan.bi@intel.com&gt;
Cc: Jiaxin Wu &lt;jiaxin.wu@intel.com&gt;
Cc: Ray Ni &lt;ray.ni@intel.com&gt;
Signed-off-by: Taylor Beebe &lt;taylor.d.beebe@gmail.com&gt;
Reviewed-by: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg: Add NULL checks and Return Status to ImagePropertiesRecordLib</title>
<updated>2023-11-27T18:55:18+00:00</updated>
<author>
<name>Taylor Beebe</name>
<email>taylor.d.beebe@gmail.com</email>
</author>
<published>2023-11-03T15:29:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=cf78580a34d4794346ab08e0365e74a6f3fc29ca'/>
<id>urn:sha1:cf78580a34d4794346ab08e0365e74a6f3fc29ca</id>
<content type='text'>
Update function headers to clarify the contract of each function and
improve readability. Add NULL checks to all functions that take a
pointer as an argument. Add return status to functions that
may need to return early due to invalid input.

Cc: Jian J Wang &lt;jian.j.wang@intel.com&gt;
Cc: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
Cc: Dandan Bi &lt;dandan.bi@intel.com&gt;
Signed-off-by: Taylor Beebe &lt;taylor.d.beebe@gmail.com&gt;
Reviewed-by: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg: Fix MAT SplitTable() Logic</title>
<updated>2023-11-27T18:55:18+00:00</updated>
<author>
<name>Taylor Beebe</name>
<email>taylor.d.beebe@gmail.com</email>
</author>
<published>2023-11-20T20:07:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=7ae0516dd9073eabca495e1f59a03193cdd99614'/>
<id>urn:sha1:7ae0516dd9073eabca495e1f59a03193cdd99614</id>
<content type='text'>
SplitTable() does not properly handle the case where there is
an odd number of code regions within a loaded image. When there are
an odd number of code regions, at least one image region descriptor
is overwritten with uninitialized memory which has caused crashes
in the right conditions.

This failure cases is documented extensively in the following bugzilla:
https://bugzilla.tianocore.org/show_bug.cgi?id=4492

Cc: Jian J Wang &lt;jian.j.wang@intel.com&gt;
Cc: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
Cc: Dandan Bi &lt;dandan.bi@intel.com&gt;
Signed-off-by: Taylor Beebe &lt;taylor.d.beebe@gmail.com&gt;
Reviewed-by: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg: Fix MAT SplitRecord() Logic</title>
<updated>2023-11-27T18:55:18+00:00</updated>
<author>
<name>Taylor Beebe</name>
<email>taylor.d.beebe@gmail.com</email>
</author>
<published>2023-11-20T20:07:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=e2f2bbe208b4c7ebcedacfc8333df1e52cbf07eb'/>
<id>urn:sha1:e2f2bbe208b4c7ebcedacfc8333df1e52cbf07eb</id>
<content type='text'>
SplitRecord() does not handle the case where a memory descriptor
describes an image region plus extra pages before or after the
image region. This patch fixes this case by carving off the
unrelated regions into their own descriptors.

Cc: Jian J Wang &lt;jian.j.wang@intel.com&gt;
Cc: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
Cc: Dandan Bi &lt;dandan.bi@intel.com&gt;
Signed-off-by: Taylor Beebe &lt;taylor.d.beebe@gmail.com&gt;
Reviewed-by: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
</content>
</entry>
<entry>
<title>MdeModulePkg: Fix MAT Descriptor Count Calculation</title>
<updated>2023-11-27T18:55:18+00:00</updated>
<author>
<name>Taylor Beebe</name>
<email>taylor.d.beebe@gmail.com</email>
</author>
<published>2023-11-20T20:07:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=acb29d4cbeb4f11c33576fcde438d0a37e053933'/>
<id>urn:sha1:acb29d4cbeb4f11c33576fcde438d0a37e053933</id>
<content type='text'>
|4K PAGE|DATA|CODE|DATA|CODE|DATA|4K PAGE|
Say the above memory region is currently one memory map descriptor.
The above image memory layout example contains two code sections
oriented in a way that maximizes the number of descriptors which
would be required to describe each section.

NOTE: It's unlikely that a data section would ever be between
two code sections, but it's still handled by the below formula
for correctness.

There are two code sections (let's say CodeSegmentMax == 2),
three data sections, and two unrelated memory regions flanking the
image. The number of required descriptors to describe this layout
will be 2 * 2 + 3 == 7. This patch updates the calculations to account
for the worst-case scenario.

Cc: Jian J Wang &lt;jian.j.wang@intel.com&gt;
Cc: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
Cc: Dandan Bi &lt;dandan.bi@intel.com&gt;
Signed-off-by: Taylor Beebe &lt;taylor.d.beebe@gmail.com&gt;
Reviewed-by: Liming Gao &lt;gaoliming@byosoft.com.cn&gt;
</content>
</entry>
</feed>
