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

Commit 203e9e41 authored by Xunlei Pang's avatar Xunlei Pang Committed by Linus Torvalds
Browse files

kexec: move vmcoreinfo out of the kernel's .bss section

As Eric said,
 "what we need to do is move the variable vmcoreinfo_note out of the
  kernel's .bss section. And modify the code to regenerate and keep this
  information in something like the control page.

  Definitely something like this needs a page all to itself, and ideally
  far away from any other kernel data structures. I clearly was not
  watching closely the data someone decided to keep this silly thing in
  the kernel's .bss section."

This patch allocates extra pages for these vmcoreinfo_XXX variables, one
advantage is that it enhances some safety of vmcoreinfo, because
vmcoreinfo now is kept far away from other kernel data structures.

Link: http://lkml.kernel.org/r/1493281021-20737-1-git-send-email-xlpang@redhat.com


Signed-off-by: default avatarXunlei Pang <xlpang@redhat.com>
Tested-by: default avatarMichael Holzheu <holzheu@linux.vnet.ibm.com>
Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
Suggested-by: default avatarEric Biederman <ebiederm@xmission.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Dave Young <dyoung@redhat.com>
Cc: Hari Bathini <hbathini@linux.vnet.ibm.com>
Cc: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 112166f8
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -163,8 +163,3 @@ void arch_crash_save_vmcoreinfo(void)
#endif
}
phys_addr_t paddr_vmcoreinfo_note(void)
{
	return ia64_tpa((unsigned long)(char *)&vmcoreinfo_note);
}
+1 −0
Original line number Diff line number Diff line
@@ -246,6 +246,7 @@ void arch_crash_save_vmcoreinfo(void)
	VMCOREINFO_SYMBOL(lowcore_ptr);
	VMCOREINFO_SYMBOL(high_memory);
	VMCOREINFO_LENGTH(lowcore_ptr, NR_CPUS);
	mem_assign_absolute(S390_lowcore.vmcore_info, paddr_vmcoreinfo_note());
}

void machine_shutdown(void)
+0 −6
Original line number Diff line number Diff line
@@ -496,11 +496,6 @@ static void __init setup_memory_end(void)
	pr_notice("The maximum memory size is %luMB\n", memory_end >> 20);
}

static void __init setup_vmcoreinfo(void)
{
	mem_assign_absolute(S390_lowcore.vmcore_info, paddr_vmcoreinfo_note());
}

#ifdef CONFIG_CRASH_DUMP

/*
@@ -939,7 +934,6 @@ void __init setup_arch(char **cmdline_p)
#endif

	setup_resources();
	setup_vmcoreinfo();
	setup_lowcore();
	smp_fill_possible_mask();
	cpu_detect_mhz_feature();
+1 −1
Original line number Diff line number Diff line
@@ -457,7 +457,7 @@ static int prepare_elf64_headers(struct crash_elf_data *ced,
	bufp += sizeof(Elf64_Phdr);
	phdr->p_type = PT_NOTE;
	phdr->p_offset = phdr->p_paddr = paddr_vmcoreinfo_note();
	phdr->p_filesz = phdr->p_memsz = sizeof(vmcoreinfo_note);
	phdr->p_filesz = phdr->p_memsz = VMCOREINFO_NOTE_SIZE;
	(ehdr->e_phnum)++;

#ifdef CONFIG_X86_64
+2 −2
Original line number Diff line number Diff line
@@ -2693,8 +2693,8 @@ EXPORT_SYMBOL_GPL(xen_destroy_contiguous_region);
phys_addr_t paddr_vmcoreinfo_note(void)
{
	if (xen_pv_domain())
		return virt_to_machine(&vmcoreinfo_note).maddr;
		return virt_to_machine(vmcoreinfo_note).maddr;
	else
		return __pa_symbol(&vmcoreinfo_note);
		return __pa(vmcoreinfo_note);
}
#endif /* CONFIG_KEXEC_CORE */
Loading