Re: [PATCH v4 1/1] oslib-posix: initialize backend memory objects in parallel

2024-02-02 Thread Mario Casquero
This patch has been successfully tested by QE. After configuring two memory-backends with preallocation context objects, binded to two host nodes; the result is QEMU being at least three times faster than before. # time /usr/libexec/qemu-kvm -M q35 -m 16G,maxmem=32G -numa node,memdev=mem0,nodeid=0

Re: [PATCH v2] qemu_init: increase NOFILE soft limit on POSIX

2024-02-02 Thread Fiona Ebner
Am 18.12.23 um 11:13 schrieb Fiona Ebner: > In many configurations, e.g. multiple vNICs with multiple queues or > with many Ceph OSDs, the default soft limit of 1024 is not enough. > QEMU is supposed to work fine with file descriptors >= 1024 and does > not use select() on POSIX. Bump the soft limi

Re: [PATCH v2 3/3] hw: Set virtio-iommu aw-bits default value on pc_q35_9.0 and arm virt

2024-02-02 Thread Eric Auger
Hi Zhenzhong, On 2/2/24 07:51, Duan, Zhenzhong wrote: > Hi Eric, > >> -Original Message- >> From: Eric Auger >> pc_q35_9.0 and arm virt >> >> Currently the default input range can extend to 64 bits. On x86, >> when the virtio-iommu protects vfio devices, the physical iommu >> may support

Re: Re: [PATCH] RISC-V: Report the QEMU vendor/arch IDs on virtual CPUs

2024-02-02 Thread Andrew Jones
On Thu, Feb 01, 2024 at 04:06:15PM +0100, Andrew Jones wrote: > On Wed, Jan 31, 2024 at 10:24:30AM -0800, Palmer Dabbelt wrote: > > Right now we just report 0 for marchid/mvendorid in QEMU. That's legal, > > but it's tricky for users that want to check if they're running on QEMU > > to do so. Thi

Re: [PATCH 3/6] target/riscv: add remaining named features

2024-02-02 Thread Daniel Henrique Barboza
On 2/1/24 23:14, Alistair Francis wrote: On Thu, Feb 1, 2024 at 5:15 AM Daniel Henrique Barboza wrote: On 1/29/24 22:10, Alistair Francis wrote: On Fri, Jan 26, 2024 at 5:54 AM Daniel Henrique Barboza wrote: The RVA22U64 and RVA22S64 profiles mandates certain extensions that, until no

Re: [PATCH 0/2] migration: Fix return-path thread exit

2024-02-02 Thread Peter Xu
On Thu, Feb 01, 2024 at 07:48:51PM +0100, Cédric Le Goater wrote: > Hello, Hi, Cédric, Thanks for the patches. > > Today, close_return_path_on_source() can perform a shutdown to exit > the return-path thread if an error occured. However, migrate_fd_cleanup() > does cleanups too early and the sh

Re: [PULL 02/10] hw/hppa/machine: Disable default devices with --nodefaults option

2024-02-02 Thread Helge Deller
Hi Guenter, On 2/2/24 05:22, Guenter Roeck wrote: On Sat, Jan 13, 2024 at 06:57:20AM +0100, del...@kernel.org wrote: From: Helge Deller Recognize the qemu --nodefaults option, which will disable the following default devices on hppa: - lsi53c895a SCSI controller, - artist graphics card, - LAS

Re: [External] Re: [PATCH v3 13/20] migration/multifd: Prepare to introduce DSA acceleration on the multifd path.

2024-02-02 Thread Peter Xu
On Mon, Jan 22, 2024 at 04:37:09PM -0800, Hao Xiang wrote: > > > +static void set_normal_pages(MultiFDSendParams *p) > > > +{ > > > +for (int i = 0; i < p->pages->num; i++) { > > > +p->batch_task->results[i] = false; > > > +} > > > +} > > Please correct me if I am wrong but set_norm

[PATCH v7 4/6] target/riscv: Add pointer masking tb flags

2024-02-02 Thread Alexey Baturo
From: Alexey Baturo Signed-off-by: Alexey Baturo Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/cpu.h| 3 +++ target/riscv/cpu_helper.c | 3 +++ target/riscv/translate.c | 5 + 3 files changed, 11 insertions(+) diff --git a/target/riscv/cpu.h b/ta

[PATCH v7 2/6] target/riscv: Add new CSR fields for S{sn, mn, m}pm extensions as part of Zjpm v0.8

2024-02-02 Thread Alexey Baturo
From: Alexey Baturo Signed-off-by: Alexey Baturo Reviewed-by: Alistair Francis --- target/riscv/cpu.h | 8 target/riscv/cpu_bits.h | 3 +++ target/riscv/cpu_cfg.h | 3 +++ target/riscv/csr.c | 11 +++ target/riscv/machine.c | 10 +++--- target/riscv/pmp.c

[PATCH v7 5/6] target/riscv: Update address modify functions to take into account pointer masking

2024-02-02 Thread Alexey Baturo
From: Alexey Baturo Signed-off-by: Alexey Baturo Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/translate.c | 22 -- target/riscv/vector_helper.c | 13 + 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/target/

[PATCH v7 3/6] target/riscv: Add helper functions to calculate current number of masked bits for pointer masking

