[PATCH] migrate/ram: let ram_save_target_page_legacy() return if qemu file got error

2023-08-15 Thread Guoyi Tu
When the migration process of a virtual machine using huge pages is cancelled, QEMU will continue to complete the processing of the current huge page through the qemu file object got an error set. These processing, such as compression and encryption, will consume a lot of CPU resources which may

[PATCH v6 01/12] Add virtio-sound device stub

2023-08-15 Thread Emmanouil Pitsidianakis
Add a new VIRTIO device for the virtio sound device id. Functionality will be added in the following commits. Signed-off-by: Emmanouil Pitsidianakis --- MAINTAINERS| 6 + hw/virtio/Kconfig | 5 + hw/virtio/meson.build | 1 + hw/virtio/trace-events

[PATCH v6 05/12] virtio-sound: handle VIRTIO_SND_R_PCM_INFO request

2023-08-15 Thread Emmanouil Pitsidianakis
Respond to the VIRTIO_SND_R_PCM_INFO control request with the parameters of each requested PCM stream. Signed-off-by: Emmanouil Pitsidianakis --- hw/virtio/trace-events | 1 + hw/virtio/virtio-snd.c | 78 ++ 2 files changed, 79 insertions(+) diff --git a

[PATCH v6 02/12] Add virtio-sound-pci device

2023-08-15 Thread Emmanouil Pitsidianakis
This patch adds a PCI wrapper device for the virtio-sound device. It is necessary to instantiate a virtio-snd device in a guest. All sound logic will be added to the virtio-snd device in the following commits. To add this device with a guest, you'll need a >=5.13 kernel compiled with CONFIG_SND_VI

[PATCH v6 08/12] virtio-sound: handle VIRTIO_SND_R_PCM_PREPARE

2023-08-15 Thread Emmanouil Pitsidianakis
Handles the PCM prepare control request. It initializes a PCM stream when the guests asks for it. Signed-off-by: Emmanouil Pitsidianakis --- hw/virtio/virtio-snd.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/hw/virtio/virtio-snd.c b/hw/virtio/virtio-snd.c index c

[PATCH v6 00/12] Add VIRTIO sound card

2023-08-15 Thread Emmanouil Pitsidianakis
This patch series adds an audio device implementing the recent virtio sound spec (1.2) and a corresponding PCI wrapper device. https://github.com/epilys/qemu-virtio-snd/tree/virtio-snd-v6 Main differences with v5 patch series [^v5] : - Free any existing PCM stream resources before allocating

[PATCH v6 06/12] virtio-sound: handle VIRTIO_SND_R_PCM_{START,STOP}

2023-08-15 Thread Emmanouil Pitsidianakis
Handle the start and stop control messages for a stream_id. This request does nothing at the moment except for replying to it. Audio playback or capture will be started/stopped here in follow-up commits. Signed-off-by: Emmanouil Pitsidianakis --- hw/virtio/trace-events | 1 + hw/virtio/virtio-s

[PATCH v6 10/12] virtio-sound: implement audio output (TX)

2023-08-15 Thread Emmanouil Pitsidianakis
Handle output IO messages in the transmit (TX) virtqueue. It allocates a VirtIOSoundPCMBlock for each IO message and copies the data buffer to it. When the IO buffer is written to the host's sound card, the guest will be notified that it has been consumed. The lifetime of an IO message is: 1. Gu

[PATCH v6 04/12] virtio-sound: set PCM stream parameters

2023-08-15 Thread Emmanouil Pitsidianakis
This commit sets the virtio-snd device's default PCM parameters in virtio_snd_pcm_set_params_impl(). The same function will be used to set parameters from the guest with VIRTIO_SND_R_PCM_SET_PARAMS in a follow-up commit. PCM parameters describe the sound card parameters that the guest's kernel see

[PATCH v6 07/12] virtio-sound: handle VIRTIO_SND_PCM_SET_PARAMS

2023-08-15 Thread Emmanouil Pitsidianakis
Handle the set parameters control request. It reconfigures a stream based on a guest's preference if the values are valid and supported. Signed-off-by: Emmanouil Pitsidianakis --- hw/virtio/trace-events | 1 + hw/virtio/virtio-snd.c | 26 ++ 2 files changed, 27 insertion

[PATCH v6 12/12] docs/system: add basic virtio-snd documentation

2023-08-15 Thread Emmanouil Pitsidianakis
This commit adds basic documentation for using virtio-snd. Signed-off-by: Emmanouil Pitsidianakis --- docs/system/device-emulation.rst | 1 + docs/system/devices/virtio-snd.rst | 36 ++ 2 files changed, 37 insertions(+) create mode 100644 docs/system/devices/virti

[PATCH v6 03/12] virtio-sound: handle control messages and streams

2023-08-15 Thread Emmanouil Pitsidianakis
Receive guest requests in the control (CTRL) queue of the virtio sound device and reply with a NOT SUPPORTED error to all control commands. The receiving handler is virtio_snd_handle_ctrl(). It stores all control messages in the queue in the device's command queue. Then it calls virtio_snd_process

[PATCH v6 09/12] virtio-sound: handle VIRTIO_SND_PCM_RELEASE

