Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 108470
b: refs/heads/master
c: fb45daa
h: refs/heads/master
v: v3
  • Loading branch information
Huang Ying authored and Linus Torvalds committed Aug 15, 2008
1 parent 57a181a commit faeb5aa
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 163f6876f5c3ff8215e900b93779e960a56b3694
refs/heads/master: fb45daa69d287b394eca1619b3fadff7c0215c71
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/machine_kexec_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void machine_kexec(struct kimage *image)
}

control_page = page_address(image->control_code_page);
memcpy(control_page, relocate_kernel, PAGE_SIZE/2);
memcpy(control_page, relocate_kernel, KEXEC_CONTROL_CODE_MAX_SIZE);

relocate_kernel_ptr = control_page;
page_list[PA_CONTROL_PAGE] = __pa(control_page);
Expand Down
10 changes: 7 additions & 3 deletions trunk/arch/x86/kernel/relocate_kernel_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
#define PAGE_ATTR (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY)
#define PAE_PGD_ATTR (_PAGE_PRESENT)

/* control_page + PAGE_SIZE/2 ~ control_page + PAGE_SIZE * 3/4 are
* used to save some data for jumping back
/* control_page + KEXEC_CONTROL_CODE_MAX_SIZE
* ~ control_page + PAGE_SIZE are used as data storage and stack for
* jumping back
*/
#define DATA(offset) (PAGE_SIZE/2+(offset))
#define DATA(offset) (KEXEC_CONTROL_CODE_MAX_SIZE+(offset))

/* Minimal CPU state */
#define ESP DATA(0x0)
Expand Down Expand Up @@ -376,3 +377,6 @@ swap_pages:
popl %ebx
popl %ebp
ret

.globl kexec_control_code_size
.set kexec_control_code_size, . - relocate_kernel
8 changes: 8 additions & 0 deletions trunk/arch/x86/kernel/vmlinux_32.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,11 @@ SECTIONS

DWARF_DEBUG
}

#ifdef CONFIG_KEXEC
/* Link time checks */
#include <asm/kexec.h>

ASSERT(kexec_control_code_size <= KEXEC_CONTROL_CODE_MAX_SIZE,
"kexec control code size is too big")
#endif
4 changes: 4 additions & 0 deletions trunk/include/asm-x86/kexec.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
# define PAGES_NR 17
#endif

#ifdef CONFIG_X86_32
# define KEXEC_CONTROL_CODE_MAX_SIZE 2048
#endif

#ifndef __ASSEMBLY__

#include <linux/string.h>
Expand Down

0 comments on commit faeb5aa

Please sign in to comment.