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]
Message-ID: <c7a142ee-d34f-494a-b4f9-921d739aeb59@arm.com>
Date: Thu, 6 Mar 2025 10:25:37 +0000
From: Suzuki K Poulose <suzuki.poulose@....com>
To: Yeoreum Yun <yeoreum.yun@....com>, mike.leach@...aro.org,
 james.clark@...aro.org, alexander.shishkin@...ux.intel.com,
 bigeasy@...utronix.de, clrkwllms@...nel.org, rostedt@...dmis.org
Cc: coresight@...ts.linaro.org, linux-arm-kernel@...ts.infradead.org,
 linux-kernel@...r.kernel.org, linux-rt-devel@...ts.linux.dev
Subject: Re: [PATCH v5 8/9] coresight-tmc: change tmc_drvdata spinlock's type
 to raw_spinlock_t

Hi Levi,

On 06/03/2025 09:47, Yeoreum Yun wrote:
> In coresight-tmc drivers, tmc_drvdata->spinlock can be held
> during __schedule() by perf_event_task_sched_out()/in().
> 
> Since tmc_drvdata->spinlock type is spinlock_t and
> perf_event_task_sched_out()/in() is called after acquiring rq_lock,
> which is raw_spinlock_t (an unsleepable lock),
> this poses an issue in PREEMPT_RT kernel where spinlock_t is sleepable.
> 
> To address this, change type tmc_drvdata->spinlock in coresight-tmc drivers,
> which can be called by perf_event_task_sched_out()/in(),
> from spinlock_t to raw_spinlock_t.
> 
> Reviewed-by: James Clark <james.clark@...aro.org>
> Reviewed-by: Mike Leach <mike.leach@...aro.org>
> Signed-off-by: Yeoreum Yun <yeoreum.yun@....com>


Unfortunately, this still doesn't cover the current coresight next 
branch. I get build errors as below :

"[PATCH] coresight-tmc: change tmc_drvdata spinlock's type to" has style 
problems, please review. This is because, we merged the coresight panic
trace support in the coresight next, on 21st Feb.


NOTE: If any of the errors are false positives, please report
       them to the maintainer, see CHECKPATCH in MAINTAINERS.
   CALL    scripts/checksyscalls.sh
   CC [M]  drivers/hwtracing/coresight/coresight-tmc-core.o
   CC [M]  drivers/hwtracing/coresight/coresight-tmc-etf.o
   CC [M]  drivers/hwtracing/coresight/coresight-tmc-etr.o
   CC [M]  drivers/hwtracing/coresight/coresight-catu.o
In file included from ./include/linux/mmzone.h:8,
                  from ./include/linux/gfp.h:7,
                  from ./include/linux/slab.h:16,
                  from ./include/linux/resource_ext.h:11,
                  from ./include/linux/acpi.h:13,
                  from drivers/hwtracing/coresight/coresight-tmc-core.c:7:
drivers/hwtracing/coresight/coresight-tmc-core.c: In function 
‘tmc_crashdata_open’:
drivers/hwtracing/coresight/coresight-tmc-core.c:361:20: error: passing 
argument 1 of ‘spinlock_check’ from incompatible pointer type 
[-Werror=incompatible-pointer-types]
   361 |  spin_lock_irqsave(&drvdata->spinlock, flags);
       |                    ^~~~~~~~~~~~~~~~~~
       |                    |
       |                    raw_spinlock_t * {aka struct raw_spinlock *}
./include/linux/spinlock.h:244:34: note: in definition of macro 
‘raw_spin_lock_irqsave’
   244 |   flags = _raw_spin_lock_irqsave(lock); \
       |                                  ^~~~
drivers/hwtracing/coresight/coresight-tmc-core.c:361:2: note: in 
expansion of macro ‘spin_lock_irqsave’
   361 |  spin_lock_irqsave(&drvdata->spinlock, flags);
       |  ^~~~~~~~~~~~~~~~~
In file included from ./include/linux/mmzone.h:8,
                  from ./include/linux/gfp.h:7,
                  from ./include/linux/slab.h:16,
                  from ./include/linux/resource_ext.h:11,
                  from ./include/linux/acpi.h:13,
                  from drivers/hwtracing/coresight/coresight-tmc-core.c:7:
./include/linux/spinlock.h:324:67: note: expected ‘spinlock_t *’ {aka 
‘struct spinlock *’} but argument is of type ‘raw_spinlock_t *’ {aka 
‘struct raw_spinlock *’}
   324 | static __always_inline raw_spinlock_t 
*spinlock_check(spinlock_t *lock)


Cheers
Suzuki


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