public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen/x86: Don't BUG on CPU0 offlining
@ 2017-06-26 16:39 Vitaly Kuznetsov
  2017-06-28 15:44 ` [Xen-devel] " Konrad Rzeszutek Wilk
  2017-07-18  8:00 ` Juergen Gross
  0 siblings, 2 replies; 5+ messages in thread
From: Vitaly Kuznetsov @ 2017-06-26 16:39 UTC (permalink / raw)
  To: xen-devel; +Cc: x86, linux-kernel, Boris Ostrovsky, Juergen Gross

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.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
- 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(-)

diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
index a1895a8..1ecb05d 100644
--- a/arch/x86/xen/time.c
+++ b/arch/x86/xen/time.c
@@ -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) {
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Xen-devel] [PATCH] xen/x86: Don't BUG on CPU0 offlining
  2017-06-26 16:39 [PATCH] xen/x86: Don't BUG on CPU0 offlining Vitaly Kuznetsov
@ 2017-06-28 15:44 ` Konrad Rzeszutek Wilk
  2017-06-28 16:31   ` Vitaly Kuznetsov
  2017-07-18  8:00 ` Juergen Gross
  1 sibling, 1 reply; 5+ messages in thread
From: Konrad Rzeszutek Wilk @ 2017-06-28 15:44 UTC (permalink / raw)
  To: Vitaly Kuznetsov
  Cc: xen-devel, Juergen Gross, Boris Ostrovsky, x86, linux-kernel

On Mon, Jun 26, 2017 at 06:39:30PM +0200, Vitaly Kuznetsov wrote:
> 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.
> 
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>


Perhaps:

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

?

> ---
> - 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(-)
> 
> diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
> index a1895a8..1ecb05d 100644
> --- a/arch/x86/xen/time.c
> +++ b/arch/x86/xen/time.c
> @@ -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) {
> -- 
> 2.9.4
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xen-devel] [PATCH] xen/x86: Don't BUG on CPU0 offlining
  2017-06-28 15:44 ` [Xen-devel] " Konrad Rzeszutek Wilk
@ 2017-06-28 16:31   ` Vitaly Kuznetsov
  2017-06-29  7:02     ` Juergen Groß
  0 siblings, 1 reply; 5+ messages in thread
From: Vitaly Kuznetsov @ 2017-06-28 16:31 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: xen-devel, Juergen Gross, Boris Ostrovsky, x86, linux-kernel

Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> writes:

> On Mon, Jun 26, 2017 at 06:39:30PM +0200, Vitaly Kuznetsov wrote:
>> 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.
>> 
>> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
>
> 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.

-- 
  Vitaly

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xen-devel] [PATCH] xen/x86: Don't BUG on CPU0 offlining
  2017-06-28 16:31   ` Vitaly Kuznetsov
@ 2017-06-29  7:02     ` Juergen Groß
  0 siblings, 0 replies; 5+ messages in thread
From: Juergen Groß @ 2017-06-29  7:02 UTC (permalink / raw)
  To: Vitaly Kuznetsov, Konrad Rzeszutek Wilk
  Cc: xen-devel, Boris Ostrovsky, x86, linux-kernel

On 06/28/2017 06:31 PM, Vitaly Kuznetsov wrote:
> Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> writes:
> 
>> On Mon, Jun 26, 2017 at 06:39:30PM +0200, Vitaly Kuznetsov wrote:
>>> 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.
>>>
>>> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
>>
>> 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.

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

So:

Acked-by: Juergen Gross <jgross@suse.com>


Juergen

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xen/x86: Don't BUG on CPU0 offlining
  2017-06-26 16:39 [PATCH] xen/x86: Don't BUG on CPU0 offlining Vitaly Kuznetsov
  2017-06-28 15:44 ` [Xen-devel] " Konrad Rzeszutek Wilk
@ 2017-07-18  8:00 ` Juergen Gross
  1 sibling, 0 replies; 5+ messages in thread
From: Juergen Gross @ 2017-07-18  8:00 UTC (permalink / raw)
  To: Vitaly Kuznetsov, xen-devel; +Cc: x86, linux-kernel, Boris Ostrovsky

On 26/06/17 18:39, Vitaly Kuznetsov wrote:
> 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.
> 
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>

Committed to xen/tip for-linus-4.13


Thanks,

Juergen

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-07-18  8:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-26 16:39 [PATCH] xen/x86: Don't BUG on CPU0 offlining Vitaly Kuznetsov
2017-06-28 15:44 ` [Xen-devel] " Konrad Rzeszutek Wilk
2017-06-28 16:31   ` Vitaly Kuznetsov
2017-06-29  7:02     ` Juergen Groß
2017-07-18  8:00 ` Juergen Gross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox