[PULL 06/26] spiceaudio: add a pcm_ops buffer_get_free function

2022-10-13 Thread Gerd Hoffmann
From: Volker Rümelin It seems there is a demand [1] for low latency playback over SPICE. Add a pcm_ops buffer_get_free function to reduce the playback latency. The mixing engine buffer becomes a temporary buffer. [1] https://lists.nongnu.org/archive/html/qemu-devel/2022-01/msg01644.html Signed-

[PULL 02/26] audio: fix GUS audio playback with out.mixing-engine=off

2022-10-13 Thread Gerd Hoffmann
From: Volker Rümelin Fix GUS audio playback with out.mixing-engine=off. The GUS audio device needs to know the amount of samples to produce in advance. To reproduce start qemu with -parallel none -device gus,audiodev=audio0 -audiodev pa,id=audio0,out.mixing-engine=off and start the cartoon.exe

[PULL 15/26] cirrus_vga: fix potential memory overflow

2022-10-13 Thread Gerd Hoffmann
From: lu zhipeng Signed-off-by: lu zhipeng Message-Id: <20220929122352.1891-1-luzhip...@cestc.cn> Signed-off-by: Gerd Hoffmann --- hw/display/cirrus_vga.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c index 3bb6a58698c1..2

[PULL 11/26] audio: fix sw->buf size for audio recording

2022-10-13 Thread Gerd Hoffmann
From: Volker Rümelin The calculation of the buffer size needed to store audio samples after resampling is wrong for audio recording. For audio recording sw->ratio is calculated as sw->ratio = frontend sample rate / backend sample rate. >From this follows frontend samples = frontend sample rate

[PULL 22/26] ui/gtk: Fix the implicit mouse ungrabbing logic

2022-10-13 Thread Gerd Hoffmann
From: Akihiko Odaki Although the grab menu item represents the tabbed displays, the old implicit mouse ungrabbing logic changes the grab menu item even for an untabbed display. Leave the grab menu item when implicitly ungrabbing mouse for an untabbed display. The new ungrabbing logic introduced

[PULL 03/26] audio: run downstream playback queue unconditionally

2022-10-13 Thread Gerd Hoffmann
From: Volker Rümelin Run the downstream playback queue even if the emulated audio device didn't write new samples. There still may be buffered audio samples downstream. This is for the -audiodev out.mixing-engine=off case. Commit a8a98cfd42 ("audio: run downstream playback queue uncondition- all

[PULL 05/26] audio: add more audio rate control functions

2022-10-13 Thread Gerd Hoffmann
From: Volker Rümelin The next patch needs two new rate control functions. The first one returns the bytes needed at call time to maintain the selected rate. The second one adjusts the bytes actually sent. Split the audio_rate_get_bytes() function into these two functions and reintroduce audio_ra

[PULL 00/26] Kraxel 20221013 patches

2022-10-13 Thread Gerd Hoffmann
u.git tags/kraxel-20221013-pull-request for you to fetch changes up to 61ddafbcfac4975ee245cd3453be86b0632a5605: audio: improve out.voices test (2022-10-12 20:36:17 +0200) pci: cleanup virtio ids. audio: bugfixes and latency im

[PULL 19/26] pci-ids: drop PCI_DEVICE_ID_VIRTIO_PMEM

2022-10-13 Thread Gerd Hoffmann
Not needed for a virtio 1.0 device. virtio_pci_device_plugged() overrides them anyway (so no functional change). Signed-off-by: Gerd Hoffmann Reviewed-by: David Hildenbrand Reviewed-by: Pankaj Gupta Tested-by: Pankaj Gupta Message-Id: <20221004112100.301935-4-kra...@redhat.com> --- include/h

[PULL 04/26] alsaaudio: reduce playback latency

2022-10-13 Thread Gerd Hoffmann
From: Volker Rümelin Change the buffer_get_free pcm_ops function to report the free ALSA playback buffer. The generic buffer becomes a temporary buffer and is empty after a call to audio_run_out(). Signed-off-by: Volker Rümelin Acked-by: Marc-André Lureau Message-Id: <20220923183640.8314-4-vr_

[PULL 16/26] docs: add firmware feature flags

2022-10-13 Thread Gerd Hoffmann
Add new firmware feature flags for the recently added confidential computing operating modes by amd and intel. While being at it also fix the path to the amd sev documentation. Signed-off-by: Gerd Hoffmann Reviewed-by: Kashyap Chamarthy Message-Id: <20220930133220.1771336-1-kra...@redhat.com> -

[PULL 08/26] audio: swap audio_rate_get_bytes() function parameters

2022-10-13 Thread Gerd Hoffmann
From: Volker Rümelin Swap the rate and info parameters of the audio_rate_get_bytes() function to align the parameter order with the rest of the audio_rate_*() functions. Signed-off-by: Volker Rümelin Reviewed-by: Marc-André Lureau Message-Id: <20220923183640.8314-8-vr_q...@t-online.de> Signed-

[PULL 07/26] spiceaudio: update comment

2022-10-13 Thread Gerd Hoffmann
From: Volker Rümelin Replace a comment with a question with the answer. Signed-off-by: Volker Rümelin Reviewed-by: Marc-André Lureau Message-Id: <20220923183640.8314-7-vr_q...@t-online.de> Signed-off-by: Gerd Hoffmann --- audio/spiceaudio.c | 5 - 1 file changed, 4 insertions(+), 1 delet

