u-boot/arch/x86
Bin Meng a139cc1865 x86: Specify -march=core2 to build 64-bit U-Boot proper
With newer kernel.org GCC (7.3.0 or 8.1.0), the u-boot.rom image
built for qemu-x86_64 target does not boot. It keeps resetting
soon after the 32-bit SPL jumps to 64-bit proper. Debugging shows
that the reset happens inside env_callback_init().

000000000113dd85 <env_callback_init>:
 113dd85:       41 54                   push   %r12
 113dd87:       55                      push   %rbp
 113dd88:       31 c0                   xor    %eax,%eax
 113dd8a:       53                      push   %rbx
 113dd8b:       0f 57 c0                xorps  %xmm0,%xmm0

Executing "xorps %xmm0,%xmm0" causes CPU to immediately reset.
However older GCC like 5.4.0 (the one shipped by Ubuntu 16.04)
does not generate such instructions that utilizes SSE for this
function - env_callback_init() and U-Boot boots without any issue.
Explicitly specifying -march=core2 for newer GCC allows U-Boot
proper to boot again. Examine assembly codes of env_callback_init
and there is no SSE instruction in that function hence U-Boot
continues to boot.

core2 seems to be the oldest arch in GCC that supports 64-bit.
Like 32-bit U-Boot build we use -march=i386 which is the most
conservative cpu type so that the image can run on any x86
processor, let's do the same for the 64-bit U-Boot build.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2018-10-22 17:51:45 +08:00
..
cpu x86: Update mtrr functions to allow leaving cache alone 2018-10-09 04:40:27 -06:00
dts x86: dts: edison: configure I2C#6 pins 2018-09-17 17:35:52 +08:00
include/asm x86: Update mtrr functions to allow leaving cache alone 2018-10-09 04:40:27 -06:00
lib x86/bootm: fix error handling in boot_prep_linux(...) 2018-10-22 17:51:45 +08:00
config.mk x86: Specify -march=core2 to build 64-bit U-Boot proper 2018-10-22 17:51:45 +08:00
Kconfig x86: efi: Refactor the directory of EFI app and payload support 2018-06-17 21:16:04 +08:00
Makefile SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00