Normally, DXE Runtime driver will not be rebased unless you expect it to run as XIP. Is it your expectation? If not, you can configure FvForceRebase=FALSE to disable rebase in FV that includes runtime drivers.
[FV.DXEFV] BlockSize = 0x1000 FvForceRebase = FALSE # add this line FvAlignment = 16 INF DxeRuntimeDriver.inf # Runtime Driver Thanks Liming -----Original Message----- From: edk2-devel [mailto:[email protected]] On Behalf Of Anbazhagan, Baraneedharan Sent: Wednesday, December 16, 2015 10:23 AM To: Kinney, Michael D; Yao, Jiewen; Laszlo Ersek Cc: Hamel, Lee M; Barlow, Dallas; [email protected] Subject: Re: [edk2] InsertImageRecord and Section Alignment Am using the same rules. Similar error message is used in BaseTools\Source\C\GenFv\GenFvInternalLib.c - FfsRebase() as well and it checks for driver type. Both DXE driver and DXE_RUNTIME_DRIVER uses same driver type - 0x07 > -----Original Message----- > From: edk2-devel [mailto:[email protected]] On Behalf Of > Kinney, Michael D > Sent: Tuesday, December 15, 2015 7:44 PM > To: Anbazhagan, Baraneedharan <[email protected]>; Yao, Jiewen > <[email protected]>; Laszlo Ersek <[email protected]>; Kinney, > Michael D <[email protected]> > Cc: Hamel, Lee M <[email protected]>; Barlow, Dallas > <[email protected]>; [email protected] > <[email protected]> > Subject: Re: [edk2] InsertImageRecord and Section Alignment > > Baranee, > > I see that error message if a PE/COFF image is stored in TE format or > is XIP PE/COFF image. > > In general, modules of type DXE_RUNTIME_DRIVER are not expected to use > TE or be XIP. > > Here is an example FDF file FFS rule for modules of type > DXE_RUNTIME_DRIVER. It uses PE32 (not TE) and it does not strip the > relocations. > > [Rule.Common.DXE_RUNTIME_DRIVER] > FILE DRIVER = $(NAMED_GUID) { > DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex > PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi > UI STRING="$(MODULE_NAME)" Optional > VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) > } > > Are you using a different rule? > > Mike > > > > > -----Original Message----- > > From: edk2-devel [mailto:[email protected]] On Behalf > > Of Anbazhagan, Baraneedharan > > Sent: Tuesday, December 15, 2015 5:07 PM > > To: Kinney, Michael D <[email protected]>; Yao, Jiewen > > <[email protected]>; Laszlo Ersek <[email protected]> > > Cc: Hamel, Lee M <[email protected]>; Barlow, Dallas > > <[email protected]>; [email protected] <edk2- > > [email protected]> > > Subject: Re: [edk2] InsertImageRecord and Section Alignment > > > > Hi Mike, > > Am using the same build flag that you mentioned and getting the > > build error - 'Section-Alignment and File-Alignment do not match > > :<runtime module path>.ffs' > > > > [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER] > > MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096 > > > > Thanks, > > Baranee > > > > > -----Original Message----- > > > From: Kinney, Michael D [mailto:[email protected]] > > > Sent: Tuesday, December 15, 2015 6:57 PM > > > To: Anbazhagan, Baraneedharan <[email protected]>; Yao, Jiewen > > > <[email protected]>; Laszlo Ersek <[email protected]>; > > Kinney, Michael D > > > <[email protected]> > > > Cc: Hamel, Lee M <[email protected]>; Barlow, Dallas > > > <[email protected]>; [email protected] <edk2- > > [email protected]> > > > Subject: RE: [edk2] InsertImageRecord and Section Alignment > > > > > > Baranee, > > > > > > What build flags are you using? > > > > > > Most platforms can add the following in their DSC file to get > > this to work form > > > VS20xx tool chains. > > > > > > [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER] > > > MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096 > > > > > > Thanks, > > > > > > Mike > > > > > > > -----Original Message----- > > > > From: edk2-devel [mailto:[email protected]] On > > Behalf Of > > > > Anbazhagan, Baraneedharan > > > > Sent: Tuesday, December 15, 2015 8:31 AM > > > > To: Kinney, Michael D <[email protected]>; Yao, > > Jiewen > > > > <[email protected]>; Laszlo Ersek <[email protected]> > > > > Cc: Hamel, Lee M <[email protected]>; Barlow, Dallas > > > > <[email protected]>; [email protected] <edk2- > > > > [email protected]> > > > > Subject: Re: [edk2] InsertImageRecord and Section Alignment > > > > > > > > Hi, > > > > When I tried to enable section alignment in DSC for Runtime > > modules, > > > > am getting a build error that section alignment and file > > alignment > > > > doesn't match(GenFvInternalLib.c). Am using > > > > VS2012x86 build tools. Whether any other build flag needs to > > be set? > > > > > > > > - Baranee > > > > > > > > > -----Original Message----- > > > > > From: edk2-devel [mailto:[email protected]] > > On > > > > Behalf Of Kinney, > > > > > Michael D > > > > > Sent: Monday, December 07, 2015 8:23 PM > > > > > To: Yao, Jiewen; Laszlo Ersek; Kinney, Michael D > > > > > Cc: Hamel, Lee M; [email protected] > > > > > Subject: Re: [edk2] InsertImageRecord and Section > > Alignment > > > > > > > > > > Jiewen, > > > > > > > > > > I agree that is a good place to put the error message. > > > > > > > > > > Mike > > > > > > > > > > > -----Original Message----- > > > > > > From: Yao, Jiewen > > > > > > Sent: Sunday, December 6, 2015 7:06 PM > > > > > > To: Kinney, Michael D <[email protected]>; > > Laszlo > > > > Ersek > > > > > > <[email protected]>; Kinney, Michael D > > > > <[email protected]> > > > > > > Cc: Hamel, Lee M <[email protected]>; edk2- > > > > [email protected] > > > > > > <[email protected]> > > > > > > Subject: RE: [edk2] InsertImageRecord and Section > > Alignment > > > > > > > > > > > > Hi Mike > > > > > > I agree that we can change this from ERROR to WARNING, > > and > > > > only add 1 ERROR > > > > > message. > > > > > > > > > > > > However, the > > > > \MdeModulePkg\Universal\PropertiesTableAttributesDxe > > > > > > module is optional module, because a platform may use > > its > > > > own module to set > > > > > attributes for ACPINvs or reserved. > > > > > > > > > > > > How about we add error message when install this table > > in > > > > > DxeCore.InstallPropertiesTable(). > > > > > > if ((mPropertiesTable.MemoryProtectionAttribute & > > > > > > > > > > > > EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA) > > > > == > > > > > 0) { > > > > > > DEBUG ((EFI_D_ERROR, "MemoryProtectionAttribute > > > > > NON_EXECUTABLE_PE_DATA not set\n")); <== New line > > > > > > return ; > > > > > > } > > > > > > > > > > > > Thank you > > > > > > Yao Jiewen > > > > > > > > > > > > -----Original Message----- > > > > > > From: edk2-devel [mailto:edk2-devel- > > [email protected]] On > > > > Behalf Of > > > > > > Kinney, Michael D > > > > > > Sent: Friday, December 04, 2015 8:27 AM > > > > > > To: Laszlo Ersek; Kinney, Michael D > > > > > > Cc: Hamel, Lee M; [email protected] > > > > > > Subject: Re: [edk2] InsertImageRecord and Section > > Alignment > > > > > > > > > > > > Laszlo, > > > > > > > > > > > > That is a good question. If a platform requires > > > > > > > > > > > > EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA > > > > to > > > > > be set, then it is an error condition. That is why it is > > an > > > > error message and not a > > > > > warning message. > > > > > > > > > > > > We could consider changing this specific message to a > > > > warning, and add > > > > > > one error message from the > > > > > > \MdeModulePkg\Universal\PropertiesTableAttributesDxe > > module. > > > > That way, only > > > > > platforms that include this module will get an error > > message > > > > if any runtime modules > > > > > for not use 4KB aligned. > > > > > > > > > > > > Mike > > > > > > > > > > > > > -----Original Message----- > > > > > > > From: Laszlo Ersek [mailto:[email protected]] > > > > > > > Sent: Thursday, December 3, 2015 3:36 PM > > > > > > > To: Kinney, Michael D <[email protected]> > > > > > > > Cc: Hamel, Lee M <[email protected]>; edk2- > > > > [email protected] > > > > > > > <[email protected]> > > > > > > > Subject: Re: [edk2] InsertImageRecord and Section > > > > Alignment > > > > > > > > > > > > > > On 12/03/15 21:16, Kinney, Michael D wrote: > > > > > > > > Lee, > > > > > > > > > > > > > > > > It is a feature from UEFI Specification 2.5 - > > Section > > > > 4.6 - > > > > > > > > EFI_PROPERTIES_TABLE > > > > > > > > > > > > > > > > In order to set the > > > > > > > > > > > > > > EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA > > > > > > > > bit, runtime drivers need to be built so their > > PE/COFF > > > > code and > > > > > > > > data sections do not share the same 4KB page. > > > > > > > > > > > > > > > > The log message you are seeing is not an error. It > > is a > > > > warning > > > > > > > > message that a runtime driver was loaded that does > > not > > > > meet the > > > > > > > > requirements to set this bit. > > > > > > > > > > > > > > Should the message be downgraded from EFI_D_ERROR to > > > > EFI_D_WARN > > > > > > > ("MdeModulePkg/Core/Dxe/Misc/PropertiesTable.c")? > > > > > > > > > > > > > > Thanks > > > > > > > Laszlo > > > > > > > > > > > > > > > > > > > > > > > Mike > > > > > > > > > > > > > > > >> -----Original Message----- > > > > > > > >> From: Hamel, Lee M > > > > > > > >> Sent: Thursday, December 3, 2015 11:19 AM > > > > > > > >> To: Kinney, Michael D <[email protected]>; > > > > > > > >> [email protected] > > > > > > > >> Subject: RE: InsertImageRecord and Section > > Alignment > > > > > > > >> > > > > > > > >> Thanks for the solution. Any idea why my code was > > fine > > > > before > > > > > > > >> and now it's not (the design change reason, not > > that > > > > > > > >> tools_def.txt changed)? I'm trying to understand > > why a > > > > change > > > > > > > >> was made that > > > > > > caused the problem. > > > > > > > >> > > > > > > > >> -----Original Message----- > > > > > > > >> From: Kinney, Michael D > > > > > > > >> Sent: Thursday, December 03, 2015 11:13 AM > > > > > > > >> To: Hamel, Lee M <[email protected]>; > > > > > > > >> [email protected]; Kinney, Michael D > > > > > > > >> <[email protected]> > > > > > > > >> Subject: RE: InsertImageRecord and Section > > Alignment > > > > > > > >> > > > > > > > >> Lee, > > > > > > > >> > > > > > > > >> You can fix this by adding the following to the DSC > > > > file to force modules of type > > > > > DXE_RUNTIME_DRIVER to use 4KB alignment. > > > > > > > >> > > > > > > > >> [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER] > > > > > > > >> MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096 > > > > > > > >> > > > > > > > >> Mike > > > > > > > >> > > > > > > > >>> -----Original Message----- > > > > > > > >>> From: edk2-devel [mailto:edk2-devel- > > > > [email protected]] On > > > > > > > >>> Behalf Of Hamel, Lee M > > > > > > > >>> Sent: Thursday, December 3, 2015 10:57 AM > > > > > > > >>> To: [email protected] > > > > > > > >>> Subject: [edk2] InsertImageRecord and Section > > > > Alignment > > > > > > > >>> > > > > > > > >>> I recently synced to a newer UDK 2015 and now get > > this > > > > serial output many > > > > > times for different images: > > > > > > > >>> > > > > > > > >>> !!!!!!!! InsertImageRecord - Section > > Alignment(0x20) > > > > is not 4K !!!!!!!! > > > > > > > >>> !!!!!!!! Image - <some > > > > > > > >>> path>\ReportStatusCodeRouterRuntimeDxe.pdb > > > > > > > >>> > > > > > > > >>> Has anyone seen this problem when syncing to UDK > > 2015? > > > > I am using Visual > > > > > Studio 2010 to build. > > > > > > > >>> > > > > > > > >>> _______________________________________________ > > > > > > > >>> 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 > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > 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 > > > > _______________________________________________ > > > > 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 > _______________________________________________ > 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 _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

