x86: Ensure no instruction sets of MMX/SSE are generated in 64-bit build
authorBin Meng <bmeng.cn@gmail.com>
Sun, 14 Oct 2018 03:52:02 +0000 (20:52 -0700)
committerBin Meng <bmeng.cn@gmail.com>
Mon, 22 Oct 2018 09:51:45 +0000 (17:51 +0800)
commitdd4611dea435d77dcc8f695c35b15c4a2cc1e55f
tree40e5afd90f9659807e688211d48618450924e49e
parenta139cc1865aa7dd14e896596fa23938b303d7052
x86: Ensure no instruction sets of MMX/SSE are generated in 64-bit build

With the '-march=core2' fix, it seems that we have some luck that
the 64-bit U-Boot boots again. However if we examine the disassembly
codes there are still SSE instructions elsewhere which means passing
cpu type to GCC is not enough to prevent it from generating these
instructions. A simple test case is doing a 'bootefi selftest' from
the U-Boot shell and it leads to a reset too.

The 'bootefi selftest' reset is even seen with the image created by
the relative older GCC 5.4.0, the one shipped by Ubuntu 16.04.

The reset actually originates from undefined instruction exception
caused by these SSE instructions. To keep U-Boot as a bootloader as
simple as possible, we don't want to handle such advanced SIMD stuff.
To make sure no MMX/SSE instruction sets are generated, tell GCC not
to do this. Note AVX is out of the question as CORE2 is old enough
to support AVX yet.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
arch/x86/config.mk