android_kernel_motorola_sm6375/arch/powerpc
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Michael Ellerman 0b4eb172cc powerpc/64s: Fix crashes when toggling entry flush barrier
commit aec86b052df6541cc97c5fca44e5934cbea4963b upstream.

The entry flush mitigation can be enabled/disabled at runtime via a
debugfs file (entry_flush), which causes the kernel to patch itself to
enable/disable the relevant mitigations.

However depending on which mitigation we're using, it may not be safe to
do that patching while other CPUs are active. For example the following
crash:

  sleeper[15639]: segfault (11) at c000000000004c20 nip c000000000004c20 lr c000000000004c20

Shows that we returned to userspace with a corrupted LR that points into
the kernel, due to executing the partially patched call to the fallback
entry flush (ie. we missed the LR restore).

Fix it by doing the patching under stop machine. The CPUs that aren't
doing the patching will be spinning in the core of the stop machine
logic. That is currently sufficient for our purposes, because none of
the patching we do is to that code or anywhere in the vicinity.

Fixes: f79643787e0a ("powerpc/64s: flush L1D on kernel entry")
Cc: stable@vger.kernel.org # v5.10+
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210506044959.1298123-2-mpe@ellerman.id.au
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-19 10:08:29 +02:00
..
boot
configs vgacon: remove software scrollback support 2020-09-17 13:47:54 +02:00
crypto
include powerpc/64s: Fix pte update for kernel memory on radix 2021-05-14 09:44:27 +02:00
kernel powerpc/iommu: Annotate nested lock for lockdep 2021-05-19 10:08:24 +02:00
kvm KVM: PPC: Book3S HV P9: Restore host CTRL SPR after guest exit 2021-05-14 09:44:28 +02:00
lib powerpc/64s: Fix crashes when toggling entry flush barrier 2021-05-19 10:08:29 +02:00
math-emu
mm powerpc/64s: Fix pte update for kernel memory on radix 2021-05-14 09:44:27 +02:00
net
oprofile
perf powerpc/perf: Fix PMU constraint check for EBB events 2021-05-14 09:44:28 +02:00
platforms powerpc/pseries: Stop calling printk in rtas_stop_self() 2021-05-19 10:08:23 +02:00
purgatory
sysdev powerpc/xive: Fix xmon command "dxi" 2021-05-14 09:44:29 +02:00
tools
xmon powerpc/xmon: Change printk() to pr_cont() 2020-12-30 11:51:39 +01:00
Kbuild
Kconfig powerpc: Fix HAVE_HARDLOCKUP_DETECTOR_ARCH build configuration 2021-05-14 09:44:26 +02:00
Kconfig.debug powerpc: iommu: fix build when neither PCI or IBMVIO is set 2021-05-14 09:44:28 +02:00
Makefile powerpc: Drop -me200 addition to build flags 2020-12-16 10:56:55 +01:00
Makefile.postlink