stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen/spinlock: Don't enable them unconditionally.
@ 2014-04-04 18:48 konrad
  2014-04-04 20:25 ` Steven Rostedt
  2014-04-07 17:14 ` David Vrabel
  0 siblings, 2 replies; 3+ messages in thread
From: konrad @ 2014-04-04 18:48 UTC (permalink / raw)
  To: xen-devel, linux-kernel
  Cc: Konrad Rzeszutek Wilk, Steven Rostedt, stable, Boris Ostrovsky,
	David Vrabel

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

The git commit a945928ea2709bc0e8e8165d33aed855a0110279
('xen: Do not enable spinlocks before jump_label_init() has executed')
was added to deal with the jump machinery. Earlier the code
that turned on the jump label was only called by Xen specific
functions. But now that it had been moved to the initcall machinery
it gets called on Xen, KVM, and baremetal - ouch!. And the detection
machinery to only call it on Xen wasn't remembered in the heat
of merge window excitement.

This means that the slowpath is enabled on baremetal while it should
not be.

Reported-by: Waiman Long <waiman.long@hp.com>
CC: Steven Rostedt <rostedt@goodmis.org>
CC: stable@vger.kernel.org
CC: Boris Ostrovsky <boris.ostrovsky@oracle.com>
CC: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 arch/x86/xen/spinlock.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/x86/xen/spinlock.c b/arch/x86/xen/spinlock.c
index 581521c..c570fea 100644
--- a/arch/x86/xen/spinlock.c
+++ b/arch/x86/xen/spinlock.c
@@ -274,7 +274,7 @@ void __init xen_init_spinlocks(void)
 		printk(KERN_DEBUG "xen: PV spinlocks disabled\n");
 		return;
 	}
-
+	printk(KERN_DEBUG "xen: PV spinlocks enabled\n");
 	pv_lock_ops.lock_spinning = PV_CALLEE_SAVE(xen_lock_spinning);
 	pv_lock_ops.unlock_kick = xen_unlock_kick;
 }
@@ -290,6 +290,9 @@ static __init int xen_init_spinlocks_jump(void)
 	if (!xen_pvspin)
 		return 0;
 
+	if (!xen_domain())
+		return 0;
+
 	static_key_slow_inc(&paravirt_ticketlocks_enabled);
 	return 0;
 }
-- 
1.7.7.6


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

* Re: [PATCH] xen/spinlock: Don't enable them unconditionally.
  2014-04-04 18:48 [PATCH] xen/spinlock: Don't enable them unconditionally konrad
@ 2014-04-04 20:25 ` Steven Rostedt
  2014-04-07 17:14 ` David Vrabel
  1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2014-04-04 20:25 UTC (permalink / raw)
  To: konrad
  Cc: xen-devel, linux-kernel, Konrad Rzeszutek Wilk, stable,
	Boris Ostrovsky, David Vrabel

On Fri,  4 Apr 2014 14:48:04 -0400
konrad@kernel.org wrote:

> From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> 
> The git commit a945928ea2709bc0e8e8165d33aed855a0110279
> ('xen: Do not enable spinlocks before jump_label_init() has executed')
> was added to deal with the jump machinery. Earlier the code
> that turned on the jump label was only called by Xen specific
> functions. But now that it had been moved to the initcall machinery
> it gets called on Xen, KVM, and baremetal - ouch!. And the detection
> machinery to only call it on Xen wasn't remembered in the heat
> of merge window excitement.
> 
> This means that the slowpath is enabled on baremetal while it should
> not be.
> 
> Reported-by: Waiman Long <waiman.long@hp.com>

Acked-by: Steven Rostedt <rostedt@goodmis.org>

-- Steve

> CC: stable@vger.kernel.org
> CC: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> CC: David Vrabel <david.vrabel@citrix.com>
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> ---
>  arch/x86/xen/spinlock.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/xen/spinlock.c b/arch/x86/xen/spinlock.c
> index 581521c..c570fea 100644
> --- a/arch/x86/xen/spinlock.c
> +++ b/arch/x86/xen/spinlock.c
> @@ -274,7 +274,7 @@ void __init xen_init_spinlocks(void)
>  		printk(KERN_DEBUG "xen: PV spinlocks disabled\n");
>  		return;
>  	}
> -
> +	printk(KERN_DEBUG "xen: PV spinlocks enabled\n");
>  	pv_lock_ops.lock_spinning = PV_CALLEE_SAVE(xen_lock_spinning);
>  	pv_lock_ops.unlock_kick = xen_unlock_kick;
>  }
> @@ -290,6 +290,9 @@ static __init int xen_init_spinlocks_jump(void)
>  	if (!xen_pvspin)
>  		return 0;
>  
> +	if (!xen_domain())
> +		return 0;
> +
>  	static_key_slow_inc(&paravirt_ticketlocks_enabled);
>  	return 0;
>  }


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

* Re: [PATCH] xen/spinlock: Don't enable them unconditionally.
  2014-04-04 18:48 [PATCH] xen/spinlock: Don't enable them unconditionally konrad
  2014-04-04 20:25 ` Steven Rostedt
@ 2014-04-07 17:14 ` David Vrabel
  1 sibling, 0 replies; 3+ messages in thread
From: David Vrabel @ 2014-04-07 17:14 UTC (permalink / raw)
  To: konrad
  Cc: xen-devel, linux-kernel, Konrad Rzeszutek Wilk, Steven Rostedt,
	stable, Boris Ostrovsky

On 04/04/14 19:48, konrad@kernel.org wrote:
> From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> 
> The git commit a945928ea2709bc0e8e8165d33aed855a0110279
> ('xen: Do not enable spinlocks before jump_label_init() has executed')
> was added to deal with the jump machinery. Earlier the code
> that turned on the jump label was only called by Xen specific
> functions. But now that it had been moved to the initcall machinery
> it gets called on Xen, KVM, and baremetal - ouch!. And the detection
> machinery to only call it on Xen wasn't remembered in the heat
> of merge window excitement.
> 
> This means that the slowpath is enabled on baremetal while it should
> not be.

Applied to devel/for-linus-3.15.

Thanks.

David

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

end of thread, other threads:[~2014-04-07 17:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-04 18:48 [PATCH] xen/spinlock: Don't enable them unconditionally konrad
2014-04-04 20:25 ` Steven Rostedt
2014-04-07 17:14 ` David Vrabel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).