2023-08-15 Thread Emmanouil Pitsidianakis
Handle the PCM release control request, which is necessary for flushing pending sound IO. No IO is handled yet so currently it only replies to the request. Signed-off-by: Emmanouil Pitsidianakis --- hw/virtio/trace-events | 1 + hw/virtio/virtio-snd.c | 38 +-

[PATCH v6 11/12] virtio-sound: implement audio capture (RX)

2023-08-15 Thread Emmanouil Pitsidianakis
To perform audio capture we duplicate the TX logic of the previous commit with the following difference: we receive data from the QEMU audio backend and write it in the virt queue IO buffers the guest sends to QEMU. When they are full (i.e. they have `period_bytes` amount of data) or when recording

Re: qemu-system-riscv64 -cpu host uses wrong privilege spec version

2023-08-15 Thread Daniel Henrique Barboza
On 8/14/23 09:49, Andreas Schwab wrote: When running a KVM enabled qemu inside a qemu instance, I get these warnings: $ qemu-system-riscv64 -cpu host -machine virt,accel=kvm qemu-system-riscv64: warning: disabling h extension for hart 0x because privilege spec version does no

[PATCH v2] arm/kvm: Enable support for KVM_CAP_ARM_EAGER_SPLIT_CHUNK_SIZE

2023-08-15 Thread Shameer Kolothum via
Now that we have Eager Page Split support added for ARM in the kernel, enable it in Qemu. This adds, -eager-split-size to -accel sub-options to set the eager page split chunk size. -enable KVM_CAP_ARM_EAGER_SPLIT_CHUNK_SIZE. The chunk size specifies how many pages to break at a time, using a sin

Re: qemu-system-riscv64 -cpu host uses wrong privilege spec version

2023-08-15 Thread Andreas Schwab
On Aug 15 2023, Daniel Henrique Barboza wrote: > This was fixed in 8.1 by eddabb6b88 ("target/riscv: skip features setup for > KVM CPUs"). > Which QEMU version/branch are you using? Thanks, this was tested with 8.0.4. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8

Re: qemu-system-m68k: ../hw/scsi/scsi-disk.c:557: scsi_write_data: Assertion `r->req.aiocb == NULL' failed.

2023-08-15 Thread Waldemar Brodkorb
Hi, Thomas Huth wrote, > On 13/08/2023 09.46, Waldemar Brodkorb wrote: > > Hi, > > > > I am using Qemu 8.0.3 and getting this error: > > qemu-system-m68k: ../hw/scsi/scsi-disk.c:557: scsi_write_data: Assertion > > `r->req.aiocb == NULL' failed. > > > > It happens f.e. when I extract the glibc s

Re: [PATCH 2/5] qemu-nbd: fix regression with qemu-nbd --fork run over ssh

2023-08-15 Thread Denis V. Lunev
On 8/14/23 16:14, Kevin Wolf wrote: Am 17.07.2023 um 16:55 hat Denis V. Lunev geschrieben: Commit e6df58a5578fee7a50bbf36f4a50a2781cff855d Author: Hanna Reitz Date: Wed May 8 23:18:18 2019 +0200 qemu-nbd: Do not close stderr has introduced an interesting regression. Original be

[PATCH 1/2] virtio: use blk_io_plug_call() in virtio_irqfd_notify()

2023-08-15 Thread Stefan Hajnoczi
virtio-blk and virtio-scsi invoke virtio_irqfd_notify() to send Used Buffer Notifications from an IOThread. This involves an eventfd write(2) syscall. Calling this repeatedly when completing multiple I/O requests in a row is wasteful. Use the blk_io_plug_call() API to batch together virtio_irqfd_n

[PATCH 0/2] virtio-blk: use blk_io_plug_call() instead of notification BH

2023-08-15 Thread Stefan Hajnoczi
Replace the seldom-used virtio-blk notification BH mechanism with blk_io_plug(). This is part of an effort to enable the multi-queue block layer in virtio-blk. The notification BH was not multi-queue friendly. The blk_io_plug() mechanism improves fio rw=randread bs=4k iodepth=64 numjobs=8 IOPS by

[PATCH 2/2] virtio-blk: remove batch notification BH

2023-08-15 Thread Stefan Hajnoczi
There is a batching mechanism for virtio-blk Used Buffer Notifications that is no longer needed because the previous commit added batching to virtio_notify_irqfd(). Note that this mechanism was rarely used in practice because it is only enabled when EVENT_IDX is not negotiated by the driver. Moder

Re: [PATCH 2/5] qemu-nbd: fix regression with qemu-nbd --fork run over ssh

2023-08-15 Thread Denis V. Lunev
On 8/15/23 12:40, Denis V. Lunev wrote: On 8/14/23 16:14, Kevin Wolf wrote: Am 17.07.2023 um 16:55 hat Denis V. Lunev geschrieben: Commit e6df58a5578fee7a50bbf36f4a50a2781cff855d Author: Hanna Reitz Date:   Wed May 8 23:18:18 2019 +0200 qemu-nbd: Do not close stderr has introduc

[PATCH] include/hw/virtio/virtio-gpu: Fix virtio-gpu with blob on big endian hosts

