qemu/hw
Peter Maydell cd247eae16 hw/char/pl011: Use correct masks for IBRD and FBRD
In commit b88cfee902 we defined masks for the IBRD and FBRD
integer and fractional baud rate divider registers, to prevent the
guest from writing invalid values which could cause division-by-zero.
Unfortunately we got the mask values the wrong way around: the FBRD
register is six bits and the IBRD register is 16 bits, not
vice-versa.

You would only run into this bug if you programmed the UART to a baud
rate of less than 9600, because for 9600 baud and above the IBRD
value will fit into 6 bits, as per the table in
 https://developer.arm.com/documentation/ddi0183/g/programmers-model/register-descriptions/fractional-baud-rate-register--uartfbrd

The only visible effects would be that the value read back from
the register by the guest would be truncated, and we would
print an incorrect baud rate in the debug logs.

Cc: qemu-stable@nongnu.org
Fixes: b88cfee902 ("hw/char/pl011: Avoid division-by-zero in pl011_get_baudrate()")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2610
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Message-id: 20241007144732.2491331-1-peter.maydell@linaro.org
2024-10-15 15:16:17 +01:00
..
9pfs 9p: remove 'proxy' filesystem backend driver 2024-10-03 19:33:25 +02:00
acpi hw/acpi: remove break after g_assert_not_reached() 2024-09-24 13:53:35 +02:00
adc hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
alpha
arm hw/arm: Add SPI to Allwinner A10 2024-10-15 15:16:17 +01:00
audio hw/audio/hda: fix memory leak on audio setup 2024-10-14 17:34:09 +04:00
avr
block hw/virtio-blk: fix -Werror=maybe-uninitialized false-positive 2024-10-02 16:14:29 +04:00
char hw/char/pl011: Use correct masks for IBRD and FBRD 2024-10-15 15:16:17 +01:00
core hw/clock: Expose 'qtest-clock-period' QOM property for QTests 2024-10-15 11:29:45 +01:00
cpu
cxl hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
display ui: refactor using a common qemu_pixman_shareable 2024-10-14 17:34:09 +04:00
dma hw/dma: Remove omap_dma4 device 2024-10-01 14:58:07 +01:00
fsi hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
gpio hw/gpio: Remove TYPE_OMAP2_GPIO 2024-10-01 14:44:42 +01:00
hppa hw/char: Extract serial-mm 2024-10-03 19:33:23 +02:00
hyperv hw/hyperv: remove return after g_assert_not_reached() 2024-09-24 13:53:35 +02:00
i2c hw/i2c/aspeed: Add support for 64 bit addresses 2024-09-16 17:44:08 +02:00
i386 * pc: Add a description for the i8042 property 2024-10-04 19:28:37 +01:00
ide hw/ahci: fix -Werror=maybe-uninitialized false-positive 2024-10-02 16:14:29 +04:00
input hw/input: Remove lm832x device 2024-10-01 14:41:10 +01:00
intc hw/intc/omap_intc: Remove now-unnecessary abstract base class 2024-10-15 15:16:17 +01:00
ipack
ipmi
isa hw/char/serial.h: Extract serial-isa.h 2024-10-03 19:33:23 +02:00
loongarch hw/char: Extract serial-mm 2024-10-03 19:33:23 +02:00
m68k hw/m68k: Use explicit big-endian LD/ST API 2024-10-07 11:33:20 +02:00
mem hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
microblaze hw/char: Extract serial-mm 2024-10-03 19:33:23 +02:00
mips * pc: Add a description for the i8042 property 2024-10-04 19:28:37 +01:00
misc hw/misc: Create STM32L4x5 SYSCFG clock 2024-10-15 11:29:45 +01:00
net hw/net/rocker: Remove unused rocker_fp_ports 2024-10-03 17:26:06 +03:00
nubus hw/nubus/nubus-device: Range check 'slot' property 2024-09-08 11:49:49 +02:00
nvme hw/nvme: add atomic write support 2024-10-01 09:02:05 +02:00
nvram hw: Remove unused fw_cfg_init_io 2024-10-03 17:26:06 +03:00
openrisc hw/char: Extract serial-mm 2024-10-03 19:33:23 +02:00
pci hw/pci: Remove unused pcie_chassis_find_slot 2024-10-03 17:26:06 +03:00
pci-bridge hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
pci-host q35: Remove unused mch_mcfg_base 2024-10-03 17:26:05 +03:00
pcmcia hw/pcmcia: Remove pxa2xx pcmcia device 2024-10-01 14:25:54 +01:00
ppc hw/char: Extract serial-mm 2024-10-03 19:33:23 +02:00
remote remote: Remove unused remote_iohub_finalize 2024-10-03 17:26:06 +03:00
riscv * pc: Add a description for the i8042 property 2024-10-04 19:28:37 +01:00
rtc hw/rtc: Remove twl92230 device 2024-10-01 14:40:59 +01:00
rx
s390x hw/s390x: Use explicit big-endian LD/ST API 2024-10-07 11:33:20 +02:00
scsi hw/vhost-scsi: fix -Werror=maybe-uninitialized 2024-10-02 16:14:29 +04:00
sd hw/sdhci: fix -Werror=maybe-uninitialized false-positive 2024-10-02 16:14:29 +04:00
sensor hw/sensor/tmp105: Lower 4 bit of limit registers are always 0 2024-09-13 20:11:13 +02:00
sh4 hw/sh4: Remove sh7750_register_io_device() helper 2024-09-13 20:10:49 +02:00
smbios
sparc hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
sparc64 hw/char: Extract serial-mm 2024-10-03 19:33:23 +02:00
ssi hw/ssi: Allwinner A10 SPI emulation 2024-10-15 15:16:17 +01:00
timer hw/timer: Remove omap_synctimer 2024-10-01 14:56:27 +01:00
tpm hw/tpm: remove break after g_assert_not_reached() 2024-09-24 13:53:35 +02:00
tricore hw: Use device_class_set_legacy_reset() instead of opencoding 2024-09-13 15:31:44 +01:00
ufs hw/ufs: minor bug fixes related to ufs-test 2024-09-06 18:04:16 +09:00
usb hw/usb: Remove MUSB USB host controller 2024-10-01 14:43:02 +01:00
vfio vfio/igd: correctly calculate stolen memory size for gen 9 and later 2024-09-17 10:37:55 +02:00
virtio vhost: Remove unused vhost_dev_{load|save}_inflight 2024-10-03 17:26:06 +03:00
watchdog hw/watchdog: replace assert(0) with g_assert_not_reached() 2024-09-13 20:12:16 +02:00
xen hw/xen: xenpvh: Add pci-intx-irq-base property 2024-10-03 19:37:35 +02:00
xenpv
xtensa hw/char: Extract serial-mm 2024-10-03 19:33:23 +02:00
Kconfig hw/timer: Remove TYPE_ETRAX_FS_TIMER device 2024-09-13 20:11:13 +02:00
meson.build hw/cris: Remove image loader helper 2024-09-13 20:10:50 +02:00