aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/kexec.h
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@redhat.com>2014-08-08 17:26:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-08 18:57:33 -0400
commitdd5f726076cc7639d9713b334c8c133f77c6757a (patch)
tree6b3e88bdf3e764d97eb88464e31abc097dab44f6 /arch/x86/include/asm/kexec.h
parent27f48d3e633be23656a097baa3be336e04a82d84 (diff)
kexec: support for kexec on panic using new system call
This patch adds support for loading a kexec on panic (kdump) kernel usning new system call. It prepares ELF headers for memory areas to be dumped and for saved cpu registers. Also prepares the memory map for second kernel and limits its boot to reserved areas only. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Cc: Borislav Petkov <bp@suse.de> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Eric Biederman <ebiederm@xmission.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Greg Kroah-Hartman <greg@kroah.com> Cc: Dave Young <dyoung@redhat.com> Cc: WANG Chao <chaowang@redhat.com> Cc: Baoquan He <bhe@redhat.com> Cc: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/x86/include/asm/kexec.h')
-rw-r--r--arch/x86/include/asm/kexec.h30
1 files changed, 27 insertions, 3 deletions
diff --git a/arch/x86/include/asm/kexec.h b/arch/x86/include/asm/kexec.h
index 0dfccced4edf..d2434c1cad05 100644
--- a/arch/x86/include/asm/kexec.h
+++ b/arch/x86/include/asm/kexec.h
@@ -25,6 +25,8 @@
25#include <asm/ptrace.h> 25#include <asm/ptrace.h>
26#include <asm/bootparam.h> 26#include <asm/bootparam.h>
27 27
28struct kimage;
29
28/* 30/*
29 * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return. 31 * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return.
30 * I.e. Maximum page that is mapped directly into kernel memory, 32 * I.e. Maximum page that is mapped directly into kernel memory,
@@ -62,6 +64,10 @@
62# define KEXEC_ARCH KEXEC_ARCH_X86_64 64# define KEXEC_ARCH KEXEC_ARCH_X86_64
63#endif 65#endif
64 66
67/* Memory to backup during crash kdump */
68#define KEXEC_BACKUP_SRC_START (0UL)
69#define KEXEC_BACKUP_SRC_END (640 * 1024UL) /* 640K */
70
65/* 71/*
66 * CPU does not save ss and sp on stack if execution is already 72 * CPU does not save ss and sp on stack if execution is already
67 * running in kernel mode at the time of NMI occurrence. This code 73 * running in kernel mode at the time of NMI occurrence. This code
@@ -161,17 +167,35 @@ struct kimage_arch {
161 pud_t *pud; 167 pud_t *pud;
162 pmd_t *pmd; 168 pmd_t *pmd;
163 pte_t *pte; 169 pte_t *pte;
170 /* Details of backup region */
171 unsigned long backup_src_start;
172 unsigned long backup_src_sz;
173
174 /* Physical address of backup segment */
175 unsigned long backup_load_addr;
176
177 /* Core ELF header buffer */
178 void *elf_headers;
179 unsigned long elf_headers_sz;
180 unsigned long elf_load_addr;
164}; 181};
182#endif /* CONFIG_X86_32 */
165 183
184#ifdef CONFIG_X86_64
185/*
186 * Number of elements and order of elements in this structure should match
187 * with the ones in arch/x86/purgatory/entry64.S. If you make a change here
188 * make an appropriate change in purgatory too.
189 */
166struct kexec_entry64_regs { 190struct kexec_entry64_regs {
167 uint64_t rax; 191 uint64_t rax;
168 uint64_t rbx;
169 uint64_t rcx; 192 uint64_t rcx;
170 uint64_t rdx; 193 uint64_t rdx;
171 uint64_t rsi; 194 uint64_t rbx;
172 uint64_t rdi;
173 uint64_t rsp; 195 uint64_t rsp;
174 uint64_t rbp; 196 uint64_t rbp;
197 uint64_t rsi;
198 uint64_t rdi;
175 uint64_t r8; 199 uint64_t r8;
176 uint64_t r9; 200 uint64_t r9;
177 uint64_t r10; 201 uint64_t r10;