xen/spinlock: Don't enable them unconditionally.
Subsystems (3)
PATCH 1/1 xen/spinlock: Don't enable them unconditionally.
From: Konrad Rzeszutek Wilk <[email protected]>
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.
--- arch/x86/xen/spinlock.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
arch/x86/xen/spinlock.c +4 -1
@@ -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 (¶virt_ticketlocks_enabled);return 0 ; }
Signature · 1 line
1.7.7.6
Quoted 11 lines · On Fri, 4 Apr 2014 14:48:04 -0400 [email protected] wrote:
From: Konrad Rzeszutek Wilk <[email protected]>
The git commit
a945928ea2709bc0e8e8165d33aed855a0110279('xen: Do not enable spinlocks beforejump_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.
Quoted 4 lines
This means that the slowpath is enabled on baremetal while it should not be.
Reported-by Waiman Long <[email protected]>
-- Steve
Quoted 31 lines
CC Boris Ostrovsky <[email protected]>CC David Vrabel <[email protected]>Signed-off-by Konrad Rzeszutek Wilk <[email protected]>--- arch/x86/xen/spinlock.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)arch/x86/xen/spinlock.c +4
-1@@ -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 (¶virt_ticketlocks_enabled);return 0 ; }
Quoted 11 lines · On Fri, 4 Apr 2014 14:48:04 -0400 [email protected] wrote:
From: Konrad Rzeszutek Wilk <[email protected]>
The git commit
a945928ea2709bc0e8e8165d33aed855a0110279('xen: Do not enable spinlocks beforejump_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.
Quoted 4 lines
This means that the slowpath is enabled on baremetal while it should not be.
Reported-by Waiman Long <[email protected]>
-- Steve
Quoted 31 lines
CC Boris Ostrovsky <[email protected]>CC David Vrabel <[email protected]>Signed-off-by Konrad Rzeszutek Wilk <[email protected]>--- arch/x86/xen/spinlock.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)arch/x86/xen/spinlock.c +4
-1@@ -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 (¶virt_ticketlocks_enabled);return 0 ; }
David Vrabel
AppliedQuoted 11 lines · On 04/04/14 19:48, [email protected] wrote:
From: Konrad Rzeszutek Wilk <[email protected]>
The git commit
a945928ea2709bc0e8e8165d33aed855a0110279('xen: Do not enable spinlocks beforejump_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.
Quoted 2 lines
This means that the slowpath is enabled on baremetal while it should not be.
Applied to devel/for-linus-3.15.
Thanks.
David
David Vrabel
AppliedQuoted 11 lines · On 04/04/14 19:48, [email protected] wrote:
From: Konrad Rzeszutek Wilk <[email protected]>
The git commit
a945928ea2709bc0e8e8165d33aed855a0110279('xen: Do not enable spinlocks beforejump_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.
Quoted 2 lines
This means that the slowpath is enabled on baremetal while it should not be.
Applied to devel/for-linus-3.15.
Thanks.
David