2023-08-15 Thread Thomas Huth
Using "-device virtio-gpu,blob=true" currently does not work on big endian hosts (like s390x). The guest kernel prints an error message like: [drm:virtio_gpu_dequeue_ctrl_func [virtio_gpu]] *ERROR* response 0x1200 (command 0x10c) and the display stays black. When running QEMU with "-d guest_err

Re: [PATCH] migrate/ram: let ram_save_target_page_legacy() return if qemu file got error

2023-08-15 Thread Fabiano Rosas
Guoyi Tu writes: > When the migration process of a virtual machine using huge pages is > cancelled, > QEMU will continue to complete the processing of the current huge page > through the qemu file object got an error set. These processing, such as > compression and encryption, will consume a lot

Re: [PATCH v6 04/12] target/riscv/cpu.c: del DEFINE_PROP_END_OF_LIST() from riscv_cpu_extensions

2023-08-15 Thread Daniel Henrique Barboza
On 8/10/23 14:49, Alistair Francis wrote: On Thu, Jul 27, 2023 at 6:20 PM Daniel Henrique Barboza wrote: This last blank element is used by the 'for' loop to check if a property has a valid name. Remove it and use ARRAY_SIZE() instead like riscv_cpu_options is already using. All future arr

Re: [PATCH for-8.2 2/4] tests/migration-test: Add a test for null parameter setups

2023-08-15 Thread Fabiano Rosas
Peter Xu writes: > Add a test for StrOrNull parameters (tls-*). > > Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas

Re: [PATCH for-8.2 1/4] migration/qmp: Fix crash on setting tls-authz with null

2023-08-15 Thread Fabiano Rosas
Peter Xu writes: > QEMU will crash if anyone tries to set tls-authz (which is a type > StrOrNull) with 'null' value. Fix it in the easy way by converting it to > qstring just like the other two tls parameters. > > Cc: qemu-sta...@nongnu.org # v4.0+ > Fixes: d2f1d29b95 ("migration: add support fo

Re: [PATCH 07/24] target/ppc: Use tcg_gen_negsetcond_*

2023-08-15 Thread Nicholas Piggin
On Tue Aug 8, 2023 at 1:11 PM AEST, Richard Henderson wrote: > Signed-off-by: Richard Henderson Reviewed-by: Nicholas Piggin Tested-by: Nicholas Piggin > --- > target/ppc/translate/fixedpoint-impl.c.inc | 6 -- > target/ppc/translate/vmx-impl.c.inc| 8 +++- > 2 files changed,

Re: [PATCH v6 04/12] target/riscv/cpu.c: del DEFINE_PROP_END_OF_LIST() from riscv_cpu_extensions

2023-08-15 Thread Peter Maydell
On Tue, 15 Aug 2023 at 13:44, Daniel Henrique Barboza wrote: > > > > On 8/10/23 14:49, Alistair Francis wrote: > > On Thu, Jul 27, 2023 at 6:20 PM Daniel Henrique Barboza > > wrote: > >> > >> This last blank element is used by the 'for' loop to check if a property > >> has a valid name. > >> > >>

Re: [PATCH 11/24] tcg/ppc: Use the Set Boolean Extension

2023-08-15 Thread Nicholas Piggin
On Tue Aug 8, 2023 at 1:11 PM AEST, Richard Henderson wrote: > The SETBC family of instructions requires exactly two insns for > all comparisions, saving 0-3 insns per (neg)setcond. > Nice patch. Tested on a POWER10. Tested-by: Nicholas Piggin > Signed-off-by: Richard Henderson > --- > tcg/pp

Re: [PULL 00/14] linux-user image mapping fixes

2023-08-15 Thread Michael Tokarev
09.08.2023 00:08, Richard Henderson пишет: The following changes since commit 0450cf08976f9036feaded438031b4cba94f6452: Merge tag 'fixes-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging (2023-08-07 13:55:00 -0700) are available in the Git repository at: https://git

Re: [PATCH v5 3/9] virtio-gpu: hostmem

2023-08-15 Thread Manos Pitsidianakis
Reviewed-by: Emmanouil Pitsidianakis Tested-by: Emmanouil Pitsidianakis On Tue, 15 Aug 2023 03:35, Gurchetan Singh wrote: From: Gerd Hoffmann Use VIRTIO_GPU_SHM_ID_HOST_VISIBLE as id for virtio-gpu. Signed-off-by: Antonio Caggiano Tested-by: Alyssa Ross Acked-by: Michael S. Tsirkin ---

Re: [PATCH v5 4/9] virtio-gpu: blob prep

2023-08-15 Thread Manos Pitsidianakis
Reviewed-by: Emmanouil Pitsidianakis Tested-by: Emmanouil Pitsidianakis On Tue, 15 Aug 2023 03:35, Gurchetan Singh wrote: From: Antonio Caggiano This adds preparatory functions needed to: - decode blob cmds - tracking iovecs Signed-off-by: Antonio Caggiano Signed-off-by: Dmitry O

Re: [PATCH v5 5/9] gfxstream + rutabaga prep: added need defintions, fields, and options

2023-08-15 Thread Manos Pitsidianakis
On Tue, 15 Aug 2023 03:35, Gurchetan Singh wrote: This modifies the common virtio-gpu.h file have the fields and defintions needed by gfxstream/rutabaga, by VirtioGpuRutabaga. The command to run these would be: Signed-off-by: Gurchetan Singh Tested-by: Alyssa Ross --- -device virtio-vga-ruta

