diff options
author | Vitaly Kuznetsov <vkuznets@redhat.com> | 2017-03-14 13:35:44 -0400 |
---|---|---|
committer | Juergen Gross <jgross@suse.com> | 2017-05-02 05:04:40 -0400 |
commit | aa1c84e8ca7f6f881514b109b9a2468db148045c (patch) | |
tree | 09a3c95b9a2337d477349a3a12b7d570bfa909f2 | |
parent | a2d1078a35f9a38ae888aa6147e4ca32666154a1 (diff) |
x86/xen: split xen_cpu_die()
Split xen_cpu_die() into xen_pv_cpu_die() and xen_hvm_cpu_die() to support
further splitting of smp.c.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
-rw-r--r-- | arch/x86/xen/smp.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c index 00c623bef72f..c51d1a699869 100644 --- a/arch/x86/xen/smp.c +++ b/arch/x86/xen/smp.c | |||
@@ -514,10 +514,10 @@ static int xen_cpu_disable(void) | |||
514 | return 0; | 514 | return 0; |
515 | } | 515 | } |
516 | 516 | ||
517 | static void xen_cpu_die(unsigned int cpu) | 517 | static void xen_pv_cpu_die(unsigned int cpu) |
518 | { | 518 | { |
519 | while (xen_pv_domain() && HYPERVISOR_vcpu_op(VCPUOP_is_up, | 519 | while (HYPERVISOR_vcpu_op(VCPUOP_is_up, |
520 | xen_vcpu_nr(cpu), NULL)) { | 520 | xen_vcpu_nr(cpu), NULL)) { |
521 | __set_current_state(TASK_UNINTERRUPTIBLE); | 521 | __set_current_state(TASK_UNINTERRUPTIBLE); |
522 | schedule_timeout(HZ/10); | 522 | schedule_timeout(HZ/10); |
523 | } | 523 | } |
@@ -530,6 +530,15 @@ static void xen_cpu_die(unsigned int cpu) | |||
530 | } | 530 | } |
531 | } | 531 | } |
532 | 532 | ||
533 | static void xen_hvm_cpu_die(unsigned int cpu) | ||
534 | { | ||
535 | if (common_cpu_die(cpu) == 0) { | ||
536 | xen_smp_intr_free(cpu); | ||
537 | xen_uninit_lock_cpu(cpu); | ||
538 | xen_teardown_timer(cpu); | ||
539 | } | ||
540 | } | ||
541 | |||
533 | static void xen_play_dead(void) /* used only with HOTPLUG_CPU */ | 542 | static void xen_play_dead(void) /* used only with HOTPLUG_CPU */ |
534 | { | 543 | { |
535 | play_dead_common(); | 544 | play_dead_common(); |
@@ -552,7 +561,12 @@ static int xen_cpu_disable(void) | |||
552 | return -ENOSYS; | 561 | return -ENOSYS; |
553 | } | 562 | } |
554 | 563 | ||
555 | static void xen_cpu_die(unsigned int cpu) | 564 | static void xen_pv_cpu_die(unsigned int cpu) |
565 | { | ||
566 | BUG(); | ||
567 | } | ||
568 | |||
569 | static void xen_hvm_cpu_die(unsigned int cpu) | ||
556 | { | 570 | { |
557 | BUG(); | 571 | BUG(); |
558 | } | 572 | } |
@@ -733,7 +747,7 @@ static const struct smp_ops xen_smp_ops __initconst = { | |||
733 | .smp_cpus_done = xen_smp_cpus_done, | 747 | .smp_cpus_done = xen_smp_cpus_done, |
734 | 748 | ||
735 | .cpu_up = xen_cpu_up, | 749 | .cpu_up = xen_cpu_up, |
736 | .cpu_die = xen_cpu_die, | 750 | .cpu_die = xen_pv_cpu_die, |
737 | .cpu_disable = xen_cpu_disable, | 751 | .cpu_disable = xen_cpu_disable, |
738 | .play_dead = xen_play_dead, | 752 | .play_dead = xen_play_dead, |
739 | 753 | ||
@@ -762,7 +776,7 @@ void __init xen_hvm_smp_init(void) | |||
762 | { | 776 | { |
763 | smp_ops.smp_prepare_cpus = xen_hvm_smp_prepare_cpus; | 777 | smp_ops.smp_prepare_cpus = xen_hvm_smp_prepare_cpus; |
764 | smp_ops.smp_send_reschedule = xen_smp_send_reschedule; | 778 | smp_ops.smp_send_reschedule = xen_smp_send_reschedule; |
765 | smp_ops.cpu_die = xen_cpu_die; | 779 | smp_ops.cpu_die = xen_hvm_cpu_die; |
766 | smp_ops.send_call_func_ipi = xen_smp_send_call_function_ipi; | 780 | smp_ops.send_call_func_ipi = xen_smp_send_call_function_ipi; |
767 | smp_ops.send_call_func_single_ipi = xen_smp_send_call_function_single_ipi; | 781 | smp_ops.send_call_func_single_ipi = xen_smp_send_call_function_single_ipi; |
768 | smp_ops.smp_prepare_boot_cpu = xen_hvm_smp_prepare_boot_cpu; | 782 | smp_ops.smp_prepare_boot_cpu = xen_hvm_smp_prepare_boot_cpu; |