diff options
Diffstat (limited to 'include/asm-x86/kexec_32.h')
-rw-r--r-- | include/asm-x86/kexec_32.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/include/asm-x86/kexec_32.h b/include/asm-x86/kexec_32.h index 4b9dc9e6b701..ff39d2f88022 100644 --- a/include/asm-x86/kexec_32.h +++ b/include/asm-x86/kexec_32.h | |||
@@ -45,7 +45,7 @@ | |||
45 | /* We can also handle crash dumps from 64 bit kernel. */ | 45 | /* We can also handle crash dumps from 64 bit kernel. */ |
46 | #define vmcore_elf_check_arch_cross(x) ((x)->e_machine == EM_X86_64) | 46 | #define vmcore_elf_check_arch_cross(x) ((x)->e_machine == EM_X86_64) |
47 | 47 | ||
48 | /* CPU does not save ss and esp on stack if execution is already | 48 | /* CPU does not save ss and sp on stack if execution is already |
49 | * running in kernel mode at the time of NMI occurrence. This code | 49 | * running in kernel mode at the time of NMI occurrence. This code |
50 | * fixes it. | 50 | * fixes it. |
51 | */ | 51 | */ |
@@ -53,16 +53,16 @@ static inline void crash_fixup_ss_esp(struct pt_regs *newregs, | |||
53 | struct pt_regs *oldregs) | 53 | struct pt_regs *oldregs) |
54 | { | 54 | { |
55 | memcpy(newregs, oldregs, sizeof(*newregs)); | 55 | memcpy(newregs, oldregs, sizeof(*newregs)); |
56 | newregs->esp = (unsigned long)&(oldregs->esp); | 56 | newregs->sp = (unsigned long)&(oldregs->sp); |
57 | __asm__ __volatile__( | 57 | __asm__ __volatile__( |
58 | "xorl %%eax, %%eax\n\t" | 58 | "xorl %%eax, %%eax\n\t" |
59 | "movw %%ss, %%ax\n\t" | 59 | "movw %%ss, %%ax\n\t" |
60 | :"=a"(newregs->xss)); | 60 | :"=a"(newregs->ss)); |
61 | } | 61 | } |
62 | 62 | ||
63 | /* | 63 | /* |
64 | * This function is responsible for capturing register states if coming | 64 | * This function is responsible for capturing register states if coming |
65 | * via panic otherwise just fix up the ss and esp if coming via kernel | 65 | * via panic otherwise just fix up the ss and sp if coming via kernel |
66 | * mode exception. | 66 | * mode exception. |
67 | */ | 67 | */ |
68 | static inline void crash_setup_regs(struct pt_regs *newregs, | 68 | static inline void crash_setup_regs(struct pt_regs *newregs, |
@@ -71,21 +71,21 @@ static inline void crash_setup_regs(struct pt_regs *newregs, | |||
71 | if (oldregs) | 71 | if (oldregs) |
72 | crash_fixup_ss_esp(newregs, oldregs); | 72 | crash_fixup_ss_esp(newregs, oldregs); |
73 | else { | 73 | else { |
74 | __asm__ __volatile__("movl %%ebx,%0" : "=m"(newregs->ebx)); | 74 | __asm__ __volatile__("movl %%ebx,%0" : "=m"(newregs->bx)); |
75 | __asm__ __volatile__("movl %%ecx,%0" : "=m"(newregs->ecx)); | 75 | __asm__ __volatile__("movl %%ecx,%0" : "=m"(newregs->cx)); |
76 | __asm__ __volatile__("movl %%edx,%0" : "=m"(newregs->edx)); | 76 | __asm__ __volatile__("movl %%edx,%0" : "=m"(newregs->dx)); |
77 | __asm__ __volatile__("movl %%esi,%0" : "=m"(newregs->esi)); | 77 | __asm__ __volatile__("movl %%esi,%0" : "=m"(newregs->si)); |
78 | __asm__ __volatile__("movl %%edi,%0" : "=m"(newregs->edi)); | 78 | __asm__ __volatile__("movl %%edi,%0" : "=m"(newregs->di)); |
79 | __asm__ __volatile__("movl %%ebp,%0" : "=m"(newregs->ebp)); | 79 | __asm__ __volatile__("movl %%ebp,%0" : "=m"(newregs->bp)); |
80 | __asm__ __volatile__("movl %%eax,%0" : "=m"(newregs->eax)); | 80 | __asm__ __volatile__("movl %%eax,%0" : "=m"(newregs->ax)); |
81 | __asm__ __volatile__("movl %%esp,%0" : "=m"(newregs->esp)); | 81 | __asm__ __volatile__("movl %%esp,%0" : "=m"(newregs->sp)); |
82 | __asm__ __volatile__("movw %%ss, %%ax;" :"=a"(newregs->xss)); | 82 | __asm__ __volatile__("movl %%ss, %%eax;" :"=a"(newregs->ss)); |
83 | __asm__ __volatile__("movw %%cs, %%ax;" :"=a"(newregs->xcs)); | 83 | __asm__ __volatile__("movl %%cs, %%eax;" :"=a"(newregs->cs)); |
84 | __asm__ __volatile__("movw %%ds, %%ax;" :"=a"(newregs->xds)); | 84 | __asm__ __volatile__("movl %%ds, %%eax;" :"=a"(newregs->ds)); |
85 | __asm__ __volatile__("movw %%es, %%ax;" :"=a"(newregs->xes)); | 85 | __asm__ __volatile__("movl %%es, %%eax;" :"=a"(newregs->es)); |
86 | __asm__ __volatile__("pushfl; popl %0" :"=m"(newregs->eflags)); | 86 | __asm__ __volatile__("pushfl; popl %0" :"=m"(newregs->flags)); |
87 | 87 | ||
88 | newregs->eip = (unsigned long)current_text_addr(); | 88 | newregs->ip = (unsigned long)current_text_addr(); |
89 | } | 89 | } |
90 | } | 90 | } |
91 | asmlinkage NORET_TYPE void | 91 | asmlinkage NORET_TYPE void |