Peter Maydell
3c27494434
hw/misc/stm32_rcc: Correct offset-to-irq calculation
...
In the STM32 RCC, there is a block of 5 "enable" registers, each of
which has 32 bits; each bit determines the level of one of the 5 * 32
= 160 enable_irq output lines. The code calculates the irq to be
worked on using
irq_offset = ((addr - STM32_RCC_AHB1_ENR) / 4) * 32;
This assumes that the registers are all consecutive; however, there
is a gap between the AHB1/2/3 registers and the APB1/2 registers, so
for the APB1/2 registers we calculate a number that is 32 too high
and can index off the end of the enable_irq[] array.
The handling of the reset registers has an identical bug.
Adjust the calculation of irq_offset to cope with the gap, and fix
the case labels so accesses to the gap fall into the default
LOG_UNIMP rather than being treated as if they were an actual
register.
Coverity CID: 1663683, 1663686
Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org >
Reviewed-by: Alistair Francis <alistair.francis@wdc.com >
Message-id: 20260709104832.1989240-1-peter.maydell@linaro.org
2026-07-13 12:34:17 +01:00
..
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2021-02-11 11:50:14 +00:00
2026-04-27 10:06:37 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2026-02-04 10:10:57 +01:00
2025-12-27 10:11:08 +01:00
2026-02-04 10:10:57 +01:00
2025-12-27 10:11:08 +01:00
2026-05-26 07:13:49 +02:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:07 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2020-03-23 17:22:30 +00:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2026-04-24 21:27:22 +02:00
2025-12-27 10:11:08 +01:00
2020-06-09 06:59:44 +02:00
2021-03-19 15:18:43 +01:00
2026-06-29 11:03:46 +01:00
2025-12-27 10:11:08 +01:00
2020-09-18 14:12:32 -04:00
2020-09-18 14:12:32 -04:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2026-04-27 09:45:58 +01:00
2025-02-25 17:02:00 +00:00
2020-09-18 14:12:32 -04:00
2020-09-18 14:12:32 -04:00
2026-06-29 11:03:46 +01:00
2025-12-27 10:11:08 +01:00
2026-01-20 19:51:36 +01:00
2023-10-06 10:33:43 +02:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2026-04-24 21:27:22 +02:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2026-05-22 09:45:47 +10:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2026-02-02 22:14:51 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-04-23 14:08:21 -07:00
2026-01-09 15:12:15 +10:00
2026-01-09 15:12:48 +10:00
2026-03-09 16:45:25 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2026-07-13 12:34:17 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2026-05-15 08:53:09 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:07 +01:00
2024-07-02 06:58:48 +02:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00
2026-05-28 14:18:24 +01:00
2025-12-27 10:11:08 +01:00
2025-12-27 10:11:08 +01:00