On Mon, Mar 27, 2023 at 09:32:51PM +0800, Guo Ren wrote: > On Mon, Mar 27, 2023 at 7:30 PM Conor Dooley <conor.dooley@xxxxxxxxxxxxx> wrote: > > > > On Fri, Mar 24, 2023 at 03:12:37AM -0400, guoren@xxxxxxxxxx wrote: > > > From: Guo Ren <guoren@xxxxxxxxxxxxxxxxx> > > > > > > Add independent irq stacks for percpu to prevent kernel stack overflows. > > > It is also compatible with VMAP_STACK by implementing > > > arch_alloc_vmap_stack. Many architectures have supported > > > HAVE_IRQ_EXIT_ON_IRQ_STACK, riscv should follow up. > > > > > > Tested-by: Jisheng Zhang <jszhang@xxxxxxxxxx> > > > Signed-off-by: Guo Ren <guoren@xxxxxxxxxxxxxxxxx> > > > Signed-off-by: Guo Ren <guoren@xxxxxxxxxx> > > > > > --- a/arch/riscv/kernel/irq.c > > > +++ b/arch/riscv/kernel/irq.c > > > @@ -9,6 +9,37 @@ > > > #include <linux/irqchip.h> > > > #include <linux/seq_file.h> > > > #include <asm/smp.h> > > > +#include <asm/vmap_stack.h> > > > + > > > +#ifdef CONFIG_IRQ_STACKS > > > +DEFINE_PER_CPU(ulong *, irq_stack_ptr); > > > > btw, sparse is complaining about this variable: > > ../arch/riscv/kernel/irq.c:15:1: warning: symbol '__pcpu_scope_irq_stack_ptr' was not declared. Should it be static? > I declared it in traps.c, maybe I should put it in the vmap_stack.h. Ahh, I was distracted by the DEFINE_PER_CPU above and didn't look at where the actual declaration was.. Moving it to a header sounds good to me, thanks.
Attachment:
signature.asc
Description: PGP signature