[PATCH 1/5] migration/ram: Remove RAMState from xbzrle_cache_zero_page

2023-08-15 Thread Fabiano Rosas
'rs' is not used in that function. It's a leftover from commit 9360447d34 ("ram: Use MigrationStats for statistics"). Signed-off-by: Fabiano Rosas --- migration/ram.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 9040d66e61..87ef

[PATCH 3/5] migration/ram: Move xbzrle zero page handling into save_zero_page

2023-08-15 Thread Fabiano Rosas
It makes a bit more sense to have the zero page handling of xbzrle right where we save the zero page. This also makes save_zero_page() follow the same format as save_compress_page() at the top level of ram_save_target_page_legacy(). Signed-off-by: Fabiano Rosas --- migration/ram.c | 27

[PATCH 2/5] migration/ram: Stop passing QEMUFile around in save_zero_page

2023-08-15 Thread Fabiano Rosas
We don't need the QEMUFile when we're already passing the PageSearchStatus. Signed-off-by: Fabiano Rosas --- migration/ram.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 87efab72e8..761f43dc34 100644 --- a/migration/ram.c

[PATCH 5/5] migration/ram: Merge save_zero_page functions

2023-08-15 Thread Fabiano Rosas
We don't need to do this in two pieces. One single function makes it easier to grasp, specially since it removes the indirection on the return value handling. Signed-off-by: Fabiano Rosas --- migration/ram.c | 41 +++-- 1 file changed, 11 insertions(+), 30 del

[PATCH 0/5] migration/ram: Merge zero page handling

2023-08-15 Thread Fabiano Rosas
Hi, This is another small series that I extracted from my fixed-ram series and that could be already considered for merging. This is just code movement, no functional change. The objective is to consolidate the zero page handling in the same routine that saves the page header and does accounting.

[PATCH 4/5] migration/ram: Return early from save_zero_page

2023-08-15 Thread Fabiano Rosas
Invert the first conditional so we return early when len == 0. This is merely to make the next patch easier to read. Signed-off-by: Fabiano Rosas --- migration/ram.c | 29 +++-- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/migration/ram.c b/migration/ra

[PATCH 1/9] gitlab: enable ccache for many build jobs

2023-08-15 Thread Alex Bennée
From: Daniel P. Berrangé The `ccache` tool can be very effective at reducing compilation times when re-running pipelines with only minor changes each time. For example a fresh 'build-system-fedora' job will typically take 20 minutes on the gitlab.com shared runners. With ccache this is reduced to

[PATCH 7/9] gdbstub: remove unused user_ctx field

2023-08-15 Thread Alex Bennée
This was always NULL so drop it. Signed-off-by: Alex Bennée --- gdbstub/gdbstub.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index e7d48fa0d4..8e9bc17e07 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -836

[PATCH 6/9] gdbstub: fixes cases where wrong threads were reported to GDB on SIGINT

2023-08-15 Thread Alex Bennée
From: Matheus Branco Borella This fix is implemented by having the vCont handler set the value of `gdbserver_state.c_cpu` if any threads are to be resumed. The specific CPU picked is arbitrarily from the ones to be resumed, but it should be okay, as all GDB cares about is that it is a resumed thr

[PATCH 9/9] gdbstub: replace global gdb_has_xml with a function

2023-08-15 Thread Alex Bennée
Try and make the self reported global hack a little less hackish by providing a query function instead. As gdb_has_xml was always set if we negotiated XML we can now use the presence of ->target_xml as the test instead. Signed-off-by: Alex Bennée --- gdbstub/internals.h| 1 + include/exec/g

[PATCH 4/9] tests: remove test-gdbstub.py

2023-08-15 Thread Alex Bennée
This isn't directly called by our CI and because it doesn't run via our run-test.py script does things slightly differently. Lets remove it as we have plenty of working in-tree tests now for various aspects of gdbstub. Signed-off-by: Alex Bennée --- tests/guest-debug/test-gdbstub.py | 177 --

[PATCH 0/9] gdbstub and testing fixes for 8.2

2023-08-15 Thread Alex Bennée
This is the current state for my maintainer queue for when the tree re-opens. It includes the previous testing/next fixes as well as some more cleanups to modernise the gdbstub tests and code. It also includes Matheus' fixes for SIGINT. The following patches need review: gdbstub: replace global

[PATCH 2/9] tests/docker: cleanup non-verbose output

2023-08-15 Thread Alex Bennée
Even with --quiet docker will spam the sha256 to the console. Avoid this by redirecting stdout. While we are at it fix the name we echo which was broken during 0b1a649047 (tests/docker: use direct RUNC call to build containers). Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth --- tests/dock

[PATCH 8/9] gdbstub: refactor get_feature_xml

2023-08-15 Thread Alex Bennée
Try to bring up the code to more modern standards by: - use dynamic GString built xml over a fixed buffer - use autofree to save on explicit g_free() calls - don't hand hack strstr to find the delimiter Signed-off-by: Alex Bennée --- gdbstub/internals.h | 2 +- gdbstub/gdbstub.c | 62 +

[PATCH 5/9] tests/tcg: clean-up gdb confirm/pagination settings

