aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/lguest/x86/core.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-04-14 18:44:29 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2010-04-14 18:44:29 -0700
commit7223b915421716b4e57ffb7e13f41f1b926db55c (patch)
tree2c5fb902eb2986c84ee8f0f1988cc3d63b9d0107 /drivers/lguest/x86/core.c
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k (diff)
parentlguest: stop using KVM hypercall mechanism (diff)
downloadlinux-dev-7223b915421716b4e57ffb7e13f41f1b926db55c.tar.xz
linux-dev-7223b915421716b4e57ffb7e13f41f1b926db55c.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus: lguest: stop using KVM hypercall mechanism lguest: workaround cmpxchg8b_emu by ignoring cli in the guest.
Diffstat (limited to 'drivers/lguest/x86/core.c')
-rw-r--r--drivers/lguest/x86/core.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/lguest/x86/core.c b/drivers/lguest/x86/core.c
index fb2b7ef7868e..b4eb675a807e 100644
--- a/drivers/lguest/x86/core.c
+++ b/drivers/lguest/x86/core.c
@@ -288,6 +288,18 @@ static int emulate_insn(struct lg_cpu *cpu)
insn = lgread(cpu, physaddr, u8);
/*
+ * Around 2.6.33, the kernel started using an emulation for the
+ * cmpxchg8b instruction in early boot on many configurations. This
+ * code isn't paravirtualized, and it tries to disable interrupts.
+ * Ignore it, which will Mostly Work.
+ */
+ if (insn == 0xfa) {
+ /* "cli", or Clear Interrupt Enable instruction. Skip it. */
+ cpu->regs->eip++;
+ return 1;
+ }
+
+ /*
* 0x66 is an "operand prefix". It means it's using the upper 16 bits
* of the eax register.
*/