[PULL 14/26] ui/gtk-egl: egl context needs to be unbound in the end of gd_egl_switch

2022-10-13 Thread Gerd Hoffmann
From: Dongwon Kim A thread often fails to bind an egl context to itself after guest VM is rebooted because the context is still owned by another thread. It is not very clear what condition makes this happen but this can be prevented by unbinding the context from the thread in the end of gd_egl_sw

[PULL 24/26] gtk: Add show_menubar=on|off command line option.

2022-10-13 Thread Gerd Hoffmann
From: Bryce Mills The patch adds "show_menubar" command line option for GTK UI similar to "show_tabs". This option allows to hide menu bar initially, it still can be toggled by shortcut and other shortcuts still work. Signed-off-by: Bryce Mills Acked-by: Markus Armbruster Message-Id: Signed-

[PULL 10/26] audio: refactor audio_get_avail()

2022-10-13 Thread Gerd Hoffmann
From: Volker Rümelin Split out the code in audio_get_avail() that calculates the buffer size that the audio frontend can read. This is similar to the code changes in audio_get_free(). Signed-off-by: Volker Rümelin Reviewed-by: Marc-André Lureau Message-Id: <20220923183640.8314-10-vr_q...@t-onl

[PULL 09/26] audio: rename audio_sw_bytes_free()

2022-10-13 Thread Gerd Hoffmann
From: Volker Rümelin Rename and refactor audio_sw_bytes_free(). This function is not limited to calculate the free audio buffer size. The renamed function returns the number of frames instead of bytes. Signed-off-by: Volker Rümelin Reviewed-by: Marc-André Lureau Message-Id: <20220923183640.831

[PULL 26/26] audio: improve out.voices test

2022-10-13 Thread Gerd Hoffmann
From: Helge Konetzka Improve readability of audio out.voices test: If 1 is logged and set after positive test, 1 should be tested. Signed-off-by: Helge Konetzka Reviewed-by: Marc-André Lureau Message-Id: <20221012114925.5084-3...@zapateado.de> Signed-off-by: Gerd Hoffmann --- audio/audio.c |

Re: [PATCH v3 2/3] block: introduce zone append write for zoned devices

2022-10-13 Thread Sam Li
Damien Le Moal 于2022年10月13日周四 13:55写道: > > On 10/10/22 11:33, Sam Li wrote: > > A zone append command is a write operation that specifies the first > > logical block of a zone as the write position. When writing to a zoned > > block device using zone append, the byte offset of writes is pointing >

[PULL 17/26] pci-ids: drop PCI_DEVICE_ID_VIRTIO_IOMMU

2022-10-13 Thread Gerd Hoffmann
Not needed for a virtio 1.0 device. virtio_pci_device_plugged() overrides them anyway (so no functional change). Signed-off-by: Gerd Hoffmann Reviewed-by: Eric Auger Tested-by: Eric Auger Message-Id: <20221004112100.301935-2-kra...@redhat.com> --- include/hw/pci/pci.h | 1 - hw/virtio

[PULL 12/26] audio: prevent an integer overflow in resampling code

2022-10-13 Thread Gerd Hoffmann
From: Volker Rümelin There are corner cases where rate->opos can overflow. For example, if QEMU is started with -audiodev pa,id=audio0, out.frequency=11025 -device ich9-intel-hda -device hda-duplex, audiodev=audio0 and the guest plays audio with a sampling frequency of 44100Hz, rate->opos will ov

[PULL 25/26] audio: fix in.voices test

2022-10-13 Thread Gerd Hoffmann
From: Helge Konetzka Calling qemu with valid -audiodev ...,in.voices=0 results in an obsolete warning: audio: Bogus number of capture voices 0, setting to 0 This patch fixes the in.voices test. Signed-off-by: Helge Konetzka Reviewed-by: Marc-André Lureau Message-Id: <20221012114925.5084-2...

[PULL 21/26] pci-ids: document modern virtio-pci ids in pci.h too

2022-10-13 Thread Gerd Hoffmann
While being at it add a #define for the magic 0x1040 number. Signed-off-by: Gerd Hoffmann Reviewed-by: Eric Auger Message-Id: <20221004112100.301935-6-kra...@redhat.com> --- include/hw/pci/pci.h | 10 ++ hw/virtio/virtio-pci.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-)

[PULL 20/26] pci-ids: drop list of modern virtio devices

2022-10-13 Thread Gerd Hoffmann
Drop the list of modern virtio devices and explain how they are calculated instead. Signed-off-by: Gerd Hoffmann Reviewed-by: Eric Auger Message-Id: <20221004112100.301935-5-kra...@redhat.com> --- docs/specs/pci-ids.txt | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) dif

[PULL 23/26] qemu-edid: Restrict input parameter -d to avoid division by zero

2022-10-13 Thread Gerd Hoffmann
From: Sebastian Mitterle A zero value for dpi will lead to a division by zero in qemu_edid_dpi_to_mm(). Tested by runnig qemu-edid -dX, X = 0, 100. Resolves: qemu-project/qemu#1249 Suggested-by: Thomas Huth Signed-off-by: Sebastian Mitterle Message-Id: <20221011151216.64897-1-smitt...@redhat.

