diff options
Diffstat (limited to 'arch/x86/xen')
-rw-r--r-- | arch/x86/xen/enlighten.c | 42 | ||||
-rw-r--r-- | arch/x86/xen/mmu.c | 2 | ||||
-rw-r--r-- | arch/x86/xen/smp.c | 3 | ||||
-rw-r--r-- | arch/x86/xen/suspend.c | 17 | ||||
-rw-r--r-- | arch/x86/xen/time.c | 7 | ||||
-rw-r--r-- | arch/x86/xen/xen-asm_64.S | 4 | ||||
-rw-r--r-- | arch/x86/xen/xen-ops.h | 2 |
7 files changed, 51 insertions, 26 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index e2511bccbc8d..2b26dd5930c6 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -140,24 +140,23 @@ static void xen_vcpu_setup(int cpu) | |||
140 | */ | 140 | */ |
141 | void xen_vcpu_restore(void) | 141 | void xen_vcpu_restore(void) |
142 | { | 142 | { |
143 | if (have_vcpu_info_placement) { | 143 | int cpu; |
144 | int cpu; | ||
145 | 144 | ||
146 | for_each_online_cpu(cpu) { | 145 | for_each_online_cpu(cpu) { |
147 | bool other_cpu = (cpu != smp_processor_id()); | 146 | bool other_cpu = (cpu != smp_processor_id()); |
148 | 147 | ||
149 | if (other_cpu && | 148 | if (other_cpu && |
150 | HYPERVISOR_vcpu_op(VCPUOP_down, cpu, NULL)) | 149 | HYPERVISOR_vcpu_op(VCPUOP_down, cpu, NULL)) |
151 | BUG(); | 150 | BUG(); |
152 | 151 | ||
153 | xen_vcpu_setup(cpu); | 152 | xen_setup_runstate_info(cpu); |
154 | 153 | ||
155 | if (other_cpu && | 154 | if (have_vcpu_info_placement) |
156 | HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL)) | 155 | xen_vcpu_setup(cpu); |
157 | BUG(); | ||
158 | } | ||
159 | 156 | ||
160 | BUG_ON(!have_vcpu_info_placement); | 157 | if (other_cpu && |
158 | HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL)) | ||
159 | BUG(); | ||
161 | } | 160 | } |
162 | } | 161 | } |
163 | 162 | ||
@@ -180,6 +179,7 @@ static __read_mostly unsigned int cpuid_leaf1_ecx_mask = ~0; | |||
180 | static void xen_cpuid(unsigned int *ax, unsigned int *bx, | 179 | static void xen_cpuid(unsigned int *ax, unsigned int *bx, |
181 | unsigned int *cx, unsigned int *dx) | 180 | unsigned int *cx, unsigned int *dx) |
182 | { | 181 | { |
182 | unsigned maskebx = ~0; | ||
183 | unsigned maskecx = ~0; | 183 | unsigned maskecx = ~0; |
184 | unsigned maskedx = ~0; | 184 | unsigned maskedx = ~0; |
185 | 185 | ||
@@ -187,9 +187,16 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx, | |||
187 | * Mask out inconvenient features, to try and disable as many | 187 | * Mask out inconvenient features, to try and disable as many |
188 | * unsupported kernel subsystems as possible. | 188 | * unsupported kernel subsystems as possible. |
189 | */ | 189 | */ |
190 | if (*ax == 1) { | 190 | switch (*ax) { |
191 | case 1: | ||
191 | maskecx = cpuid_leaf1_ecx_mask; | 192 | maskecx = cpuid_leaf1_ecx_mask; |
192 | maskedx = cpuid_leaf1_edx_mask; | 193 | maskedx = cpuid_leaf1_edx_mask; |
194 | break; | ||
195 | |||
196 | case 0xb: | ||
197 | /* Suppress extended topology stuff */ | ||
198 | maskebx = 0; | ||
199 | break; | ||
193 | } | 200 | } |
194 | 201 | ||
195 | asm(XEN_EMULATE_PREFIX "cpuid" | 202 | asm(XEN_EMULATE_PREFIX "cpuid" |
@@ -199,6 +206,7 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx, | |||
199 | "=d" (*dx) | 206 | "=d" (*dx) |
200 | : "0" (*ax), "2" (*cx)); | 207 | : "0" (*ax), "2" (*cx)); |
201 | 208 | ||
209 | *bx &= maskebx; | ||
202 | *cx &= maskecx; | 210 | *cx &= maskecx; |
203 | *dx &= maskedx; | 211 | *dx &= maskedx; |
204 | } | 212 | } |
@@ -1086,10 +1094,8 @@ asmlinkage void __init xen_start_kernel(void) | |||
1086 | 1094 | ||
1087 | __supported_pte_mask |= _PAGE_IOMAP; | 1095 | __supported_pte_mask |= _PAGE_IOMAP; |
1088 | 1096 | ||
1089 | #ifdef CONFIG_X86_64 | ||
1090 | /* Work out if we support NX */ | 1097 | /* Work out if we support NX */ |
1091 | check_efer(); | 1098 | x86_configure_nx(); |
1092 | #endif | ||
1093 | 1099 | ||
1094 | xen_setup_features(); | 1100 | xen_setup_features(); |
1095 | 1101 | ||
@@ -1179,6 +1185,8 @@ asmlinkage void __init xen_start_kernel(void) | |||
1179 | 1185 | ||
1180 | xen_raw_console_write("about to get started...\n"); | 1186 | xen_raw_console_write("about to get started...\n"); |
1181 | 1187 | ||
1188 | xen_setup_runstate_info(0); | ||
1189 | |||
1182 | /* Start the world */ | 1190 | /* Start the world */ |
1183 | #ifdef CONFIG_X86_32 | 1191 | #ifdef CONFIG_X86_32 |
1184 | i386_start_kernel(); | 1192 | i386_start_kernel(); |
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 3bf7b1d250ce..bf4cd6bfe959 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -185,7 +185,7 @@ static inline unsigned p2m_index(unsigned long pfn) | |||
185 | } | 185 | } |
186 | 186 | ||
187 | /* Build the parallel p2m_top_mfn structures */ | 187 | /* Build the parallel p2m_top_mfn structures */ |
188 | static void __init xen_build_mfn_list_list(void) | 188 | void xen_build_mfn_list_list(void) |
189 | { | 189 | { |
190 | unsigned pfn, idx; | 190 | unsigned pfn, idx; |
191 | 191 | ||
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c index fe03eeed7b48..64757c0ba5fc 100644 --- a/arch/x86/xen/smp.c +++ b/arch/x86/xen/smp.c | |||
@@ -73,7 +73,7 @@ static __cpuinit void cpu_bringup(void) | |||
73 | 73 | ||
74 | xen_setup_cpu_clockevents(); | 74 | xen_setup_cpu_clockevents(); |
75 | 75 | ||
76 | cpu_set(cpu, cpu_online_map); | 76 | set_cpu_online(cpu, true); |
77 | percpu_write(cpu_state, CPU_ONLINE); | 77 | percpu_write(cpu_state, CPU_ONLINE); |
78 | wmb(); | 78 | wmb(); |
79 | 79 | ||
@@ -295,6 +295,7 @@ static int __cpuinit xen_cpu_up(unsigned int cpu) | |||
295 | (unsigned long)task_stack_page(idle) - | 295 | (unsigned long)task_stack_page(idle) - |
296 | KERNEL_STACK_OFFSET + THREAD_SIZE; | 296 | KERNEL_STACK_OFFSET + THREAD_SIZE; |
297 | #endif | 297 | #endif |
298 | xen_setup_runstate_info(cpu); | ||
298 | xen_setup_timer(cpu); | 299 | xen_setup_timer(cpu); |
299 | xen_init_lock_cpu(cpu); | 300 | xen_init_lock_cpu(cpu); |
300 | 301 | ||
diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c index 95be7b434724..987267f79bf5 100644 --- a/arch/x86/xen/suspend.c +++ b/arch/x86/xen/suspend.c | |||
@@ -1,4 +1,5 @@ | |||
1 | #include <linux/types.h> | 1 | #include <linux/types.h> |
2 | #include <linux/clockchips.h> | ||
2 | 3 | ||
3 | #include <xen/interface/xen.h> | 4 | #include <xen/interface/xen.h> |
4 | #include <xen/grant_table.h> | 5 | #include <xen/grant_table.h> |
@@ -27,6 +28,8 @@ void xen_pre_suspend(void) | |||
27 | 28 | ||
28 | void xen_post_suspend(int suspend_cancelled) | 29 | void xen_post_suspend(int suspend_cancelled) |
29 | { | 30 | { |
31 | xen_build_mfn_list_list(); | ||
32 | |||
30 | xen_setup_shared_info(); | 33 | xen_setup_shared_info(); |
31 | 34 | ||
32 | if (suspend_cancelled) { | 35 | if (suspend_cancelled) { |
@@ -44,7 +47,19 @@ void xen_post_suspend(int suspend_cancelled) | |||
44 | 47 | ||
45 | } | 48 | } |
46 | 49 | ||
50 | static void xen_vcpu_notify_restore(void *data) | ||
51 | { | ||
52 | unsigned long reason = (unsigned long)data; | ||
53 | |||
54 | /* Boot processor notified via generic timekeeping_resume() */ | ||
55 | if ( smp_processor_id() == 0) | ||
56 | return; | ||
57 | |||
58 | clockevents_notify(reason, NULL); | ||
59 | } | ||
60 | |||
47 | void xen_arch_resume(void) | 61 | void xen_arch_resume(void) |
48 | { | 62 | { |
49 | /* nothing */ | 63 | smp_call_function(xen_vcpu_notify_restore, |
64 | (void *)CLOCK_EVT_NOTIFY_RESUME, 1); | ||
50 | } | 65 | } |
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c index 0a5aa44299a5..9d1f853120d8 100644 --- a/arch/x86/xen/time.c +++ b/arch/x86/xen/time.c | |||
@@ -100,7 +100,7 @@ bool xen_vcpu_stolen(int vcpu) | |||
100 | return per_cpu(runstate, vcpu).state == RUNSTATE_runnable; | 100 | return per_cpu(runstate, vcpu).state == RUNSTATE_runnable; |
101 | } | 101 | } |
102 | 102 | ||
103 | static void setup_runstate_info(int cpu) | 103 | void xen_setup_runstate_info(int cpu) |
104 | { | 104 | { |
105 | struct vcpu_register_runstate_memory_area area; | 105 | struct vcpu_register_runstate_memory_area area; |
106 | 106 | ||
@@ -434,7 +434,7 @@ void xen_setup_timer(int cpu) | |||
434 | name = "<timer kasprintf failed>"; | 434 | name = "<timer kasprintf failed>"; |
435 | 435 | ||
436 | irq = bind_virq_to_irqhandler(VIRQ_TIMER, cpu, xen_timer_interrupt, | 436 | irq = bind_virq_to_irqhandler(VIRQ_TIMER, cpu, xen_timer_interrupt, |
437 | IRQF_DISABLED|IRQF_PERCPU|IRQF_NOBALANCING, | 437 | IRQF_DISABLED|IRQF_PERCPU|IRQF_NOBALANCING|IRQF_TIMER, |
438 | name, NULL); | 438 | name, NULL); |
439 | 439 | ||
440 | evt = &per_cpu(xen_clock_events, cpu); | 440 | evt = &per_cpu(xen_clock_events, cpu); |
@@ -442,8 +442,6 @@ void xen_setup_timer(int cpu) | |||
442 | 442 | ||
443 | evt->cpumask = cpumask_of(cpu); | 443 | evt->cpumask = cpumask_of(cpu); |
444 | evt->irq = irq; | 444 | evt->irq = irq; |
445 | |||
446 | setup_runstate_info(cpu); | ||
447 | } | 445 | } |
448 | 446 | ||
449 | void xen_teardown_timer(int cpu) | 447 | void xen_teardown_timer(int cpu) |
@@ -494,6 +492,7 @@ __init void xen_time_init(void) | |||
494 | 492 | ||
495 | setup_force_cpu_cap(X86_FEATURE_TSC); | 493 | setup_force_cpu_cap(X86_FEATURE_TSC); |
496 | 494 | ||
495 | xen_setup_runstate_info(cpu); | ||
497 | xen_setup_timer(cpu); | 496 | xen_setup_timer(cpu); |
498 | xen_setup_cpu_clockevents(); | 497 | xen_setup_cpu_clockevents(); |
499 | } | 498 | } |
diff --git a/arch/x86/xen/xen-asm_64.S b/arch/x86/xen/xen-asm_64.S index 02f496a8dbaa..53adefda4275 100644 --- a/arch/x86/xen/xen-asm_64.S +++ b/arch/x86/xen/xen-asm_64.S | |||
@@ -96,7 +96,7 @@ ENTRY(xen_sysret32) | |||
96 | pushq $__USER32_CS | 96 | pushq $__USER32_CS |
97 | pushq %rcx | 97 | pushq %rcx |
98 | 98 | ||
99 | pushq $VGCF_in_syscall | 99 | pushq $0 |
100 | 1: jmp hypercall_iret | 100 | 1: jmp hypercall_iret |
101 | ENDPATCH(xen_sysret32) | 101 | ENDPATCH(xen_sysret32) |
102 | RELOC(xen_sysret32, 1b+1) | 102 | RELOC(xen_sysret32, 1b+1) |
@@ -151,7 +151,7 @@ ENTRY(xen_syscall32_target) | |||
151 | ENTRY(xen_sysenter_target) | 151 | ENTRY(xen_sysenter_target) |
152 | lea 16(%rsp), %rsp /* strip %rcx, %r11 */ | 152 | lea 16(%rsp), %rsp /* strip %rcx, %r11 */ |
153 | mov $-ENOSYS, %rax | 153 | mov $-ENOSYS, %rax |
154 | pushq $VGCF_in_syscall | 154 | pushq $0 |
155 | jmp hypercall_iret | 155 | jmp hypercall_iret |
156 | ENDPROC(xen_syscall32_target) | 156 | ENDPROC(xen_syscall32_target) |
157 | ENDPROC(xen_sysenter_target) | 157 | ENDPROC(xen_sysenter_target) |
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h index 355fa6b99c9c..f9153a300bce 100644 --- a/arch/x86/xen/xen-ops.h +++ b/arch/x86/xen/xen-ops.h | |||
@@ -25,6 +25,7 @@ extern struct shared_info *HYPERVISOR_shared_info; | |||
25 | 25 | ||
26 | void xen_setup_mfn_list_list(void); | 26 | void xen_setup_mfn_list_list(void); |
27 | void xen_setup_shared_info(void); | 27 | void xen_setup_shared_info(void); |
28 | void xen_build_mfn_list_list(void); | ||
28 | void xen_setup_machphys_mapping(void); | 29 | void xen_setup_machphys_mapping(void); |
29 | pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn); | 30 | pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn); |
30 | void xen_ident_map_ISA(void); | 31 | void xen_ident_map_ISA(void); |
@@ -41,6 +42,7 @@ void __init xen_build_dynamic_phys_to_machine(void); | |||
41 | 42 | ||
42 | void xen_init_irq_ops(void); | 43 | void xen_init_irq_ops(void); |
43 | void xen_setup_timer(int cpu); | 44 | void xen_setup_timer(int cpu); |
45 | void xen_setup_runstate_info(int cpu); | ||
44 | void xen_teardown_timer(int cpu); | 46 | void xen_teardown_timer(int cpu); |
45 | cycle_t xen_clocksource_read(void); | 47 | cycle_t xen_clocksource_read(void); |
46 | void xen_setup_cpu_clockevents(void); | 48 | void xen_setup_cpu_clockevents(void); |