qemu/hw
Volker Rümelin 59de6e246f hw/audio/hda-codec: fix multiplication overflow
After a relatively short time, there is an multiplication overflow
when multiplying (now - buft_start) with hda_bytes_per_second().
While the uptime now - buft_start only overflows after 2**63 ns
= 292.27 years, this happens hda_bytes_per_second() times faster
with the multiplication. At 44100 samples/s * 2 channels
* 2 bytes/channel = 176400 bytes/s that is 14.52 hours. After the
multiplication overflow the affected audio stream stalls.

Replace the multiplication and following division with muldiv64()
to prevent a multiplication overflow.

Fixes: 280c1e1cdb ("audio/hda: create millisecond timers that handle IO")
Reported-by: M_O_Bz <m_o_bz@163.com>
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-Id: <20231105172552.8405-1-vr_qemu@t-online.de>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 74e8593e7e51d6b11ae9c56a3f4e7bb714bac4ec)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2023-12-05 12:32:36 +03:00
..
9pfs
acpi
adc
alpha
arm
audio hw/audio/hda-codec: fix multiplication overflow 2023-12-05 12:32:36 +03:00
avr hw/avr/atmega: Fix wrong initial value of stack pointer 2023-12-05 12:32:36 +03:00
block hw/xen: use correct default protocol for xen-block on x86 2023-11-09 16:39:13 +03:00
char
core util/uuid: Add UUID_STR_LEN definition 2023-11-09 16:39:13 +03:00
cpu
cris
cxl
display ati-vga: Implement fallback for pixman routines 2023-11-09 16:39:13 +03:00
dma
gpio
hppa
hyperv util/uuid: Add UUID_STR_LEN definition 2023-11-09 16:39:13 +03:00
i2c
i386 hw/xen: take iothread mutex in xen_evtchn_reset_op() 2023-11-09 16:39:13 +03:00
ide hw/ide/ahci: fix legacy software reset 2023-11-22 14:25:22 +03:00
input lasips2: LASI PS/2 devices are not user-createable 2023-10-21 10:22:02 +03:00
intc
ipack
ipmi
isa
loongarch
m68k
mem
microblaze
mips hw/mips: LOONGSON3V depends on UNIMP device 2023-11-19 21:15:06 +03:00
misc hw/misc/mps2-scc: Free MPS2SCC::oscclk[] array on finalize() 2023-12-05 12:32:36 +03:00
net net: Provide MemReentrancyGuard * to qemu_new_nic() 2023-11-29 15:33:42 +03:00
nios2
nubus
nvme
nvram hw/nvram/xlnx-efuse-ctrl: Free XlnxVersalEFuseCtrl[] "pg0-lock" array 2023-12-05 12:32:36 +03:00
openrisc
pci
pci-bridge
pci-host
pcmcia
ppc
rdma hw/rdma/vmw/pvrdma_cmd: Use correct struct in query_port() 2023-10-24 09:14:34 +03:00
remote
riscv riscv: Fix SiFive E CLINT clock frequency 2023-11-29 16:15:22 +03:00
rtc
rx
s390x s390x/pci: only limit DMA aperture if vfio DMA limit reported 2023-11-19 21:15:06 +03:00
scsi scsi-disk: ensure that FORMAT UNIT commands are terminated 2023-10-03 18:25:13 +03:00
sd hw/sd/sdhci: Block Size Register bits [14:12] is lost 2023-10-24 09:12:45 +03:00
sensor
sh4
smbios
sparc
sparc64
ssi
timer
tpm
tricore
usb net: Provide MemReentrancyGuard * to qemu_new_nic() 2023-11-29 15:33:42 +03:00
vfio vfio/pci: Fix buffer overrun when writing the VF token 2023-11-09 16:39:13 +03:00
virtio hw/virtio: Add VirtioPCIDeviceTypeInfo::instance_finalize field 2023-12-05 12:32:36 +03:00
watchdog
xen
xenpv
xtensa
Kconfig
meson.build