linux-stable/arch/powerpc
Christophe Leroy c8a6d91005 powerpc/non-smp: Unconditionaly call smp_mb() on switch_mm
Commit 3ccfebedd8 ("powerpc, membarrier: Skip memory barrier in
switch_mm()") added some logic to skip the smp_mb() in
switch_mm_irqs_off() before the call to switch_mmu_context().

However, on non SMP smp_mb() is just a compiler barrier and doing
it unconditionaly is simpler than the logic used to check whether the
barrier is needed or not.

After the patch:

00000000 <switch_mm_irqs_off>:
...
   c:	7c 04 18 40 	cmplw   r4,r3
  10:	81 24 00 24 	lwz     r9,36(r4)
  14:	91 25 04 c8 	stw     r9,1224(r5)
  18:	4d 82 00 20 	beqlr
  1c:	48 00 00 00 	b       1c <switch_mm_irqs_off+0x1c>
			1c: R_PPC_REL24	switch_mmu_context

Before the patch:

00000000 <switch_mm_irqs_off>:
...
   c:	7c 04 18 40 	cmplw   r4,r3
  10:	81 24 00 24 	lwz     r9,36(r4)
  14:	91 25 04 c8 	stw     r9,1224(r5)
  18:	4d 82 00 20 	beqlr
  1c:	81 24 00 28 	lwz     r9,40(r4)
  20:	71 29 00 0a 	andi.   r9,r9,10
  24:	40 82 00 34 	bne     58 <switch_mm_irqs_off+0x58>
  28:	48 00 00 00 	b       28 <switch_mm_irqs_off+0x28>
			28: R_PPC_REL24	switch_mmu_context
...
  58:	2c 03 00 00 	cmpwi   r3,0
  5c:	41 82 ff cc 	beq     28 <switch_mm_irqs_off+0x28>
  60:	48 00 00 00 	b       60 <switch_mm_irqs_off+0x60>
			60: R_PPC_REL24	switch_mmu_context

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/e9d501da0c59f60ca767b1b3ea4603fce6d02b9e.1625486440.git.christophe.leroy@csgroup.eu
2021-08-10 23:14:55 +10:00
..
boot powerpc: move the install rule to arch/powerpc/Makefile 2021-08-04 10:53:39 +10:00
configs TTY / Serial patches for 5.14-rc1 2021-07-05 14:08:24 -07:00
crypto crypto: powepc/sha1 - remove unneeded semicolon 2021-03-07 15:13:14 +11:00
include powerpc/non-smp: Unconditionaly call smp_mb() on switch_mm 2021-08-10 23:14:55 +10:00
kernel powerpc/smp: Use existing L2 cache_map cpumask to find L3 cache siblings 2021-08-04 10:53:39 +10:00
kexec powerpc/kexec: blacklist functions called in real mode for kprobe 2021-07-26 20:38:51 +10:00
kvm KVM: PPC: Book3S HV Nested: Sanitise H_ENTER_NESTED TM state 2021-07-23 16:19:38 +10:00
lib powerpc: Only build restart_table.c for 64s 2021-07-01 22:50:54 +10:00
math-emu powerpc/64s: avoid reloading (H)SRR registers if they are still valid 2021-06-25 00:06:55 +10:00
mm powerpc/kexec: blacklist functions called in real mode for kprobe 2021-07-26 20:38:51 +10:00
net powerpc/bpf: Reject atomic ops in ppc32 JIT 2021-07-05 22:23:25 +10:00
perf powerpc/64s/perf: Always use SIAR for kernel interrupts 2021-08-04 10:53:39 +10:00
platforms powerpc/kexec: blacklist functions called in real mode for kprobe 2021-07-26 20:38:51 +10:00
purgatory powerpc/kexec: Don't use .machine ppc64 in trampoline_64.S 2021-04-08 21:17:43 +10:00
sysdev powerpc/xive: Fix error handling when allocating an IPI 2021-07-05 22:23:25 +10:00
tools
xmon powerpc updates for 5.14 2021-07-02 12:54:34 -07:00
Kbuild
Kconfig powerpc updates for 5.14 2021-07-02 12:54:34 -07:00
Kconfig.debug powerpc: Make PPC_IRQ_SOFT_MASK_DEBUG depend on PPC64 2021-06-25 00:07:09 +10:00
Makefile powerpc: move the install rule to arch/powerpc/Makefile 2021-08-04 10:53:39 +10:00
Makefile.postlink