]> git.ipfire.org Git - thirdparty/linux.git/commit
riscv: kgdb: Ensure that BUFMAX > NUMREGBYTES
authorMiquel Sabaté Solà <mikisabate@gmail.com>
Mon, 15 Sep 2025 14:32:52 +0000 (16:32 +0200)
committerPaul Walmsley <pjw@kernel.org>
Fri, 10 Oct 2025 01:36:45 +0000 (19:36 -0600)
commit781380d2cdef34559a0125ca6464b90bfc01594f
treeb091a5b92285704e04fe91786100d1a95579c65c
parent812258ff4166bcd41c7d44707e0591f9ae32ac8c
riscv: kgdb: Ensure that BUFMAX > NUMREGBYTES

The current value of BUFMAX is similar as in other architectures, but as
per documentation on KGDB (see
'Documentation/process/debugging/kgdb.rst'), BUFMAX has to be larger
than NUMREGBYTES.

Some NUMREGBYTES architectures (e.g. powerpc or hexagon) actually define
BUFMAX in relation to NUMREGBYTES, and thus this condition is always
guaranteed. Since 2048 is a value that is generally accepted on all
architectures, and that is larger than the current value of NUMREGBYTES,
we can keep this value in arch/riscv, but we can at least add an
'static_assert' as an extra measure just in case NUMREGBYTES changes in
the future for some unforseen reason.

Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Link: https://lore.kernel.org/r/20250915143252.154955-1-mikisabate@gmail.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
arch/riscv/include/asm/kgdb.h