2023-08-15 Thread Alex Bennée
We can do this all in the run-test.py script so remove the extraneous bits from the individual tests which got copied from the original non-CI gdb tests. Signed-off-by: Alex Bennée --- tests/guest-debug/run-test.py | 2 ++ tests/tcg/aarch64/gdbstub/test-sve-ioctl.py

[PATCH 3/9] tests/tcg: remove quoting for info output

2023-08-15 Thread Alex Bennée
This avoids ugly multi-line wrapping for the test on non V=1 builds. Signed-off-by: Alex Bennée --- tests/tcg/aarch64/Makefile.target | 2 +- tests/tcg/multiarch/system/Makefile.softmmu-target | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/tcg/aar

Re: [PATCH 2/5] qemu-nbd: fix regression with qemu-nbd --fork run over ssh

2023-08-15 Thread Kevin Wolf
Am 15.08.2023 um 14:17 hat Denis V. Lunev geschrieben: > Hi! > > Small side note. > > I am 100% sure that I have run this set of tests and > there was no fault. I have re-run them and once > again has not get the fault :-) > > The reason for that is quite interesting: > * the test does not start

Re: [PATCH v5 6/9] gfxstream + rutabaga: add initial support for gfxstream

2023-08-15 Thread Manos Pitsidianakis
Reviewed-by: Emmanouil Pitsidianakis Tested-by: Emmanouil Pitsidianakis On Tue, 15 Aug 2023 03:35, Gurchetan Singh wrote: This adds initial support for gfxstream and cross-domain. Both features rely on virtio-gpu blob resources and context types, which are also implemented in this patch. gf

Re: [PATCH v5 7/9] gfxstream + rutabaga: meson support

2023-08-15 Thread Manos Pitsidianakis
Reviewed-by: Emmanouil Pitsidianakis Tested-by: Emmanouil Pitsidianakis On Tue, 15 Aug 2023 03:35, Gurchetan Singh wrote: - Add meson detection of rutabaga_gfx - Build virtio-gpu-rutabaga.c + associated vga/pci files when present Signed-off-by: Gurchetan Singh Tested-by: Alyssa Ross --- v

Re: [PATCH v6 11/12] virtio-sound: implement audio capture (RX)

2023-08-15 Thread 林伟6
typo error? this should be rx queue callback called ? +virtio_snd_handle_rx_xfer(void) "tx queue callback called" > From: "Emmanouil Pitsidianakis" > Date: Tue, Aug 15, 2023, 17:10 > Subject: [PATCH v6 11/12] virtio-sound: implement audio capture (RX) > To: > Cc: "Emmanouil Pitsidianakis", "Igo

Re: [PATCH v5 8/9] gfxstream + rutabaga: enable rutabaga

2023-08-15 Thread Manos Pitsidianakis
Reviewed-by: Emmanouil Pitsidianakis Tested-by: Emmanouil Pitsidianakis On Tue, 15 Aug 2023 03:35, Gurchetan Singh wrote: This change enables rutabaga to receive virtio-gpu-3d hypercalls when it is active. Signed-off-by: Gurchetan Singh Tested-by: Alyssa Ross --- v3: Whitespace fix (Akihik

Re: [PATCH v5 6/9] gfxstream + rutabaga: add initial support for gfxstream

2023-08-15 Thread Akihiko Odaki
On 2023/08/15 9:35, Gurchetan Singh wrote: This adds initial support for gfxstream and cross-domain. Both features rely on virtio-gpu blob resources and context types, which are also implemented in this patch. gfxstream has a long and illustrious history in Android graphics paravirtualization.

Re: [PATCH v5 9/9] docs/system: add basic virtio-gpu documentation

2023-08-15 Thread Manos Pitsidianakis
Reviewed-by: Emmanouil Pitsidianakis On Tue, 15 Aug 2023 03:35, Gurchetan Singh wrote: This adds basic documentation for virtio-gpu. Suggested-by: Akihiko Odaki Signed-off-by: Gurchetan Singh --- v2: - Incorporated suggestions by Akihiko Odaki - Listed the currently supported capset_name

Re: LTP test related to virtio releasing and reassigning resource leads to guest hung

2023-08-15 Thread Stefan Hajnoczi
On Thu, 10 Aug 2023 at 22:27, longguang.yue wrote: > > > 一) > Can you post the guest kernel messages (dmesg)? If the guest is hanging > then it may be easiest to configure a serial console so the kernel > messages are sent to the host where you can see them. > > Does the hang occur during the LTP

Re: [PATCH 2/5] qemu-nbd: fix regression with qemu-nbd --fork run over ssh

2023-08-15 Thread Peter Maydell
On Tue, 15 Aug 2023 at 15:59, Kevin Wolf wrote: > In general I think it makes sense that FAIL means that the test could > run as expected, but we got an unexpected result (i.e. this is likely a > QEMU bug), and SKIP means that the test couldn't meaningfully be > performed on the host system. > > M

Re: [PATCH v5 6/9] gfxstream + rutabaga: add initial support for gfxstream

2023-08-15 Thread Gurchetan Singh
On Tue, Aug 15, 2023 at 8:07 AM Akihiko Odaki wrote: > On 2023/08/15 9:35, Gurchetan Singh wrote: > > This adds initial support for gfxstream and cross-domain. Both > > features rely on virtio-gpu blob resources and context types, which > > are also implemented in this patch. > > > > gfxstream h

