1. 27 9月, 2022 3 次提交
    • A
      efi: libstub: remove pointless goto kludge · a12b78b5
      Ard Biesheuvel 提交于
      Remove some goto cruft that serves no purpose and obfuscates the code.
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      a12b78b5
    • A
      efi: libstub: simplify efi_get_memory_map() and struct efi_boot_memmap · eab31265
      Ard Biesheuvel 提交于
      Currently, struct efi_boot_memmap is a struct that is passed around
      between callers of efi_get_memory_map() and the users of the resulting
      data, and which carries pointers to various variables whose values are
      provided by the EFI GetMemoryMap() boot service.
      
      This is overly complex, and it is much easier to carry these values in
      the struct itself. So turn the struct into one that carries these data
      items directly, including a flex array for the variable number of EFI
      memory descriptors that the boot service may return.
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      eab31265
    • A
      efi: libstub: avoid efi_get_memory_map() for allocating the virt map · f80d2604
      Ard Biesheuvel 提交于
      The virt map is a set of efi_memory_desc_t descriptors that are passed
      to SetVirtualAddressMap() to inform the firmware about the desired
      virtual mapping of the regions marked as EFI_MEMORY_RUNTIME. The only
      reason we currently call the efi_get_memory_map() helper is that it
      gives us an allocation that is guaranteed to be of sufficient size.
      However, efi_get_memory_map() has grown some additional complexity over
      the years, and today, we're actually better off calling the EFI boot
      service directly with a zero size, which tells us how much memory should
      be enough for the virt map.
      
      While at it, avoid creating the VA map allocation if we will not be
      using it anyway, i.e., if efi_novamap is true.
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      f80d2604
  2. 21 9月, 2022 1 次提交
  3. 06 9月, 2022 1 次提交
    • H
      efi/loongarch: Add efistub booting support · ead384d9
      Huacai Chen 提交于
      This patch adds efistub booting support, which is the standard UEFI boot
      protocol for LoongArch to use.
      
      We use generic efistub, which means we can pass boot information (i.e.,
      system table, memory map, kernel command line, initrd) via a light FDT
      and drop a lot of non-standard code.
      
      We use a flat mapping to map the efi runtime in the kernel's address
      space. In efi, VA = PA; in kernel, VA = PA + PAGE_OFFSET. As a result,
      flat mapping is not identity mapping, SetVirtualAddressMap() is still
      needed for the efi runtime.
      Tested-by: NXi Ruoyao <xry111@xry111.site>
      Signed-off-by: NHuacai Chen <chenhuacai@loongson.cn>
      [ardb: change fpic to fpie as suggested by Xi Ruoyao]
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      ead384d9
  4. 12 8月, 2022 17 次提交
  5. 11 8月, 2022 18 次提交