|
@@ -658,10 +658,26 @@ static void xen_clts(void)
|
|
xen_mc_issue(PARAVIRT_LAZY_CPU);
|
|
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)
|
|
static void xen_write_cr0(unsigned long cr0)
|
|
{
|
|
{
|
|
struct multicall_space mcs;
|
|
struct multicall_space mcs;
|
|
|
|
|
|
|
|
+ percpu_write(xen_cr0_value, cr0);
|
|
|
|
+
|
|
/* Only pay attention to cr0.TS; everything else is
|
|
/* Only pay attention to cr0.TS; everything else is
|
|
ignored. */
|
|
ignored. */
|
|
mcs = xen_mc_entry(0);
|
|
mcs = xen_mc_entry(0);
|
|
@@ -847,7 +863,7 @@ static const struct pv_cpu_ops xen_cpu_ops __initdata = {
|
|
|
|
|
|
.clts = xen_clts,
|
|
.clts = xen_clts,
|
|
|
|
|
|
- .read_cr0 = native_read_cr0,
|
|
|
|
|
|
+ .read_cr0 = xen_read_cr0,
|
|
.write_cr0 = xen_write_cr0,
|
|
.write_cr0 = xen_write_cr0,
|
|
|
|
|
|
.read_cr4 = native_read_cr4,
|
|
.read_cr4 = native_read_cr4,
|