On 11/1/23 21:11, Taylor Beebe wrote:
> This patch is the final in this series which needs a review. Can someone
> take a look?

I'll try to do that.

I didn't have mail delivery enabled for the list in August. Can you
resend v4, rebased, and with the R-b / A-b tags given thus far picked up?

Sorry about the churn.

Thanks,
Laszlo

> 
> On 8/4/2023 12:46 PM, Taylor Beebe via groups.io wrote:
>> From: Taylor Beebe <taylor.d.be...@gmail.com>
>>
>> The function EnforceMemoryMapAttribute() in the SMM MAT logic will
>> ensure that the CODE and DATA memory types have the desired attributes.
>> The consumer of the SMM MAT should only override the Attributes field
>> in the MAT if it is nonzero. This also allows the UEFI and SMM MAT
>> logic to use ImagePropertiesRecordLib instead of carrying two copies
>> of the image properties record manipulation.
>>
>> Signed-off-by: Taylor Beebe <t...@taylorbeebe.com>
>> Cc: Eric Dong <eric.d...@intel.com>
>> Cc: Ray Ni <ray...@intel.com>
>> Cc: Rahul Kumar <rahul1.ku...@intel.com>
>> Cc: Gerd Hoffmann <kra...@redhat.com>
>> ---
>>   UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c | 19
>> +++++++++++--------
>>   1 file changed, 11 insertions(+), 8 deletions(-)
>>
>> diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c
>> b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c
>> index 6f498666157e..d302a9b0cbcf 100644
>> --- a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c
>> +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c
>> @@ -1062,14 +1062,17 @@ SetMemMapAttributes (
>>     MemoryMap = MemoryMapStart;
>>     for (Index = 0; Index < MemoryMapEntryCount; Index++) {
>>       DEBUG ((DEBUG_VERBOSE, "SetAttribute: Memory Entry - 0x%lx,
>> 0x%x\n", MemoryMap->PhysicalStart, MemoryMap->NumberOfPages));
>> -    if (MemoryMap->Type == EfiRuntimeServicesCode) {
>> -      MemoryAttribute = EFI_MEMORY_RO;
>> -    } else {
>> -      ASSERT ((MemoryMap->Type == EfiRuntimeServicesData) ||
>> (MemoryMap->Type == EfiConventionalMemory));
>> -      //
>> -      // Set other type memory as NX.
>> -      //
>> -      MemoryAttribute = EFI_MEMORY_XP;
>> +    MemoryAttribute = MemoryMap->Attribute & EFI_MEMORY_ACCESS_MASK;
>> +    if (MemoryAttribute == 0) {
>> +      if (MemoryMap->Type == EfiRuntimeServicesCode) {
>> +        MemoryAttribute = EFI_MEMORY_RO;
>> +      } else {
>> +        ASSERT ((MemoryMap->Type == EfiRuntimeServicesData) ||
>> (MemoryMap->Type == EfiConventionalMemory));
>> +        //
>> +        // Set other type memory as NX.
>> +        //
>> +        MemoryAttribute = EFI_MEMORY_XP;
>> +      }
>>       }
>>         //



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110523): https://edk2.groups.io/g/devel/message/110523
Mute This Topic: https://groups.io/mt/102328201/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to