Files
qemu/hw
Peter Maydell 8bb514f373 hw/intc/mips_gic: Avoid Coverity complaint in VP writes
The MIPS GIC does a check for a guest error in the write path for the
SH_MAP*_VP registers which triggers a Coverity complaint because it
assigns -1 to a uint64_t. The code doesn't misbehave because the -1
case will be caught by the following OFFSET_CHECK(), but the code
could be improved:
 * there is no need to special case to avoid passing 0 to ctz64(),
   because (unlike the compiler builtins) QEMU defines that this
   has a specific behaviour, returning 64
 * the OFFSET_CHECK() macro will go to the "bad_offset" label and
   print an error implying that the guest wrote to an invalid
   register offset. This is misleading about the actual problem,
   which is that the guest wrote a bogus value to a valid register
   offset

Make the error check print a better log message, and avoid the
special casing on ctz64(); in passing, this should also make
Coverity happier.

CID: 1547545
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20260512111536.3437645-1-peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2026-05-21 08:20:58 +02:00
..
2026-05-18 14:59:21 +02:00
2026-04-24 21:27:14 +02:00
2026-03-08 23:08:41 +01:00
2026-05-21 08:20:58 +02:00
2026-02-27 14:22:07 +01:00
2026-05-18 13:47:25 +02:00
2025-12-27 10:11:08 +01:00
2026-03-08 23:08:41 +01:00
2026-05-20 16:52:22 +09:00