linux/arch/powerpc
Michael Ellerman dd47993372 powerpc/xmon: Fix disassembly CPU feature checks
[ Upstream commit 14196e47c5 ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-08-03 09:00:17 +02:00
..
boot Kbuild updates for v6.10 2024-05-18 12:39:20 -07:00
configs printk changes for 6.10 2024-05-15 12:34:46 -07:00
crypto powerpc/crypto: Add generated P8 asm to .gitignore 2024-06-04 17:45:46 +10:00
include powerpc/uaccess: Use YZ asm constraint for ld 2024-05-30 22:57:27 +10:00
kernel powerpc/prom: Add CPU info to hardware description string later 2024-08-03 09:00:12 +02:00
kexec powerpc/kexec_file: fix cpus node update to FDT 2024-08-03 09:00:09 +02:00
kvm KVM: PPC: Book3S HV: Fix the get_one_reg of SDAR 2024-08-03 09:00:08 +02:00
lib powerpc updates for 6.10 2024-05-17 09:05:46 -07:00
math-emu
mm The usual shower of singleton fixes and minor series all over MM, 2024-05-19 09:21:03 -07:00
net powerpc/bpf: enforce full ordering for ATOMIC operations with BPF_FETCH 2024-05-29 22:12:42 +10:00
perf driver core: Add device_show_string() helper for sysfs attributes 2024-05-04 17:37:03 +02:00
platforms powerpc/pseries: Fix scv instruction crash with kexec 2024-06-28 22:05:44 +10:00
purgatory Makefile: remove redundant tool coverage variables 2024-05-14 23:35:48 +09:00
sysdev powerpc: Fix typos 2024-05-08 00:21:30 +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-08-03 09:00:17 +02:00
Kbuild powerpc: Fix fatal warnings flag for LLVM's integrated assembler 2024-04-08 16:06:41 +10:00
Kconfig powerpc: Limit ARCH_HAS_KERNEL_FPU_SUPPORT to PPC64 2024-05-30 22:57:27 +10:00
Kconfig.debug powerpc/ps3: move udbg_shutdown_ps3gelic prototype 2023-11-21 12:06:50 +11:00
Makefile powerpc: implement ARCH_HAS_KERNEL_FPU_SUPPORT 2024-05-19 14:36:18 -07:00
Makefile.postlink kbuild: remove ARCH_POSTLINK from module builds 2023-10-28 21:10:08 +09:00