diff options
author | Magnus Damm <magnus@valinux.co.jp> | 2006-09-26 04:52:38 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2006-09-26 04:52:38 -0400 |
commit | 3566561bfadffcb5dbc85d576be80c0dbf2cccc9 (patch) | |
tree | eaafaf68156f9f2f1a2af8a7ffed95653fea8aa5 /include/asm-i386/kexec.h | |
parent | 4bfaaef01a1badb9e8ffb0c0a37cd2379008d21f (diff) |
[PATCH] i386: Avoid overwriting the current pgd (V4, i386)
kexec: Avoid overwriting the current pgd (V4, i386)
This patch upgrades the i386-specific kexec code to avoid overwriting the
current pgd. Overwriting the current pgd is bad when CONFIG_CRASH_DUMP is used
to start a secondary kernel that dumps the memory of the previous kernel.
The code introduces a new set of page tables. These tables are used to provide
an executable identity mapping without overwriting the current pgd.
Signed-off-by: Magnus Damm <magnus@valinux.co.jp>
Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'include/asm-i386/kexec.h')
-rw-r--r-- | include/asm-i386/kexec.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/asm-i386/kexec.h b/include/asm-i386/kexec.h index 53f0e06672dc..4dfc9f5ed031 100644 --- a/include/asm-i386/kexec.h +++ b/include/asm-i386/kexec.h | |||
@@ -1,6 +1,26 @@ | |||
1 | #ifndef _I386_KEXEC_H | 1 | #ifndef _I386_KEXEC_H |
2 | #define _I386_KEXEC_H | 2 | #define _I386_KEXEC_H |
3 | 3 | ||
4 | #define PA_CONTROL_PAGE 0 | ||
5 | #define VA_CONTROL_PAGE 1 | ||
6 | #define PA_PGD 2 | ||
7 | #define VA_PGD 3 | ||
8 | #define PA_PTE_0 4 | ||
9 | #define VA_PTE_0 5 | ||
10 | #define PA_PTE_1 6 | ||
11 | #define VA_PTE_1 7 | ||
12 | #ifdef CONFIG_X86_PAE | ||
13 | #define PA_PMD_0 8 | ||
14 | #define VA_PMD_0 9 | ||
15 | #define PA_PMD_1 10 | ||
16 | #define VA_PMD_1 11 | ||
17 | #define PAGES_NR 12 | ||
18 | #else | ||
19 | #define PAGES_NR 8 | ||
20 | #endif | ||
21 | |||
22 | #ifndef __ASSEMBLY__ | ||
23 | |||
4 | #include <asm/fixmap.h> | 24 | #include <asm/fixmap.h> |
5 | #include <asm/ptrace.h> | 25 | #include <asm/ptrace.h> |
6 | #include <asm/string.h> | 26 | #include <asm/string.h> |
@@ -72,5 +92,12 @@ static inline void crash_setup_regs(struct pt_regs *newregs, | |||
72 | newregs->eip = (unsigned long)current_text_addr(); | 92 | newregs->eip = (unsigned long)current_text_addr(); |
73 | } | 93 | } |
74 | } | 94 | } |
95 | asmlinkage NORET_TYPE void | ||
96 | relocate_kernel(unsigned long indirection_page, | ||
97 | unsigned long control_page, | ||
98 | unsigned long start_address, | ||
99 | unsigned int has_pae) ATTRIB_NORET; | ||
100 | |||
101 | #endif /* __ASSEMBLY__ */ | ||
75 | 102 | ||
76 | #endif /* _I386_KEXEC_H */ | 103 | #endif /* _I386_KEXEC_H */ |