lkml.org 
[lkml]   [2022]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] riscv: VMAP_STACK overflow detection thread-safe
On Thu, Nov 24, 2022 at 12:26:12AM -0800, Deepak Gupta wrote:
>On Thu, Nov 24, 2022 at 09:32:19AM +0800, Guo Ren wrote:
>>>+.macro asm_per_cpu dst sym tmp
>>>+ REG_L \tmp, TASK_TI_CPU_NUM(tp)
>>>+ slli \tmp, \tmp, 0x3
>>>+ la \dst, __per_cpu_offset
>>>+ add \dst, \dst, \tmp
>>>+ REG_L \tmp, 0(\dst)
>>>+ la \dst, \sym
>>>+ add \dst, \dst, \tmp
>>Another tricky asm code of using percpu, I don't know how the percpu
>>maintenance guy thinks.
>
>On this, if you can point me to someone, I would like to get their feedback.
>While discussing this, one issue that comes in my mind is if the shift
>of 0x3 is correct or not on 32bit systems. I don't know what's the
>size of each entry
>in `__per_cpu_offset`. On 64bit it's 8 bytes and thus 3 bit shift.

Yes this would need a fix for 32bit.
`__per_cpu_offset` is an array of `unsigned long` and thus shift should be 2 bit
on 32bit systems.

\
 
 \ /
  Last update: 2022-11-24 10:08    [W:0.072 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site