Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323999
b: refs/heads/master
c: 9c6ff8b
h: refs/heads/master
i:
  323997: 8e07788
  323995: 1aab341
  323991: a1a6278
  323983: ebde109
  323967: 7438258
v: v3
  • Loading branch information
Suresh Siddha authored and H. Peter Anvin committed Sep 18, 2012
1 parent 3eebb15 commit 897b1d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 841e3604d35aa70d399146abdc526d8c89a2c2f5
refs/heads/master: 9c6ff8bbb69a4e7b47ac40bfa44509296e89c5c0
10 changes: 7 additions & 3 deletions trunk/drivers/lguest/x86/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ void lguest_arch_run_guest(struct lg_cpu *cpu)
* we set it now, so we can trap and pass that trap to the Guest if it
* uses the FPU.
*/
if (cpu->ts)
unlazy_fpu(current);
if (cpu->ts && user_has_fpu())
stts();

/*
* SYSENTER is an optimized way of doing system calls. We can't allow
Expand Down Expand Up @@ -234,6 +234,10 @@ void lguest_arch_run_guest(struct lg_cpu *cpu)
if (boot_cpu_has(X86_FEATURE_SEP))
wrmsr(MSR_IA32_SYSENTER_CS, __KERNEL_CS, 0);

/* Clear the host TS bit if it was set above. */
if (cpu->ts && user_has_fpu())
clts();

/*
* If the Guest page faulted, then the cr2 register will tell us the
* bad virtual address. We have to grab this now, because once we
Expand All @@ -249,7 +253,7 @@ void lguest_arch_run_guest(struct lg_cpu *cpu)
* a different CPU. So all the critical stuff should be done
* before this.
*/
else if (cpu->regs->trapnum == 7)
else if (cpu->regs->trapnum == 7 && !user_has_fpu())
math_state_restore();
}

Expand Down

0 comments on commit 897b1d1

Please sign in to comment.