Skip to content
  1. May 05, 2014
  2. Apr 10, 2014
  3. Mar 26, 2014
  4. Mar 20, 2014
  5. Mar 19, 2014
  6. Mar 13, 2014
  7. Mar 05, 2014
    • Matt Fleming's avatar
      x86/boot: Fix non-EFI build · 3db4cafd
      Matt Fleming authored
      
      
      The kbuild test robot reported the following errors, introduced with
      commit 54b52d87 ("x86/efi: Build our own EFI services pointer
      table"),
      
       arch/x86/boot/compressed/head_32.o: In function `efi32_config':
      >> (.data+0x58): undefined reference to `efi_call_phys'
      
       arch/x86/boot/compressed/head_64.o: In function `efi64_config':
      >> (.data+0x90): undefined reference to `efi_call6'
      
      Wrap the efi*_config structures in #ifdef CONFIG_EFI_STUB so that we
      don't make references to EFI functions if they're not compiled in.
      
      Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
      3db4cafd
    • Matt Fleming's avatar
      x86, tools: Fix up compiler warnings · b663a685
      Matt Fleming authored
      
      
      The kbuild test robot reported the following errors that were introduced
      with commit 993c30a0 ("x86, tools: Consolidate #ifdef code"),
      
        arch/x86/boot/tools/build.c: In function 'update_pecoff_setup_and_reloc':
      >> arch/x86/boot/tools/build.c:252:1: error: parameter name omitted
          static inline void update_pecoff_setup_and_reloc(unsigned int) {}
          ^
        arch/x86/boot/tools/build.c: In function 'update_pecoff_text':
      >> arch/x86/boot/tools/build.c:253:1: error: parameter name omitted
          static inline void update_pecoff_text(unsigned int, unsigned int) {}
          ^
      >> arch/x86/boot/tools/build.c:253:1: error: parameter name omitted
      
         arch/x86/boot/tools/build.c: In function 'main':
      >> arch/x86/boot/tools/build.c:372:2: warning: implicit declaration of function 'efi_stub_entry_update' [-Wimplicit-function-declaration]
          efi_stub_entry_update();
          ^
      Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
      b663a685
  8. Mar 04, 2014
    • Matt Fleming's avatar
      x86/boot: Don't overwrite cr4 when enabling PAE · 108d3f44
      Matt Fleming authored
      
      
      Some EFI firmware makes use of the FPU during boottime services and
      clearing X86_CR4_OSFXSR by overwriting %cr4 causes the firmware to
      crash.
      
      Add the PAE bit explicitly instead of trashing the existing contents,
      leaving the rest of the bits as the firmware set them.
      
      Cc: H. Peter Anvin <hpa@zytor.com>
      Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
      108d3f44
    • Matt Fleming's avatar
      x86/efi: Wire up CONFIG_EFI_MIXED · 7d453eee
      Matt Fleming authored
      
      
      Add the Kconfig option and bump the kernel header version so that boot
      loaders can check whether the handover code is available if they want.
      
      The xloadflags field in the bzImage header is also updated to reflect
      that the kernel supports both entry points by setting both of
      XLF_EFI_HANDOVER_32 and XLF_EFI_HANDOVER_64 when CONFIG_EFI_MIXED=y.
      XLF_CAN_BE_LOADED_ABOVE_4G is disabled so that the kernel text is
      guaranteed to be addressable with 32-bits.
      
      Note that no boot loaders should be using the bits set in xloadflags to
      decide which entry point to jump to. The entire scheme is based on the
      concept that 32-bit bootloaders always jump to ->handover_offset and
      64-bit loaders always jump to ->handover_offset + 512. We set both bits
      merely to inform the boot loader that it's safe to use the native
      handover offset even if the machine type in the PE/COFF header claims
      otherwise.
      
      Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
      7d453eee
    • Matt Fleming's avatar
      x86/efi: Firmware agnostic handover entry points · b8ff87a6
      Matt Fleming authored
      
      
      The EFI handover code only works if the "bitness" of the firmware and
      the kernel match, i.e. 64-bit firmware and 64-bit kernel - it is not
      possible to mix the two. This goes against the tradition that a 32-bit
      kernel can be loaded on a 64-bit BIOS platform without having to do
      anything special in the boot loader. Linux distributions, for one thing,
      regularly run only 32-bit kernels on their live media.
      
      Despite having only one 'handover_offset' field in the kernel header,
      EFI boot loaders use two separate entry points to enter the kernel based
      on the architecture the boot loader was compiled for,
      
          (1) 32-bit loader: handover_offset
          (2) 64-bit loader: handover_offset + 512
      
      Since we already have two entry points, we can leverage them to infer
      the bitness of the firmware we're running on, without requiring any boot
      loader modifications, by making (1) and (2) valid entry points for both
      CONFIG_X86_32 and CONFIG_X86_64 kernels.
      
      To be clear, a 32-bit boot loader will always use (1) and a 64-bit boot
      loader will always use (2). It's just that, if a single kernel image
      supports (1) and (2) that image can be used with both 32-bit and 64-bit
      boot loaders, and hence both 32-bit and 64-bit EFI.
      
      (1) and (2) must be 512 bytes apart at all times, but that is already
      part of the boot ABI and we could never change that delta without
      breaking existing boot loaders anyhow.
      
      Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
      b8ff87a6
    • Matt Fleming's avatar
      x86/efi: Split the boot stub into 32/64 code paths · c116e8d6
      Matt Fleming authored
      
      
      Make the decision which code path to take at runtime based on
      efi_early->is64.
      
      Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
      c116e8d6
    • Matt Fleming's avatar
      x86/efi: Add early thunk code to go from 64-bit to 32-bit · 0154416a
      Matt Fleming authored
      
      
      Implement the transition code to go from IA32e mode to protected mode in
      the EFI boot stub. This is required to use 32-bit EFI services from a
      64-bit kernel.
      
      Since EFI boot stub is executed in an identity-mapped region, there's
      not much we need to do before invoking the 32-bit EFI boot services.
      However, we do reload the firmware's global descriptor table
      (efi32_boot_gdt) in case things like timer events are still running in
      the firmware.
      
      Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
      0154416a
    • Matt Fleming's avatar
      x86/efi: Build our own EFI services pointer table · 54b52d87
      Matt Fleming authored
      
      
      It's not possible to dereference the EFI System table directly when
      booting a 64-bit kernel on a 32-bit EFI firmware because the size of
      pointers don't match.
      
      In preparation for supporting the above use case, build a list of
      function pointers on boot so that callers don't have to worry about
      converting pointer sizes through multiple levels of indirection.
      
      Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
      54b52d87
    • Matt Fleming's avatar
      efi: Add separate 32-bit/64-bit definitions · 677703ce
      Matt Fleming authored
      
      
      The traditional approach of using machine-specific types such as
      'unsigned long' does not allow the kernel to interact with firmware
      running in a different CPU mode, e.g. 64-bit kernel with 32-bit EFI.
      
      Add distinct EFI structure definitions for both 32-bit and 64-bit so
      that we can use them in the 32-bit and 64-bit code paths.
      
      Acked-by: default avatarBorislav Petkov <bp@suse.de>
      Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
      677703ce
    • Matt Fleming's avatar
      x86, tools: Consolidate #ifdef code · 993c30a0
      Matt Fleming authored
      
      
      Instead of littering main() with #ifdef CONFIG_EFI_STUB, move the logic
      into separate functions that do nothing if the config option isn't set.
      This makes main() much easier to read.
      
      Acked-by: default avatarBorislav Petkov <bp@suse.de>
      Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
      993c30a0
    • Matt Fleming's avatar
      x86/boot: Cleanup header.S by removing some #ifdefs · 86134a1b
      Matt Fleming authored
      
      
      handover_offset is now filled out by build.c. Don't set a default value
      as it will be overwritten anyway.
      
      Acked-by: default avatarBorislav Petkov <bp@suse.de>
      Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
      86134a1b
  9. Feb 26, 2014
  10. Jan 30, 2014
  11. Jan 22, 2014
  12. Jan 14, 2014
  13. Jan 04, 2014
  14. Dec 29, 2013
  15. Dec 09, 2013
    • H. Peter Anvin's avatar
      x86, build: Pass in additional -mno-mmx, -mno-sse options · 8b3b005d
      H. Peter Anvin authored
      
      
      In checkin
      
          5551a34e x86-64, build: Always pass in -mno-sse
      
      we unconditionally added -mno-sse to the main build, to keep newer
      compilers from generating SSE instructions from autovectorization.
      However, this did not extend to the special environments
      (arch/x86/boot, arch/x86/boot/compressed, and arch/x86/realmode/rm).
      Add -mno-sse to the compiler command line for these environments, and
      add -mno-mmx to all the environments as well, as we don't want a
      compiler to generate MMX code either.
      
      This patch also removes a $(cc-option) call for -m32, since we have
      long since stopped supporting compilers too old for the -m32 option,
      and in fact hardcode it in other places in the Makefiles.
      
      Reported-by: default avatarKevin B. Smith <kevin.b.smith@intel.com>
      Cc: Sunil K. Pandey <sunil.k.pandey@intel.com>
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      Cc: H. J. Lu <hjl.tools@gmail.com>
      Link: http://lkml.kernel.org/n/tip-j21wzqv790q834n7yc6g80j1@git.kernel.org
      Cc: <stable@vger.kernel.org> # build fix only
      8b3b005d
  16. Nov 12, 2013
  17. Oct 13, 2013
Loading