aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen/enlighten.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/xen/enlighten.c')
-rw-r--r--arch/x86/xen/enlighten.c40
1 files changed, 12 insertions, 28 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 3d3bf05dec7f..7171a0736071 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -52,8 +52,6 @@
52 52
53EXPORT_SYMBOL_GPL(hypercall_page); 53EXPORT_SYMBOL_GPL(hypercall_page);
54 54
55DEFINE_PER_CPU(enum paravirt_lazy_mode, xen_lazy_mode);
56
57DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu); 55DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu);
58DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info); 56DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info);
59DEFINE_PER_CPU(unsigned long, xen_cr3); 57DEFINE_PER_CPU(unsigned long, xen_cr3);
@@ -249,29 +247,10 @@ static void xen_halt(void)
249 xen_safe_halt(); 247 xen_safe_halt();
250} 248}
251 249
252static void xen_set_lazy_mode(enum paravirt_lazy_mode mode) 250static void xen_leave_lazy(void)
253{ 251{
254 BUG_ON(preemptible()); 252 paravirt_leave_lazy(paravirt_get_lazy_mode());
255
256 switch (mode) {
257 case PARAVIRT_LAZY_NONE:
258 BUG_ON(x86_read_percpu(xen_lazy_mode) == PARAVIRT_LAZY_NONE);
259 break;
260
261 case PARAVIRT_LAZY_MMU:
262 case PARAVIRT_LAZY_CPU:
263 BUG_ON(x86_read_percpu(xen_lazy_mode) != PARAVIRT_LAZY_NONE);
264 break;
265
266 case PARAVIRT_LAZY_FLUSH:
267 /* flush if necessary, but don't change state */
268 if (x86_read_percpu(xen_lazy_mode) != PARAVIRT_LAZY_NONE)
269 xen_mc_flush();
270 return;
271 }
272
273 xen_mc_flush(); 253 xen_mc_flush();
274 x86_write_percpu(xen_lazy_mode, mode);
275} 254}
276 255
277static unsigned long xen_store_tr(void) 256static unsigned long xen_store_tr(void)
@@ -358,7 +337,7 @@ static void xen_load_tls(struct thread_struct *t, unsigned int cpu)
358 * loaded properly. This will go away as soon as Xen has been 337 * loaded properly. This will go away as soon as Xen has been
359 * modified to not save/restore %gs for normal hypercalls. 338 * modified to not save/restore %gs for normal hypercalls.
360 */ 339 */
361 if (xen_get_lazy_mode() == PARAVIRT_LAZY_CPU) 340 if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_CPU)
362 loadsegment(gs, 0); 341 loadsegment(gs, 0);
363} 342}
364 343
@@ -962,6 +941,11 @@ static const struct pv_cpu_ops xen_cpu_ops __initdata = {
962 941
963 .set_iopl_mask = xen_set_iopl_mask, 942 .set_iopl_mask = xen_set_iopl_mask,
964 .io_delay = xen_io_delay, 943 .io_delay = xen_io_delay,
944
945 .lazy_mode = {
946 .enter = paravirt_enter_lazy_cpu,
947 .leave = xen_leave_lazy,
948 },
965}; 949};
966 950
967static const struct pv_irq_ops xen_irq_ops __initdata = { 951static const struct pv_irq_ops xen_irq_ops __initdata = {
@@ -1037,10 +1021,11 @@ static const struct pv_mmu_ops xen_mmu_ops __initdata = {
1037 .activate_mm = xen_activate_mm, 1021 .activate_mm = xen_activate_mm,
1038 .dup_mmap = xen_dup_mmap, 1022 .dup_mmap = xen_dup_mmap,
1039 .exit_mmap = xen_exit_mmap, 1023 .exit_mmap = xen_exit_mmap,
1040};
1041 1024
1042static const struct pv_misc_ops xen_misc_ops __initdata = { 1025 .lazy_mode = {
1043 .set_lazy_mode = xen_set_lazy_mode, 1026 .enter = paravirt_enter_lazy_mmu,
1027 .leave = xen_leave_lazy,
1028 },
1044}; 1029};
1045 1030
1046#ifdef CONFIG_SMP 1031#ifdef CONFIG_SMP
@@ -1114,7 +1099,6 @@ asmlinkage void __init xen_start_kernel(void)
1114 pv_irq_ops = xen_irq_ops; 1099 pv_irq_ops = xen_irq_ops;
1115 pv_apic_ops = xen_apic_ops; 1100 pv_apic_ops = xen_apic_ops;
1116 pv_mmu_ops = xen_mmu_ops; 1101 pv_mmu_ops = xen_mmu_ops;
1117 pv_misc_ops = xen_misc_ops;
1118 1102
1119 machine_ops = xen_machine_ops; 1103 machine_ops = xen_machine_ops;
1120 1104