aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2008-05-26 18:31:01 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-27 04:11:35 -0400
commit7b1333aa4cb546ddeb9c05098a53d9a777623a05 (patch)
tree2ab9949f9f64da6ea9510985c45fa0f047545ec9
parent0922abdc3982ae54cbe1b24ac5aa91a260eca1bb (diff)
xen: use hypercall rather than clts
Xen will trap and emulate clts, but its better to use a hypercall. Also, xenner doesn't handle clts. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/x86/xen/enlighten.c28
-rw-r--r--include/asm-x86/xen/hypercall.h7
2 files changed, 33 insertions, 2 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index a05b7721bc81..446f4cd649e6 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -607,6 +607,30 @@ static void xen_flush_tlb_others(const cpumask_t *cpus, struct mm_struct *mm,
607 xen_mc_issue(PARAVIRT_LAZY_MMU); 607 xen_mc_issue(PARAVIRT_LAZY_MMU);
608} 608}
609 609
610static void xen_clts(void)
611{
612 struct multicall_space mcs;
613
614 mcs = xen_mc_entry(0);
615
616 MULTI_fpu_taskswitch(mcs.mc, 0);
617
618 xen_mc_issue(PARAVIRT_LAZY_CPU);
619}
620
621static void xen_write_cr0(unsigned long cr0)
622{
623 struct multicall_space mcs;
624
625 /* Only pay attention to cr0.TS; everything else is
626 ignored. */
627 mcs = xen_mc_entry(0);
628
629 MULTI_fpu_taskswitch(mcs.mc, (cr0 & X86_CR0_TS) != 0);
630
631 xen_mc_issue(PARAVIRT_LAZY_CPU);
632}
633
610static void xen_write_cr2(unsigned long cr2) 634static void xen_write_cr2(unsigned long cr2)
611{ 635{
612 x86_read_percpu(xen_vcpu)->arch.cr2 = cr2; 636 x86_read_percpu(xen_vcpu)->arch.cr2 = cr2;
@@ -978,10 +1002,10 @@ static const struct pv_cpu_ops xen_cpu_ops __initdata = {
978 .set_debugreg = xen_set_debugreg, 1002 .set_debugreg = xen_set_debugreg,
979 .get_debugreg = xen_get_debugreg, 1003 .get_debugreg = xen_get_debugreg,
980 1004
981 .clts = native_clts, 1005 .clts = xen_clts,
982 1006
983 .read_cr0 = native_read_cr0, 1007 .read_cr0 = native_read_cr0,
984 .write_cr0 = native_write_cr0, 1008 .write_cr0 = xen_write_cr0,
985 1009
986 .read_cr4 = native_read_cr4, 1010 .read_cr4 = native_read_cr4,
987 .read_cr4_safe = native_read_cr4_safe, 1011 .read_cr4_safe = native_read_cr4_safe,
diff --git a/include/asm-x86/xen/hypercall.h b/include/asm-x86/xen/hypercall.h
index c2ccd997ed35..897ff79cca3b 100644
--- a/include/asm-x86/xen/hypercall.h
+++ b/include/asm-x86/xen/hypercall.h
@@ -315,6 +315,13 @@ HYPERVISOR_nmi_op(unsigned long op, unsigned long arg)
315} 315}
316 316
317static inline void 317static inline void
318MULTI_fpu_taskswitch(struct multicall_entry *mcl, int set)
319{
320 mcl->op = __HYPERVISOR_fpu_taskswitch;
321 mcl->args[0] = set;
322}
323
324static inline void
318MULTI_update_va_mapping(struct multicall_entry *mcl, unsigned long va, 325MULTI_update_va_mapping(struct multicall_entry *mcl, unsigned long va,
319 pte_t new_val, unsigned long flags) 326 pte_t new_val, unsigned long flags)
320{ 327{