armv8: layerscape: use memalign() to allocate spintable code
authorMichael Walle <michael@walle.cc>
Sun, 31 Oct 2021 22:21:56 +0000 (23:21 +0100)
committerPriyanka Jain <priyanka.jain@nxp.com>
Tue, 9 Nov 2021 11:48:23 +0000 (17:18 +0530)
commitcdf8534b8a01fd894fcc24f404e1feb5c51d95b2
tree1e33a8bf4ce41d806d642b6eaec64bd7d3440395
parent12d2b42a054f419184386012b14845e2c05f2c86
armv8: layerscape: use memalign() to allocate spintable code

Don't use efi_allocate_pages(). The allocated memory isn't carved out of
the lmb allocations. The memory might then be allocated twice.
Particulary, this might happened with the fdt_high/initrd_high feature
which will relocate the fdt/ramdisk. This might then overlap with the
spin table.

Instead use memalign() which allocates on memory on the heap which is
correctly carved out by lmb.

Please note, that the memory is later reserved in the device tree as
well as in the EFI memory map in ft_fixup_cpu() (in
arch/arm/cpu/armv8/fsl-layerscape/fdt.c).

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
arch/arm/cpu/armv8/fsl-layerscape/mp.c