linux-stable/arch
Michael Ellerman 0713298280 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 08:49:22 +02:00
..
alpha rtc: Add support for configuring the UIP timeout for RTC reads 2024-01-31 16:17:01 -08:00
arc ARC: [plat-hsdk]: Remove misplaced interrupt-cells property 2024-05-02 16:29:23 +02:00
arm ARM: spitz: fix GPIO assignment for backlight 2024-08-03 08:49:02 +02:00
arm64 arm64: dts: qcom: sm6350: Add missing qcom,non-secure-domain property 2024-08-03 08:49:02 +02:00
csky csky, hexagon: fix broken sys_sync_file_range 2024-07-05 09:31:57 +02:00
hexagon hexagon: fix fadvise64_64 calling conventions 2024-07-05 09:31:57 +02:00
ia64 ia64/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 20:03:46 +02:00
loongarch LoongArch: Fix callchain parse error with kernel tracepoint events again 2024-06-12 11:03:43 +02:00
m68k m68k: cmpxchg: Fix return value for default case in __arch_xchg() 2024-08-03 08:49:02 +02:00
microblaze microblaze: Remove early printk call from cpuinfo-static.c 2024-06-12 11:03:39 +02:00
mips MIPS: Octeron: remove source file executable bit 2024-08-03 08:49:22 +02:00
nios2 mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:16:25 +02:00
openrisc mm: always expand the stack with the mmap write lock held 2023-07-01 13:16:25 +02:00
parisc parisc: use generic sys_fanotify_mark implementation 2024-07-05 09:31:51 +02:00
powerpc powerpc/xmon: Fix disassembly CPU feature checks 2024-08-03 08:49:22 +02:00
riscv riscv: stacktrace: fix usage of ftrace_graph_ret_addr() 2024-07-25 09:49:19 +02:00
s390 s390/uv: Don't call folio_wait_writeback() without a folio reference 2024-08-03 08:49:12 +02:00
sh sh: rework sync_file_range ABI 2024-07-05 09:31:57 +02:00
sparc sparc64: Fix incorrect function signature and add prototype for prom_cif_init 2024-08-03 08:49:16 +02:00
um ubd: untagle discard vs write zeroes not support handling 2024-08-03 08:48:53 +02:00
x86 perf/x86/intel/cstate: Fix Alderlake/Raptorlake/Meteorlake 2024-08-03 08:49:07 +02:00
xtensa xtensa: fix MAKE_PC_FROM_RA second argument 2024-06-21 14:35:39 +02:00
.gitignore
Kconfig Revert "mm: mmap: allow for the maximum number of bits for randomizing mmap_base by default" 2024-06-27 13:46:24 +02:00