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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 25 Sep 2019 18:47:12 +0200
From:   Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To:     Clark Williams <clark.williams@...il.com>
Cc:     bigeasy@...utronix.com, tglx@...utronix.com,
        linux-rt-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PREEMPT_RT PATCH 1/3] i915: do not call
 lockdep_assert_irqs_disabled() on PREEMPT_RT

On 2019-08-19 19:33:17 [-0500], Clark Williams wrote:
> From: Clark Williams <williams@...hat.com>
> 
> The 'breadcrumb' code in the i915 driver calls lockdep_assert_irqs_disabled()
> when starting some operations. This is valid on a stock kernel
> but on a PREEMPT_RT kernel the spin_lock_irq*() calls to not disable
> interrupts and likewise the spin_unlock_irq*() calls to not enable interrupts.
> 
> Conditionalize these calls based on whether PREEMPT_RT_FULL is enabled.
> 
> Signed-off-by: Clark Williams <williams@...hat.com>
> ---
>  drivers/gpu/drm/i915/intel_breadcrumbs.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_breadcrumbs.c b/drivers/gpu/drm/i915/intel_breadcrumbs.c
> index 832cb6b1e9bd..3eef6010ebf6 100644
> --- a/drivers/gpu/drm/i915/intel_breadcrumbs.c
> +++ b/drivers/gpu/drm/i915/intel_breadcrumbs.c
> @@ -101,7 +101,8 @@ __dma_fence_signal__notify(struct dma_fence *fence)
>  	struct dma_fence_cb *cur, *tmp;
>  
>  	lockdep_assert_held(fence->lock);
> -	lockdep_assert_irqs_disabled();
> +	if (!IS_ENABLED(CONFIG_PREEMPT_RT_FULL))
> +		lockdep_assert_irqs_disabled();
>  

Both asserts went in commit c36beba6b296b ("drm/i915: Seal races between
async GPU cancellation, retirement and signaling"). It looks like its
purpose is to ensure that ->lock is acquired and that interrupts are
also disabled because that lock is always acquired with disabled
interrupts. This isn't required, lockdep is clever enough to yell at you
if you manage to use it wrong.
Let me drop that lockdep_assert_irqs_disabled().

Sebastian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