Skip to content

Commit

Permalink
lguest: Fix guest crash when CONFIG_X86_USE_3DNOW=y
Browse files Browse the repository at this point in the history
One of the very first things lguest_init() does is a memcpy.  On
Athlon/Duron/K7 or CyrixIII/VIA-C3 or Geode GX/LX, this tries to use
MMX.

memcpy -> _mmx_memcpy -> kernel_fpu_begin -> clts -> paravirt_ops.clts

But we haven't set paravirt_ops.clts yet, so we do the native version
and crash.  The simplest solution is to use __memcpy.

Thanks to Michael Rasenberger for the bug report.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Rusty Russell authored and Linus Torvalds committed Sep 12, 2007
1 parent 9863b78 commit c413fec
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/lguest/lguest.c
Original file line number Diff line number Diff line change
Expand Up @@ -964,11 +964,12 @@ __init void lguest_init(void *boot)
{
/* Copy boot parameters first: the Launcher put the physical location
* in %esi, and head.S converted that to a virtual address and handed
* it to us. */
memcpy(&boot_params, boot, PARAM_SIZE);
* it to us. We use "__memcpy" because "memcpy" sometimes tries to do
* tricky things to go faster, and we're not ready for that. */
__memcpy(&boot_params, boot, PARAM_SIZE);
/* The boot parameters also tell us where the command-line is: save
* that, too. */
memcpy(boot_command_line, __va(boot_params.hdr.cmd_line_ptr),
__memcpy(boot_command_line, __va(boot_params.hdr.cmd_line_ptr),
COMMAND_LINE_SIZE);

/* We're under lguest, paravirt is enabled, and we're running at
Expand Down

0 comments on commit c413fec

Please sign in to comment.