[PATCH 2/2] block-backend: process zoned requests in the current AioContext

2023-08-15 Thread Stefan Hajnoczi
Process zoned requests in the current thread's AioContext instead of in the BlockBackend's AioContext. There is no need to use the BlockBackend's AioContext thanks to CoMutex bs->wps->colock, which protects zone metadata. Signed-off-by: Stefan Hajnoczi --- block/block-backend.c | 12 ++-

[PATCH 1/2] block-backend: process I/O in the current AioContext

2023-08-15 Thread Stefan Hajnoczi
Switch blk_aio_*() APIs over to multi-queue by using qemu_get_current_aio_context() instead of blk_get_aio_context(). This change will allow devices to process I/O in multiple IOThreads in the future. I audited existing blk_aio_*() callers: - migration/block.c: blk_mig_lock() protects the data acc

[PATCH 0/2] block-backend: process I/O in the current AioContext

2023-08-15 Thread Stefan Hajnoczi
Switch blk_aio_*() APIs over to multi-queue by using qemu_get_current_aio_context() instead of blk_get_aio_context(). This change will allow devices to process I/O in multiple IOThreads in the future. Stefan Hajnoczi (2): block-backend: process I/O in the current AioContext block-backend: proc

Re: [PATCH RFC 1/7] include/sysemu/os-posix.h: move *daemonize* declaration together

2023-08-15 Thread Eric Blake
On Sat, Aug 12, 2023 at 03:47:55PM +0300, Michael Tokarev wrote: > Signed-off-by: Michael Tokarev > --- > include/sysemu/os-posix.h | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) Reviewed-by: Eric Blake > > diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h > ind

Re: [RFC PATCH] tcg/ppc: Enable direct branching tcg_out_goto_tb with TCG_REG_TB

2023-08-15 Thread Richard Henderson
On 8/14/23 22:01, Jordan Niethe wrote: Direct branch patching was disabled when using TCG_REG_TB in commit 736a1588c1 ("tcg/ppc: Fix race in goto_tb implementation"). Commit 7502f89c74 ("tcg/ppc: Use prefixed instructions for tcg_out_goto_tb") used the support for pc relative ISAv3.1 instructions

Re: [PATCH 2/5] qemu-nbd: fix regression with qemu-nbd --fork run over ssh

2023-08-15 Thread Eric Blake
On Mon, Aug 14, 2023 at 04:14:41PM +0200, Kevin Wolf wrote: > Am 17.07.2023 um 16:55 hat Denis V. Lunev geschrieben: > > Commit e6df58a5578fee7a50bbf36f4a50a2781cff855d > > Author: Hanna Reitz > > Date: Wed May 8 23:18:18 2019 +0200 > > qemu-nbd: Do not close stderr > > has introduce

Re: [PATCH RFC 2/7] os-posix: create and export os_set_runas()

2023-08-15 Thread Eric Blake
On Sat, Aug 12, 2023 at 03:47:56PM +0300, Michael Tokarev wrote: > Signed-off-by: Michael Tokarev > --- > include/sysemu/os-posix.h | 1 + > os-posix.c| 23 --- > 2 files changed, 17 insertions(+), 7 deletions(-) > Reviewed-by: Eric Blake -- Eric Blake, Pr

Re: [PATCH RFC 3/7] os-posix.c: create and export os_set_chroot()

2023-08-15 Thread Eric Blake
On Sat, Aug 12, 2023 at 03:47:57PM +0300, Michael Tokarev wrote: > Signed-off-by: Michael Tokarev > --- > include/sysemu/os-posix.h | 1 + > os-posix.c| 9 +++-- > 2 files changed, 8 insertions(+), 2 deletions(-) > Reviewed-by: Eric Blake -- Eric Blake, Principal Software

Re: [PATCH RFC 4/7] os-posix.c, softmmu/vl.c: move os_parse_cmd_args() into qemu_init()

2023-08-15 Thread Eric Blake
On Sat, Aug 12, 2023 at 03:47:58PM +0300, Michael Tokarev wrote: > This will stop linking softmmu-specific os_parse_cmd_args() into every > qemu executable which happens to use other functions from os-posix.c, > such as os_set_line_buffering() or os_setup_signal_handling(). > > Also, since there's

Re: [PATCH v6 04/12] target/riscv/cpu.c: del DEFINE_PROP_END_OF_LIST() from riscv_cpu_extensions

2023-08-15 Thread Daniel Henrique Barboza
On 8/15/23 10:15, Peter Maydell wrote: On Tue, 15 Aug 2023 at 13:44, Daniel Henrique Barboza wrote: On 8/10/23 14:49, Alistair Francis wrote: On Thu, Jul 27, 2023 at 6:20 PM Daniel Henrique Barboza wrote: This last blank element is used by the 'for' loop to check if a property has a v

Re: [PATCH] target/i386: Fix reporting of CPU dies when nr_cores=nr_threads=1

