Merge patch "drivers: perf: Do not broadcast to other cpus when starting a counter"
authorPalmer Dabbelt <palmer@rivosinc.com>
Thu, 9 Nov 2023 14:44:13 +0000 (06:44 -0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 9 Nov 2023 14:44:13 +0000 (06:44 -0800)
This is really just a single patch, but since the offending fix hasn't
yet made it to my for-next I'm merging it here.

Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1  2 
arch/riscv/Makefile
arch/riscv/kernel/irq.c
arch/riscv/kernel/setup.c
arch/riscv/kernel/signal.c
arch/riscv/kernel/traps.c
drivers/perf/riscv_pmu_sbi.c

Simple merge
@@@ -79,23 -60,41 +79,23 @@@ static void init_irq_stacks(void
  }
  #endif /* CONFIG_VMAP_STACK */
  
- #ifdef CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK
+ #ifdef CONFIG_SOFTIRQ_ON_OWN_STACK
 +static void ___do_softirq(struct pt_regs *regs)
 +{
 +      __do_softirq();
 +}
 +
  void do_softirq_own_stack(void)
  {
 -#ifdef CONFIG_IRQ_STACKS
 -      if (on_thread_stack()) {
 -              ulong *sp = per_cpu(irq_stack_ptr, smp_processor_id())
 -                                      + IRQ_STACK_SIZE/sizeof(ulong);
 -              __asm__ __volatile(
 -              "addi   sp, sp, -"RISCV_SZPTR  "\n"
 -              REG_S"  ra, (sp)                \n"
 -              "addi   sp, sp, -"RISCV_SZPTR  "\n"
 -              REG_S"  s0, (sp)                \n"
 -              "addi   s0, sp, 2*"RISCV_SZPTR "\n"
 -              "move   sp, %[sp]               \n"
 -              "call   __do_softirq            \n"
 -              "addi   sp, s0, -2*"RISCV_SZPTR"\n"
 -              REG_L"  s0, (sp)                \n"
 -              "addi   sp, sp, "RISCV_SZPTR   "\n"
 -              REG_L"  ra, (sp)                \n"
 -              "addi   sp, sp, "RISCV_SZPTR   "\n"
 -              :
 -              : [sp] "r" (sp)
 -              : "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7",
 -                "t0", "t1", "t2", "t3", "t4", "t5", "t6",
 -#ifndef CONFIG_FRAME_POINTER
 -                "s0",
 -#endif
 -                "memory");
 -      } else
 -#endif
 +      if (on_thread_stack())
 +              call_on_irq_stack(NULL, ___do_softirq);
 +      else
                __do_softirq();
  }
- #endif /* CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK */
+ #endif /* CONFIG_SOFTIRQ_ON_OWN_STACK */
  
  #else
 +static void init_irq_scs(void) {}
  static void init_irq_stacks(void) {}
  #endif /* CONFIG_IRQ_STACKS */
  
Simple merge
Simple merge
Simple merge
Simple merge