]> git.ipfire.org Git - thirdparty/qemu.git/commit
ppc/pnv: Fix LPC serirq routing calculation
authorNicholas Piggin <npiggin@gmail.com>
Tue, 6 Aug 2024 13:13:11 +0000 (23:13 +1000)
committerMichael Tokarev <mjt@tls.msk.ru>
Tue, 5 Nov 2024 15:38:34 +0000 (18:38 +0300)
commitafbd6b50773b91318067bc6633dd6d6486b93edc
tree034d4cb71d93708d2d759157dd7493bcdae4292c
parent84fb165d967d7245d2779b3a4217a08b0c312a51
ppc/pnv: Fix LPC serirq routing calculation

The serirq routing table is split over two registers, the calculation
for the high irqs in the second register did not subtract the irq
offset. This was spotted by Coverity as a shift-by-negative. Fix this
and change the open-coded shifting and masking to use extract32()
function so it's less error-prone.

This went unnoticed because irqs >= 14 are not used in a standard
QEMU/OPAL boot, changing the first QEMU serial-isa irq to 14 to test
does demonstrate serial irqs aren't received, and that this change
fixes that.

Cc: qemu-stable@nongnu.org
Reported-by: Cédric Le Goater <clg@redhat.com>
Resolves: Coverity CID 1558829 (partially)
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
(cherry picked from commit 899e488650bb8bd52e1b2b44ceaae17df2e20b7f)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/ppc/pnv_lpc.c
target/ppc/cpu.h