linux/arch/powerpc
Michael Ellerman 14196e47c5 powerpc/xmon: Fix disassembly CPU feature checks
In the xmon disassembly code there are several CPU feature checks to
determine what dialects should be passed to the disassembler. The
dialect controls which instructions the disassembler will recognise.

Unfortunately the checks are incorrect, because instead of passing a
single CPU feature they are passing a mask of feature bits.

For example the code:

  if (cpu_has_feature(CPU_FTRS_POWER5))
      dialect |= PPC_OPCODE_POWER5;

Is trying to check if the system is running on a Power5 CPU. But
CPU_FTRS_POWER5 is a mask of *all* the feature bits that are enabled on
a Power5.

In practice the test will always return true for any 64-bit CPU, because
at least one bit in the mask will be present in the CPU_FTRS_ALWAYS
mask.

Similarly for all the other checks against CPU_FTRS_xx masks.

Rather than trying to match the disassembly behaviour exactly to the
current CPU, just differentiate between 32-bit and 64-bit, and Altivec,
VSX and HTM.

That will cause some instructions to be shown in disassembly even
on a CPU that doesn't support them, but that's OK, objdump -d output
has the same behaviour, and if anything it's less confusing than some
instructions not being disassembled.

Fixes: 897f112bb4 ("[POWERPC] Import updated version of ppc disassembly code for xmon")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240509121248.270878-2-mpe@ellerman.id.au
2024-07-11 17:31:54 +10:00
..
boot powerpc/boot: Remove all 40x platforms from boot 2024-06-28 22:28:47 +10:00
configs powerpc/configs: Update defconfig with now user-visible CONFIG_FSL_IFC 2024-07-04 23:10:40 +10:00
crypto powerpc/crypto/chacha-p10: Fix failure on non Power10 2024-04-05 00:02:18 +11:00
include powerpc: Drop clang workaround for builtin constant checks 2024-07-11 17:31:44 +10:00
kernel powerpc/pci: Hotplug driver bridge support 2024-07-04 23:10:40 +10:00
kexec powerpc/kexec: Use of_property_read_reg() 2024-07-04 21:55:18 +10:00
kvm powerpc updates for 6.10 2024-05-17 09:05:46 -07:00
lib powerpc updates for 6.10 2024-05-17 09:05:46 -07:00
math-emu powerpc/math-emu: Inhibit W=1 warnings 2022-09-08 11:11:18 +10:00
mm powerpc/64s/radix/kfence: map __kfence_pool at page granularity 2024-07-04 21:55:18 +10:00
net powerpc64/bpf: jit support for signed division and modulo 2024-07-11 15:40:21 +10:00
perf powerpc/perf: Set cpumode flags using sample address 2024-06-17 22:47:16 +10:00
platforms powerpc: add missing MODULE_DESCRIPTION() macros 2024-07-04 22:39:20 +10:00
purgatory Makefile: remove redundant tool coverage variables 2024-05-14 23:35:48 +09:00
sysdev powerpc: add missing MODULE_DESCRIPTION() macros 2024-07-04 22:39:20 +10:00
tools powerpc/tools: Pass -mabi=elfv2 to gcc-check-mprofile-kernel.sh 2023-10-20 17:46:33 +11:00
xmon powerpc/xmon: Fix disassembly CPU feature checks 2024-07-11 17:31:54 +10:00
Kbuild powerpc: Fix fatal warnings flag for LLVM's integrated assembler 2024-04-08 16:06:41 +10:00
Kconfig powerpc: Replace CONFIG_4xx with CONFIG_44x 2024-06-28 22:28:48 +10:00
Kconfig.debug powerpc: Remove 40x from Kconfig and defconfig 2024-06-28 22:28:47 +10:00
Makefile powerpc: Remove 40x from Kconfig and defconfig 2024-06-28 22:28:47 +10:00
Makefile.postlink kbuild: remove ARCH_POSTLINK from module builds 2023-10-28 21:10:08 +09:00