linux-brain/arch/x86/boot
Arvind Sankar 615d0014bf x86/boot: Use unsigned comparison for addresses
[ Upstream commit 81a34892c2c7c809f9c4e22c5ac936ae673fb9a2 ]

The load address is compared with LOAD_PHYSICAL_ADDR using a signed
comparison currently (using jge instruction).

When loading a 64-bit kernel using the new efi32_pe_entry() point added by:

  97aa276579b2 ("efi/x86: Add true mixed mode entry point into .compat section")

using Qemu with -m 3072, the firmware actually loads us above 2Gb,
resulting in a very early crash.

Use the JAE instruction to perform a unsigned comparison instead, as physical
addresses should be considered unsigned.

Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20200301230436.2246909-6-nivedita@alum.mit.edu
Link: https://lore.kernel.org/r/20200308080859.21568-14-ardb@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-04-17 10:48:41 +02:00
..
compressed x86/boot: Use unsigned comparison for addresses 2020-04-17 10:48:41 +02:00
tools x86: boot: Fix EFI stub alignment 2018-11-13 11:08:26 -08:00
.gitignore x86/build: Add more generated files to the .gitignore file 2017-11-07 11:22:21 +01:00
a20.c x86, setup: "glove box" BIOS interrupts in the core boot code 2009-04-09 16:08:11 -07:00
apm.c x86, setup: "glove box" BIOS interrupts in the APM code 2009-04-09 16:08:11 -07:00
bioscall.S x86, boot: Move intcall() to the .inittext section 2014-01-04 14:29:08 -08:00
bitops.h x86/boot: Use CC_SET()/CC_OUT() instead of open coding it 2018-08-02 14:30:42 +02:00
boot.h x86/boot: Fix BSS corruption/overwrite bug in early x86 kernel startup 2017-04-20 10:05:23 +02:00
cmdline.c x86, boot: Pass cmd_line_ptr with unsigned long instead 2013-01-29 15:26:09 -08:00
code16gcc.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
copy.S x86/boot: Remove unused copy_*_gs() functions 2017-06-05 09:35:16 +02:00
cpu.c Revert "x86/boot: Fail the boot if !M486 and CPUID is missing" 2016-12-19 11:54:20 +01:00
cpucheck.c x86/boot: Detect 5-level paging support 2017-04-04 08:22:33 +02:00
cpuflags.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cpuflags.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ctype.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
early_serial_console.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
edd.c x86, boot: Create a separate string.h file to provide standard string functions 2014-03-19 15:43:45 -07:00
genimage.sh x86/build: Make isoimage work on Debian 2017-12-16 16:23:31 +01:00
header.S Merge branch 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-11-13 16:32:30 -08:00
install.sh kbuild: use INSTALLKERNEL to select customized installkernel script 2009-09-20 12:18:14 +02:00
main.c x86/boot: Obsolete the MCA sys_desc_table 2015-07-21 10:55:11 +02:00
Makefile x86/build: Specify elf_i386 linker emulation explicitly for i386 objects 2019-04-05 22:33:16 +02:00
memory.c x86/boot/e820: Separate the E820 ABI structures from the in-kernel structures 2017-01-29 13:39:32 +01:00
mkcpustr.c x86/cpufeature: Carve out X86_FEATURE_* 2016-01-30 11:22:17 +01:00
mtools.conf.in i386: move boot 2007-10-11 11:16:45 +02:00
pm.c x86: remove zImage support 2009-03-11 11:00:00 -07:00
pmjump.S x86, setup: move 32-bit code to .text32 2009-03-17 15:26:06 -07:00
printf.c x86/boot: Fix a sanity check in printf.c 2013-08-14 11:48:41 +02:00
regs.c x86, boot: Create a separate string.h file to provide standard string functions 2014-03-19 15:43:45 -07:00
setup.ld x86, boot: Define the 2.12 bzImage boot protocol 2013-01-27 15:56:37 -08:00
string.c x86/purgatory: Do not use __builtin_memcpy and __builtin_memset 2019-08-16 10:12:50 +02:00
string.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tty.c x86, setup: reorganize the early console setup 2010-08-02 15:51:56 -07:00
version.c kbuild: move utsrelease.h to include/generated 2009-12-12 13:08:15 +01:00
vesa.h x86-boot: don't request VBE2 information 2008-03-07 16:39:14 +01:00
video-bios.c x86: fix usage of bios intcall() 2009-07-04 12:56:32 -07:00
video-mode.c x86/mm: Fix regression with huge pages on PAE 2015-12-04 09:14:27 +01:00
video-vesa.c x86, boot: Create a separate string.h file to provide standard string functions 2014-03-19 15:43:45 -07:00
video-vga.c x86: Use ARRAY_SIZE 2017-10-19 16:15:47 +02:00
video.c x86/mm: Fix regression with huge pages on PAE 2015-12-04 09:14:27 +01:00
video.h x86/boot/video: Move the 'video_segment' variable to video.c 2015-02-19 00:25:05 +01:00