[PULL 13/26] ui/vnc-clipboard: fix integer underflow in vnc_client_cut_text_ext

2022-10-13 Thread Gerd Hoffmann
From: Mauro Matteo Cascella Extended ClientCutText messages start with a 4-byte header. If len < 4, an integer underflow occurs in vnc_client_cut_text_ext. The result is used to decompress data in a while loop in inflate_buffer, leading to CPU consumption and denial of service. Prevent this by ch

Re: [PATCH v3 1/3] file-posix:add the tracking of the zones write pointers

2022-10-13 Thread Sam Li
Damien Le Moal 于2022年10月13日周四 15:30写道: > > On 2022/10/13 16:08, Sam Li wrote: > > Damien Le Moal 于2022年10月13日周四 13:13写道: > >> > >> On 10/10/22 11:33, Sam Li wrote: > >>> Since Linux doesn't have a user API to issue zone append operations to > >>> zoned devices from user space, the file-posix driv

Re: [PATCH v3 1/3] file-posix:add the tracking of the zones write pointers

2022-10-13 Thread Damien Le Moal
On 2022/10/13 16:08, Sam Li wrote: > Damien Le Moal 于2022年10月13日周四 13:13写道: >> >> On 10/10/22 11:33, Sam Li wrote: >>> Since Linux doesn't have a user API to issue zone append operations to >>> zoned devices from user space, the file-posix driver is modified to add >>> zone append emulation using

[PULL 18/26] pci-ids: drop PCI_DEVICE_ID_VIRTIO_MEM

2022-10-13 Thread Gerd Hoffmann
Not needed for a virtio 1.0 device. virtio_pci_device_plugged() overrides them anyway (so no functional change). Signed-off-by: Gerd Hoffmann Reviewed-by: David Hildenbrand Message-Id: <20221004112100.301935-3-kra...@redhat.com> --- include/hw/pci/pci.h | 1 - hw/virtio/virtio-mem-pci.c

[RISU PATCH v2 5/5] loongarch: Add block 'safefloat' and nanbox_s()

2022-10-13 Thread Song Gao
Some LoongArch instructions don't care the high 32bit, so use nanbox_s() set the high 32bit 0x. Reviewed-by: Richard Henderson Signed-off-by: Song Gao --- loongarch64.risu | 119 +++-- risugen| 2 +- risugen_loongarch64.pm | 2

Re: [PATCH v3 1/3] file-posix:add the tracking of the zones write pointers

2022-10-13 Thread Sam Li
Damien Le Moal 于2022年10月13日周四 13:13写道: > > On 10/10/22 11:33, Sam Li wrote: > > Since Linux doesn't have a user API to issue zone append operations to > > zoned devices from user space, the file-posix driver is modified to add > > zone append emulation using regular writes. To do this, the file-po

[PATCH] configure: Avoid using strings binary

2022-10-13 Thread Michal Privoznik
When determining the endiandness of the target architecture we're building for a small program is compiled, which in an obfuscated way declares two strings. Then, we look which string is in correct order (using strings binary) and deduct the endiandness. But using the strings binary is problematic,

[RISU PATCH v2 1/5] risu: Use alternate stack

2022-10-13 Thread Song Gao
We can use alternate stack, so that we can use sp register as intput/ouput register. I had tested aarch64/LoongArch architecture. Reviewed-by: Richard Henderson Signed-off-by: Song Gao --- risu.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/risu.c b/risu

Re: [PATCH v3 2/3] block: introduce zone append write for zoned devices

2022-10-13 Thread Damien Le Moal
On 2022/10/13 16:27, Sam Li wrote: > Damien Le Moal 于2022年10月13日周四 13:55写道: >> >> On 10/10/22 11:33, Sam Li wrote: >>> A zone append command is a write operation that specifies the first >>> logical block of a zone as the write position. When writing to a zoned >>> block device using zone append,

[RISU PATCH v2 2/5] loongarch: Add LoongArch basic test support

2022-10-13 Thread Song Gao
This patch adds LoongArch server, client support, and basic test file. Reviewed-by: Richard Henderson Signed-off-by: Song Gao --- risu_loongarch64.c | 50 ++ risu_reginfo_loongarch64.c | 183 + risu_reginfo_loongarch64.h | 25 + test_loo

[RISU PATCH v2 0/5] Add LoongArch architectures support

2022-10-13 Thread Song Gao
hi, This series adds LoongArch architectures support, we had tested two mode: 1. LoongArch host server + LoongArch host client; 2. LoongArch host server + qemu client. You can find all LoongArch instructions at [1]. This series not contains all LoongArch instructions, such as pcadd, syscalls, r

Re: MultiFD and default channel out of order mapping on receive side.

2022-10-13 Thread Daniel P . Berrangé
On Thu, Oct 13, 2022 at 01:23:40AM +0530, manish.mishra wrote: > Hi Everyone, > Hope everyone is doing great. I have seen some live migration issues with > qemu-4.2 when using multiFD. Signature of issue is something like this. > 2022-10-01T09:57:53.972864Z qemu-kvm: failed to receive packet via m

[RISU PATCH v2 4/5] loongarch: Add risufile with loongarch instructions