2024-02-02 Thread Alexey Baturo
From: Alexey Baturo Signed-off-by: Alexey Baturo Reviewed-by: Alistair Francis --- target/riscv/cpu.h| 4 +++ target/riscv/cpu_helper.c | 58 +++ 2 files changed, 62 insertions(+) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 4c0d7142

[PATCH v7 0/6] Pointer Masking update for Zjpm v0.8

2024-02-02 Thread Alexey Baturo
From: Alexey Baturo Hi, I'm terribly sorry, but previous rebase went wrong and somehow I missed it. This time I double-checked rebased version. This patch series is properly rebased on https://github.com/alistair23/qemu/tree/riscv-to-apply.next Thanks [v6]: This patch series is rebased on h

[PATCH v7 1/6] target/riscv: Remove obsolete pointer masking extension code.

2024-02-02 Thread Alexey Baturo
From: Alexey Baturo Zjpm v0.8 is almost frozen and it's much simplier compared to the existing one: The newer version doesn't allow to specify custom mask or base for masking. Instead it allows only certain options for masking top bits. Signed-off-by: Alexey Baturo Acked-by: Alistair Francis

[PATCH v7 6/6] target/riscv: Enable updates for pointer masking variables and thus enable pointer masking extension

2024-02-02 Thread Alexey Baturo
From: Alexey Baturo Signed-off-by: Alexey Baturo Reviewed-by: Alistair Francis --- target/riscv/cpu.c | 9 + 1 file changed, 9 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index ded84f2e09..23d1692b59 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -

[PATCH v2 03/23] migration/multifd: Drop MultiFDSendParams.quit, cleanup error paths

2024-02-02 Thread peterx
From: Peter Xu Multifd send side has two fields to indicate error quits: - MultiFDSendParams.quit - &multifd_send_state->exiting Merge them into the global one. The replacement is done by changing all p->quit checks into the global var check. The global check doesn't need any lock. A few

[PATCH v2 07/23] migration/multifd: Simplify locking in sender thread

2024-02-02 Thread peterx
From: Peter Xu The sender thread will yield the p->mutex before IO starts, trying to not block the requester thread. This may be unnecessary lock optimizations, because the requester can already read pending_job safely even without the lock, because the requester is currently the only one who ca

[PATCH v2 02/23] migration/multifd: multifd_send_kick_main()

2024-02-02 Thread peterx
From: Peter Xu When a multifd sender thread hit errors, it always needs to kick the main thread by kicking all the semaphores that it can be waiting upon. Provide a helper for it and deduplicate the code. Reviewed-by: Fabiano Rosas Signed-off-by: Peter Xu --- migration/multifd.c | 21 +++

[PATCH v2 05/23] migration/multifd: Drop MultiFDSendParams.normal[] array

2024-02-02 Thread peterx
From: Peter Xu This array is redundant when p->pages exists. Now we extended the life of p->pages to the whole period where pending_job is set, it should be safe to always use p->pages->offset[] rather than p->normal[]. Drop the array. Alongside, the normal_num is also redundant, which is the

[PATCH v2 13/23] migration/multifd: Move header prepare/fill into send_prepare()

2024-02-02 Thread peterx
From: Peter Xu This patch redefines the interfacing of ->send_prepare(). It further simplifies multifd_send_thread() especially on zero copy. Now with the new interface, we require the hook to do all the work for preparing the IOVs to send. After it's completed, the IOVs should be ready to be

[PATCH v2 11/23] migration/multifd: Move trace_multifd_send|recv()

2024-02-02 Thread peterx
From: Peter Xu Move them into fill/unfill of packets. With that, we can further cleanup the send/recv thread procedure, and remove one more temp var. Reviewed-by: Fabiano Rosas Signed-off-by: Peter Xu --- migration/multifd.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-)

[PATCH v2 01/23] migration/multifd: Drop stale comment for multifd zero copy

2024-02-02 Thread peterx
From: Peter Xu We've already done that with multifd_flush_after_each_section, for multifd in general. Drop the stale "TODO-like" comment. Reviewed-by: Fabiano Rosas Signed-off-by: Peter Xu --- migration/multifd.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/migration/multi

[PATCH v2 19/23] migration/multifd: Cleanup multifd_save_cleanup()

2024-02-02 Thread peterx
From: Peter Xu Shrink the function by moving relevant works into helpers: move the thread join()s into multifd_send_terminate_threads(), then create two more helpers to cover channel/state cleanups. Add a TODO entry for the thread terminate process because p->running is still buggy. We need to

[PATCH v2 04/23] migration/multifd: Postpone reset of MultiFDPages_t

2024-02-02 Thread peterx
From: Peter Xu Now we reset MultiFDPages_t object in the multifd sender thread in the middle of the sending job. That's not necessary, because the "*pages" struct will not be reused anyway until pending_job is cleared. Move that to the end after the job is completed, provide a helper to reset a

[PATCH v2 20/23] migration/multifd: Cleanup multifd_load_cleanup()

2024-02-02 Thread peterx
From: Peter Xu Use similar logic to cleanup the recv side. Note that multifd_recv_terminate_threads() may need some similar rework like the sender side, but let's leave that for later. Signed-off-by: Peter Xu --- migration/multifd.c | 52 ++--- 1 file c

