All of lore.kernel.org
 help / color / mirror / Atom feed
* Bug report: cpu_relax call from vdso space
@ 2022-10-15  7:08 Denis Ivanov
  2022-10-17 17:54 ` Atish Patra
  2022-10-18 14:19 ` Jisheng Zhang
  0 siblings, 2 replies; 5+ messages in thread
From: Denis Ivanov @ 2022-10-15  7:08 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou; +Cc: Dao Lu, linux-riscv

Hello,

Segmentation fault may be raised from cpu_relax() 
(arch/riscv/include/asm/vdso/processor.h).

cpu_relax() may be called from vDSO functions (ex: 
__vdso_clock_gettime). This means that global 'riscv_isa_ext_keys' 
variable must not be used in cpu_relax() directly.

Use of this array was added to cpu_relax() in
https://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git/commit/?h=fixes&id=8eb060e10185cfc97ef0200d197ec246ba0f9f8c

Denis Ivanov


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Bug report: cpu_relax call from vdso space
  2022-10-15  7:08 Bug report: cpu_relax call from vdso space Denis Ivanov
@ 2022-10-17 17:54 ` Atish Patra
  2022-10-18  8:37   ` Denis Ivanov
  2022-10-18 14:19 ` Jisheng Zhang
  1 sibling, 1 reply; 5+ messages in thread
From: Atish Patra @ 2022-10-17 17:54 UTC (permalink / raw)
  To: Denis Ivanov
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Dao Lu, linux-riscv

On Sat, Oct 15, 2022 at 12:09 AM Denis Ivanov <denis.ivanov@cloudbear.ru> wrote:
>
> Hello,
>
> Segmentation fault may be raised from cpu_relax()
> (arch/riscv/include/asm/vdso/processor.h).
>
> cpu_relax() may be called from vDSO functions (ex:
> __vdso_clock_gettime). This means that global 'riscv_isa_ext_keys'
> variable must not be used in cpu_relax() directly.
>
> Use of this array was added to cpu_relax() in
> https://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git/commit/?h=fixes&id=8eb060e10185cfc97ef0200d197ec246ba0f9f8c
>

Thanks. We saw some other issues with the static key in cpu_relax path as well.

https://lore.kernel.org/linux-riscv/20220922060958.44203-1-samuel@sholland.org/

We may remove the static key altogether from that path.

> Denis Ivanov
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv



-- 
Regards,
Atish

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Bug report: cpu_relax call from vdso space
  2022-10-17 17:54 ` Atish Patra
@ 2022-10-18  8:37   ` Denis Ivanov
  0 siblings, 0 replies; 5+ messages in thread
From: Denis Ivanov @ 2022-10-18  8:37 UTC (permalink / raw)
  To: Atish Patra; +Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Dao Lu, linux-riscv

That sounds reasonable. Thanks.

10/17/2022 8:54 PM, Atish Patra пишет:
> On Sat, Oct 15, 2022 at 12:09 AM Denis Ivanov <denis.ivanov@cloudbear.ru> wrote:
>> Hello,
>>
>> Segmentation fault may be raised from cpu_relax()
>> (arch/riscv/include/asm/vdso/processor.h).
>>
>> cpu_relax() may be called from vDSO functions (ex:
>> __vdso_clock_gettime). This means that global 'riscv_isa_ext_keys'
>> variable must not be used in cpu_relax() directly.
>>
>> Use of this array was added to cpu_relax() in
>> https://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git/commit/?h=fixes&id=8eb060e10185cfc97ef0200d197ec246ba0f9f8c
>>
> Thanks. We saw some other issues with the static key in cpu_relax path as well.
>
> https://lore.kernel.org/linux-riscv/20220922060958.44203-1-samuel@sholland.org/
>
> We may remove the static key altogether from that path.
>
>> Denis Ivanov
>>
>>
>> _______________________________________________
>> linux-riscv mailing list
>> linux-riscv@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-riscv
>
>

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Bug report: cpu_relax call from vdso space
  2022-10-15  7:08 Bug report: cpu_relax call from vdso space Denis Ivanov
  2022-10-17 17:54 ` Atish Patra
@ 2022-10-18 14:19 ` Jisheng Zhang
  2022-10-18 16:14   ` Denis Ivanov
  1 sibling, 1 reply; 5+ messages in thread
From: Jisheng Zhang @ 2022-10-18 14:19 UTC (permalink / raw)
  To: Denis Ivanov
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Dao Lu, linux-riscv

On Sat, Oct 15, 2022 at 10:08:55AM +0300, Denis Ivanov wrote:
> Hello,
> 
> Segmentation fault may be raised from cpu_relax()
> (arch/riscv/include/asm/vdso/processor.h).
> 
> cpu_relax() may be called from vDSO functions (ex: __vdso_clock_gettime).
> This means that global 'riscv_isa_ext_keys' variable must not be used in
> cpu_relax() directly.

Hi,

Could you please share how to reproduce the Segment fault with
cpu_relax()? 

Thanks

> 
> Use of this array was added to cpu_relax() in
> https://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git/commit/?h=fixes&id=8eb060e10185cfc97ef0200d197ec246ba0f9f8c
> 
> Denis Ivanov
> 
> 
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Bug report: cpu_relax call from vdso space
  2022-10-18 14:19 ` Jisheng Zhang
@ 2022-10-18 16:14   ` Denis Ivanov
  0 siblings, 0 replies; 5+ messages in thread
From: Denis Ivanov @ 2022-10-18 16:14 UTC (permalink / raw)
  To: Jisheng Zhang
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Dao Lu, linux-riscv

I debugged segmentation fault after nightly regression fails on LTP test 
inotify09 
(https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/inotify/inotify09.c).
In kernel call sequence is following:
__vdso_clock_gettime -> __cvdso_clock_gettime -> 
__cvdso_clock_gettime_data -> __cvdso_clock_gettime_common -> do_hres -> 
cpu_relax

10/18/2022 5:19 PM, Jisheng Zhang пишет:
> On Sat, Oct 15, 2022 at 10:08:55AM +0300, Denis Ivanov wrote:
>> Hello,
>>
>> Segmentation fault may be raised from cpu_relax()
>> (arch/riscv/include/asm/vdso/processor.h).
>>
>> cpu_relax() may be called from vDSO functions (ex: __vdso_clock_gettime).
>> This means that global 'riscv_isa_ext_keys' variable must not be used in
>> cpu_relax() directly.
> Hi,
>
> Could you please share how to reproduce the Segment fault with
> cpu_relax()?
>
> Thanks
>
>> Use of this array was added to cpu_relax() in
>> https://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git/commit/?h=fixes&id=8eb060e10185cfc97ef0200d197ec246ba0f9f8c
>>
>> Denis Ivanov
>>
>>
>> _______________________________________________
>> linux-riscv mailing list
>> linux-riscv@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-riscv

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-10-18 16:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-15  7:08 Bug report: cpu_relax call from vdso space Denis Ivanov
2022-10-17 17:54 ` Atish Patra
2022-10-18  8:37   ` Denis Ivanov
2022-10-18 14:19 ` Jisheng Zhang
2022-10-18 16:14   ` Denis Ivanov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.