lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 7 Oct 2021 12:59:28 -0400
From:   Joe Korty <joe.korty@...current-rt.com>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
        Steven Rostedt <rostedt@...dmis.org>,
        Clark Williams <williams@...hat.com>,
        Jun Miao <jun.miao@...driver.com>,
        linux-rt-users <linux-rt-users@...r.kernel.org>,
        linux-kernel@...r.kernel.org
Subject: [PATCH 5.10-rt+] drm/i915/gt: transform irq_disable into local_lock.

Convert IRQ blocking in intel_breadcrumbs_park() to a local lock.

Affects 5.10-rt and all later releases, up to and including when
rt was merged into mainline.

This problem has been reported in two other linux-rt-users postings,
  
   [PREEMPT_RT] i915: fix PREEMPT_RT locking splats (Clark Williams)
   [linux-5.12.y-rt] drm/i915/gt: Fix a lockdep warning with interrupts enabled (Jun Miao)

Neither of these submit the obvious solution, nor,
AFAICT, has either yet been acted on.  So I muddy the
waters further by submitting this, a third fix.

Signed-off-by: Joe Korty <joe.korty@...current-rt.com>
Tested-by: Joe Korty <joe.korty@...current-rt.com>

Index: b/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c
===================================================================
--- a/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c
+++ b/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c
@@ -34,6 +34,16 @@
 #include "intel_gt_pm.h"
 #include "intel_gt_requests.h"
 
+#include <linux/local_lock.h>
+
+struct event_lock {
+	local_lock_t l;
+};
+
+static DEFINE_PER_CPU(struct event_lock, event_lock) = {
+	.l = INIT_LOCAL_LOCK(l),
+};
+
 static bool irq_enable(struct intel_engine_cs *engine)
 {
 	if (!engine->irq_enable)
@@ -342,9 +352,9 @@ void intel_breadcrumbs_park(struct intel
 	/* Kick the work once more to drain the signalers */
 	irq_work_sync(&b->irq_work);
 	while (unlikely(READ_ONCE(b->irq_armed))) {
-		local_irq_disable();
+		local_lock_irq(&event_lock.l);
 		signal_irq_work(&b->irq_work);
-		local_irq_enable();
+		local_unlock_irq(&event_lock.l);
 		cond_resched();
 	}
 	GEM_BUG_ON(!list_empty(&b->signalers));

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