[PATCH v3] board_f.c: Insure gd->new_bootstage alignment

Tom Rini trini at konsulko.com
Tue Dec 17 13:52:04 CET 2019


On Mon, Dec 16, 2019 at 11:53:48AM +0000, Patrick DELAUNAY wrote:
> Hi Tom,
> 
> > From: Patrice CHOTARD <patrice.chotard at st.com>
> > Sent: mercredi 27 novembre 2019 10:12
> > 
> > In reserve_bootstage(), in case size is odd, gd->new_bootstage is not aligned. In
> > bootstage_relocate(), the platform hangs when getting access to data-
> > >record[i].name.
> > To avoid this issue, make gd->new_bootstage 16 byte aligned.
> > 
> > To insure that new_bootstage is 16 byte aligned (at least needed for
> > x86_64 and ARMv8) and new_bootstage starts down to get enough space,
> > ALIGN_DOWN macro is used.
> > 
> > Fixes: ac9cd4805c8b ("bootstage: Correct relocation algorithm")
> > 
> > Signed-off-by: Patrice Chotard <patrice.chotard at st.com>
> > Reviewed-by: Vikas MANOCHA <vikas.manocha at st.com>
> > Reviewed-by: Patrick Delaunay <patrick.delaunay at st.com>
> > Tested-by: Patrick Delaunay <patrick.delaunay at st.com>
> > 
> 
> Do you plan to merge this fixe for the next rc for v2020.01 ?
> Or do you expect some change / review.
>
> This patch is mandatory for stm32mp1 (ARM plaform with bootstage
> feature activated).
> Without this patch, the boot failed (at least for v2020.01-rc3 : crash
> has struct pointer new_bootstage is not aligned).
> 
> Or I will deactivate the BOOTSTAGE feature...
 
I think at this point I would prefer dropping BOOTSTAGE from those
boards for the release.  There's already been more than one "I think
this is safe" followed by "this broke ..." changes I've tried.  Sorry!

-- 
Tom


More information about the U-Boot mailing list