]> xenbits.xensource.com Git - qemu-xen.git/commit
hw/misc/stm32l4x5_rcc: Add validation for MCOPRE and MCOSEL values
authorZheyu Ma <zheyuma97@gmail.com>
Tue, 18 Jun 2024 13:55:50 +0000 (15:55 +0200)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 13 Aug 2024 10:34:56 +0000 (11:34 +0100)
commit20516e8d0e07739bd2e9bc8f51f319e37a9bc86c
treeb08847931372ccb508f65989e335d27e095d6716
parent9eb51530c12ae645b91e308d16196c68563ea883
hw/misc/stm32l4x5_rcc: Add validation for MCOPRE and MCOSEL values

This commit adds validation checks for the MCOPRE and MCOSEL values in
the rcc_update_cfgr_register function. If the MCOPRE value exceeds
0b100 or the MCOSEL value exceeds 0b111, an error is logged and the
corresponding clock mux is disabled. This helps in identifying and
handling invalid configurations in the RCC registers.

Reproducer:
cat << EOF | qemu-system-aarch64 -display \
none -machine accel=qtest, -m 512M -machine b-l475e-iot01a -qtest \
stdio
writeq 0x40021008 0xffffffff
EOF

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2356
Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/misc/stm32l4x5_rcc.c