bb71d9fe | 10-Jun-2025 |
Daniel P. Berrangé <berrange@redhat.com> |
hw/audio/via-ac97: skip automatic zero-init of large array
The 'out_cb' method has a 4k byte array used for copying data between the audio backend and device. Skip the automatic zero-init of this ar
hw/audio/via-ac97: skip automatic zero-init of large array
The 'out_cb' method has a 4k byte array used for copying data between the audio backend and device. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path.
The 'tmpbuf' array will be fully initialized when reading data from device memory.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20250610123709.835102-14-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
30c82f66 | 10-Jun-2025 |
Daniel P. Berrangé <berrange@redhat.com> |
hw/audio/sb16: skip automatic zero-init of large array
The 'write_audio' method has a 4k byte array used for copying data between the audio backend and device. Skip the automatic zero-init of this a
hw/audio/sb16: skip automatic zero-init of large array
The 'write_audio' method has a 4k byte array used for copying data between the audio backend and device. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path.
The 'tmpbuf' array will be fully initialized when reading data from device memory.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20250610123709.835102-13-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
5b6cd5c5 | 10-Jun-2025 |
Daniel P. Berrangé <berrange@redhat.com> |
hw/audio/marvell_88w8618: skip automatic zero-init of large array
The 'mv88w8618_audio_callback' method has a 4k byte array used for copying data between the audio backend and device. Skip the autom
hw/audio/marvell_88w8618: skip automatic zero-init of large array
The 'mv88w8618_audio_callback' method has a 4k byte array used for copying data between the audio backend and device. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path.
The 'buf' array will be fully initialized when reading data from device memory.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20250610123709.835102-12-berrange@redhat.com [Fixed hw/audio/gus in commit message --Stefan] Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
2e438da4 | 10-Jun-2025 |
Daniel P. Berrangé <berrange@redhat.com> |
hw/audio/gus: skip automatic zero-init of large array
The 'GUS_read_DMA' method has a 4k byte array used for copying data between the audio backend and device. Skip the automatic zero-init of this a
hw/audio/gus: skip automatic zero-init of large array
The 'GUS_read_DMA' method has a 4k byte array used for copying data between the audio backend and device. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path.
The 'tmpbuf' array will be fully initialized when reading data from device memory.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20250610123709.835102-11-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
8236e206 | 10-Jun-2025 |
Daniel P. Berrangé <berrange@redhat.com> |
hw/audio/es1370: skip automatic zero-init of large array
The 'es1370_transfer_audio' method has a 4k byte array used for copying data between the audio backend and device. Skip the automatic zero-in
hw/audio/es1370: skip automatic zero-init of large array
The 'es1370_transfer_audio' method has a 4k byte array used for copying data between the audio backend and device. Skip the automatic zero-init of this array to eliminate the performance overhead in the I/O hot path.
The 'tmpbuf' array will be fully initialized when reading data from the audio backend and/or device memory.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20250610123709.835102-10-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
ca2cc038 | 10-Jun-2025 |
Daniel P. Berrangé <berrange@redhat.com> |
hw/audio/cs4231a: skip automatic zero-init of large arrays
The 'cs_write_audio' method has a pair of byte arrays, one 4k in size and one 8k, which are used in converting audio samples. Skip the auto
hw/audio/cs4231a: skip automatic zero-init of large arrays
The 'cs_write_audio' method has a pair of byte arrays, one 4k in size and one 8k, which are used in converting audio samples. Skip the automatic zero-init of these arrays to eliminate the performance overhead in the I/O hot path.
The 'tmpbuf' array will be fully initialized when reading a block of data from the guest. The 'linbuf' array will be fully initialized when converting the audio samples.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20250610123709.835102-9-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
f4b1c3db | 15-May-2025 |
Volker Rümelin <vr_qemu@t-online.de> |
hw/audio/asc: replace g_malloc0() with g_malloc()
There is no need to allocate initialized memory with g_malloc0() if it's directly followed by a memset() function call. g_malloc() is sufficient.
R
hw/audio/asc: replace g_malloc0() with g_malloc()
There is no need to allocate initialized memory with g_malloc0() if it's directly followed by a memset() function call. g_malloc() is sufficient.
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20250515054429.7385-5-vr_qemu@t-online.de>
show more ...
|
626b3900 | 14-Nov-2024 |
Paolo Bonzini <pbonzini@redhat.com> |
hw/audio/hda: fix memory leak on audio setup
When SET_STREAM_FORMAT is called, the st->buft timer is overwritten, thus causing a memory leak. This was originally fixed in commit 816139ae6a5 ("hw/au
hw/audio/hda: fix memory leak on audio setup
When SET_STREAM_FORMAT is called, the st->buft timer is overwritten, thus causing a memory leak. This was originally fixed in commit 816139ae6a5 ("hw/audio/hda: fix memory leak on audio setup", 2024-11-14) but that caused the audio to break in SPICE.
Fortunately, a simpler fix is possible. The timer only needs to be reset, because the callback is always the same (st->output is set at realize time in hda_audio_init); call to timer_new_ns overkill. Replace it with timer_del and only initialize the timer once; for simplicity, do it even if use_timer is false.
An even simpler fix would be to free the old time in hda_audio_setup(). However, it seems better to place the initialization of the timer close to that of st->ouput.
Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Message-ID: <20241114125318.1707590-3-pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
show more ...
|
6d6e2336 | 08-Oct-2024 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
hw/audio/hda: fix memory leak on audio setup
When SET_STREAM_FORMAT is called, we should clear the existing setup.
Factor out common function to close a stream.
Direct leak of 144 byte(s) in 3 obj
hw/audio/hda: fix memory leak on audio setup
When SET_STREAM_FORMAT is called, we should clear the existing setup.
Factor out common function to close a stream.
Direct leak of 144 byte(s) in 3 object(s) allocated from: #0 0x7f91d38f7350 in calloc (/lib64/libasan.so.8+0xf7350) (BuildId: a4ad7eb954b390cf00f07fa10952988a41d9fc7a) #1 0x7f91d2ab7871 in g_malloc0 (/lib64/libglib-2.0.so.0+0x64871) (BuildId: 36b60dbd02e796145a982d0151ce37202ec05649) #2 0x562fa2f447ee in timer_new_full /home/elmarco/src/qemu/include/qemu/timer.h:538 #3 0x562fa2f4486f in timer_new /home/elmarco/src/qemu/include/qemu/timer.h:559 #4 0x562fa2f448a9 in timer_new_ns /home/elmarco/src/qemu/include/qemu/timer.h:577 #5 0x562fa2f47955 in hda_audio_setup ../hw/audio/hda-codec.c:490 #6 0x562fa2f4897e in hda_audio_command ../hw/audio/hda-codec.c:605
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-ID: <20241008125028.1177932-3-marcandre.lureau@redhat.com>
show more ...
|