2022-10-13 Thread Song Gao
Acked-by: Richard Henderson Signed-off-by: Song Gao --- loongarch64.risu | 573 +++ 1 file changed, 573 insertions(+) create mode 100644 loongarch64.risu diff --git a/loongarch64.risu b/loongarch64.risu new file mode 100644 index 000..d059811 ---

[RISU PATCH v2 3/5] loongarch: Implement risugen module

2022-10-13 Thread Song Gao
Reviewed-by: Richard Henderson Signed-off-by: Song Gao --- risugen_loongarch64.pm | 486 + 1 file changed, 486 insertions(+) create mode 100644 risugen_loongarch64.pm diff --git a/risugen_loongarch64.pm b/risugen_loongarch64.pm new file mode 100644 index

Re: [PATCH] target/i386: Switch back XFRM value

2022-10-13 Thread Huang, Kai
On Thu, 2022-10-13 at 02:23 -0400, Yang Zhong wrote: > > > enclave only supported SSE and x87 feature(xfrm=0x3). > > > > Is this true?  Perhaps I am missing something, but it seems env- > > > features[FEAT_XSAVE_XCR0_LO] only includes LBR bit, which is bit 15. > >   We printed the XFRM value from

Re: [RFC PATCH 1/4] docs/devel: add a maintainers section to development process

2022-10-13 Thread Markus Armbruster
Alex Bennée writes: > We don't currently have a clear place in the documentation to describe > the rolls and responsibilities of a maintainer. Lets create one so we > can. I've moved a few small bits out of other files to try and keep > everything in one place. > > Signed-off-by: Alex Bennée > -

Re: [PATCH v7 4/5] hw/mem/cxl-type3: Add CXL CDAT Data Object Exchange

2022-10-13 Thread Jonathan Cameron via
On Wed, 12 Oct 2022 14:21:15 -0400 Gregory Price wrote: > Included in this response is a recommended patch set on top of this > patch that resolves a number of issues, including style and a heap > corruption bug. > > The purpose of this patch set is to refactor the CDAT initialization > code to

Re: MultiFD and default channel out of order mapping on receive side.

2022-10-13 Thread manish.mishra
On 13/10/22 1:45 pm, Daniel P. Berrangé wrote: On Thu, Oct 13, 2022 at 01:23:40AM +0530, manish.mishra wrote: Hi Everyone, Hope everyone is doing great. I have seen some live migration issues with qemu-4.2 when using multiFD. Signature of issue is something like this. 2022-10-01T09:57:53.9728

Re: [RFC PATCH 4/4] docs/devel: try and improve the language around patch review

2022-10-13 Thread Markus Armbruster
Alex Bennée writes: > It is important that contributors take the review process seriously > and we collaborate in a respectful way while avoiding personal > attacks. Try and make this clear in the language. > > Signed-off-by: Alex Bennée Reviewed-by: Markus Armbruster

Re: [PATCH 2/5] hw/mem/cxl_type3: Pull validation checks ahead of functional code

2022-10-13 Thread Jonathan Cameron via
On Wed, 12 Oct 2022 14:21:17 -0400 Gregory Price wrote: > For style - pulling these validations ahead flattens the code. True, but at the cost of separating the check from where it is obvious why we have the check. I'd prefer to see it next to the use. Inverting the hostmem check is resonable

[PATCH v4 7/7] qga: Add HW address getting for FreeBSD

2022-10-13 Thread Alexander Ivanov
Replace a dumb function in commands-bsd.c by the code of HW address getting. Reviewed-by: Konstantin Kostiuk Reviewed-by: Marc-André Lureau Signed-off-by: Alexander Ivanov --- qga/commands-bsd.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/qga/commands-bsd.c b/qga/comma

[PATCH v2] migration/channel-block: fix return value for qio_channel_block_{readv, writev}

2022-10-13 Thread Fiona Ebner
in the error case. The documentation in include/io/channel.h states that -1 or QIO_CHANNEL_ERR_BLOCK should be returned upon error. Simply passing along the return value from the bdrv-functions has the potential to confuse the call sides. Non-blocking mode is not implemented currently, so -1 it is.

Re: [PATCH] configure: Avoid using strings binary

2022-10-13 Thread Michal Prívozník
On 10/13/22 10:37, Michal Privoznik wrote: > When determining the endiandness of the target architecture we're > building for a small program is compiled, which in an obfuscated > way declares two strings. Then, we look which string is in > correct order (using strings binary) and deduct the endian

[PATCH v4 3/7] qga: Add UFS freeze/thaw support for FreeBSD

2022-10-13 Thread Alexander Ivanov
UFS supports FS freezing through ioctl UFSSUSPEND on /dev/ufssuspend. Frozen FS can be thawed by closing /dev/ufssuspend file descriptior. Use getmntinfo to get a list of mounted FS. Reviewed-by: Konstantin Kostiuk Reviewed-by: Marc-André Lureau Signed-off-by: Alexander Ivanov --- qga/command

[PATCH v4 6/7] qga: Move HW address getting to a separate function

2022-10-13 Thread Alexander Ivanov
In the next patch FreeBSD support for guest-network-get-interfaces will be added. Previously move Linux-specific code of HW address getting to a separate functions and add a dumb function to commands-bsd.c. Reviewed-by: Konstantin Kostiuk Reviewed-by: Marc-André Lureau Signed-off-by: Alexander I

