Hi Minitri
1. You are right that, this will happen if we do not use 4K alignment for 
PE/COFF image. (.code and .data segs are merged in x86)
In current implementation, if a platform defines 
EFI_PROPERTIES_TABLE/EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA,
 and use 4K alignment link option. Data seg will be returned as 
EfiRuntimeServicesData.

2. I am not sure what "moved" means here. It is true that OS will use non-1:1 
mapping virtual address for EfiRuntimeServicesData, which means Virtual address 
is changed. But the physical address is still same.
PiSmmCore is inside of SMM, so it can still access same physical address, by 
using 1:1 mapping paging in SMM.


Thank you
Yao Jiewen

-----Original Message-----
From: edk2-devel [mailto:[email protected]] On Behalf Of iMac Pro
Sent: Thursday, October 15, 2015 4:59 PM
To: [email protected]
Subject: [edk2] SMM core problems

Hi,

Found that problems in PiSmmIpl.c/PiSmmCore.c:

1.  SMM_CORE_PRIVATE_DATA *gSmmCorePrivate  is pointer to 
EfiRuntimeServicesCode (.code and .data segs are merged in x86) memory that can 
be declared as ReadOnly by OS. But  SmmCommunicationCommunicate write to it. 
GPE in OS !!!

2. EfiRuntimeServicesData memory can be moved by OS loader physically.
("preserved by the loader" in spec - not means in the same place). So this is 
not best place to store SMM_CORE_PRIVATE_DATA also, because PiSmmCore.c.does 
not know that boot loader moved it.

Best regards,
Dimitri
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to