2023-08-15 Thread ‍小太
On Thu, 27 Jul 2023 at 19:16, ‍小太 wrote: > > On Thu, 27 Jul 2023 at 11:25, Xiaoyao Li wrote: > > > > On 7/24/2023 2:59 AM, 小太 wrote: > > > When QEMU is started with `-smp D,sockets=1,dies=D,cores=1,threads=1` > > > (that > > > is, 1 socket with D dies but each die contains just a single thread),

Re: [PATCH RFC 5/7] softmmu/vl.c: inline include/qemu/qemu-options.h into vl.c

2023-08-15 Thread Eric Blake
On Sat, Aug 12, 2023 at 03:47:59PM +0300, Michael Tokarev wrote: > qemu-options.h just includes qemu-options.def with some #defines. > We already do this in vl.c in other place. Since no other file > includes qemu-options.h anymore, just inline it in vl.c. > > This effectively reverts second half

Re: [PATCH RFC 6/7] os-posix.c: move code around

2023-08-15 Thread Eric Blake
On Sat, Aug 12, 2023 at 03:48:00PM +0300, Michael Tokarev wrote: > this moves code blocks so that functions and variables which > belongs to the same concept are now close to each other. > There's no actual code changes in there. > > Signed-off-by: Michael Tokarev > --- > os-posix.c | 49 +++

Re: [PATCH RFC 7/7] util/async-teardown.c: move to softmmu/, only build it when system build is requested

2023-08-15 Thread Eric Blake
On Sat, Aug 12, 2023 at 03:48:01PM +0300, Michael Tokarev wrote: > Signed-off-by: Michael Tokarev > --- > {util => softmmu}/async-teardown.c | 0 > softmmu/meson.build| 1 + > util/meson.build | 1 - > 3 files changed, 1 insertion(+), 1 deletion(-) > rename {uti

[PATCH v3 00/14] tcg/ppc: direct branching, power9, power10

2023-08-15 Thread Richard Henderson
Supercedes: 20230808030250.50602-1-richard.hender...@linaro.org Supercedes: 20230815050117.34731-1-jniet...@gmail.com Build on Jordan's patch to allow direct branching and USE_REG_TB to co-exist. Use the power9 addpcis wherever pc-relative addrs might be handy. Merge in my power10 patches for pr

[PATCH v3 03/14] tcg/ppc: Enable direct branching tcg_out_goto_tb with TCG_REG_TB

2023-08-15 Thread Richard Henderson
From: Jordan Niethe Direct branch patching was disabled when using TCG_REG_TB in commit 736a1588c1 ("tcg/ppc: Fix race in goto_tb implementation"). The issue with direct branch patching with TCG_REG_TB is the lack of synchronization between the new TCG_REG_TB being established and the direct bra

[PATCH v3 12/14] tcg/ppc: Use prefixed instructions in tcg_out_dupi_vec

2023-08-15 Thread Richard Henderson
The prefixed instructions have a pc-relative form to use here. Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 9 + 1 file changed, 9 insertions(+) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 670811b636..0cdb7ef37a 100644 --- a/tcg/ppc/tcg-targ

[PATCH v3 04/14] tcg/ppc: Reinterpret tb-relative to TB+4

2023-08-15 Thread Richard Henderson
It saves one insn to load the address of TB+4 instead of TB. Adjust all of the indexing to match. Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc

[PATCH v3 13/14] tcg/ppc: Use PLD in tcg_out_goto_tb

2023-08-15 Thread Richard Henderson
Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 0cdb7ef37a..20aaa90af2 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -2708,6 +2708,9 @@ static v

[PATCH v3 08/14] tcg/ppc: Use ADDPCIS in tcg_out_goto_tb

2023-08-15 Thread Richard Henderson
Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index a5c1891eb6..b7d1b4f1bb 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -2

[PATCH v3 05/14] tcg/ppc: Use ADDPCIS in tcg_out_tb_start

2023-08-15 Thread Richard Henderson
With ISA v3.0, we can use ADDPCIS instead of BCL+MFLR to load NIP. Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 25 ++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 19004fa568..36

[PATCH v3 07/14] tcg/ppc: Use ADDPCIS for the constant pool

2023-08-15 Thread Richard Henderson
Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 12 1 file changed, 12 insertions(+) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index a302bfff2e..a5c1891eb6 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -1076,6 +1076,12

[PATCH v3 02/14] tcg: Add tcg_out_tb_start backend hook

2023-08-15 Thread Richard Henderson
This hook may emit code at the beginning of the TB. Suggested-by: Jordan Niethe Signed-off-by: Richard Henderson --- tcg/tcg.c| 3 +++ tcg/aarch64/tcg-target.c.inc | 5 + tcg/arm/tcg-target.c.inc | 5 + tcg/i386/tcg-target.c.inc| 5 + tcg/

[PATCH v3 01/14] tcg/ppc: Untabify tcg-target.c.inc

2023-08-15 Thread Richard Henderson
Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 511e14b180..642d0fd128 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -221,7 +

[PATCH v3 14/14] RFC tcg/ppc: Disable TCG_REG_TB for Power9/Power10

2023-08-15 Thread Richard Henderson
This may or may not improve performance. It appears to result in slightly larger code, but perhaps not enough to matter. Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target

[PATCH v3 06/14] tcg/ppc: Use ADDPCIS in tcg_out_movi_int

2023-08-15 Thread Richard Henderson
Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 13 + 1 file changed, 13 insertions(+) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 36b4f61236..a302bfff2e 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -1050,6 +1050,1

[PATCH v3 11/14] tcg/ppc: Use PLD in tcg_out_movi for constant pool

2023-08-15 Thread Richard Henderson
The prefixed instruction has a pc-relative form to use here. Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 24 1 file changed, 24 insertions(+) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 1aece2cbf7..670811b636 100644 --- a/t

[PATCH v3 09/14] tcg/ppc: Use PADDI in tcg_out_movi

2023-08-15 Thread Richard Henderson
PADDI can load 34-bit immediates and 34-bit pc-relative addresses. Reviewed-by: Jordan Niethe Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 51 1 file changed, 51 insertions(+) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target

[PATCH v3 10/14] tcg/ppc: Use prefixed instructions in tcg_out_mem_long

2023-08-15 Thread Richard Henderson
When the offset is out of range of the non-prefixed insn, but fits the 34-bit immediate of the prefixed insn, use that. Reviewed-by: Jordan Niethe Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 66 1 file changed, 66 insertions(+) diff

[PATCH v7 05/12] target/riscv/cpu.c: split vendor exts from riscv_cpu_extensions[]

2023-08-15 Thread Daniel Henrique Barboza
Our goal is to make riscv_cpu_extensions[] hold only ratified, non-vendor extensions. Create a new riscv_cpu_vendor_exts[] array for them, changing riscv_cpu_add_user_properties() and riscv_cpu_add_kvm_properties() accordingly. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis

[PATCH v7 01/12] target/riscv/cpu.c: split CPU options from riscv_cpu_extensions[]

2023-08-15 Thread Daniel Henrique Barboza
We'll add a new CPU type that will enable a considerable amount of extensions. To make it easier for us we'll do a few cleanups in our existing riscv_cpu_extensions[] array. Start by splitting all CPU non-boolean options from it. Create a new riscv_cpu_options[] array for them. Add all these prope

[PATCH v7 02/12] target/riscv/cpu.c: skip 'bool' check when filtering KVM props

2023-08-15 Thread Daniel Henrique Barboza
After the introduction of riscv_cpu_options[] all properties in riscv_cpu_extensions[] are booleans. This check is now obsolete. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis --- target/riscv/cpu.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) dif

