aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/lguest/boot.c5
-rw-r--r--drivers/lguest/x86/core.c2
2 files changed, 3 insertions, 4 deletions
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
index d2235db4085..136d9df0295 100644
--- a/arch/x86/lguest/boot.c
+++ b/arch/x86/lguest/boot.c
@@ -371,8 +371,7 @@ static void lguest_cpuid(unsigned int *eax, unsigned int *ebx,
371static unsigned long current_cr0, current_cr3; 371static unsigned long current_cr0, current_cr3;
372static void lguest_write_cr0(unsigned long val) 372static void lguest_write_cr0(unsigned long val)
373{ 373{
374 /* 8 == TS bit. */ 374 lazy_hcall(LHCALL_TS, val & X86_CR0_TS, 0, 0);
375 lazy_hcall(LHCALL_TS, val & 8, 0, 0);
376 current_cr0 = val; 375 current_cr0 = val;
377} 376}
378 377
@@ -387,7 +386,7 @@ static unsigned long lguest_read_cr0(void)
387static void lguest_clts(void) 386static void lguest_clts(void)
388{ 387{
389 lazy_hcall(LHCALL_TS, 0, 0, 0); 388 lazy_hcall(LHCALL_TS, 0, 0, 0);
390 current_cr0 &= ~8U; 389 current_cr0 &= ~X86_CR0_TS;
391} 390}
392 391
393/* CR2 is the virtual address of the last page fault, which the Guest only ever 392/* CR2 is the virtual address of the last page fault, which the Guest only ever
diff --git a/drivers/lguest/x86/core.c b/drivers/lguest/x86/core.c
index 9eed12d5a39..09d9207420d 100644
--- a/drivers/lguest/x86/core.c
+++ b/drivers/lguest/x86/core.c
@@ -562,7 +562,7 @@ void lguest_arch_setup_regs(struct lguest *lg, unsigned long start)
562 * is supposed to always be "1". Bit 9 (0x200) controls whether 562 * is supposed to always be "1". Bit 9 (0x200) controls whether
563 * interrupts are enabled. We always leave interrupts enabled while 563 * interrupts are enabled. We always leave interrupts enabled while
564 * running the Guest. */ 564 * running the Guest. */
565 regs->eflags = 0x202; 565 regs->eflags = X86_EFLAGS_IF | 0x2;
566 566
567 /* The "Extended Instruction Pointer" register says where the Guest is 567 /* The "Extended Instruction Pointer" register says where the Guest is
568 * running. */ 568 * running. */