[PATCH] qapi-gen: mark coroutine QMP command functions as coroutine_fn

2022-10-13 Thread Paolo Bonzini
Coroutine commands have to be declared as coroutine_fn, but the marker does not show up in the qapi-comands-* headers; likewise, the marshaling function calls the command and therefore must be coroutine_fn. Static analysis would want coroutine_fn to match between prototype and declaration, because

[PATCH v4 2/7] qga: Move Linux-specific FS freeze/thaw code to a separate file

2022-10-13 Thread Alexander Ivanov
In the next patches we are going to add FreeBSD support for QEMU Guest Agent. In the result, code in commands-posix.c will be too cumbersome. Move Linux-specific FS freeze/thaw code to a separate file commands-linux.c keeping common POSIX code in commands-posix.c. Reviewed-by: Konstantin Kostiuk

[PATCH] blkdebug: ignore invalid rules in non-coroutine context

2022-10-13 Thread Paolo Bonzini
blkdebug events can be called from either non-coroutine or coroutine contexts. However, some actions (specifically suspend actions and errors reported with immediately=off) only make sense from within a coroutine. Currently, using those action would lead to an abort() in qemu_coroutine_yield() ("

[PATCH v4 1/7] qga: Add initial FreeBSD support

2022-10-13 Thread Alexander Ivanov
- Fix device path. - Fix virtio-serial channel initialization. - Make the code buildable in FreeBSD. Reviewed-by: Konstantin Kostiuk Acked-by: Marc-André Lureau Signed-off-by: Alexander Ivanov --- meson.build | 2 +- qga/channel-posix.c | 19 +++ qga/commands-posix.c

[PATCH v4 4/7] qga: Add shutdown/halt/reboot support for FreeBSD

2022-10-13 Thread Alexander Ivanov
Add appropriate shutdown command arguments to qmp_guest_shutdown() for FreeBSD. Reviewed-by: Konstantin Kostiuk Reviewed-by: Marc-André Lureau Signed-off-by: Alexander Ivanov --- qga/commands-posix.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/qga/commands-posix.c b/qga/commands

[PATCH v4 5/7] qga: Add support for user password setting in FreeBSD

2022-10-13 Thread Alexander Ivanov
Move qmp_guest_set_user_password() from __linux__ condition to (__linux__ || __FreeBSD__) condition. Add command and arguments for password setting in FreeBSD. Reviewed-by: Konstantin Kostiuk Reviewed-by: Marc-André Lureau Signed-off-by: Alexander Ivanov --- qga/commands-posix.c | 35 +

[PATCH v2] qapi-gen: mark coroutine QMP command functions as coroutine_fn

2022-10-13 Thread Paolo Bonzini
Coroutine commands have to be declared as coroutine_fn, but the marker does not show up in the qapi-comands-* headers; likewise, the marshaling function calls the command and therefore must be coroutine_fn. Static analysis would want coroutine_fn to match between prototype and declaration, because

Re: [PATCH] RISC-V: Add support for Ztso

2022-10-13 Thread Dr. David Alan Gilbert
* Andrea Parri (and...@rivosinc.com) wrote: > > > > Is x86's brand of memory ordering strong enough for Ztso? > > > > I thought x86 had an optimisation where it was allowed to store forward > > > > within the current CPU causing stores not to be quite strictly ordered. > > [...] > > > then a bit

[PATCH v4 0/7] qga: Add FreeBSD support

2022-10-13 Thread Alexander Ivanov
Add freeze/thaw, shutdown/halt/reboot, password setting and guest-network-get-interfaces command support for FreeBSD. v4: 6,7: Return bool instead int in guest_get_hw_addr(). v3: 1: Add a comment about echo suppressing. 5: Replace code moving by splitting the code into a few blocks under archi

Re: [PATCH 2/5] hw/mem/cxl_type3: Pull validation checks ahead of functional code

2022-10-13 Thread Jonathan Cameron via
On Thu, 13 Oct 2022 10:07:40 +0100 Jonathan Cameron wrote: > On Wed, 12 Oct 2022 14:21:17 -0400 > Gregory Price wrote: > > > For style - pulling these validations ahead flattens the code. > > True, but at the cost of separating the check from where it is > obvious why we have the check. I'd

Re: [PATCH] net: print a more actionable error when slirp is not found

2022-10-13 Thread Jakob Bohm
On 02/10/2022 15:49, Marc-André Lureau wrote: Hi On Fri, Sep 30, 2022 at 11:49 PM Christian Schoenebeck wrote: On Donnerstag, 29. September 2022 18:32:37 CEST Marc-André Lureau wrote: From: Marc-André Lureau If slirp is not found during compile-time, and not manually disabled, print a frie

Re: [PATCH] configure: Avoid using strings binary

2022-10-13 Thread Peter Maydell
On Thu, 13 Oct 2022 at 09:47, Michal Privoznik wrote: > > When determining the endiandness of the target architecture we're > building for a small program is compiled, which in an obfuscated > way declares two strings. Then, we look which string is in > correct order (using strings binary) and ded

Re: [PATCH v7 4/5] hw/mem/cxl-type3: Add CXL CDAT Data Object Exchange

2022-10-13 Thread Jonathan Cameron via
On Wed, 12 Oct 2022 12:01:54 -0400 Gregory Price wrote: > This code contains heap corruption on free, and I think should be > refactored to pre-allocate all the entries we're interested in putting > into the table. This would flatten the code and simplify the error > handling steps. > > Also, s

Re: [PATCH v7 4/5] hw/mem/cxl-type3: Add CXL CDAT Data Object Exchange

2022-10-13 Thread Jonathan Cameron via
On Wed, 12 Oct 2022 12:01:54 -0400 Gregory Price wrote: > This code contains heap corruption on free, and I think should be > refactored to pre-allocate all the entries we're interested in putting > into the table. Good point on the heap corruption.. (oops. Particularly as I raised that I didn't

Re: [PATCH] configure: Avoid using strings binary

2022-10-13 Thread Michal Prívozník
On 10/13/22 12:39, Peter Maydell wrote: > On Thu, 13 Oct 2022 at 09:47, Michal Privoznik wrote: >> >> When determining the endiandness of the target architecture we're >> building for a small program is compiled, which in an obfuscated >> way declares two strings. Then, we look which string is in

Re: [PATCH] configure: Avoid using strings binary

2022-10-13 Thread Daniel P . Berrangé
On Thu, Oct 13, 2022 at 11:39:34AM +0100, Peter Maydell wrote: > On Thu, 13 Oct 2022 at 09:47, Michal Privoznik wrote: > > > > When determining the endiandness of the target architecture we're > > building for a small program is compiled, which in an obfuscated > > way declares two strings. Then,

Re: [PATCH 4/5] hw/mem/cxl_type3: Change the CDAT allocation/free strategy

2022-10-13 Thread Jonathan Cameron via
On Wed, 12 Oct 2022 14:21:19 -0400 Gregory Price wrote: > The existing code allocates a subtable for SLBIS entries, uses a > local variable to avoid a g_autofree footgun, and the cleanup code > causes heap corruption. Ah good point (particularly given I moaned about how you were handling the fre

Re: [PATCH 3/5] hw/mem/cxl_type3: CDAT pre-allocate and check resources prior to work

2022-10-13 Thread Jonathan Cameron via
On Wed, 12 Oct 2022 14:21:18 -0400 Gregory Price wrote: > Makes the size of the allocated cdat table static (6 entries), > flattens the code, and reduces the number of exit conditions > > Signed-off-by: Gregory Price Hmm. I don't entirely like this as it stands because it leads to more fragile

Re: [PATCH RFC 0/2] qemu-thread: Strict unlock check

2022-10-13 Thread Peter Maydell
On Wed, 12 Oct 2022 at 19:16, Peter Xu wrote: > > On Tue, Oct 11, 2022 at 06:41:52PM -0400, Peter Xu wrote: > > NOTE: mark patchset RFC because "make check" will easily fail; but I didn't > > yet dig into why as I'm not familiar with the code paths that triggers, it > > can be bugs hidden or somet

Re: [PATCH 5/5] hw/mem/cxl_type3: Refactor CDAT sub-table entry initialization into a function

2022-10-13 Thread Jonathan Cameron via
On Wed, 12 Oct 2022 14:21:20 -0400 Gregory Price wrote: > The CDAT can contain multiple entries for multiple memory regions, this > will allow us to re-use the initialization code when volatile memory > region support is added. > > Signed-off-by: Gregory Price I'm in two minds about this... We

Re: [PATCH] tests/docker: Add flex/bison to `debian-all-test`

2022-10-13 Thread Alex Bennée
Anton Johansson writes: > Adds flex/bison to the debian-all-test-cross container which was missed > in the previous CI patch. These dependencies are required by the > idef-parser patchset for target/hexagon. > > Signed-off-by: Anton Johansson Queued to testing/next, thanks. -- Alex Bennée

Re: [PATCH v7 3/5] hw/cxl/cdat: CXL CDAT Data Object Exchange implementation

2022-10-13 Thread Jonathan Cameron via
On Fri, 7 Oct 2022 16:21:54 +0100 Jonathan Cameron wrote: > From: Huai-Cheng Kuo > > The Data Object Exchange implementation of CXL Coherent Device Attribute > Table (CDAT). This implementation is referring to "Coherent Device > Attribute Table Specification, Rev. 1.02, Oct. 2020" and "Compute

Re: [PATCH] blkdebug: ignore invalid rules in non-coroutine context

2022-10-13 Thread Markus Armbruster
Paolo Bonzini writes: > blkdebug events can be called from either non-coroutine or coroutine > contexts. However, some actions (specifically suspend actions and > errors reported with immediately=off) only make sense from within > a coroutine. > > Currently, using those action would lead to an a

Re: [PATCH v7 4/5] hw/mem/cxl-type3: Add CXL CDAT Data Object Exchange

2022-10-13 Thread Gregory Price
Reading through your notes, everything seems reasonable, though I'm not sure I agree with the two pass notion, though I'll wait to see the patch set. The enum is a good idea, *forehead slap*, I should have done it. If we have a local enum, why not just make it global (within the file) and allocat

Re: [PATCH] configure: Avoid using strings binary

2022-10-13 Thread Peter Maydell
On Thu, 13 Oct 2022 at 12:08, Daniel P. Berrangé wrote: > > On Thu, Oct 13, 2022 at 11:39:34AM +0100, Peter Maydell wrote: > > On Thu, 13 Oct 2022 at 09:47, Michal Privoznik wrote: > > > > > > When determining the endiandness of the target architecture we're > > > building for a small program is

Re: [PATCH v7 4/5] hw/mem/cxl-type3: Add CXL CDAT Data Object Exchange

2022-10-13 Thread Jonathan Cameron via
On Thu, 13 Oct 2022 07:36:28 -0400 Gregory Price wrote: > Reading through your notes, everything seems reasonable, though I'm not > sure I agree with the two pass notion, though I'll wait to see the patch > set. > > The enum is a good idea, *forehead slap*, I should have done it. If we > have a

[PATCH v8 4/5] hw/mem/cxl-type3: Add CXL CDAT Data Object Exchange

2022-10-13 Thread Jonathan Cameron via
From: Huai-Cheng Kuo The CDAT can be specified in two ways. One is to add ",cdat=" in "-device cxl-type3"'s command option. The file is required to provide the whole CDAT table in binary mode. The other is to use the default that provides some 'reasonable' numbers based on type of memory and size

[PATCH v8 0/5] QEMU PCIe DOE for PCIe 4.0/5.0 and CXL 2.

2022-10-13 Thread Jonathan Cameron via
Changes since v7: Details in individual patches: Thanks to Gregory Price for reviewing! - Fix heap corruption. - Check allocations succeed. - Substantial refactor of type 3 cdat table build to make it simpler and easier to add volatile entry support. V7 Cover letter - lightly edited. Whilst

[PATCH v8 1/5] hw/pci: PCIe Data Object Exchange emulation

2022-10-13 Thread Jonathan Cameron via
From: Huai-Cheng Kuo Emulation of PCIe Data Object Exchange (DOE) PCIE Base Specification r6.0 6.3 Data Object Exchange Supports multiple DOE PCIe Extended Capabilities for a single PCIe device. For each capability, a static array of DOEProtocol should be passed to pcie_doe_init(). The protocols

[PATCH v8 5/5] hw/pci-bridge/cxl-upstream: Add a CDAT table access DOE

2022-10-13 Thread Jonathan Cameron via
This Data Object Exchange Mailbox allows software to query the latency and bandwidth between ports on the switch. For now only provide information on routes between the upstream port and each downstream port (not p2p). Signed-off-by: Jonathan Cameron -- Changes since v7: - Moved to enum for cdat

[PATCH v8 3/5] hw/cxl/cdat: CXL CDAT Data Object Exchange implementation

2022-10-13 Thread Jonathan Cameron via
From: Huai-Cheng Kuo The Data Object Exchange implementation of CXL Coherent Device Attribute Table (CDAT). This implementation is referring to "Coherent Device Attribute Table Specification, Rev. 1.03, July. 2022" and "Compute Express Link Specification, Rev. 3.0, July. 2022" This patch adds co

[PATCH v8 2/5] hw/mem/cxl-type3: Add MSIX support

2022-10-13 Thread Jonathan Cameron via
This will be used by several upcoming patch sets so break it out such that it doesn't matter which one lands first. Signed-off-by: Jonathan Cameron --- hw/mem/cxl_type3.c | 9 + 1 file changed, 9 insertions(+) diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c index a71bf1afeb..568c9d

Re: [PATCH] configure: Avoid using strings binary

2022-10-13 Thread Marc-André Lureau
Hi On Thu, Oct 13, 2022 at 3:50 PM Peter Maydell wrote: > On Thu, 13 Oct 2022 at 12:08, Daniel P. Berrangé > wrote: > > > > On Thu, Oct 13, 2022 at 11:39:34AM +0100, Peter Maydell wrote: > > > On Thu, 13 Oct 2022 at 09:47, Michal Privoznik > wrote: > > > > > > > > When determining the endiand

Re: [PATCH v4 2/7] qga: Move Linux-specific FS freeze/thaw code to a separate file

2022-10-13 Thread Marc-André Lureau
Hi On Thu, Oct 13, 2022 at 1:23 PM Alexander Ivanov < alexander.iva...@virtuozzo.com> wrote: > In the next patches we are going to add FreeBSD support for QEMU Guest > Agent. In the result, code in commands-posix.c will be too cumbersome. > > Move Linux-specific FS freeze/thaw code to a separate

Re: [RFC 7/7] migration: call qemu_savevm_state_pending_exact() with the guest stopped

2022-10-13 Thread Joao Martins
+Avihai, +Jason On 03/10/2022 04:16, Juan Quintela wrote: > HACK ahead. > > There are devices that require the guest to be stopped to tell us what > is the size of its state. "... and have transferred said device state" if we are talking current vfio. We can't query size of the data_fd right n

[PATCH 00/24] More coroutine_fn fixes

2022-10-13 Thread Paolo Bonzini
Most of these were extracted from Alberto's static analysis series. After this series, the only errors reported by the analyzer are: - a call to bs->drv->bdrv_co_drain_begin from bdrv_open_driver. This relies on bdrv_co_drain_begin not having to yield, which is indeed the case right after ope

[PATCH 02/24] block: remove incorrect coroutine_fn annotation

2022-10-13 Thread Paolo Bonzini
From: Alberto Faria Signed-off-by: Alberto Faria Signed-off-by: Paolo Bonzini --- block/io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/io.c b/block/io.c index d30073036e..236b12da2a 100644 --- a/block/io.c +++ b/block/io.c @@ -2739,8 +2739,8 @@ int coroutine

Re: [PATCH v7 4/5] hw/mem/cxl-type3: Add CXL CDAT Data Object Exchange

2022-10-13 Thread Gregory Price
fwiw this is what my function looked like after the prior changes, very similar to yours proposed below static int ct3_build_cdat_table(CDATSubHeader ***cdat_table, void *priv) { CXLType3Dev *ct3d = priv; MemoryRegion *vmr = NULL, *pmr = NULL; uint64_t

[PATCH 03/24] monitor: add missing coroutine_fn annotation

2022-10-13 Thread Paolo Bonzini
From: Alberto Faria hmp_block_resize and hmp_screendump are defined as a ".coroutine = true" command, so they must be coroutine_fn. Signed-off-by: Alberto Faria Signed-off-by: Paolo Bonzini --- block/monitor/block-hmp-cmds.c | 2 +- include/block/block-hmp-cmds.h | 2 +- include/monitor/hmp.

[PATCH 07/24] coroutine-io: add missing coroutine_fn annotation to prototypes

2022-10-13 Thread Paolo Bonzini
From: Alberto Faria Signed-off-by: Alberto Faria Signed-off-by: Paolo Bonzini --- include/qemu/coroutine.h | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/qemu/coroutine.h b/include/qemu/coroutine.h index d848489b65..06d323143c 100644 --- a/include/qemu/coro

[PATCH 04/24] ssh: add missing coroutine_fn annotation

2022-10-13 Thread Paolo Bonzini
From: Alberto Faria ssh_write is only called from ssh_co_writev. Signed-off-by: Alberto Faria Signed-off-by: Paolo Bonzini --- block/ssh.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/ssh.c b/block/ssh.c index a2dc646536..ceb4f4c5bc 100644 --- a/block/ssh.c

[PATCH 06/24] coroutine-lock: add missing coroutine_fn annotation to prototypes

2022-10-13 Thread Paolo Bonzini
From: Alberto Faria The functions are marked coroutine_fn in the definition. Signed-off-by: Alberto Faria Signed-off-by: Paolo Bonzini --- include/qemu/coroutine.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/qemu/coroutine.h b/include/qemu/coroutine.

[PATCH 13/24] vmdk: manually add more coroutine_fn annotations

2022-10-13 Thread Paolo Bonzini
The validity of these was double-checked with Alberto Faria's static analyzer. Signed-off-by: Paolo Bonzini --- block/vmdk.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index f7d8856dfb..c720376aa5 100644 --

[PATCH 08/24] block: add missing coroutine_fn annotation to BlockDriverState callbacks

2022-10-13 Thread Paolo Bonzini
From: Alberto Faria Signed-off-by: Alberto Faria Signed-off-by: Paolo Bonzini --- block/qcow2.h| 14 +++--- include/block/block_int-common.h | 12 +--- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/block/qcow2.h b/block/qcow2.h index 3e7c5

[PATCH 01/24] backup: remove incorrect coroutine_fn annotation

2022-10-13 Thread Paolo Bonzini
From: Alberto Faria The .set_speed callback is not called from coroutine. Signed-off-by: Alberto Faria Signed-off-by: Paolo Bonzini --- block/backup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/backup.c b/block/backup.c index b2b649e305..6a9ad97a53 100644 --- a/

[PATCH 10/24] blkdebug: add missing coroutine_fn annotation for indirect-called functions

2022-10-13 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- block/blkdebug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index bbf2948703..b159a9b825 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -672,7 +672,7 @@ blkdebug_co_pwritev(BlockDriverState *bs,

[PATCH 11/24] qcow: manually add more coroutine_fn annotations

2022-10-13 Thread Paolo Bonzini
get_cluster_offset() and decompress_cluster() are only called from the read and write paths. The validity of these was double-checked with Alberto Faria's static analyzer. Signed-off-by: Paolo Bonzini --- block/qcow.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --gi

[PATCH 21/24] vdi: switch to *_co_* functions

2022-10-13 Thread Paolo Bonzini
From: Alberto Faria Signed-off-by: Alberto Faria Signed-off-by: Paolo Bonzini --- block/vdi.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/block/vdi.c b/block/vdi.c index e942325455..2ecf47216a 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -664,7 +664,8

[PATCH 05/24] block: add missing coroutine_fn annotation to prototypes

2022-10-13 Thread Paolo Bonzini
From: Alberto Faria The functions are marked coroutine_fn in the definition. Signed-off-by: Alberto Faria Signed-off-by: Paolo Bonzini --- include/block/block-io.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/block/block-io.h b/include/block/block-io.h inde

[PATCH 09/24] qcow2: add coroutine_fn annotation for indirect-called functions

2022-10-13 Thread Paolo Bonzini
From: Alberto Faria Signed-off-by: Alberto Faria Signed-off-by: Paolo Bonzini --- block/qcow2.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index b57f7cc8ee..b7cac50eb3 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -5287,8 +5287

  1   2   3   >