On 06/08/15 16:24, Yao, Jiewen wrote: > That is good question. :-) > > 1) For VisualStudio, the link option can be changed directly - /ALIGN:4096. > And we need update RELEASE_*_*_DLINK_FLAGS = /MERGE:.data=.text > /MERGE:.rdata=.text, to RELEASE_*_*_DLINK_FLAGS = /MERGE:.rdata=.data > > 2) For GCC, we need another link script, and set .text ALIGN(0x1000) and > .data ALIGN(0x1000) > We also need update GenFw/Elf32Convert.c, GenFw/Elf64Convert.c. > ================ > UINT32 mCoffAlignment = 0x20; > if ((mEhdr->e_entry & 0xFFF) == 0) { > mCoffAlignment = 0x1000; > } > ================ > > 3) For Build tool, we will add format: > [BuildOptions.$(arch).CodeBase.$(MODULE_TYPE)] > So that a platform may override rule for runtime driver > [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER] > > Tool team will prepare all patch for base tool later.
Great, thank you. Laszlo > -----Original Message----- > From: Laszlo Ersek [mailto:ler...@redhat.com] > Sent: Monday, June 08, 2015 10:15 PM > To: Yao, Jiewen > Cc: edk2-devel@lists.sourceforge.net > Subject: Re: [edk2] [patch] MdePkg/PropertiesTable support, > MdeModulePkg/DxeCore support UEFI2.5 properties table > > On 06/08/15 15:56, Yao, Jiewen wrote: >> Hi Laszlo >> This is for UEFI2.5 Properties Table feature. See UEFI 2.5 spec, 4.6 EFI >> Configuration Table & Properties Table, page 105. >> >> // >> // Memory attribute (Not defined bits are reserved) // #define >> EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA 0x1 // >> BIT 0 - description - implies the runtime data is separated from the >> code This bit implies that the UEFI runtime code and data sections of >> the executable image are separate and aligned to at least a 4KiB >> boundary. This bit also implies that the data pages do no have any >> executable code. >> >> A platform may use gEfiMdeModulePkgTokenSpaceGuid.PropertiesTableEnable to >> control enable or disable this feature. >> In order to meet "secure by default" rule, we define it TRUE as default >> configuration in MdeModulePkg. >> >> If a platform does not want to enable this feature, it can override this PCD >> to be FALSE. >> If a platform wants to enable this feature, it can override link option to >> make code/data 4K aligned for any runtime driver. > > I think the last option would be preferable for OVMF as well -- where can we > change that link option? Does it belong with BaseTools, or with the rules in > the FDF file? > > Thanks! > Laszlo > >> Thank you >> Yao Jiewen >> >> >> -----Original Message----- >> From: Laszlo Ersek [mailto:ler...@redhat.com] >> Sent: Monday, June 08, 2015 6:34 PM >> To: Yao, Jiewen >> Cc: edk2-devel@lists.sourceforge.net >> Subject: Re: [edk2] [patch] MdePkg/PropertiesTable support, >> MdeModulePkg/DxeCore support UEFI2.5 properties table >> >> On 06/04/15 16:34, Yao, Jiewen wrote: >> >>> + SetPropertiesTableSectionAlignment (SectionAlignment); if >>> + ((SectionAlignment & (SIZE_4KB - 1)) != 0) { >>> + DEBUG ((EFI_D_ERROR, "!!!!!!!! InsertImageRecord - Section >>> + Alignment(0x%x) is not 4K !!!!!!!!\n", SectionAlignment)); >> >> I just noticed that the above message is printed under OVMF for all >> DXE_RUNTIME_DRIVER modules. Why does that happen? >> >> Thanks >> Laszlo >> >>> + PdbPointer = PeCoffLoaderGetPdbPointer ((VOID*) (UINTN) ImageAddress); >>> + if (PdbPointer != NULL) { >>> + DEBUG ((EFI_D_ERROR, "!!!!!!!! Image - %a !!!!!!!!\n", >>> PdbPointer)); >>> + } >>> + goto Finish; >>> + } >> > ------------------------------------------------------------------------------ _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel