linux-stable/arch/powerpc
Michael Ellerman fef071be57 powerpc/dcr: Use cmplwi instead of 3-argument cmpli
In dcr-low.S we use cmpli with three arguments, instead of four
arguments as defined in the ISA:

	cmpli	cr0,r3,1024

This appears to be a PPC440-ism, looking at the "PPC440x5 CPU Core
User’s Manual" it shows cmpli having no L field, but implied to be 0 due
to the core being 32-bit. It mentions that the ISA defines four
arguments and recommends using cmplwi.

It also corresponds to the old POWER instruction set, which had no L
field there, a reserved bit instead.

dcr-low.S is only built 32-bit, because it is only built when
DCR_NATIVE=y, which is only selected by 40x and 44x. Looking at the
generated code (with gcc/gas) we see cmplwi as expected.

Although gas is happy with the 3-argument version when building for
32-bit, the LLVM assembler is not and errors out with:

  arch/powerpc/sysdev/dcr-low.S:27:10: error: invalid operand for instruction
   cmpli 0,%r3,1024; ...
           ^

Switch to the cmplwi extended opcode, which avoids any confusion when
reading the ISA, fixes the issue with the LLVM assembler, and also means
the code could be built 64-bit in future (though that's very unlikely).

Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
BugLink: https://github.com/ClangBuiltLinux/linux/issues/1419
Link: https://lore.kernel.org/r/20211014024424.528848-1-mpe@ellerman.id.au
2021-10-28 22:29:25 +11:00
..
boot powerpc/boot: Set LC_ALL=C in wrapper script 2021-10-27 22:31:22 +11:00
configs powerpc/64s: Default to 64K pages for 64 bit book3s 2021-10-27 22:31:22 +11:00
crypto crypto: powepc/sha1 - remove unneeded semicolon 2021-03-07 15:13:14 +11:00
include powerpc/book3e: Fix set_memory_x() and set_memory_nx() 2021-10-28 00:41:29 +11:00
kernel powerpc/64s/interrupt: Fix check_return_regs_valid() false positive 2021-10-27 22:33:47 +11:00
kexec powerpc/machdep: Remove stale functions from ppc_md structure 2021-10-22 15:22:05 +11:00
kvm powerpc/asm: Remove UPD_CONSTR after GCC 4.9 removal 2021-10-09 00:15:59 +11:00
lib powerpc/security: Use a mutex for interrupt exit code patching 2021-10-28 17:23:58 +11: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/fsl_booke: Fix setting of exec flag when setting TLBCAMs 2021-10-28 00:41:29 +11:00
net powerpc/bpf: Fix write protecting JIT code 2021-10-28 00:08:32 +11:00
perf powerpc/perf: Fix cycles/instructions as PM_CYC/PM_INST_CMPL in power10 2021-10-14 21:46:45 +11:00
platforms powerpc/83xx/mpc8349emitx: Make mcu_gpiochip_remove() return void 2021-10-28 00:41:29 +11:00
purgatory powerpc/kexec: Don't use .machine ppc64 in trampoline_64.S 2021-04-08 21:17:43 +10:00
sysdev powerpc/dcr: Use cmplwi instead of 3-argument cmpli 2021-10-28 22:29:25 +11:00
tools powerpc/head_check: Fix shellcheck errors 2021-08-17 22:52:02 +10:00
xmon powerpc: Refactor verification of MSR_RI 2021-08-26 21:21:07 +10:00
Kbuild
Kconfig powerpc/64s: Default to 64K pages for 64 bit book3s 2021-10-27 22:31:22 +11:00
Kconfig.debug powerpc/ptdump: Convert powerpc to GENERIC_PTDUMP 2021-08-25 13:35:48 +10:00
Makefile powerpc: Add "-z notext" flag to disable diagnostic 2021-08-15 13:49:39 +10:00
Makefile.postlink