u-boot/arch/x86
J. Tang 3c03f4928e x86: Force 32-bit jumps in interrupt handlers
Depending upon the compiler used, IRQ entries could vary in sizes. With
GCC 5.x, the code generator will use short jumps for some IRQ entries
but near jumps for others. For example, GCC 5.4.0 generates the
following:

$ objdump -d interrupt.o
<snip>
00000207 <irq_18>:
207:   6a 12                   push   $0x12
209:   eb 85                   jmp    190 <irq_common_entry>

0000020b <irq_19>:
20b:   6a 13                   push   $0x13
20d:   eb 81                   jmp    190 <irq_common_entry>

0000020f <irq_20>:
20f:   6a 14                   push   $0x14
211:   e9 7a ff ff ff          jmp    190 <irq_common_entry>

00000216 <irq_21>:
216:   6a 15                   push   $0x15
218:   e9 73 ff ff ff          jmp    190 <irq_common_entry>

This causes a problem in cpu_init_interrupts(), because the IDT setup
assumed same sizes for all IRQ entries. GCC 4.x always generated 32-bit
jumps, so this previously was not a problem.

The fix is to force 32-bit near jumps for all entries within the
inline assembly. This works for GCC 5.x, and 4.x was already using
that form of jumping.

Signed-off-by: Jason Tang <tang@jtang.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-02-21 14:53:29 +08:00
..
cpu x86: Force 32-bit jumps in interrupt handlers 2017-02-21 14:53:29 +08:00
dts x86: qemu: Mark ucode as optional for SPL in u-boot.dtsi 2017-02-07 13:27:13 +08:00
include/asm x86: Move turbo_state to global_data 2017-02-07 13:07:26 +08:00
lib dm: core: Replace of_offset with accessor 2017-02-08 06:12:14 -07:00
config.mk x86: Update compile/link flags to support 64-bit U-Boot 2017-02-07 13:14:54 +08:00
Kconfig x86: make LOAD_FROM_32_BIT visible for platforms 2017-02-07 13:36:50 +08:00
Makefile x86: Add 64-bit start-up code 2017-02-06 11:38:46 +08:00