Skip to content

Commit 27f48d3

Browse files
rhvgoyaltorvalds
authored andcommitted
kexec-bzImage64: support for loading bzImage using 64bit entry
This is loader specific code which can load bzImage and set it up for 64bit entry. This does not take care of 32bit entry or real mode entry. 32bit mode entry can be implemented if somebody needs it. 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>
1 parent 12db556 commit 27f48d3

7 files changed

Lines changed: 415 additions & 6 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef _ASM_KEXEC_BZIMAGE64_H
2+
#define _ASM_KEXEC_BZIMAGE64_H
3+
4+
extern struct kexec_file_ops kexec_bzImage64_ops;
5+
6+
#endif /* _ASM_KEXE_BZIMAGE64_H */

‎arch/x86/include/asm/kexec.h‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#include <asm/page.h>
2525
#include <asm/ptrace.h>
26+
#include <asm/bootparam.h>
2627

2728
/*
2829
* KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return.
@@ -161,6 +162,26 @@ struct kimage_arch {
161162
pmd_t *pmd;
162163
pte_t *pte;
163164
};
165+
166+
struct kexec_entry64_regs {
167+
uint64_t rax;
168+
uint64_t rbx;
169+
uint64_t rcx;
170+
uint64_t rdx;
171+
uint64_t rsi;
172+
uint64_t rdi;
173+
uint64_t rsp;
174+
uint64_t rbp;
175+
uint64_t r8;
176+
uint64_t r9;
177+
uint64_t r10;
178+
uint64_t r11;
179+
uint64_t r12;
180+
uint64_t r13;
181+
uint64_t r14;
182+
uint64_t r15;
183+
uint64_t rip;
184+
};
164185
#endif
165186

166187
typedef void crash_vmclear_fn(void);

‎arch/x86/kernel/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,5 @@ ifeq ($(CONFIG_X86_64),y)
118118

119119
obj-$(CONFIG_PCI_MMCONFIG) += mmconf-fam10h_64.o
120120
obj-y += vsmp_64.o
121+
obj-$(CONFIG_KEXEC) += kexec-bzimage64.o
121122
endif

0 commit comments

Comments
 (0)