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] [day] [month] [year] [list]
Message-ID: <ZzzDG6FFprnWPnCj@uudg.org>
Date: Tue, 19 Nov 2024 13:55:55 -0300
From: "Luis Claudio R. Goncalves" <lgoncalv@...hat.com>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: Thierry Reding <thierry.reding@...il.com>,
	Krishna Reddy <vdumpa@...dia.com>, Will Deacon <will@...nel.org>,
	Robin Murphy <robin.murphy@....com>, Joerg Roedel <joro@...tes.org>,
	Jonathan Hunter <jonathanh@...dia.com>,
	linux-kernel@...r.kernel.org, iommu@...ts.linux.dev,
	linux-arm-kernel@...ts.infradead.org, linux-tegra@...r.kernel.org,
	Steven Rostedt <rostedt@...dmis.org>,
	linux-rt-devel@...ts.linux.dev
Subject: Re: [PATCH] iommu/tegra241-cmdqv: do not call smp_processor_id in
 preemptible context

On Tue, Nov 19, 2024 at 08:15:10AM +0100, Sebastian Andrzej Siewior wrote:
> On 2024-11-18 21:19:28 [-0300], Luis Claudio R. Goncalves wrote:
> > With PREEMPT_RT enabled some of the calls to tegra241_cmdqv_get_cmdq()
> > during boot will happen in preemptible context. As this function calls
> > smp_processor_id(), these calls will trigger a "BUG: using smp_processor_id()
> > in preemptible" backtrace if DEBUG_PREEMPT is enabled.
> 
> If this is only on PREEMPT_RT, where is the disabled preemption coming
> from on !PREEMPT_RT?

You are correct. This is not exclusive to PREEMPT_RT, also happens with the
stock kernel. I ran more tests and this time I made sure DEBUG_PREEMPT was
enabled. That was enough to reproduce the problem.
 
> > As tegra241_cmdqv_get_cmdq() only calls smp_processor_id() to use the
> > CPU number as a factor to balance out traffic on cmdq usage, it is safe
> > to use raw_smp_processor_id() here.
> > 
> > Signed-off-by: Luis Claudio R. Goncalves <lgoncalv@...hat.com>
> 
> Sebastian
> 
---end quoted text---


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