powerpc/xmon: Check cpu id in commands "c#", "dp#" and "dx#"
authorGreg Kurz <groug@kaod.org>
Tue, 9 Mar 2021 18:11:10 +0000 (19:11 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 7 May 2024 14:48:32 +0000 (00:48 +1000)
commit8873aab8646194a4446117bb617cc71bddda2dee
tree6e8a30f0fb3726c755cf9a45e2dd1f3268f0dbd0
parentc3710ee7cd695dc1b0b4b8cfbf464e313467f970
powerpc/xmon: Check cpu id in commands "c#", "dp#" and "dx#"

All these commands end up peeking into the PACA using the user
originated cpu id as an index. Check the cpu id is valid in order
to prevent xmon to crash. Instead of printing an error, this follows
the same behavior as the "lp s #" command : ignore the buggy cpu id
parameter and fall back to the #-less version of the command.

Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/161531347060.252863.10490063933688958044.stgit@bahia.lan
arch/powerpc/xmon/xmon.c