On Mon, Oct 13, 2014 at 5:59 PM, Lin, Ryan ryan.lin@intel.com wrote:
Hi Peter,
It should be unpatched GCC 4.9, and I found out that .bs_init is force 32-byte alignment with GCC 4.9.
Dump from ramstage.o
12 .bs_init 000000c8 00000000 00000000 00036160 2**5
CONTENTS, ALLOC, LOAD, RELOC, DATA
Do you know where the default alignment is coming from? What ramstage.o did you look at? What did the symbols say for these objects? Are the sizes for the OBJECT types set to 20 for sure (I'd expect it to be)?
The following could be related: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61296
We might be playing whack-a-mole and need to align all of our special sections up to a typical cacheline (64) in the linker scripts. Or we switch all of our objects in special sections to be pointers to objects so that we can pointer align them.
As the result, padding datd is added to mrc_cache_update, pch_log and cbmem_bscb.
0001d1d0 T _bs_init_begin
0001d1e0 t mrc_cache_update <- 32 bytes
0001d200 t pch_log <- 32 bytes
0001d220 t finalize
0001d248 t spi_init_bscb
0001d25c t cbmem_bscb <- 36 bytes
0001d280 t disable_rom_cache_bscb
0001d2a8 T _bs_init_end
If we add aligned(4) to the define as the following :
#define BOOT_STATE_INIT_ATTR __attribute__ ((used, aligned(4), section (“.bs_init)))
We can get 4-byte alignment for .bs_init.
What is your thoughts on this?
Regards,
Ryan
-- coreboot mailing list: coreboot@coreboot.org http://www.coreboot.org/mailman/listinfo/coreboot