OSDN Git Service

efi/x86: Replace references to efi_early->is64 with efi_is_64bit()
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 20 Jul 2018 01:47:24 +0000 (10:47 +0900)
committerIngo Molnar <mingo@kernel.org>
Sun, 22 Jul 2018 12:13:43 +0000 (14:13 +0200)
commitaab9593c0cb4454f9d261a8c87a3361f3186c4ec
treee05607bc70413374e07bcf7c377245bbecb01367
parentc4db9c1e8c70bc60e392da8a485bcfb035d559c2
efi/x86: Replace references to efi_early->is64 with efi_is_64bit()

There are a couple of places in the x86 EFI stub code where we select
between 32-bit and 64-bit versions of the support routines based on
the value of efi_early->is64. Referencing that field directly is a
bad idea, since it prevents the compiler from inferring that this
field can never be true on a 32-bit build, and can only become false
on a 64-bit build if support for mixed mode is compiled in. This
results in dead code to be retained in the uncompressed part of the
kernel image, which is wasteful.

So switch to the efi_is_64bit() helper, which will resolve to a
constant boolean unless building for 64-bit with mixed mode support.

Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Lukas Wunner <lukas@wunner.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/20180720014726.24031-8-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/boot/compressed/eboot.c