Skip to contentSkip to conversation

xen/x86: Don't BUG on CPU0 offlining

PATCH In review Vitaly Kuznetsov 3 participants 8 messages Jun 26, 2017 – Jul 18, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/x86: Don't BUG on CPU0 offlining

CONFIG_BOOTPARAM_HOTPLUG_CPU0 allows to offline CPU0 but Xen HVM guests BUG() in xen_teardown_timer(). Remove the BUG_ON(), this is probably a leftover from ancient times when CPU0 hotplug was impossible, it works just fine for HVM.

---
- CPU0 hotplug is currently broken on x86, see
https://lkml.org/lkml/2017/6/26/529

---
 arch/x86/xen/time.c | 1 -
 1 file changed, 1 deletion(-)
arch/x86/xen/time.c +0 -1
index a1895a8..1ecb05d 100644
@@ -309,7 +309,6 @@ static irqreturn_t xen_timer_interrupt(int irq, void *dev_id)
 void xen_teardown_timer(int cpu)
 {
 	struct clock_event_device *evt;
-	BUG_ON(cpu == 0);
 	evt = &per_cpu(xen_clock_events, cpu).evt;
 
 	if (evt->irq >= 0) {
Signature · 1 line
2.9.4
#1 lore raw
Quoted 6 lines · Vitaly Kuznetsov

CONFIG_BOOTPARAM_HOTPLUG_CPU0 allows to offline CPU0 but Xen HVM guests BUG() in xen_teardown_timer(). Remove the BUG_ON(), this is probably a leftover from ancient times when CPU0 hotplug was impossible, it works just fine for HVM.

Perhaps:

BUG_ON(cpu == 0 && xen_pv_domain());

?

Quoted 27 lines

---
- CPU0 hotplug is currently broken on x86, see
https://lkml.org/lkml/2017/6/26/529

---
 arch/x86/xen/time.c | 1 -
 1 file changed, 1 deletion(-)
arch/x86/xen/time.c +0 -1
index a1895a8..1ecb05d 100644
@@ -309,7 +309,6 @@ static irqreturn_t xen_timer_interrupt(int irq, void *dev_id)
 void xen_teardown_timer(int cpu)
 {
 	struct clock_event_device *evt;
-	BUG_ON(cpu == 0);
 	evt = &per_cpu(xen_clock_events, cpu).evt;
 
 	if (evt->irq >= 0) {
Signature · 7 lines
2.9.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#2 lore raw
Quoted 6 lines · Konrad Rzeszutek Wilk
Quoted 5 lines · Vitaly Kuznetsov

CONFIG_BOOTPARAM_HOTPLUG_CPU0 allows to offline CPU0 but Xen HVM guests BUG() in xen_teardown_timer(). Remove the BUG_ON(), this is probably a leftover from ancient times when CPU0 hotplug was impossible, it works just fine for HVM.

Quoted 6 lines
Quoted 1 line

Perhaps:

BUG_ON(cpu == 0 && xen_pv_domain());

Linus says no BUG_ONs :-)

xen_pv_cpu_disable() has the following:

    if (cpu == 0)
            return -EBUSY;

as a protection so we won't get to xen_teardown_timer() but if you think additional BUG_ON() protection is justified I'm definitely not against adding it.

Signature · 6 lines
  Vitaly

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#3 lore raw
In reply to Konrad Rzeszutek Wilk
Quoted 6 lines · Konrad Rzeszutek Wilk
Quoted 5 lines · Vitaly Kuznetsov

CONFIG_BOOTPARAM_HOTPLUG_CPU0 allows to offline CPU0 but Xen HVM guests BUG() in xen_teardown_timer(). Remove the BUG_ON(), this is probably a leftover from ancient times when CPU0 hotplug was impossible, it works just fine for HVM.

Quoted 6 lines
Quoted 1 line

Perhaps:

BUG_ON(cpu == 0 && xen_pv_domain());

Linus says no BUG_ONs :-)

xen_pv_cpu_disable() has the following:

    if (cpu == 0)
            return -EBUSY;

as a protection so we won't get to xen_teardown_timer() but if you think additional BUG_ON() protection is justified I'm definitely not against adding it.

Signature · 1 line
  Vitaly
maintainer Acked-by
#4 lore raw
Quoted 17 lines · Vitaly Kuznetsov
Quoted 6 lines · Konrad Rzeszutek Wilk
Quoted 5 lines · Vitaly Kuznetsov

CONFIG_BOOTPARAM_HOTPLUG_CPU0 allows to offline CPU0 but Xen HVM guests BUG() in xen_teardown_timer(). Remove the BUG_ON(), this is probably a leftover from ancient times when CPU0 hotplug was impossible, it works just fine for HVM.

Quoted 6 lines
Quoted 1 line

Perhaps:

BUG_ON(cpu == 0 && xen_pv_domain());

Linus says no BUG_ONs :-)

Quoted 8 lines

xen_pv_cpu_disable() has the following:

     if (cpu == 0)
             return -EBUSY;

as a protection so we won't get to xen_teardown_timer() but if you think additional BUG_ON() protection is justified I'm definitely not against adding it.

No, I don't think its needed. This should be handled at the appropriate level, not down in the timer handling.

So:

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

maintainer Acked-by
#5 lore raw
In reply to Vitaly Kuznetsov
Quoted 17 lines · Vitaly Kuznetsov
Quoted 6 lines · Konrad Rzeszutek Wilk
Quoted 5 lines · Vitaly Kuznetsov

CONFIG_BOOTPARAM_HOTPLUG_CPU0 allows to offline CPU0 but Xen HVM guests BUG() in xen_teardown_timer(). Remove the BUG_ON(), this is probably a leftover from ancient times when CPU0 hotplug was impossible, it works just fine for HVM.

Quoted 6 lines
Quoted 1 line

Perhaps:

BUG_ON(cpu == 0 && xen_pv_domain());

Linus says no BUG_ONs :-)

Quoted 8 lines

xen_pv_cpu_disable() has the following:

     if (cpu == 0)
             return -EBUSY;

as a protection so we won't get to xen_teardown_timer() but if you think additional BUG_ON() protection is justified I'm definitely not against adding it.

No, I don't think its needed. This should be handled at the appropriate level, not down in the timer handling.

So:

Juergen

maintainer
#6 lore raw
In reply to Vitaly Kuznetsov
Quoted 6 lines · Vitaly Kuznetsov

CONFIG_BOOTPARAM_HOTPLUG_CPU0 allows to offline CPU0 but Xen HVM guests BUG() in xen_teardown_timer(). Remove the BUG_ON(), this is probably a leftover from ancient times when CPU0 hotplug was impossible, it works just fine for HVM.

Committed to xen/tip for-linus-4.13

Thanks,

Juergen

maintainer
#7 lore raw
In reply to Vitaly Kuznetsov
Quoted 6 lines · Vitaly Kuznetsov

CONFIG_BOOTPARAM_HOTPLUG_CPU0 allows to offline CPU0 but Xen HVM guests BUG() in xen_teardown_timer(). Remove the BUG_ON(), this is probably a leftover from ancient times when CPU0 hotplug was impossible, it works just fine for HVM.

Committed to xen/tip for-linus-4.13

Thanks,

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel