Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145854
b: refs/heads/master
c: a789ed5
h: refs/heads/master
v: v3
  • Loading branch information
Jeremy Fitzhardinge committed May 8, 2009
1 parent 882f55b commit cb7cfe1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 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: b80119bb35a49a4e8dbfb9708872adfd5cf38dee
refs/heads/master: a789ed5fb6d0256c4177c2cc27e06520ddbe4d4c
18 changes: 17 additions & 1 deletion trunk/arch/x86/xen/enlighten.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,10 +658,26 @@ static void xen_clts(void)
xen_mc_issue(PARAVIRT_LAZY_CPU);
}

static DEFINE_PER_CPU(unsigned long, xen_cr0_value);

static unsigned long xen_read_cr0(void)
{
unsigned long cr0 = percpu_read(xen_cr0_value);

if (unlikely(cr0 == 0)) {
cr0 = native_read_cr0();
percpu_write(xen_cr0_value, cr0);
}

return cr0;
}

static void xen_write_cr0(unsigned long cr0)
{
struct multicall_space mcs;

percpu_write(xen_cr0_value, cr0);

/* Only pay attention to cr0.TS; everything else is
ignored. */
mcs = xen_mc_entry(0);
Expand Down Expand Up @@ -847,7 +863,7 @@ static const struct pv_cpu_ops xen_cpu_ops __initdata = {

.clts = xen_clts,

.read_cr0 = native_read_cr0,
.read_cr0 = xen_read_cr0,
.write_cr0 = xen_write_cr0,

.read_cr4 = native_read_cr4,
Expand Down

0 comments on commit cb7cfe1

Please sign in to comment.