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

[Xen-changelog] [xen master] xen/spinlock: disable spinlock debugging in console_force_unlock()



commit f3b5ba34ceae42354d0cc321224029cad4f4dcc3
Author:     Juergen Gross <jgross@xxxxxxxx>
AuthorDate: Wed Jan 8 11:43:24 2020 +0100
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Wed Jan 8 18:43:17 2020 +0000

    xen/spinlock: disable spinlock debugging in console_force_unlock()
    
    console_force_unlock() might result in subsequent ASSERT() triggering
    when CONFIG_DEBUG_LOCKS was active. Avoid that by calling
    spin_debug_disable() in console_force_unlock() and make the spinlock
    debug assertions trigger only if spin_debug was active.
    
    Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/common/spinlock.c      | 3 ++-
 xen/drivers/char/console.c | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c
index ed69f0a4d2..286f916bca 100644
--- a/xen/common/spinlock.c
+++ b/xen/common/spinlock.c
@@ -85,7 +85,8 @@ static void got_lock(union lock_debug *debug)
 
 static void rel_lock(union lock_debug *debug)
 {
-    ASSERT(debug->cpu == smp_processor_id());
+    if ( atomic_read(&spin_debug) > 0 )
+        ASSERT(debug->cpu == smp_processor_id());
     debug->cpu = SPINLOCK_NO_CPU;
 }
 
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index b31d789a5d..4bcbbfa7d6 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -1077,6 +1077,7 @@ void console_unlock_recursive_irqrestore(unsigned long 
flags)
 void console_force_unlock(void)
 {
     watchdog_disable();
+    spin_debug_disable();
     spin_lock_init(&console_lock);
     serial_force_unlock(sercon_handle);
     console_locks_busted = 1;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
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®.