Skip to content

powerpc: fix preempt_count imbalances in perf and kexec paths

Aboorva Devarajan linuxppc-dev lkml 3 versions – Applied

Status from this message: Applied to powerpc/next.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 3 repliesApplied
  2. v23 patches 0 repliesSuperseded
  3. v13 patches 9 repliesSuperseded

Changes in v3 from the cover letter

- Patches 2 and 3: use raw_smp_processor_id() instead of smp_processor_id(). Both paths run with interrupts disabled, so the plain accessor is sufficient.

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/3powerpc/perf: fix preempt count underflow in fsl_emb_pmu_delarch/powerpc/perf/core-fsl-emb.c+2 -10 replies
2/3powerpc/powernv: fix preempt count leak in pnv_kexec_wait_secondaries_downarch/powerpc/platforms/powernv/setup.c+2 -10 replies
3/3powerpc/kexec: fix double get_cpu() imbalance in kexec_prepare_cpusarch/powerpc/kexec/core_64.c+1 -31 reply

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchShrikanth HegdeRitesh Harjani (IBM)
SeriesR-b
1/3R-b
2/3
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/3] powerpc: fix preempt_count imbalances in perf and kexec paths

Hi all,

This patch series fixes some minor preempt_count bookkeeping issues in arch/powerpc/ found during a preemption leak audit prompted by the lazy/full preemption model changes. These are get_cpu/put_cpu and get_cpu_var/put_cpu_var pairing errors that leave preempt_count incorrectly elevated or underflowed.

v2 -> v3:
- Patches 2 and 3: use raw_smp_processor_id() instead of smp_processor_id(). Both paths run with interrupts disabled, so the plain accessor is sufficient.

v2: https://lore.kernel.org/all/[email protected]/

v1: https://lore.kernel.org/all/[email protected]/

Testing:
- Patches 2 and 3: kexec boot-tested on PowerNV (powernv_defconfig) and pseries (pseries_defconfig).
- Patch 1: compile-tested only (ppc64e_defconfig + CONFIG_FSL_EMB_PERFMON); no e500/fsl_emb hardware to runtime-test.

Please let me know your comments.

Thanks,
Aboorva

Aboorva Devarajan (3):
powerpc/perf: fix preempt count underflow in fsl_emb_pmu_del powerpc/powernv: fix preempt count leak in
pnv_kexec_wait_secondaries_down
powerpc/kexec: fix double get_cpu() imbalance in kexec_prepare_cpus

 arch/powerpc/kexec/core_64.c           | 4 +---
 arch/powerpc/perf/core-fsl-emb.c       | 3 ++-
 arch/powerpc/platforms/powernv/setup.c | 3 ++-
 3 files changed, 5 insertions(+), 5 deletions(-)

base-commit: 03da3bc22934393e1dcc63ed3c50457b6d7e345e

Signature · 1 line
2.54.0