diff options
author | Zheyu Ma <zheyuma97@gmail.com> | 2024-06-18 16:40:09 +0200 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2024-06-21 14:01:59 +0100 |
commit | ff8aff01fa20c4fd5bbe46e1d25fbefdf996ef73 (patch) | |
tree | 2124291207ae34e318618a65d6aac1fb8bb8a8e1 /qapi | |
parent | 5d173f30f6828a1a4e6133eb324cc4ab0277a06d (diff) | |
download | qemu-ff8aff01fa20c4fd5bbe46e1d25fbefdf996ef73.zip qemu-ff8aff01fa20c4fd5bbe46e1d25fbefdf996ef73.tar.gz qemu-ff8aff01fa20c4fd5bbe46e1d25fbefdf996ef73.tar.bz2 |
hw/timer/a9gtimer: Handle QTest mode in a9_gtimer_get_current_cpu
This commit updates the a9_gtimer_get_current_cpu() function to handle
cases where QTest is enabled. When QTest is used, it returns 0 instead
of dereferencing the current_cpu, which can be NULL. This prevents the
program from crashing during QTest runs.
Reproducer:
cat << EOF | qemu-system-aarch64 -display \
none -machine accel=qtest, -m 512M -machine npcm750-evb -qtest stdio
writel 0xf03fe20c 0x26d7468c
EOF
Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20240618144009.3137806-1-zheyuma97@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'qapi')
0 files changed, 0 insertions, 0 deletions