[PATCH v2 12/23] migration/multifd: multifd_send_prepare_header()

2024-02-02 Thread peterx
From: Peter Xu Introduce a helper multifd_send_prepare_header() to setup the header packet for multifd sender. It's fine to setup the IOV[0] _before_ send_prepare() because the packet buffer is already ready, even if the content is to be filled in. With this helper, we can already slightly clea

[PATCH v2 00/23] migration/multifd: Refactor ->send_prepare() and cleanups

2024-02-02 Thread peterx
From: Peter Xu v1: https://lore.kernel.org/r/20240131103111.306523-1-pet...@redhat.com This v2 patchset contains quite a few refactorings to current multifd: 1) Redefines send_prepare() interface, to be: p->pages ---> send_prepare() -> IOVs A major goal of it i

[PATCH v2 21/23] migration/multifd: Stick with send/recv on function names

2024-02-02 Thread peterx
From: Peter Xu Most of the multifd code uses send/recv to represent the two sides, but some rare cases use save/load. Since send/recv is the majority, replacing the save/load use cases to use send/recv globally. Now we reach a consensus on the naming. Signed-off-by: Peter Xu --- migration/mu

[PATCH v2 14/23] migration/multifd: Forbid spurious wakeups

2024-02-02 Thread peterx
From: Peter Xu Now multifd's logic is designed to have no spurious wakeup. I still remember a talk to Juan and he seems to agree we should drop it now, and if my memory was right it was there because multifd used to hit that when still debugging. Let's drop it and see what can explode; as long

[PATCH v2 10/23] migration/multifd: Move total_normal_pages accounting

2024-02-02 Thread peterx
From: Peter Xu Just like the previous patch, move the accounting for total_normal_pages on both src/dst sides into the packet fill/unfill procedures. Reviewed-by: Fabiano Rosas Signed-off-by: Peter Xu --- migration/multifd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --gi

[PATCH v2 06/23] migration/multifd: Separate SYNC request with normal jobs

2024-02-02 Thread peterx
From: Peter Xu Multifd provide a threaded model for processing jobs. On sender side, there can be two kinds of job: (1) a list of pages to send, or (2) a sync request. The sync request is a very special kind of job. It never contains a page array, but only a multifd packet telling the dest sid

[PATCH v2 08/23] migration/multifd: Drop pages->num check in sender thread

2024-02-02 Thread peterx
From: Peter Xu Now with a split SYNC handler, we always have pages->num set for pending_job==true. Assert it instead. Reviewed-by: Fabiano Rosas Signed-off-by: Peter Xu --- migration/multifd.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/migration/multifd

[PATCH v2 18/23] migration/multifd: Rewrite multifd_queue_page()

2024-02-02 Thread peterx
From: Peter Xu The current multifd_queue_page() is not easy to read and follow. It is not good with a few reasons: - No helper at all to show what exactly does a condition mean; in short, readability is low. - Rely on pages->ramblock being cleared to detect an empty queue. It's slight

[PATCH v2 22/23] migration/multifd: Fix MultiFDSendParams.packet_num race

2024-02-02 Thread peterx
From: Peter Xu As reported correctly by Fabiano [1], MultiFDSendParams.packet_num is buggy to be assigned and stored. Consider two consequent operations of: (1) queue a job into multifd send thread X, then (2) queue another sync request to the same send thread X. Then the MultiFDSendParams.pack

[PATCH v2 23/23] migration/multifd: Optimize sender side to be lockless

2024-02-02 Thread peterx
From: Peter Xu When reviewing my attempt to refactor send_prepare(), Fabiano suggested we try out with dropping the mutex in multifd code [1]. I thought about that before but I never tried to change the code. Now maybe it's time to give it a stab. This only optimizes the sender side. The tric

[PATCH v2 17/23] migration/multifd: Change retval of multifd_send_pages()

2024-02-02 Thread peterx
From: Peter Xu Using int is an overkill when there're only two options. Change it to a boolean. Signed-off-by: Peter Xu --- migration/multifd.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/migration/multifd.c b/migration/multifd.c index 12e587fda8..35d4e

[PATCH v2 09/23] migration/multifd: Rename p->num_packets and clean it up

2024-02-02 Thread peterx
From: Peter Xu This field, no matter whether on src or dest, is only used for debugging purpose. They can even be removed already, unless it still more or less provide some accounting on "how many packets are sent/recved for this thread". The other more important one is called packet_num, which

[PATCH v2 15/23] migration/multifd: Split multifd_send_terminate_threads()

2024-02-02 Thread peterx
From: Peter Xu Split multifd_send_terminate_threads() into two functions: - multifd_send_set_error(): used when an error happened on the sender side, set error and quit state only - multifd_send_terminate_threads(): used only by the main thread to kick all multifd send threads out o

[PATCH v2 16/23] migration/multifd: Change retval of multifd_queue_page()

2024-02-02 Thread peterx
From: Peter Xu Using int is an overkill when there're only two options. Change it to a boolean. Signed-off-by: Peter Xu --- migration/multifd.h | 2 +- migration/multifd.c | 9 + migration/ram.c | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/migration/multi

