[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 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 - _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 more

[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

[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

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

回复: 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

[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

[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

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,

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 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

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

[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

[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 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 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

[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 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

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

[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

[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

[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 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

[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 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 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

[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

[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

[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

[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,

[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

[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

[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

[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

[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

[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

[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 ---

[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 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

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

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.

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, -

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

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

[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

[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 +-

[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 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).

[PULL 31/36] tests/qtest: Creating qtest for GMAC Module

2024-02-02 Thread Peter Maydell
From: Nabih Estefan Diaz - Created qtest to check initialization of registers in GMAC Module. - Implemented test into Build File. Change-Id: I8b2fe152d3987a7eec4cf6a1d25ba92e75a5391d Signed-off-by: Nabih Estefan Reviewed-by: Tyrone Ting Message-id:

[PULL 22/36] pci-host: designware: Limit value range of iATU viewport register

2024-02-02 Thread Peter Maydell
From: Guenter Roeck The latest version of qemu (v8.2.0-869-g7a1dc45af5) crashes when booting the mcimx7d-sabre emulation with Linux v5.11 and later. qemu-system-arm: ../system/memory.c:2750: memory_region_set_alias_offset: Assertion `mr->alias' failed. Problem is that the Designware PCIe

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

2024-02-02 Thread Peter Maydell
From: Philippe Mathieu-Daudé Restrict MachineClass::valid_cpu_types[] to the single valid CPU types. Instead of ignoring invalid CPU type requested by the user: $ qemu-system-arm -M midway -cpu cortex-a7 -S -monitor stdio QEMU 8.2.50 monitor - type 'help' for more information (qemu) info

[PULL 01/36] target/arm: fix exception syndrome for AArch32 bkpt insn

2024-02-02 Thread Peter Maydell
From: Jan Klötzke Debug exceptions that target AArch32 Hyp mode are reported differently than on AAarch64. Internally, Qemu uses the AArch64 syndromes. Therefore such exceptions need to be either converted to a prefetch abort (breakpoints, vector catch) or a data abort (watchpoints). Cc:

[PULL 10/36] tests/qtest/xlnx-versal-trng-test.c: Drop use of variable length array

2024-02-02 Thread Peter Maydell
This test program is the last use of any variable length array in the codebase. If we can get rid of all uses of VLAs we can make the compiler error on new additions. This is a defensive measure against security bugs where an on-stack dynamic allocation isn't correctly size-checked (e.g.

[PULL 07/36] system/vl.c: Fix handling of '-serial none -serial something'

2024-02-02 Thread Peter Maydell
Currently if the user passes multiple -serial options on the command line, we mostly treat those as applying to the different serial devices in order, so that for example -serial stdio -serial file:filename will connect the first serial port to stdio and the second to the named file. The

[PULL 32/36] hw/net: GMAC Rx Implementation

2024-02-02 Thread Peter Maydell
From: Nabih Estefan Diaz - Implementation of Receive function for packets - Implementation for reading and writing from and to descriptors in memory for Rx When RX starts, we need to flush the queued packets so that they can be received by the GMAC device. Without this it won't work with TAP

[PULL 02/36] pci: Switch bus reset to 3-phase-reset

2024-02-02 Thread Peter Maydell
Switch the PCI 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 Acked-by: Michael

[PULL 17/36] hw/arm/msf2: Simplify setting MachineClass::valid_cpu_types[]

2024-02-02 Thread Peter Maydell
From: Philippe Mathieu-Daudé The M2Sxxx SoC family can only be used with Cortex-M3. Propagating the CPU type from the board level is pointless. Hard-code the CPU type at the SoC level. Remove the now ignored MachineClass::default_cpu_type field. Use the common code introduced in commit

[PULL 00/36] target-arm queue

2024-02-02 Thread Peter Maydell
-target-arm-20240202 for you to fetch changes up to f09c2b7ba9908714a3e2f1decd989462536cf731: hw/arm: Connect SPI Controller to BCM2835 (2024-02-02 13:51:59 +) target/arm: fix exception syndrome for AArch32 bkpt insn pci, vmbus

[PULL 33/36] hw/net: GMAC Tx Implementation

2024-02-02 Thread Peter Maydell
From: Nabih Estefan Diaz - Implementation of Transmit function for packets - Implementation for reading and writing from and to descriptors in memory for Tx Added relevant trace-events NOTE: This function implements the steps detailed in the datasheet for transmitting messages from the GMAC.

[PULL 25/36] hw/arm/xen_arm.c: convert DPRINTF to trace events and error/warn reports

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

[PULL 11/36] target/arm: Reinstate "vfp" property on AArch32 CPUs

2024-02-02 Thread Peter Maydell
In commit 4315f7c614743 we restructured the logic for creating the VFP related properties to avoid testing the aa32_simd_r32 feature on AArch64 CPUs. However in the process we accidentally stopped exposing the "vfp" QOM property on AArch32 TCG CPUs. This mostly hasn't had any ill effects because

[PULL 12/36] doc/sphinx/hxtool.py: add optional label argument to SRST directive

2024-02-02 Thread Peter Maydell
From: David Woodhouse We can't just embed labels directly into files like qemu-options.hx which are included from multiple top-level rST files, because Sphinx sees the labels as duplicate: https://github.com/sphinx-doc/sphinx/issues/9707 So add an optional argument to the SRST directive which

[PULL 21/36] hw/arm/zynq: 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

[PULL 26/36] hw/xen/xen-mapcache.c: convert DPRINTF to tracepoints

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

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

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

[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 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

[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.

[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 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

[PULL 04/36] adb: Switch bus reset to 3-phase-reset

2024-02-02 Thread Peter Maydell
Switch the ADB 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 Acked-by: Michael

[PULL 27/36] hw/xen/xen-hvm-common.c: convert DPRINTF to tracepoints

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

[PULL 28/36] hw/xen: convert stderr prints to error/warn reports

2024-02-02 Thread Peter Maydell
From: Manos Pitsidianakis According to the QEMU Coding Style document: > Do not use printf(), fprintf() or monitor_printf(). Instead, use > error_report() or error_vreport() from error-report.h. This ensures the > error is reported in the right place (current monitor or stderr), and in > a

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

2024-02-02 Thread Peter Maydell
On Fri, 2 Feb 2024 at 15:36, David Woodhouse wrote: > > 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

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

[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

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

[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

[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

[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 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 +

[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:

[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

[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 +

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

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()

[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:

[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 +

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

[PULL 35/36] hw/ssi: Implement BCM2835 SPI Controller

2024-02-02 Thread Peter Maydell
From: Rayhan Faizel This patch adds the SPI controller for the BCM2835. Polling and interrupt modes of transfer are supported. DMA and LoSSI modes are currently unimplemented. Signed-off-by: Rayhan Faizel Message-id: 20240129221807.2983148-2-rayhan.fai...@gmail.com Reviewed-by: Peter Maydell

[PULL 36/36] hw/arm: Connect SPI Controller to BCM2835

2024-02-02 Thread Peter Maydell
From: Rayhan Faizel This patch will allow the SPI controller to be accessible from BCM2835 based boards as SPI0. SPI driver is usually disabled by default and config.txt does not work. Instead, dtmerge can be used to apply spi=on on a bcm2835 dtb file. Signed-off-by: Rayhan Faizel Message-id:

[PULL 24/36] hw/arm/z2: 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

[PULL 34/36] tests/qtest: Adding PCS Module test to GMAC Qtest

2024-02-02 Thread Peter Maydell
From: Nabih Estefan Diaz - Add PCS Register check to npcm_gmac-test Change-Id: I34821beb5e0b1e89e2be576ab58eabe41545af12 Signed-off-by: Nabih Estefan Reviewed-by: Tyrone Ting Message-id: 20240131002800.989285-7-nabiheste...@google.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell

[PULL 15/36] hw/arm/highbank: 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-4-phi...@linaro.org

[PULL 03/36] vmbus: Switch bus reset to 3-phase-reset

2024-02-02 Thread Peter Maydell
Switch vmbus 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 Acked-by: Michael S.

  1   2   >