Revision 20cd0c86553e14c495451ce7d1e2e4efd81041f0 authored by Manos Pitsidianakis on 24 March 2024, 10:04:59 UTC, committed by Michael Tokarev on 09 April 2024, 18:15:05 UTC
The current handling of invalid virtqueue elements inside the TX/RX virt
queue handlers is wrong.

They are added in a per-stream invalid queue to be processed after the
handler is done examining each message, but the invalid message might
not be specifying any stream_id; which means it's invalid to add it to
any stream->invalid queue since stream could be NULL at this point.

This commit moves the invalid queue to the VirtIOSound struct which
guarantees there will always be a valid temporary place to store them
inside the tx/rx handlers. The queue will be emptied before the handler
returns, so the queue must be empty at any other point of the device's
lifetime.

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Message-Id: <virtio-snd-rewrite-invalid-tx-rx-message-handling-v1.manos.pitsidianakis@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 731655f87f319fd06f27282c6cafbc2467ac8045)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
1 parent 627aa46
History
File Mode Size
aarch64-core.xml -rw-r--r-- 1.5 KB
aarch64-fpu.xml -rw-r--r-- 3.3 KB
aarch64-pauth.xml -rw-r--r-- 553 bytes
arm-core.xml -rw-r--r-- 1.1 KB
arm-m-profile-mve.xml -rw-r--r-- 768 bytes
arm-m-profile.xml -rw-r--r-- 968 bytes
arm-neon.xml -rw-r--r-- 3.8 KB
arm-vfp-sysregs.xml -rw-r--r-- 729 bytes
arm-vfp.xml -rw-r--r-- 1.1 KB
arm-vfp3.xml -rw-r--r-- 1.8 KB
avr-cpu.xml -rw-r--r-- 2.0 KB
cf-core.xml -rw-r--r-- 1.1 KB
cf-fp.xml -rw-r--r-- 1.0 KB
hexagon-core.xml -rw-r--r-- 9.1 KB
hexagon-hvx.xml -rw-r--r-- 6.6 KB
i386-32bit.xml -rw-r--r-- 7.2 KB
i386-64bit.xml -rw-r--r-- 8.0 KB
loongarch-base32.xml -rw-r--r-- 2.5 KB
loongarch-base64.xml -rw-r--r-- 2.5 KB
loongarch-fpu.xml -rw-r--r-- 2.9 KB
m68k-core.xml -rw-r--r-- 1.1 KB
m68k-fp.xml -rw-r--r-- 1021 bytes
microblaze-core.xml -rw-r--r-- 2.3 KB
microblaze-stack-protect.xml -rw-r--r-- 449 bytes
power-altivec.xml -rw-r--r-- 2.4 KB
power-core.xml -rw-r--r-- 2.1 KB
power-fpu.xml -rw-r--r-- 2.0 KB
power-spe.xml -rw-r--r-- 1.5 KB
power-vsx.xml -rw-r--r-- 2.0 KB
power64-core.xml -rw-r--r-- 2.1 KB
riscv-32bit-cpu.xml -rw-r--r-- 1.8 KB
riscv-32bit-fpu.xml -rw-r--r-- 2.0 KB
riscv-32bit-virtual.xml -rw-r--r-- 409 bytes
riscv-64bit-cpu.xml -rw-r--r-- 1.8 KB
riscv-64bit-fpu.xml -rw-r--r-- 2.2 KB
riscv-64bit-virtual.xml -rw-r--r-- 409 bytes
rx-core.xml -rw-r--r-- 2.8 KB
s390-acr.xml -rw-r--r-- 1.4 KB
s390-cr.xml -rw-r--r-- 1.3 KB
s390-fpr.xml -rw-r--r-- 1.4 KB
s390-gs.xml -rw-r--r-- 578 bytes
s390-virt-kvm.xml -rw-r--r-- 599 bytes
s390-virt.xml -rw-r--r-- 582 bytes
s390-vx.xml -rw-r--r-- 2.4 KB
s390x-core64.xml -rw-r--r-- 1.5 KB

back to top