回复: FW: [PATCH] vhost-user: add VIRTIO_F_IN_ORDER and VIRTIO_F_NOTIFICATION_DATA feature

2024-02-02 Thread Rick Zhong
Hi Eugenio and Michael, Let me make it more clear about the target for this patch. Currently Corigine is developing the vDPA features on NIC which are based on the QEMU vhost-vdpa/vhost-user backend. These two virtio features are helpful in data plane performance. In my understanding, these tw

Re: [PULL 06/15] tests/qtest/migration: Don't use -cpu max for aarch64

2024-02-02 Thread Peter Maydell
On Thu, 1 Feb 2024 at 23:50, Peter Xu wrote: > > Fabiano, I think you forgot to reply-to-all.. adding back the list and > people in the loop. > > On Thu, Feb 01, 2024 at 10:12:44AM -0300, Fabiano Rosas wrote: > > Peter Xu writes: > > > > > On Wed, Jan 31, 2024 at 10:09:16AM -0300, Fabiano Rosas w

Re: [PATCH] RISC-V: Report the QEMU vendor/arch IDs on virtual CPUs

2024-02-02 Thread Daniel Henrique Barboza
On 1/31/24 15:24, Palmer Dabbelt wrote: Right now we just report 0 for marchid/mvendorid in QEMU. That's legal, but it's tricky for users that want to check if they're running on QEMU to do so. This sets marchid to 42, which I've proposed as the QEMU architecture ID (mvendorid remains 0, jus

[PATCH v4] target/riscv: mcountinhibit, mcounteren, scounteren, hcounteren is 32-bit

2024-02-02 Thread Vadim Shakirov
mcountinhibit, mcounteren, scounteren and hcounteren must always be 32-bit by privileged spec Signed-off-by: Vadim Shakirov --- target/riscv/cpu.h | 8 target/riscv/machine.c | 16 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/target/riscv/cpu.h

Re: [PATCH v3 0/2] riscv: add rv32i,rv32e and rv64e CPUs

2024-02-02 Thread Daniel Henrique Barboza
Alistair, I think we should just queue this up since it's all acked. It's still applicable in riscv-to-apply.next. Thanks, Daniel On 1/22/24 09:33, Daniel Henrique Barboza wrote: Hi, This v3 has the same patches from v2 rebased with a newer riscv-to-apply.next branch (@ 096b6b07298). No o

Re: [PATCH v3 2/9] hw/cxl/cxl-mailbox-utils: Add dynamic capacity region representative and mailbox command support

2024-02-02 Thread Jonathan Cameron via
On Thu, 1 Feb 2024 11:58:43 -0800 fan wrote: > On Wed, Jan 24, 2024 at 02:51:18PM +, Jonathan Cameron wrote: > > On Tue, 7 Nov 2023 10:07:06 -0800 > > nifan@gmail.com wrote: > > > > > From: Fan Ni > > > > > > Per cxl spec 3.0, add dynamic capacity region representative based on > >

Re: [PATCH 04/14] migration/multifd: Postpone reset of MultiFDPages_t

2024-02-02 Thread Fabiano Rosas
Peter Xu writes: > On Fri, Feb 02, 2024 at 08:28:47AM +0800, Peter Xu wrote: >> > Pages allocated is nonsense. See if you agree with its removal: >> > https://gitlab.com/farosas/qemu/-/commit/7cfff1a3e31b271e901a6c08d8b5d8c01b680e4d >> > >> > --- >> > From 7cfff1a3e31b271e901a6c08d8b5d8c01b680e4

Re: [PATCH] linux-user/aarch64: Add padding before __kernel_rt_sigreturn

2024-02-02 Thread Alex Bennée
Richard Henderson writes: > Without this padding, an unwind through the signal handler > will pick up the unwind info for the preceding syscall. > > This fixes gcc's 30_threads/thread/native_handle/cancel.cc. > > Cc: qemu-sta...@nongnu.org > Fixes: ee95fae075c6 ("linux-user/aarch64: Add vdso") >

Re: [PULL 11/33] scsi: only access SCSIDevice->requests from one thread

2024-02-02 Thread Hanna Czenczek
On 01.02.24 16:25, Hanna Czenczek wrote: On 01.02.24 15:28, Stefan Hajnoczi wrote: [...] Did you find a scenario where the virtio-scsi AioContext is different from the scsi-hd BB's Aiocontext? Technically, that’s the reason for this thread, specifically that virtio_scsi_hotunplug() switche

Re: [PATCH 0/2] migration: Fix return-path thread exit

2024-02-02 Thread Cédric Le Goater
Hello Peter, Today, close_return_path_on_source() can perform a shutdown to exit the return-path thread if an error occured. However, migrate_fd_cleanup() does cleanups too early and the shutdown in close_return_path_on_source() fails, leaving the source and destination waiting for an event to o

Re: [PULL 06/14] ci: Add a migration compatibility test job

2024-02-02 Thread Peter Maydell
On Mon, 29 Jan 2024 at 03:04, wrote: > > From: Fabiano Rosas > > The migration tests have support for being passed two QEMU binaries to > test migration compatibility. > > Add a CI job that builds the lastest release of QEMU and another job > that uses that version plus an already present build o

[PATCH] vdpa-dev: Fix initialisation order to restore VDUSE compatibility

2024-02-02 Thread Kevin Wolf
VDUSE requires that virtqueues are first enabled before the DRIVER_OK status flag is set; with the current API of the kernel module, it is impossible to enable the opposite order in our block export code because userspace is not notified when a virtqueue is enabled. This requirement also mathces t

Re: [PULL 06/14] ci: Add a migration compatibility test job

2024-02-02 Thread Fabiano Rosas
Peter Maydell writes: > On Mon, 29 Jan 2024 at 03:04, wrote: >> >> From: Fabiano Rosas >> >> The migration tests have support for being passed two QEMU binaries to >> test migration compatibility. >> >> Add a CI job that builds the lastest release of QEMU and another job >> that uses that versi

Re: [PULL v2 00/17] aspeed queue

2024-02-02 Thread Peter Maydell
On Thu, 1 Feb 2024 at 14:13, Cédric Le Goater wrote: > > The following changes since commit bd2e12310b18b51aefbf834e6d54989fd175976f: > > Merge tag 'qga-pull-2024-01-30' of https://github.com/kostyanf14/qemu into > staging (2024-01-30 15:53:46 +) > > are available in the Git repository at:

Re: [PULL 0/1] loongarch-to-apply queue

2024-02-02 Thread Peter Maydell
On Thu, 1 Feb 2024 at 07:33, Song Gao wrote: > > The following changes since commit bd2e12310b18b51aefbf834e6d54989fd175976f: > > Merge tag 'qga-pull-2024-01-30' of https://github.com/kostyanf14/qemu into > staging (2024-01-30 15:53:46 +) > > are available in the Git repository at: > > ht

Re: [PATCH v4 0/2] Add BCM2835-SPI0 to BCM2835

2024-02-02 Thread Peter Maydell
On Mon, 29 Jan 2024 at 22:19, Rayhan Faizel wrote: > > This patch series implements the SPI controller for BCM2835 boards. Applied to target-arm.next, thanks. -- PMM

[PATCH v4 2/4] target/s390x: Emulate CVB, CVBY and CVBG

2024-02-02 Thread Ilya Leoshkevich
Convert to Binary - counterparts of the already implemented Convert to Decimal (CVD*) instructions. Example from the Principles of Operation: 25594C becomes 63FA. Co-developed-by: Pavel Zbitskiy Signed-off-by: Ilya Leoshkevich --- target/s390x/helper.h| 2 + target/s390x/tcg/insn-d

[PATCH v4 4/4] tests/tcg/s390x: Test CONVERT TO BINARY

2024-02-02 Thread Ilya Leoshkevich
Check the CVB's, CVBY's, and CVBG's corner cases. Co-developed-by: Pavel Zbitskiy Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/cvb.c | 102 2 files changed, 103 insertions(+) create mode 100644 tests/tcg

[PATCH v4 3/4] tests/tcg/s390x: Test CONVERT TO DECIMAL

2024-02-02 Thread Ilya Leoshkevich
Check the CVD's, CVDY's, and CVDG's corner cases. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/cvd.c | 63 + 2 files changed, 64 insertions(+) create mode 100644 tests/tcg/s390x/cvd.c diff --git a/tests/tc

[PATCH v4 1/4] target/s390x: Emulate CVDG

2024-02-02 Thread Ilya Leoshkevich
CVDG is the same as CVD, except that it converts 64 bits into 128, rather than 32 into 64. Create a new helper, which uses Int128 wrappers. Reported-by: Ido Plat Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich --- target/s390x/helper.h| 1 + target/s390x/tcg/insn-da

[PATCH v4 0/4] target/s390x: Emulate CVDG and CVB*

2024-02-02 Thread Ilya Leoshkevich
v3: https://lists.gnu.org/archive/html/qemu-devel/2024-01/msg06664.html v3 -> v4: Implement CVB error handling (David/Thomas). v2: https://lists.gnu.org/archive/html/qemu-devel/2024-01/msg05048.html v2 -> v3: Resurrect an old CVB* patch (Thomas). Add Richard's R-b. v1: https://lists.gnu

Re: [PATCH v2 1/2] gdbstub: Implement catching syscalls

2024-02-02 Thread Ilya Leoshkevich
On Thu, 2024-02-01 at 17:15 +, Alex Bennée wrote: > Ilya Leoshkevich writes: > > > GDB supports stopping on syscall entry and exit using the "catch > > syscall" command. It relies on 3 packets, which are currently not > > supported by QEMU: > > > > * qSupported:QCatchSyscalls+ [1] > > * QCat

Re: [PATCH 1/2] migration: Add a file_error argument to close_return_path_on_source()

2024-02-02 Thread Fabiano Rosas
Cédric Le Goater writes: > close_return_path_on_source() retrieves the migration error from the > the QEMUFile '->to_dst_file' to know if a shutdown is required to exit > the return-path thread. However, in migrate_fd_cleanup(), '->to_dst_file' > is cleaned up before calling close_return_path_on_

[PATCH v3 0/3] Adjust the output of x-query-virtio-status

2024-02-02 Thread Hyman Huang
Sorry for the late post of version 3. The modifications are as follows: v3: - Rebase on master - Use the refined commit message furnished by Markus for [PATCH v2 1/2] - Drop the [PATCH v2 2/2] - Add [PATCH v3 2/3] to declare the decoding functions to static - Add [PATCH v3 3/3] to Define VhostDev

[PATCH v3 3/3] qapi: Define VhostDeviceProtocols and VirtioDeviceFeatures as plain C types

2024-02-02 Thread Hyman Huang
VhostDeviceProtocols and VirtioDeviceFeatures are only used in virtio-hmp-cmds.c. So define them as plain C types there, and drop them from the QAPI schema. Signed-off-by: Hyman Huang --- hw/virtio/virtio-hmp-cmds.c | 16 +++ qapi/virtio.json| 39

[PATCH v3 1/3] qmp: Switch x-query-virtio-status back to numeric encoding

2024-02-02 Thread Hyman Huang
x-query-virtio-status returns several sets of virtio feature and status flags. It goes back to v7.2.0. In the initial commit 90c066cd682 (qmp: add QMP command x-query-virtio-status), we returned them as numbers, using virtio's well-known binary encoding. The next commit f3034ad71fc (qmp: decode

[PATCH v3 2/3] virtio: Declare the decoding functions to static

2024-02-02 Thread Hyman Huang
qmp_decode_protocols(), qmp_decode_status(), and qmp_decode_features() are now only used in virtio-hmp-cmds.c. So move them into there, redeclare them to static, and replace the qmp_ prefix with hmp_. Signed-off-by: Hyman Huang --- hw/virtio/meson.build | 3 +- hw/virtio/virtio-hmp-cmds

Re: [PATCH 2/2] migration: Fix return-path thread exit

2024-02-02 Thread Fabiano Rosas
Cédric Le Goater writes: > In case of error, close_return_path_on_source() can perform a shutdown > to exit the return-path thread. However, in migrate_fd_cleanup(), > 'to_dst_file' is closed before calling close_return_path_on_source() > and the shutdown fails, leaving the source and destinatio

Re: [PATCH 1/2] migration: Add a file_error argument to close_return_path_on_source()

2024-02-02 Thread Cédric Le Goater
On 2/2/24 15:30, Fabiano Rosas wrote: Cédric Le Goater writes: close_return_path_on_source() retrieves the migration error from the the QEMUFile '->to_dst_file' to know if a shutdown is required to exit the return-path thread. However, in migrate_fd_cleanup(), '->to_dst_file' is cleaned up bef

[PATCH 0/2] block: Allow concurrent BB context changes

2024-02-02 Thread Hanna Czenczek
Hi, Without the AioContext lock, a BB's context may kind of change at any time (unless it has a root node, and I/O requests are pending). That also means that its own context (BlockBackend.ctx) and that of its root node can differ sometimes (while the context is being changed). blk_get_aio_conte

[PATCH 2/2] scsi: Await request purging

2024-02-02 Thread Hanna Czenczek
scsi_device_for_each_req_async() currently does not provide any way to be awaited. One of its callers is scsi_device_purge_requests(), which therefore currently does not guarantee that all requests are fully settled when it returns. We want all requests to be settled, because scsi_device_purge_re

[PATCH 1/2] block-backend: Allow concurrent context changes

2024-02-02 Thread Hanna Czenczek
Since AioContext locks have been removed, a BlockBackend's AioContext may really change at any time (only exception is that it is often confined to a drained section, as noted in this patch). Therefore, blk_get_aio_context() cannot rely on its root node's context always matching that of the BlockB

Re: [PATCH 2/2] migration: Fix return-path thread exit

2024-02-02 Thread Cédric Le Goater
On 2/2/24 15:42, Fabiano Rosas wrote: Cédric Le Goater writes: In case of error, close_return_path_on_source() can perform a shutdown to exit the return-path thread. However, in migrate_fd_cleanup(), 'to_dst_file' is closed before calling close_return_path_on_source() and the shutdown fails,

Re: [PATCH 2/2] migration: Fix return-path thread exit

2024-02-02 Thread Fabiano Rosas
Cédric Le Goater writes: > On 2/2/24 15:42, Fabiano Rosas wrote: >> Cédric Le Goater writes: >> >>> In case of error, close_return_path_on_source() can perform a shutdown >>> to exit the return-path thread. However, in migrate_fd_cleanup(), >>> 'to_dst_file' is closed before calling close_retu

[PATCH v3 4/6] target/riscv: Reset henvcfg to zero

2024-02-02 Thread Daniel Henrique Barboza
From: Andrew Jones The hypervisor should decide what it wants to enable. Zero all configuration enable bits on reset. Also, commit ed67d63798f2 ("target/riscv: Update CSR bits name for svadu extension") missed one reference to 'hade'. Change it now. Fixes: 0af3f115e68e ("target/riscv: Add *envc

[PATCH v3 5/6] target/riscv: Gate hardware A/D PTE bit updating

2024-02-02 Thread Daniel Henrique Barboza
From: Andrew Jones Gate hardware A/D PTE bit updating on {m,h}envcfg.ADUE and only enable menvcfg.ADUE on reset if svade has not been selected. Now that we also consider svade, we have four possible configurations: 1) !svade && !svadu use hardware updating and there's no way to disable it

[PATCH v3 3/6] target/riscv: add remaining named features

2024-02-02 Thread Daniel Henrique Barboza
The RVA22U64 and RVA22S64 profiles mandates certain extensions that, until now, we were implying that they were available. We can't do this anymore since named features also has a riscv,isa entry. Let's add them to riscv_cpu_named_features[]. Instead of adding one bool for each named feature that

[PATCH v3 1/6] target/riscv/tcg: set 'mmu' with 'satp' in cpu_set_profile()

2024-02-02 Thread Daniel Henrique Barboza
Recent changes in options handling removed the 'mmu' default the bare CPUs had, meaning that we must enable 'mmu' by hand when using the rva22s64 profile CPU. Given that this profile is setting a satp mode, it already implies that we need a 'mmu'. Enable the 'mmu' in this case. Signed-off-by: Dan

[PATCH v3 2/6] target/riscv: add riscv,isa to named features

2024-02-02 Thread Daniel Henrique Barboza
Further discussions after the introduction of rva22 support in QEMU revealed that what we've been calling 'named features' are actually regular extensions, with their respective riscv,isa DTs. This is clarified in [1]. [2] is a bug tracker asking for the profile spec to be less cryptic about it. A

[PATCH v3 0/6] riscv: named features riscv,isa, 'svade' rework

2024-02-02 Thread Daniel Henrique Barboza
Hi, In this new version we changed patch 3 as suggested by Alistair in v1 [1]. Instead of creating individual always-true bool for each named feature, create a bool flag will be always 'true' to be used as config offset for these named extensions. Patches based on riscv-to-apply.next. Patches mi

[PATCH v3 6/6] target/riscv: Promote svade to a normal extension

2024-02-02 Thread Daniel Henrique Barboza
From: Andrew Jones Named features are extensions which don't make sense for users to control and are therefore not exposed on the command line. However, svade is an extension which makes sense for users to control, so treat it like a "normal" extension. The default is false, even for the max cpu

[PATCH v3 2/5] gdbstub: Allow specifying a reason in stop packets

2024-02-02 Thread Ilya Leoshkevich
The upcoming syscall catchpoint support needs to send stop packets with an associated reason to GDB. Add an extra parameter to gdb_handlesig() for that, and rename it to gdb_handlesig_reason(). Provide a compatibility wrapper with an old name. Signed-off-by: Ilya Leoshkevich --- gdbstub/user.c

[PATCH v3 1/5] gdbstub: Expose TARGET_SIGTRAP in a target-agnostic way

2024-02-02 Thread Ilya Leoshkevich
The upcoming syscall catchpoint support needs to send SIGTRAP stop packets to GDB. Being able to compile this support only once for all targets is a good thing, and it requires hiding TARGET_SIGTRAP behind a function call. Signed-off-by: Ilya Leoshkevich --- gdbstub/internals.h | 1 + gdbstub/

[PATCH v3 0/5] gdbstub: Implement catching syscalls

2024-02-02 Thread Ilya Leoshkevich
v2: https://lists.gnu.org/archive/html/qemu-devel/2024-01/msg02980.html v2 -> v3: Simplify the catchpoint state by making "don't catch" a subset of "catch some". Factor out several prep patches; Don't use snprintf; Add some comments (Alex). v1: https://lists

[PATCH v3 3/5] gdbstub: Add syscall entry/return hooks

2024-02-02 Thread Ilya Leoshkevich
The upcoming syscall catchpoint support needs to get control on syscall entry and return. Provide the necessary hooks for that, which are no-ops for now. Signed-off-by: Ilya Leoshkevich --- gdbstub/user.c | 8 include/gdbstub/user.h | 13 + include/user/

[PATCH v3 5/5] tests/tcg: Add the syscall catchpoint gdbstub test

2024-02-02 Thread Ilya Leoshkevich
Check that adding/removing syscall catchpoints works. Reviewed-by: Alex Bennée Signed-off-by: Ilya Leoshkevich --- tests/tcg/multiarch/Makefile.target | 10 +++- tests/tcg/multiarch/catch-syscalls.c | 51 ++ tests/tcg/multiarch/gdbstub/catch-syscalls.py | 53 +

[PATCH v3 4/5] gdbstub: Implement catching syscalls

2024-02-02 Thread Ilya Leoshkevich
GDB supports stopping on syscall entry and exit using the "catch syscall" command. It relies on 3 packets, which are currently not supported by QEMU: * qSupported:QCatchSyscalls+ [1] * QCatchSyscalls: [2] * T05syscall_entry: and T05syscall_return: [3] Implement generation and handling of these pa

Re: [PULL 00/47] nic-config.for-upstream queue

2024-02-02 Thread Peter Maydell
On Thu, 1 Feb 2024 at 16:48, David Woodhouse wrote: > > The following changes since commit 14639717bf379480e937716fcaf1e72b47fd4c5f: > > Merge tag 'pull-trivial-patches' of https://gitlab.com/mjt0k/qemu into > staging (2024-01-31 19:53:45 +) > > are available in the Git repository at: > >

[PATCH v2 3/3] virtio-blk: Use ioeventfd_attach in start_ioeventfd

2024-02-02 Thread Hanna Czenczek
Commit d3f6f294aeadd5f88caf0155e4360808c95b3146 ("virtio-blk: always set ioeventfd during startup") has made virtio_blk_start_ioeventfd() always kick the virtqueue (set the ioeventfd), regardless of whether the BB is drained. That is no longer necessary, because attaching the host notifier will no

[PATCH v2 1/3] virtio-scsi: Attach event vq notifier with no_poll

2024-02-02 Thread Hanna Czenczek
As of commit 38738f7dbbda90fbc161757b7f4be35b52205552 ("virtio-scsi: don't waste CPU polling the event virtqueue"), we only attach an io_read notifier for the virtio-scsi event virtqueue instead, and no polling notifiers. During operation, the event virtqueue is typically non-empty, but none of th

[PATCH v2 0/3] virtio: Re-enable notifications after drain

2024-02-02 Thread Hanna Czenczek
v1: https://lists.nongnu.org/archive/html/qemu-block/2024-01/msg00336.html Hi, This is basically the same series as v1: When using aio_set_event_notifier_poll(), the io_poll_end() callback is only invoked when polling ends, not when the notifier is being removed while in a polling section. Thi

[PATCH v2 2/3] virtio: Re-enable notifications after drain

2024-02-02 Thread Hanna Czenczek
During drain, we do not care about virtqueue notifications, which is why we remove the handlers on it. When removing those handlers, whether vq notifications are enabled or not depends on whether we were in polling mode or not; if not, they are enabled (by default); if so, they have been disabled

Re: [PULL 00/47] nic-config.for-upstream queue

2024-02-02 Thread David Woodhouse
On Fri, 2024-02-02 at 15:32 +, Peter Maydell wrote: > > This fails "make check' because some of the qom-test and > test-hmp checks fail when the QEMU binary segfaults. > > https://gitlab.com/qemu-project/qemu/-/jobs/6084552256 > https://gitlab.com/qemu-project/qemu/-/jobs/6084044180 Thanks.

[PULL 30/36] hw/arm: Add GMAC devices to NPCM7XX SoC

2024-02-02 Thread Peter Maydell
From: Hao Wu Change-Id: Id8a3461fb5042adc4c3fd6f4fbd1ca0d33e22565 Signed-off-by: Hao Wu Signed-off-by: Nabih Estefan Reviewed-by: Tyrone Ting Message-id: 20240131002800.989285-3-nabiheste...@google.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- include/hw/arm/npcm7xx.h | 2

[PULL 20/36] hw/arm/vexpress: Check for CPU types in machine_run_board_init()

2024-02-02 Thread Peter Maydell
From: Philippe Mathieu-Daudé Leverage the common code introduced in commit c9cf636d48 ("machine: Add a valid_cpu_types property") to check for the single valid CPU type. Remove the now unused MachineClass::default_cpu_type field. Reviewed-by: Richard Henderson Reviewed-by: Gavin Shan Signed-of

[PULL 23/36] hw/arm/strongarm.c: convert DPRINTF to trace events and guest errors

2024-02-02 Thread Peter Maydell
From: Manos Pitsidianakis Tracing DPRINTFs to stderr might not be desired. A developer that relies on trace events should be able to opt-in to each trace event and rely on QEMU's log redirection, instead of stderr by default. This commit converts DPRINTFs in this file that are used for tracing i

[PULL 05/36] hw/s390x/css-bridge: switch virtual-css bus to 3-phase-reset

2024-02-02 Thread Peter Maydell
Switch the s390x virtual-css bus from using BusClass::reset to the Resettable interface. This has no behavioural change, because the BusClass code to support subclasses that use the legacy BusClass::reset will call that method in the hold phase of 3-phase reset. Signed-off-by: Peter Maydell Acke

[PULL 06/36] hw/core: Remove transitional infrastructure from BusClass

2024-02-02 Thread Peter Maydell
BusClass currently has transitional infrastructure to support subclasses which implement the legacy BusClass::reset method rather than the Resettable interface. We have now removed all the users of BusClass::reset in the tree, so we can remove the transitional infrastructure. Signed-off-by: Peter

[PULL 19/36] hw/arm/npcm7xx_boards: Simplify setting MachineClass::valid_cpu_types[]

2024-02-02 Thread Peter Maydell
From: Philippe Mathieu-Daudé The npcm7xx Soc is created with a Cortex-A9 core, see in hw/arm/npcm7xx.c: static void npcm7xx_init(Object *obj) { NPCM7xxState *s = NPCM7XX(obj); for (int i = 0; i < NPCM7XX_MAX_NUM_CPUS; i++) { object_initialize_child(obj, "cpu[*]", &s->c

[PULL 08/36] qemu-options.hx: Improve -serial option documentation

2024-02-02 Thread Peter Maydell
The -serial option documentation is a bit brief about '-serial none' and '-serial null'. In particular it's not very clear about the difference between them, and it doesn't mention that it's up to the machine model whether '-serial none' means "don't create the serial port" or "don't wire the seria

[PULL 13/36] hw/arm/exynos: Add missing QOM parent for CPU cores

2024-02-02 Thread Peter Maydell
From: Philippe Mathieu-Daudé QDev objects created with qdev_new() need to manually add their parent relationship with object_property_add_child(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Gavin Shan Message-id: 20240129151828.59544-2-phi...@linaro.org

  1   2   >