powerpc: Use a datatype for instructions
authorJordan Niethe <jniethe5@gmail.com>
Wed, 6 May 2020 03:40:31 +0000 (13:40 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 18 May 2020 14:10:37 +0000 (00:10 +1000)
commit94afd069d937d84fb4f696eb9a78db4084e43d21
tree88f3f2fef60d56cd3b155762c378ac1fc05a5bd2
parent217862d9b98bf08958d57fd7b31b9de0f1a9477d
powerpc: Use a datatype for instructions

Currently unsigned ints are used to represent instructions on powerpc.
This has worked well as instructions have always been 4 byte words.

However, ISA v3.1 introduces some changes to instructions that mean
this scheme will no longer work as well. This change is Prefixed
Instructions. A prefixed instruction is made up of a word prefix
followed by a word suffix to make an 8 byte double word instruction.
No matter the endianness of the system the prefix always comes first.
Prefixed instructions are only planned for powerpc64.

Introduce a ppc_inst type to represent both prefixed and word
instructions on powerpc64 while keeping it possible to exclusively
have word instructions on powerpc32.

Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
[mpe: Fix compile error in emulate_spe()]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200506034050.24806-12-jniethe5@gmail.com
26 files changed:
arch/powerpc/include/asm/code-patching.h
arch/powerpc/include/asm/inst.h
arch/powerpc/include/asm/sstep.h
arch/powerpc/include/asm/uprobes.h
arch/powerpc/kernel/align.c
arch/powerpc/kernel/crash_dump.c
arch/powerpc/kernel/epapr_paravirt.c
arch/powerpc/kernel/hw_breakpoint.c
arch/powerpc/kernel/jump_label.c
arch/powerpc/kernel/kgdb.c
arch/powerpc/kernel/kprobes.c
arch/powerpc/kernel/mce_power.c
arch/powerpc/kernel/optprobes.c
arch/powerpc/kernel/setup_32.c
arch/powerpc/kernel/trace/ftrace.c
arch/powerpc/kernel/vecemu.c
arch/powerpc/lib/code-patching.c
arch/powerpc/lib/feature-fixups.c
arch/powerpc/lib/sstep.c
arch/powerpc/lib/test_emulate_step.c
arch/powerpc/mm/fault.c
arch/powerpc/perf/core-book3s.c
arch/powerpc/platforms/86xx/mpc86xx_smp.c
arch/powerpc/platforms/powermac/smp.c
arch/powerpc/xmon/xmon.c
arch/powerpc/xmon/xmon_bpts.h