Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 162b246e authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull EFI updates from Ingo Molnar:
 "The main changes in this cycle were:

   - Rework the EFI capsule loader to allow for workarounds for
     non-compliant firmware (Ard Biesheuvel)

   - Implement a capsule loader quirk for Quark X102x (Jan Kiszka)

   - Enable SMBIOS/DMI support for the ARM architecture (Ard Biesheuvel)

   - Add CONFIG_EFI_PGT_DUMP=y support for x86-32 and kexec (Sai
     Praneeth)

   - Fixes for EFI support for Xen dom0 guests running under x86-64
     hosts (Daniel Kiper)"

* 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/xen/efi: Initialize only the EFI struct members used by Xen
  efi: Process the MEMATTR table only if EFI_MEMMAP is enabled
  efi/arm: Enable DMI/SMBIOS
  x86/efi: Extend CONFIG_EFI_PGT_DUMP support to x86_32 and kexec as well
  efi/efi_test: Use memdup_user() helper
  efi/capsule: Add support for Quark security header
  efi/capsule-loader: Use page addresses rather than struct page pointers
  efi/capsule-loader: Redirect calls to efi_capsule_setup_info() via weak alias
  efi/capsule: Remove NULL test on kmap()
  efi/capsule-loader: Use a cached copy of the capsule header
  efi/capsule: Adjust return type of efi_capsule_setup_info()
  efi/capsule: Clean up pr_err/_info() messages
  efi/capsule: Remove pr_debug() on ENOMEM or EFAULT
  efi/capsule: Fix return code on failing kmap/vmap
parents 330e9e46 6c64447e
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -2062,6 +2062,23 @@ config EFI
	  is only useful for kernels that may run on systems that have
	  UEFI firmware.

config DMI
	bool "Enable support for SMBIOS (DMI) tables"
	depends on EFI
	default y
	help
	  This enables SMBIOS/DMI feature for systems.

	  This option is only useful on systems that have UEFI firmware.
	  However, even with this option, the resultant kernel should
	  continue to boot on existing non-UEFI platforms.

	  NOTE: This does *NOT* enable or encourage the use of DMI quirks,
	  i.e., the the practice of identifying the platform via DMI to
	  decide whether certain workarounds for buggy hardware and/or
	  firmware need to be enabled. This would require the DMI subsystem
	  to be enabled much earlier than we do on ARM, which is non-trivial.

endmenu

menu "CPU Power Management"
+19 −0
Original line number Diff line number Diff line
/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#ifndef __ASM_DMI_H
#define __ASM_DMI_H

#include <linux/io.h>
#include <linux/slab.h>

#define dmi_early_remap(x, l)		memremap(x, l, MEMREMAP_WB)
#define dmi_early_unmap(x, l)		memunmap(x)
#define dmi_remap(x, l)			memremap(x, l, MEMREMAP_WB)
#define dmi_unmap(x)			memunmap(x)
#define dmi_alloc(l)			kzalloc(l, GFP_KERNEL)

#endif
+0 −15
Original line number Diff line number Diff line
@@ -11,7 +11,6 @@
 *
 */

#include <linux/dmi.h>
#include <linux/efi.h>
#include <linux/init.h>

@@ -117,20 +116,6 @@ int __init efi_set_mapping_permissions(struct mm_struct *mm,
				   set_permissions, md);
}

static int __init arm64_dmi_init(void)
{
	/*
	 * On arm64, DMI depends on UEFI, and dmi_scan_machine() needs to
	 * be called early because dmi_id_init(), which is an arch_initcall
	 * itself, depends on dmi_scan_machine() having been called already.
	 */
	dmi_scan_machine();
	if (dmi_available)
		dmi_set_dump_stack_arch_desc();
	return 0;
}
core_initcall(arm64_dmi_init);

/*
 * UpdateCapsule() depends on the system being shutdown via
 * ResetSystem().
+2 −1
Original line number Diff line number Diff line
@@ -1014,7 +1014,6 @@ static void __init __efi_enter_virtual_mode(void)
	 * necessary relocation fixups for the new virtual addresses.
	 */
	efi_runtime_update_mappings();
	efi_dump_pagetable();

	/* clean DUMMY object */
	efi_delete_dummy_variable();
@@ -1029,6 +1028,8 @@ void __init efi_enter_virtual_mode(void)
		kexec_enter_virtual_mode();
	else
		__efi_enter_virtual_mode();

	efi_dump_pagetable();
}

/*
+8 −1
Original line number Diff line number Diff line
@@ -44,7 +44,14 @@ int __init efi_alloc_page_tables(void)
}

void efi_sync_low_kernel_mappings(void) {}
void __init efi_dump_pagetable(void) {}

void __init efi_dump_pagetable(void)
{
#ifdef CONFIG_EFI_PGT_DUMP
	ptdump_walk_pgd_level(NULL, swapper_pg_dir);
#endif
}

int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages)
{
	return 0;
Loading