Commit 2ec5e3a8 authored by Michael Matz's avatar Michael Matz Committed by Linus Torvalds

[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: default avatarChris Mason <mason@suse.com>
Acked-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 62287fbb
...@@ -116,13 +116,13 @@ static void load_segments(void) ...@@ -116,13 +116,13 @@ static void load_segments(void)
__asm__ __volatile__ ( __asm__ __volatile__ (
"\tljmp $"STR(__KERNEL_CS)",$1f\n" "\tljmp $"STR(__KERNEL_CS)",$1f\n"
"\t1:\n" "\t1:\n"
"\tmovl $"STR(__KERNEL_DS)",%eax\n" "\tmovl $"STR(__KERNEL_DS)",%%eax\n"
"\tmovl %eax,%ds\n" "\tmovl %%eax,%%ds\n"
"\tmovl %eax,%es\n" "\tmovl %%eax,%%es\n"
"\tmovl %eax,%fs\n" "\tmovl %%eax,%%fs\n"
"\tmovl %eax,%gs\n" "\tmovl %%eax,%%gs\n"
"\tmovl %eax,%ss\n" "\tmovl %%eax,%%ss\n"
); ::: "eax", "memory");
#undef STR #undef STR
#undef __STR #undef __STR
} }
......
...@@ -140,7 +140,7 @@ static void load_segments(void) ...@@ -140,7 +140,7 @@ static void load_segments(void)
"\tmovl %0,%%ss\n" "\tmovl %0,%%ss\n"
"\tmovl %0,%%fs\n" "\tmovl %0,%%fs\n"
"\tmovl %0,%%gs\n" "\tmovl %0,%%gs\n"
: : "a" (__KERNEL_DS) : : "a" (__KERNEL_DS) : "memory"
); );
} }
......
...@@ -93,7 +93,8 @@ static inline void crash_setup_regs(struct pt_regs *newregs, ...@@ -93,7 +93,8 @@ static inline void crash_setup_regs(struct pt_regs *newregs,
"mfxer %0\n" "mfxer %0\n"
"std %0, 296(%2)\n" "std %0, 296(%2)\n"
: "=&r" (tmp1), "=&r" (tmp2) : "=&r" (tmp1), "=&r" (tmp2)
: "b" (newregs)); : "b" (newregs)
: "memory");
} }
} }
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment