Image alignment requirement

10 views
Skip to first unread message

Dhaval Sharma

unread,
Aug 12, 2024, 2:47:25 AM8/12/24
to RISC-V Firmware Exchange
Hi All,
I had an observation: In current edk2 build tools_def.txt it is -z common-page-size=0x40 (we do have an override for DXE_RUNTIME driver which is 0x1000) and it seems accordingly all images are built. During runtime according to PcdImageProtectionPolicy it defaults to protection scheme and at least in my build it complains that alignment is not proper (it is expecting 0x1000 as per DEFAULT_PAGE_ALLOCATION_GRANULARITY but we have built images with 0x40). Should we not have everything aligned to 0x1000 (meaning tools_def.txt default to 0x1000)?

--
Thanks!
=D

Dhaval Sharma

unread,
Oct 15, 2024, 1:17:45 AM10/15/24
to RISC-V Firmware Exchange
Hi All,
I added a potential fix: https://github.com/tianocore/edk2/pull/6322 . It seems like .entry segment was not getting placed at proper alignment given the way ld is written today.

Also there was a discussion regarding RISC-V specific HOB. I added this PR: https://github.com/tianocore/edk2/compare/master...rivosinc:edk2:dev/dhaval/dev-add-rv-cpuhob
But it might be a bit longer route to get it added to the spec and then to the code. Wondering we could just continue with DT for now?
=D
--
Thanks!
=D
Reply all
Reply to author
Forward
0 new messages