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

Commit 47b3bc90 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

Pull x86 fixes from Peter Anvin:
 "Several boot fixes (MacBook, legacy EFI bootloaders), another
  please-don't-brick fix, and some minor stuff."

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86: Do not try to sync identity map for non-mapped pages
  x86, doc: Be explicit about what the x86 struct boot_params requires
  x86: Don't clear efi_info even if the sentinel hits
  x86, mm: Make sure to find a 2M free block for the first mapped area
  x86: Fix 32-bit *_cpu_data initializers
  efivarfs: return accurate error code in efivarfs_fill_super()
  efivars: efivarfs_valid_name() should handle pstore syntax
  efi: be more paranoid about available space when creating variables
  iommu, x86: Add DMA remap fault reason
  x86, smpboot: Remove unused variable
parents af2841cd cc677088
Loading
Loading
Loading
Loading
+18 −2
Original line number Original line Diff line number Diff line
@@ -14,13 +14,29 @@
 * analysis of kexec-tools; if other broken bootloaders initialize a
 * analysis of kexec-tools; if other broken bootloaders initialize a
 * different set of fields we will need to figure out how to disambiguate.
 * different set of fields we will need to figure out how to disambiguate.
 *
 *
 * Note: efi_info is commonly left uninitialized, but that field has a
 * private magic, so it is better to leave it unchanged.
 */
 */
static void sanitize_boot_params(struct boot_params *boot_params)
static void sanitize_boot_params(struct boot_params *boot_params)
{
{
	/* 
	 * IMPORTANT NOTE TO BOOTLOADER AUTHORS: do not simply clear
	 * this field.  The purpose of this field is to guarantee
	 * compliance with the x86 boot spec located in
	 * Documentation/x86/boot.txt .  That spec says that the
	 * *whole* structure should be cleared, after which only the
	 * portion defined by struct setup_header (boot_params->hdr)
	 * should be copied in.
	 *
	 * If you're having an issue because the sentinel is set, you
	 * need to change the whole structure to be cleared, not this
	 * (or any other) individual field, or you will soon have
	 * problems again.
	 */
	if (boot_params->sentinel) {
	if (boot_params->sentinel) {
		/*fields in boot_params are not valid, clear them */
		/* fields in boot_params are left uninitialized, clear them */
		memset(&boot_params->olpc_ofw_header, 0,
		memset(&boot_params->olpc_ofw_header, 0,
		       (char *)&boot_params->alt_mem_k -
		       (char *)&boot_params->efi_info -
			(char *)&boot_params->olpc_ofw_header);
			(char *)&boot_params->olpc_ofw_header);
		memset(&boot_params->kbd_status, 0,
		memset(&boot_params->kbd_status, 0,
		       (char *)&boot_params->hdr -
		       (char *)&boot_params->hdr -
+8 −2
Original line number Original line Diff line number Diff line
@@ -171,9 +171,15 @@ static struct resource bss_resource = {


#ifdef CONFIG_X86_32
#ifdef CONFIG_X86_32
/* cpu data as detected by the assembly code in head.S */
/* cpu data as detected by the assembly code in head.S */
struct cpuinfo_x86 new_cpu_data __cpuinitdata = {0, 0, 0, 0, -1, 1, 0, 0, -1};
struct cpuinfo_x86 new_cpu_data __cpuinitdata = {
	.wp_works_ok = -1,
	.fdiv_bug = -1,
};
/* common cpu data for all cpus */
/* common cpu data for all cpus */
struct cpuinfo_x86 boot_cpu_data __read_mostly = {0, 0, 0, 0, -1, 1, 0, 0, -1};
struct cpuinfo_x86 boot_cpu_data __read_mostly = {
	.wp_works_ok = -1,
	.fdiv_bug = -1,
};
EXPORT_SYMBOL(boot_cpu_data);
EXPORT_SYMBOL(boot_cpu_data);


unsigned int def_to_bigsmp;
unsigned int def_to_bigsmp;
+1 −2
Original line number Original line Diff line number Diff line
@@ -1365,9 +1365,8 @@ static inline void mwait_play_dead(void)
	unsigned int eax, ebx, ecx, edx;
	unsigned int eax, ebx, ecx, edx;
	unsigned int highest_cstate = 0;
	unsigned int highest_cstate = 0;
	unsigned int highest_subcstate = 0;
	unsigned int highest_subcstate = 0;
	int i;
	void *mwait_ptr;
	void *mwait_ptr;
	struct cpuinfo_x86 *c = __this_cpu_ptr(&cpu_info);
	int i;


	if (!this_cpu_has(X86_FEATURE_MWAIT))
	if (!this_cpu_has(X86_FEATURE_MWAIT))
		return;
		return;
+2 −3
Original line number Original line Diff line number Diff line
@@ -410,9 +410,8 @@ void __init init_mem_mapping(void)
	/* the ISA range is always mapped regardless of memory holes */
	/* the ISA range is always mapped regardless of memory holes */
	init_memory_mapping(0, ISA_END_ADDRESS);
	init_memory_mapping(0, ISA_END_ADDRESS);


	/* xen has big range in reserved near end of ram, skip it at first */
	/* xen has big range in reserved near end of ram, skip it at first.*/
	addr = memblock_find_in_range(ISA_END_ADDRESS, end, PMD_SIZE,
	addr = memblock_find_in_range(ISA_END_ADDRESS, end, PMD_SIZE, PMD_SIZE);
			 PAGE_SIZE);
	real_end = addr + PMD_SIZE;
	real_end = addr + PMD_SIZE;


	/* step_size need to be small so pgt_buf from BRK could cover it */
	/* step_size need to be small so pgt_buf from BRK could cover it */
+7 −0
Original line number Original line Diff line number Diff line
@@ -563,6 +563,13 @@ int kernel_map_sync_memtype(u64 base, unsigned long size, unsigned long flags)
	if (base > __pa(high_memory-1))
	if (base > __pa(high_memory-1))
		return 0;
		return 0;


	/*
	 * some areas in the middle of the kernel identity range
	 * are not mapped, like the PCI space.
	 */
	if (!page_is_ram(base >> PAGE_SHIFT))
		return 0;

	id_sz = (__pa(high_memory-1) <= base + size) ?
	id_sz = (__pa(high_memory-1) <= base + size) ?
				__pa(high_memory) - base :
				__pa(high_memory) - base :
				size;
				size;
Loading