[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen stable-4.7] livepatch: Wrong usage of spinlock on debug console.



commit a0ced5abefa37b41e28697b3f2ca6210a4690e95
Author:     Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
AuthorDate: Fri Jun 23 15:16:38 2017 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Jun 23 15:16:38 2017 +0200

    livepatch: Wrong usage of spinlock on debug console.
    
    If we have a large amount of livepatches and want to print them
    on the console using 'xl debug-keys x' we eventually hit
    the preemption check:
    
      if ( i && !(i % 64) )
      {
        spin_unlock(&payload_lock);
        process_pending_softirqs();
        if ( spin_trylock(&payload_lock) )
                return
    
    <facepalm> The effect is that we have just effectively
    taken the lock and returned without unlocking!
    
    Reviewed-by: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
    Reviewed-and-tested-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
    master commit: 75dfe7c566c36e0af4714557a666827f49b69191
    master date: 2017-06-12 08:59:33 -0400
---
 xen/common/livepatch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/livepatch.c b/xen/common/livepatch.c
index 5da28a3..c9a7698 100644
--- a/xen/common/livepatch.c
+++ b/xen/common/livepatch.c
@@ -1527,7 +1527,7 @@ static void livepatch_printall(unsigned char key)
             {
                 spin_unlock(&payload_lock);
                 process_pending_softirqs();
-                if ( spin_trylock(&payload_lock) )
+                if ( !spin_trylock(&payload_lock) )
                 {
                     printk("Couldn't reacquire lock. Try again.\n");
                     return;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.7

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.