1. 05 9月, 2016 1 次提交
    • J
      efi/libstub: Allocate headspace in efi_get_memory_map() · dadb57ab
      Jeffrey Hugo 提交于
      efi_get_memory_map() allocates a buffer to store the memory map that it
      retrieves.  This buffer may need to be reused by the client after
      ExitBootServices() is called, at which point allocations are not longer
      permitted.  To support this usecase, provide the allocated buffer size back
      to the client, and allocate some additional headroom to account for any
      reasonable growth in the map that is likely to happen between the call to
      efi_get_memory_map() and the client reusing the buffer.
      Signed-off-by: NJeffrey Hugo <jhugo@codeaurora.org>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Leif Lindholm <leif.lindholm@linaro.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NMatt Fleming <matt@codeblueprint.co.uk>
      dadb57ab
  2. 16 4月, 2016 1 次提交
  3. 24 2月, 2016 1 次提交
  4. 08 12月, 2015 1 次提交
  5. 12 10月, 2015 1 次提交
  6. 01 4月, 2015 1 次提交
  7. 13 1月, 2015 1 次提交
    • A
      arm64/efi: move SetVirtualAddressMap() to UEFI stub · f3cdfd23
      Ard Biesheuvel 提交于
      In order to support kexec, the kernel needs to be able to deal with the
      state of the UEFI firmware after SetVirtualAddressMap() has been called.
      To avoid having separate code paths for non-kexec and kexec, let's move
      the call to SetVirtualAddressMap() to the stub: this will guarantee us
      that it will only be called once (since the stub is not executed during
      kexec), and ensures that the UEFI state is identical between kexec and
      normal boot.
      
      This implies that the layout of the virtual mapping needs to be created
      by the stub as well. All regions are rounded up to a naturally aligned
      multiple of 64 KB (for compatibility with 64k pages kernels) and recorded
      in the UEFI memory map. The kernel proper reads those values and installs
      the mappings in a dedicated set of page tables that are swapped in during
      UEFI Runtime Services calls.
      Acked-by: NLeif Lindholm <leif.lindholm@linaro.org>
      Acked-by: NMatt Fleming <matt.fleming@intel.com>
      Tested-by: NLeif Lindholm <leif.lindholm@linaro.org>
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      f3cdfd23
  8. 09 9月, 2014 1 次提交
    • M
      efi/arm64: Fix fdt-related memory reservation · 0ceac9e0
      Mark Salter 提交于
      Commit 86c8b27a:
       "arm64: ignore DT memreserve entries when booting in UEFI mode
      
      prevents early_init_fdt_scan_reserved_mem() from being called for
      arm64 kernels booting via UEFI. This was done because the kernel
      will use the UEFI memory map to determine reserved memory regions.
      That approach has problems in that early_init_fdt_scan_reserved_mem()
      also reserves the FDT itself and any node-specific reserved memory.
      By chance of some kernel configs, the FDT may be overwritten before
      it can be unflattened and the kernel will fail to boot. More subtle
      problems will result if the FDT has node specific reserved memory
      which is not really reserved.
      
      This patch has the UEFI stub remove the memory reserve map entries
      from the FDT as it does with the memory nodes. This allows
      early_init_fdt_scan_reserved_mem() to be called unconditionally
      so that the other needed reservations are made.
      Signed-off-by: NMark Salter <msalter@redhat.com>
      Acked-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Acked-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      0ceac9e0
  9. 19 7月, 2014 1 次提交
    • A
      efi: efistub: Convert into static library · f4f75ad5
      Ard Biesheuvel 提交于
      This patch changes both x86 and arm64 efistub implementations
      from #including shared .c files under drivers/firmware/efi to
      building shared code as a static library.
      
      The x86 code uses a stub built into the boot executable which
      uncompresses the kernel at boot time. In this case, the library is
      linked into the decompressor.
      
      In the arm64 case, the stub is part of the kernel proper so the library
      is linked into the kernel proper as well.
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      f4f75ad5
  10. 08 7月, 2014 2 次提交
    • A
      efi: efistub: Refactor stub components · bd669475
      Ard Biesheuvel 提交于
      In order to move from the #include "../../../xxxxx.c" anti-pattern used
      by both the x86 and arm64 versions of the stub to a static library
      linked into either the kernel proper (arm64) or a separate boot
      executable (x86), there is some prepatory work required.
      
      This patch does the following:
      - move forward declarations of functions shared between the arch
        specific and the generic parts of the stub to include/linux/efi.h
      - move forward declarations of functions shared between various .c files
        of the generic stub code to a new local header file called "efistub.h"
      - add #includes to all .c files which were formerly relying on the
        #includor to include the correct header files
      - remove all static modifiers from functions which will need to be
        externally visible once we move to a static library
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      bd669475
    • A
      efi/arm64: efistub: remove local copy of linux_banner · f49182ec
      Ard Biesheuvel 提交于
      The shared efistub code for ARM and arm64 contains a local copy of
      linux_banner, allowing it to be referenced from separate executables
      such as the ARM decompressor. However, this introduces a dependency on
      generated header files, causing unnecessary rebuilds of the stub itself
      and, in case of arm64, vmlinux which contains it.
      
      On arm64, the copy is not actually needed since we can reference the
      original symbol directly, and as it turns out, there may be better ways
      to deal with this for ARM as well, so let's remove it from the shared
      code. If it still needs to be reintroduced for ARM later, it should live
      under arch/arm anyway and not in shared code.
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      f49182ec
  11. 07 7月, 2014 1 次提交
    • A
      efi/arm64: efistub: remove local copy of linux_banner · a55c072d
      Ard Biesheuvel 提交于
      The shared efistub code for ARM and arm64 contains a local copy of
      linux_banner, allowing it to be referenced from separate executables
      such as the ARM decompressor. However, this introduces a dependency on
      generated header files, causing unnecessary rebuilds of the stub itself
      and, in case of arm64, vmlinux which contains it.
      
      On arm64, the copy is not actually needed since we can reference the
      original symbol directly, and as it turns out, there may be better ways
      to deal with this for ARM as well, so let's remove it from the shared
      code. If it still needs to be reintroduced for ARM later, it should live
      under arch/arm anyway and not in shared code.
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      a55c072d
  12. 19 6月, 2014 1 次提交
    • C
      efi: Fix compiler warnings (unused, const, type) · 6fb8cc82
      Catalin Marinas 提交于
      This patch fixes a few compiler warning in the efi code for unused
      variable, discarding const qualifier and wrong pointer type:
      
      drivers/firmware/efi/fdt.c|66 col 22| warning: unused variable ‘name’ [-Wunused-variable]
      drivers/firmware/efi/efi.c|368 col 3| warning: passing argument 3 of ‘of_get_flat_dt_prop’ from incompatible pointer type [enabled by default]
      drivers/firmware/efi/efi.c|368 col 8| warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      6fb8cc82
  13. 01 5月, 2014 1 次提交