[PATCH] fix kexec asm

While testing kexec and kdump we hit problems where the new kernel would
freeze or instantly reboot. The easiest way to trigger it was to kexec a
kernel compiled for CONFIG_M586 on an athlon cpu. Compiling for CONFIG_MK7
instead would work fine.

The patch fixes a few problems with the kexec inline asm.

Signed-off-by: Chris Mason <mason@suse.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Michael Matz and committed by Linus Torvalds 2ec5e3a8 62287fbb

+10 -9
+7 -7
arch/i386/kernel/machine_kexec.c
··· 116 116 __asm__ __volatile__ ( 117 117 "\tljmp $"STR(__KERNEL_CS)",$1f\n" 118 118 "\t1:\n" 119 - "\tmovl $"STR(__KERNEL_DS)",%eax\n" 120 - "\tmovl %eax,%ds\n" 121 - "\tmovl %eax,%es\n" 122 - "\tmovl %eax,%fs\n" 123 - "\tmovl %eax,%gs\n" 124 - "\tmovl %eax,%ss\n" 125 - ); 119 + "\tmovl $"STR(__KERNEL_DS)",%%eax\n" 120 + "\tmovl %%eax,%%ds\n" 121 + "\tmovl %%eax,%%es\n" 122 + "\tmovl %%eax,%%fs\n" 123 + "\tmovl %%eax,%%gs\n" 124 + "\tmovl %%eax,%%ss\n" 125 + ::: "eax", "memory"); 126 126 #undef STR 127 127 #undef __STR 128 128 }
+1 -1
arch/x86_64/kernel/machine_kexec.c
··· 140 140 "\tmovl %0,%%ss\n" 141 141 "\tmovl %0,%%fs\n" 142 142 "\tmovl %0,%%gs\n" 143 - : : "a" (__KERNEL_DS) 143 + : : "a" (__KERNEL_DS) : "memory" 144 144 ); 145 145 } 146 146
+2 -1
include/asm-powerpc/kexec.h
··· 93 93 "mfxer %0\n" 94 94 "std %0, 296(%2)\n" 95 95 : "=&r" (tmp1), "=&r" (tmp2) 96 - : "b" (newregs)); 96 + : "b" (newregs) 97 + : "memory"); 97 98 } 98 99 } 99 100 #else