lkml.org 
[lkml]   [2023]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2] riscv: VMAP_STACK overflow detection thread-safe
On Thu, Jul 20, 2023 at 8:10 AM Guo Ren <guoren@kernel.org> wrote:
>
> On Thu, Nov 24, 2022 at 5:48 PM Deepak Gupta <debug@rivosinc.com> wrote:
> > +.macro asm_per_cpu dst sym tmp
> > + REG_L \tmp, TASK_TI_CPU_NUM(tp)
> > + slli \tmp, \tmp, PER_CPU_OFFSET_SHIFT
> > + la \dst, __per_cpu_offset
> > + add \dst, \dst, \tmp
> > + REG_L \tmp, 0(\dst)
> > + la \dst, \sym
> > + add \dst, \dst, \tmp
> > +.endm
> It's a tricky implementation, and we can't maintain it here because it
> depends on percpu design.

I can certainly understand this concern, but AFAICT this part of the
percpu code hasn't changed in ~14 years, so adding an assembly macro
for the computation shouldn't be a huge maintenance burden. arm64 also
performs a similar computation in assembly (starting with commit
3d8c1a013d78) and I don't see their implementation needing constant
maintenance since then.

Sami

\
 
 \ /
  Last update: 2023-07-24 19:04    [W:0.110 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site