Skip to content

kexec, panic: Making crash_kexec() NMI safe

Valentin Schneider kexec linux-rt-users lkml 2 versions Applied

Status from this message: [merged mm-nonmm-stable] panic-kexec-make-__crash_kexec-nmi-safe.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 6 repliesApplied 2/2
  2. v32 patches 0 repliesSuperseded

Changes in v4 from the cover letter

++++++++

o Someone forgot to Cc LKML on v3...

Patches in v4 All 2 applied

#Subject and filesSizeRepliesApplied
1/2kexec: Turn all kexec_mutex acquisitions into trylocksinclude/linux/kexec.h kernel/kexec_core.c kernel/ksysfs.c+15 -60 repliesApplied
2/2panic, kexec: Make __crash_kexec() NMI safekernel/kexec.c kernel/kexec_core.c kernel/kexec_file.c +1 more+30 -200 repliesApplied

Reviews trailers per patch

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

PatchPetr Mladek
SeriesR-b
1/2
2/2

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

Read the v4 thread

Cover letter [PATCH v4 0/2] kexec, panic: Making crash_kexec() NMI safe

Hi folks,

Here's ~v3~ v4 where we now completely get rid of kexec_mutex.

o Patch 1 makes sure all kexec_mutex acquisitions are trylocks. This prevents having to add any while(atomic_cmpxchg()) loops which I'd really hate to see here. If that can't be done then I think we're better off with the combined mutex+atomic var approach.
o Patch 2 does the mutex -> atomic var switch.

Revisions
=========

v3 -> v4
++++++++

o Someone forgot to Cc LKML on v3...

v2 -> v3
++++++++

o Dropped kexec_mutex entirely and made the atomic variable the one true lock for kexec (Eric)

v1 -> v2
++++++++

o Changed from Peterson-like synchronization to simpler atomic_cmpxchg (Petr)
o Slightly reworded changelog
o Added Fixes: tag. Technically should be up to since kexec can happen in an NMI, but that isn't such a clear target

Cheers,
Valentin

Valentin Schneider (2):
kexec: Turn all kexec_mutex acquisitions into trylocks panic, kexec: Make __crash_kexec() NMI safe

 include/linux/kexec.h   |  2 +-
 kernel/kexec.c          | 11 ++++-------
 kernel/kexec_core.c     | 28 ++++++++++++++++------------
 kernel/kexec_file.c     |  4 ++--
 kernel/kexec_internal.h | 15 ++++++++++++++-
 kernel/ksysfs.c         |  7 ++++++-
 6 files changed, 43 insertions(+), 24 deletions(-)

--
2.31.1