Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1591397
| From | Vitaly Kuznetsov <vkuznets@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 09/21] x86/xen: split xen_cpu_die() |
| Date | 2017-03-02 20:00 +0100 |
| Message-ID | <tgE7f-6oo-9@gated-at.bofh.it> (permalink) |
| References | <tgDbb-5KR-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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>
---
arch/x86/xen/smp.c | 26 ++++++++++++++++++++------
1 file changed, 20 insertions(+), 6 deletions(-)
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index 6c8a3a5..6c4b415 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -513,10 +513,10 @@ static int xen_cpu_disable(void)
return 0;
}
-static void xen_cpu_die(unsigned int cpu)
+static void xen_pv_cpu_die(unsigned int cpu)
{
- while (xen_pv_domain() && HYPERVISOR_vcpu_op(VCPUOP_is_up,
- xen_vcpu_nr(cpu), NULL)) {
+ while (HYPERVISOR_vcpu_op(VCPUOP_is_up,
+ xen_vcpu_nr(cpu), NULL)) {
__set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(HZ/10);
}
@@ -529,6 +529,15 @@ static void xen_cpu_die(unsigned int cpu)
}
}
+static void xen_hvm_cpu_die(unsigned int cpu)
+{
+ if (common_cpu_die(cpu) == 0) {
+ xen_smp_intr_free(cpu);
+ xen_uninit_lock_cpu(cpu);
+ xen_teardown_timer(cpu);
+ }
+}
+
static void xen_play_dead(void) /* used only with HOTPLUG_CPU */
{
play_dead_common();
@@ -551,7 +560,12 @@ static int xen_cpu_disable(void)
return -ENOSYS;
}
-static void xen_cpu_die(unsigned int cpu)
+static void xen_pv_cpu_die(unsigned int cpu)
+{
+ BUG();
+}
+
+static void xen_hvm_cpu_die(unsigned int cpu)
{
BUG();
}
@@ -732,7 +746,7 @@ static const struct smp_ops xen_smp_ops __initconst = {
.smp_cpus_done = xen_smp_cpus_done,
.cpu_up = xen_cpu_up,
- .cpu_die = xen_cpu_die,
+ .cpu_die = xen_pv_cpu_die,
.cpu_disable = xen_cpu_disable,
.play_dead = xen_play_dead,
@@ -761,7 +775,7 @@ void __init xen_hvm_smp_init(void)
{
smp_ops.smp_prepare_cpus = xen_hvm_smp_prepare_cpus;
smp_ops.smp_send_reschedule = xen_smp_send_reschedule;
- smp_ops.cpu_die = xen_cpu_die;
+ smp_ops.cpu_die = xen_hvm_cpu_die;
smp_ops.send_call_func_ipi = xen_smp_send_call_function_ipi;
smp_ops.send_call_func_single_ipi = xen_smp_send_call_function_single_ipi;
smp_ops.smp_prepare_boot_cpu = xen_hvm_smp_prepare_boot_cpu;
--
2.9.3
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 00/21] x86/xen: untangle PV and PVHVM guest support code Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-03-02 19:20 +0100
[PATCH v2 11/21] x86/xen: split off smp_pv.c Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-03-02 19:20 +0100
Re: [PATCH v2 11/21] x86/xen: split off smp_pv.c Juergen Gross <jgross@suse.com> - 2017-03-13 10:40 +0100
[PATCH v2 12/21] x86/xen: split off mmu_hvm.c Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-03-02 20:00 +0100
[PATCH v2 09/21] x86/xen: split xen_cpu_die() Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-03-02 20:00 +0100
Re: [PATCH v2 09/21] x86/xen: split xen_cpu_die() Juergen Gross <jgross@suse.com> - 2017-03-13 08:40 +0100
[PATCH v2 02/21] x86/xen: globalize have_vcpu_info_placement Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-03-02 23:10 +0100
Re: [PATCH v2 02/21] x86/xen: globalize have_vcpu_info_placement Juergen Gross <jgross@suse.com> - 2017-03-08 16:10 +0100
[PATCH v2 01/21] x86/xen: separate PV and HVM hypervisors Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-03-02 23:10 +0100
Re: [PATCH v2 01/21] x86/xen: separate PV and HVM hypervisors Juergen Gross <jgross@suse.com> - 2017-03-08 16:10 +0100
[PATCH v2 05/21] x86/xen: split off enlighten_hvm.c Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-03-02 23:10 +0100
Re: [PATCH v2 05/21] x86/xen: split off enlighten_hvm.c Juergen Gross <jgross@suse.com> - 2017-03-08 16:40 +0100
[PATCH v2 10/21] x86/xen: split off smp_hvm.c Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-03-02 23:10 +0100
Re: [PATCH v2 10/21] x86/xen: split off smp_hvm.c Juergen Gross <jgross@suse.com> - 2017-03-13 08:40 +0100
[PATCH v2 03/21] x86/xen: add CONFIG_XEN_PV to Kconfig Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-03-02 23:20 +0100
Re: [PATCH v2 03/21] x86/xen: add CONFIG_XEN_PV to Kconfig Juergen Gross <jgross@suse.com> - 2017-03-08 16:20 +0100
Re: [Xen-devel] [PATCH v2 00/21] x86/xen: untangle PV and PVHVM guest support code Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-03-05 19:10 +0100
Re: [Xen-devel] [PATCH v2 00/21] x86/xen: untangle PV and PVHVM guest support code Vitaly Kuznetsov <vkuznets@redhat.com> - 2017-03-13 14:10 +0100
Re: [PATCH v2 06/21] x86/xen: split off enlighten_pv.c Juergen Gross <jgross@suse.com> - 2017-03-08 16:20 +0100
Re: [PATCH v2 13/21] x86/xen: split off mmu_pv.c Juergen Gross <jgross@suse.com> - 2017-03-13 10:40 +0100
csiph-web