[PATCH v7 04/12] target/riscv: add DEFINE_PROP_END_OF_LIST() to riscv_cpu_options[]

2023-08-15 Thread Daniel Henrique Barboza
Add DEFINE_PROP_END_OF_LIST() and eliminate the ARRAY_SIZE() usage when iterating in the riscv_cpu_options[] array, making it similar to what we already do when working with riscv_cpu_extensions[]. We also have a more sophisticated motivation behind this change. In the future we might need to expo

[PATCH v7 00/12] riscv: add 'max' CPU, deprecate 'any'

2023-08-15 Thread Daniel Henrique Barboza
Hi, This new version contains a change in patch 4 where, instead of changing every other Property array to use ARRAY_SIZE(), convert riscv_cpu_options[] to use DEFINE_PROP_END_OF_LIST(). This change makes no difference in the code deduplication that is done in the later patches, and will spare us

[PATCH v7 07/12] target/riscv/cpu.c: add ADD_CPU_QDEV_PROPERTIES_ARRAY() macro

2023-08-15 Thread Daniel Henrique Barboza
The code inside riscv_cpu_add_user_properties() became quite repetitive after recent changes. Add a macro to hide the repetition away. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Weiwei Li --- target/riscv/cpu.c | 27 +++ 1 file changed, 11 insertions(+), 16 dele

[PATCH v7 09/12] target/riscv/cpu.c: limit cfg->vext_spec log message

2023-08-15 Thread Daniel Henrique Barboza
Inside riscv_cpu_validate_v() we're always throwing a log message if the user didn't set a vector version via 'vext_spec'. We're going to include one case with the 'max' CPU where env->vext_ver will be set in the cpu_init(). But that alone will not stop the "vector version is not specified" messag

[PATCH v7 06/12] target/riscv/cpu.c: split non-ratified exts from riscv_cpu_extensions[]

2023-08-15 Thread Daniel Henrique Barboza
Create a new riscv_cpu_experimental_exts[] to store the non-ratified extensions properties. Once they are ratified we'll move them back to riscv_cpu_extensions[]. riscv_cpu_add_user_properties() and riscv_cpu_add_kvm_properties() are changed to keep adding non-ratified properties to users. Signed

[PATCH v7 12/12] target/riscv: deprecate the 'any' CPU type

2023-08-15 Thread Daniel Henrique Barboza
The 'any' CPU type was introduced in commit dc5bd18fa5725 ("RISC-V CPU Core Definition"), being around since the beginning. It's not an easy CPU to use: it's undocumented and its name doesn't tell users much about what the CPU is supposed to bring. 'git log' doesn't help us either in knowing what w

[PATCH v7 03/12] target/riscv/cpu.c: split kvm prop handling to its own helper

2023-08-15 Thread Daniel Henrique Barboza
Future patches will split the existing Property arrays even further, and the existing code in riscv_cpu_add_user_properties() will start to scale bad with it because it's dealing with KVM constraints mixed in with TCG constraints. We're going to pay a high price to share a couple of common lines of

  1   2   >