Re: [PATCH v3 09/23] hw/uefi: add var-service-core.c

2025-02-13 Thread Gerd Hoffmann
Hi, > > How do your patches pick the transfer mode? Is that dictated by the > > host? Or is the guest free to choose? In case of the latter: How does > > the guest decide what to do? > > In our version, the guest gets to pick. It defaults to the DMA interface > unless it detects that it's r

[PATCH] net: vhost-user: add QAPI events to report connection state

2025-02-13 Thread Laurent Vivier
The netdev reports NETDEV_VHOST_USER_CONNECTED event when the chardev is connected, and NETDEV_VHOST_USER_DISCONNECTED when it is disconnected. The NETDEV_VHOST_USER_CONNECTED event includes the ChardevInfo (label, filename and frontend_open). This allows a system manager like libvirt to detect w

[PATCH] hw/arm/smmu-common: Avoid using inlined functions with external linkage

2025-02-13 Thread JianChunfu
Similarly to commit 9de9fa5c ("hw/arm/smmu-common: Avoid using inlined functions with external linkage"): None of our code base require / use inlined functions with external linkage. Some places use internal inlining in the hot path. These two functions are certainly not in any hot path and

[PATCH v2] target/sparc: Fix gdbstub incorrectly handling registers f32-f62

2025-02-13 Thread Mikael Szreder
The gdbstub implementation for the Sparc architecture would incorrectly calculate the the floating point register offset. This resulted in, for example, registers f32 and f34 to point to the same value. The issue was caused by the confusion between even register numbers and even register indexes.

[PATCH 2/5] hw/riscv: More flexible FDT placement for MPFS

2025-02-13 Thread Sebastian Huber
If the kernel entry is in the high DRAM area, place the FDT into this area. Signed-off-by: Sebastian Huber --- hw/riscv/microchip_pfsoc.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hw/riscv/microchip_pfsoc.c b/hw/riscv/microchip_pfsoc.c index ec7e2e4226..2ddc

[PATCH 5/5] hw/riscv: Configurable MPFS CLINT timebase freq

2025-02-13 Thread Sebastian Huber
This property enables the setting of the CLINT timebase frequency through the command line, for example: -machine microchip-icicle-kit,clint-timebase-frequency=1000 Signed-off-by: Sebastian Huber --- hw/riscv/microchip_pfsoc.c | 49 +++--- include/hw/riscv/

[PATCH 0/5] Improve Microchip Polarfire SoC customization

2025-02-13 Thread Sebastian Huber
Booting the microchip-icicle-kit machine using the latest PolarFire SoC Hart Software Services (HSS) no longer works since Qemu lacks support for several registers (clocks, DRAM controller). Also reading from the SDCard does not work currently. In order to allow tests runs for real-time kernels su

[PATCH 1/5] hw/misc: Add MPFS system reset support

2025-02-13 Thread Sebastian Huber
Signed-off-by: Sebastian Huber --- hw/misc/mchp_pfsoc_sysreg.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/hw/misc/mchp_pfsoc_sysreg.c b/hw/misc/mchp_pfsoc_sysreg.c index 7876fe0c5b..08196525aa 100644 --- a/hw/misc/mchp_pfsoc_sysreg.c +++ b/hw/misc/mchp_pfsoc_sysreg.c @@ -27,7 +27,

[PATCH 4/5] hw/riscv: Allow direct start of kernel for MPFS

2025-02-13 Thread Sebastian Huber
Further customize the -bios and -kernel options behaviour for the microchip-icicle-kit machine. If "-bios none -kernel filename" is specified, then do not load a firmware and instead only load and start the kernel image. Signed-off-by: Sebastian Huber --- hw/riscv/microchip_pfsoc.c | 56 +++

[PATCH 3/5] hw/riscv: Make FDT optional for MPFS

2025-02-13 Thread Sebastian Huber
Real-time kernels such as RTEMS or Zephyr may use a static device tree built into the kernel image. Do not require to use the -dtb option if -kernel is used for the microchip-icicle-kit machine. Signed-off-by: Sebastian Huber --- hw/riscv/microchip_pfsoc.c | 53 ++---

RE: [PATCH v6 00/10] Support virtio-gpu DRM native context

2025-02-13 Thread Kasireddy, Vivek
Hi Dmitry, > Subject: Re: [PATCH v6 00/10] Support virtio-gpu DRM native context > > On 2/6/25 01:13, Dmitry Osipenko wrote: > > On 2/5/25 23:08, Dmitry Osipenko wrote: > >>> Thanks for showing me the video. I will take a look and check what would > go wrong here. I kinda understand corruption ma

[PULL 1/4] overall: Remove unnecessary g_strdup_printf() calls

2025-02-13 Thread Michael Tokarev
From: Philippe Mathieu-Daudé Replace g_strdup_printf("%s", value) -> g_strdup(value) to avoid unnecessary string formatting. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé Reviewed-by: Stefan Hajnoczi Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- cr

[PULL 2/4] qemu/timer: Clarify timer_new*() must be freed with timer_free()

2025-02-13 Thread Michael Tokarev
From: Philippe Mathieu-Daudé There was not mention QEMUTimer created with timer_new*() must be released with timer_free() instead of g_free(), because then active timers are removed from the active list. Update the documentation mentioning timer_free(). Signed-off-by: Philippe Mathieu-Daudé Rev

[PULL 0/4] Trivial patches for 2025-02-14

2025-02-13 Thread Michael Tokarev
The following changes since commit ce315328f8e9bf5201db4217f3ffe0784110aa4b: Merge tag 'tracing-pull-request' of https://gitlab.com/stefanha/qemu into staging (2025-02-13 11:23:57 -0500) are available in the Git repository at: https://gitlab.com/mjt0k/qemu.git tags/pull-trivial-patches for

[PULL 3/4] target/riscv: Fix minor whitespace issue in riscv_cpu_properties

2025-02-13 Thread Michael Tokarev
From: Rob Bradford The mvendorid/mimpid/marchid properties have the wrong amount of whitespace ahead of them. Signed-off-by: Rob Bradford Reviewed-by: Daniel Henrique Barboza Signed-off-by: Michael Tokarev --- target/riscv/cpu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) di

[PULL 4/4] make-release: don't rely on $CWD when excluding subproject directories

2025-02-13 Thread Michael Tokarev
From: Michael Roth The current logic scans qemu.git/subprojects/ from *.wrap files to determine whether or not to include the associated directories in the release tarballs. However, the script assumes that it is being run from the top-level of the source directory, which may not always be the ca

Re: [PATCH] make-release: don't rely on $CWD when excluding subproject directories

2025-02-13 Thread Michael Tokarev
14.02.2025 02:53, Michael Roth пишет: The current logic scans qemu.git/subprojects/ from *.wrap files to determine whether or not to include the associated directories in the release tarballs. However, the script assumes that it is being run from the top-level of the source directory, which may n

[PATCH 4/4] target/arm: Retry pushing CPER error if necessary

2025-02-13 Thread Gavin Shan
The error -1 is returned if the previously reported CPER error hasn't been claimed. The virtual machine is terminated due to abort(). It's conflicting to the ideal behaviour that the affected vCPU retries pushing the CPER error in this case since the vCPU can't proceed its execution. Move the chun

[PATCH 3/4] acpi/ghes: Allow retry to write CPER errors

2025-02-13 Thread Gavin Shan
Multiple CPER errors can be raised on multiple vCPUs at the same time. The error -1 is returned from ghes_record_cper_errors() and QEMU is terminated due to abort() in kvm_arch_on_sigbus_vcpu(). it isn't correct and expected behaviour since the affected vCPU can't proceed with execution. It's reaso

[PATCH 2/4] acpi/ghes: Use error_report() in ghes_record_cper_errors()

2025-02-13 Thread Gavin Shan
An error object is created by ghes_record_cper_errors() to collect the error messages in its failing path. The caller prints the error messages and determine its return value base on the error object. It's unnecessary to use an error object if the error number is returned by ghes_record_cper_error

[PATCH 0/4] target/arm: Improvement on memory error handling

2025-02-13 Thread Gavin Shan
Currently, there is only one CPER buffer (entry), meaning only one memory error can be reported. In extreme case, multiple memory errors can be raised on different vCPUs. For example, a singile memory error on a 64KB page of the host can results in 16 memory errors to 4KB pages of the guest. Unfort

[PATCH 1/4] acpi/ghes: Make ghes_record_cper_errors() static

2025-02-13 Thread Gavin Shan
acpi_ghes_memory_errors() is the only caller, no need to expose the function. Besides, the last 'return' in this function isn't necessary and remove it. No functional changes intended. Signed-off-by: Gavin Shan --- hw/acpi/ghes.c | 6 ++ include/hw/acpi/ghes.h | 2 -- 2 files change

Re: [PATCH v2] vdpa: Fix endian bugs in shadow virtqueue

2025-02-13 Thread Lei Yang
I tested this patch with vdpa's regression tests, everything works fine. Tested-by: Lei Yang On Thu, Feb 13, 2025 at 2:51 PM Eugenio Perez Martin wrote: > > On Wed, Feb 12, 2025 at 5:49 PM Konstantin Shkolnyy > wrote: > > > > VDPA didn't work on a big-endian machine due to missing/incorrect >

Re: [PATCH 0/4] Handling aliased guest memory maps in vhost-vDPA SVQs

2025-02-13 Thread Lei Yang
I tested this series patches with vdpa's regression tests, everything works fine. Tested-by: Lei Yang On Wed, Feb 12, 2025 at 12:20 AM Eugenio Perez Martin wrote: > > On Wed, Feb 5, 2025 at 3:58 PM Jonah Palmer wrote: > > > > An issue arises from aliased memory mappings in the guest, where > >

[PATCH v4 1/4] guestperf: Support deferred migration for multifd

2025-02-13 Thread yong . huang
From: Hyman Huang The way to enable multifd migration has been changed by commit, 82137e6c8c (migration: enforce multifd and postcopy preempt to be set before incoming), and guestperf has not made the necessary changes. If multifd migration had been enabled in the previous manner, the following e

Re: [PATCH] target/loongarch: Add full type support for query-cpu-model-expansion

2025-02-13 Thread bibo mao
On 2025/2/14 上午12:52, Igor Mammedov wrote: On Thu, 13 Feb 2025 17:40:56 +0800 bibo mao wrote: please discard this patch :( libvirt uses static type already on LoongArch platform, there is compatibility issue. Static type cannot be removed, although I do not know the difference between stat

[PATCH v4 2/4] guestperf: Nitpick the inconsistent parameters

2025-02-13 Thread yong . huang
From: Hyman Huang Signed-off-by: Hyman Huang Reviewed-by: Fabiano Rosas Reviewed-by: Daniel P. Berrangé --- tests/migration-stress/guestperf/comparison.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/migration-stress/guestperf/comparison.py b/tests/migration-stre

[PATCH v4 0/4] Guestperf: miscellaneous refinement and enrichment

2025-02-13 Thread yong . huang
From: Hyman Huang Please review, thanks Yong v3: 1. Remove the two redundant assignments in [PATCH v2 2/5] suggested by Daniel v2: 1. Update the MAINTAINERS section suggested by Fabiano Rosas 2. Ensure the dependencies when build the initrd-stress.img suggested by Daniel 3. Fix some bugs v1: T

[PATCH v4 3/4] guestperf: Introduce multifd compression option

2025-02-13 Thread yong . huang
From: Hyman Huang Guestperf tool does not cover the multifd compression option currently, it is worth supporting so that developers can analysis the migration performance with different compression algorithms. Multifd support 4 compression algorithms currently: zlib, zstd, qpl, uadk To request

[PATCH v4 4/4] guestperf: Add test result data into report

2025-02-13 Thread yong . huang
From: Hyman Huang The migration result data is not included in the guestperf report information; include the result as a report entry so the developer can check whether the migration was successful after running guestperf. Signed-off-by: Hyman Huang --- tests/migration-stress/guestperf/engine.

Re: [PATCH v3 2/2] KVM: SEV: Configure "ALLOWED_SEV_FEATURES" VMCB Field

2025-02-13 Thread Sean Christopherson
On Thu, Feb 13, 2025, Kim Phillips wrote: > On 2/11/25 3:46 PM, Sean Christopherson wrote: > > On Mon, Feb 10, 2025, Tom Lendacky wrote: > > > On 2/7/25 17:34, Kim Phillips wrote: > > > > diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c > > > > index a2a794c32050..a9e16792cac0 100644 >

[PATCH] make-release: don't rely on $CWD when excluding subproject directories

2025-02-13 Thread Michael Roth
The current logic scans qemu.git/subprojects/ from *.wrap files to determine whether or not to include the associated directories in the release tarballs. However, the script assumes that it is being run from the top-level of the source directory, which may not always be the case. In particular, wh

Re: [PATCH v3 2/2] KVM: SEV: Configure "ALLOWED_SEV_FEATURES" VMCB Field

2025-02-13 Thread Kim Phillips
On 2/11/25 3:46 PM, Sean Christopherson wrote: On Mon, Feb 10, 2025, Tom Lendacky wrote: On 2/7/25 17:34, Kim Phillips wrote: diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c index a2a794c32050..a9e16792cac0 100644 --- a/arch/x86/kvm/svm/sev.c +++ b/arch/x86/kvm/svm/sev.c @@ -894,9

Re: [PATCH v2] target/riscv: remove warnings about Smdbltrp/Smrnmi being disabled

2025-02-13 Thread Daniel Henrique Barboza
On 2/13/25 11:56 AM, Clément Léger wrote: As raised by Richard Henderson, these warnings are displayed in user only as well. Since they aren't really useful for the end-user, remove them and add a "TODO" note in the leading comments. Signed-off-by: Clément Léger --- Reviewed-by: Daniel Hen

Re: [PATCH v3 09/23] hw/uefi: add var-service-core.c

2025-02-13 Thread Alexander Graf
On 13.02.25 15:54, Gerd Hoffmann wrote: On Thu, Feb 13, 2025 at 11:14:03AM +0100, Alexander Graf wrote: I don't think so. The firmware driver knows this actually is normal ram and can setup mappings and memory attributes accordingly. The situation is a bit different from vga memory bars whic

Re: [PATCH v2] vfio: Add property documentation

2025-02-13 Thread Alex Williamson
On Thu, 13 Feb 2025 14:50:50 +0100 Cédric Le Goater wrote: > Investigate the git history to uncover when and why the VFIO > properties were introduced and update the models. This is mostly > targeting vfio-pci device, since vfio-plateform, vfio-ap and vfio-ccw > devices are simpler. > > Organize

Re: [PATCH v2 2/3] docs/cpu-features: Update "PAuth" (Pointer Authentication) details

2025-02-13 Thread Alex Bennée
Kashyap Chamarthy writes: > PAuth (Pointer Authentication), a security feature in software, is > relevant for both KVM and QEMU. Relect this fact into the docs: > > - For KVM, `pauth` is a binary, "on" vs "off" option. The host CPU > will choose the cryptographic algorithm. > > - For TC

Re: [PATCH v2 1/3] docs/cpu-features: Consistently use vCPU instead of VCPU

2025-02-13 Thread Alex Bennée
Kashyap Chamarthy writes: > Signed-off-by: Kashyap Chamarthy Should we add vCPU to glossary.rst? Anyway: Reviewed-by: Alex Bennée -- Alex Bennée Virtualisation Tech Lead @ Linaro

Re: [PATCH v3 6/9] migration: Don't set FAILED state when cancelling

2025-02-13 Thread Peter Xu
On Thu, Feb 13, 2025 at 02:59:24PM -0300, Fabiano Rosas wrote: > The expected outcome from qmp_migrate_cancel() is that the source > migration goes to the terminal state > MIGRATION_STATUS_CANCELLED. Anything different from this is a bug when > cancelling. > > Make sure there is never a state tran

Re: [PATCH v3 3/9] migration: Change migrate_fd_ to migration_

2025-02-13 Thread Peter Xu
On Thu, Feb 13, 2025 at 02:59:21PM -0300, Fabiano Rosas wrote: > Remove all instances of _fd_ from the migration generic code. These > functions have grown over time and the _fd_ part is now just > confusing. > > migration_fd_error() -> migration_error() makes it a little > vague. Since it's only

Re: [PATCH v8 0/3] Poisoned memory recovery on reboot

2025-02-13 Thread Peter Xu
On Thu, Feb 13, 2025 at 08:35:09PM +0100, William Roche wrote: > On 2/11/25 23:35, Peter Xu wrote: > > On Tue, Feb 11, 2025 at 09:27:04PM +, “William Roche wrote: > > > From: William Roche > > > > > > Here is a very simplified version of my fix only dealing with the > > > recovery of huge pag

Re: [PULL 00/29] Misc HW patches for 2025-02-12

2025-02-13 Thread Philippe Mathieu-Daudé
On 13/2/25 19:46, Stefan Hajnoczi wrote: On Wed, Feb 12, 2025 at 10:54 AM Philippe Mathieu-Daudé wrote: The following changes since commit f9edf32ea2e18a56de5d92f57e9d10565c822367: Merge tag 'pull-request-2025-02-11' of https://gitlab.com/thuth/qemu into staging (2025-02-11 13:27:32 -0500

[PATCH 0/1] accel/kvm: set coalesced_mmio_ring to NULL after kvm_run is unmapped

2025-02-13 Thread Sid Manning
Encountered a segfault while exiting because kvm_flush_coalesced_mmio_buffer was getting called after do_kvm_destroy_vcpu unmapped cpu->kvm_run. kvm_state->coalesced_mmio_ring is an offset from cpu->kvm_run so it needs to be set to NULL after kvm_run is unmapped to avoid getting dereferenced by kv

[PATCH 1/1] accel/kvm: set coalesced_mmio_ring to NULL after kvm_run is unmapped

2025-02-13 Thread Sid Manning
kvm_flush_coalesced_mmio_buffer explicitly checks for this to be non-null. Since kvm_init_vcpu sets this as an offset from the mapped cpu->kvm_run it should be reset to NULL after kvm_run is unmapped. Signed-off-by: Sid Manning --- accel/kvm/kvm-all.c | 2 ++ 1 file changed, 2 insertions(+) di

Re: [PATCH 0/3] tests/qtest/ufs-test: Add MCQ tests

2025-02-13 Thread Fabiano Rosas
Jeuk Kim writes: > This series adds test support for UFS Multi-Circular Queue (MCQ) mode in > QEMU. > It includes MCQ initialization tests, a bitmap-based slot allocation method, > and cleanup of unused code. > > Jeuk Kim (3): > tests/qtest/ufs-test: Cleanup unused code > tests/qtest/ufs

Re: [PATCH v8 0/3] Poisoned memory recovery on reboot

2025-02-13 Thread William Roche
On 2/11/25 23:35, Peter Xu wrote: On Tue, Feb 11, 2025 at 09:27:04PM +, “William Roche wrote: From: William Roche Here is a very simplified version of my fix only dealing with the recovery of huge pages on VM reset. --- This set of patches fixes an existing bug with hardware memory error

Re: [PATCH] target/sparc: Fix gdbstub incorrectly handling registers f32-f62

2025-02-13 Thread Richard Henderson
On 2/13/25 11:03, Mikael Szreder wrote: Sorry. As you correctly pointed out there is no f33 register. I wrote f33, when I really meant f34. I believe the index of f32 is 64 and f34 is 65. This is confirmed when looking at the XML description of the registers in GDB:

Re: [PATCH] target/sparc: Fix gdbstub incorrectly handling registers f32-f62

2025-02-13 Thread Mikael Szreder
Sorry. As you correctly pointed out there is no f33 register. I wrote f33, when I really meant f34. I believe the index of f32 is 64 and f34 is 65. This is confirmed when looking at the XML description of the registers in GDB:

Re: [PULL 00/29] Misc HW patches for 2025-02-12

2025-02-13 Thread Stefan Hajnoczi
On Wed, Feb 12, 2025 at 10:54 AM Philippe Mathieu-Daudé wrote: > > The following changes since commit f9edf32ea2e18a56de5d92f57e9d10565c822367: > > Merge tag 'pull-request-2025-02-11' of https://gitlab.com/thuth/qemu into > staging (2025-02-11 13:27:32 -0500) > > are available in the Git reposi

Re: Question Regarding the PowerPC arch Support

2025-02-13 Thread Atharv Dubey
On Fri, 14 Feb, 2025, 00:05 Thomas Huth, wrote: > On 13/02/2025 19.18, Atharv Dubey wrote: > > Hello, > > > > I am new user to qemu and wanted to ask if qemu supports AHCI mode in > > PowerPC emulation. > > Hi, > > it seems like the "powernv" machine of qemu-system-ppc64 supports AHCI, > but >

Re: Question Regarding the PowerPC arch Support

2025-02-13 Thread Thomas Huth
On 13/02/2025 19.18, Atharv Dubey wrote: Hello, I am new user to qemu and wanted to ask if qemu supports AHCI mode in PowerPC emulation. Hi, it seems like the "powernv" machine of qemu-system-ppc64 supports AHCI, but I don't have a clue how to use it. So let's put qemu-...@nongnu.org in CC

Re: [PATCH 1/1] mem/cxl-type3: Add a default value of sn

2025-02-13 Thread Fan Ni
On Thu, Feb 13, 2025 at 03:09:05PM +0800, Yuquan Wang wrote: > On Tue, Feb 11, 2025 at 09:26:55AM +, Jonathan Cameron wrote: > > On Tue, 11 Feb 2025 10:24:13 +0800 > > Yuquan Wang wrote: > > > > > The previous default value of sn is UI64_NULL which would cause the > > > cookie of nd_interleav

Question Regarding the PowerPC arch Support

2025-02-13 Thread Atharv Dubey
Hello, I am new user to qemu and wanted to ask if qemu supports AHCI mode in PowerPC emulation. Regards, Atharv Dubey

[PATCH 12/12] virtio-scsi: handle ctrl virtqueue in main loop

2025-02-13 Thread Stefan Hajnoczi
Previously the ctrl virtqueue was handled in the AioContext where SCSI requests are processed. When IOThread Virtqueue Mapping was added things become more complicated because SCSI requests could run in other AioContexts. Simplify by handling the ctrl virtqueue in the main loop where reset operati

[PATCH 01/12] scsi-disk: drop unused SCSIDiskState->bh field

2025-02-13 Thread Stefan Hajnoczi
Commit 71544d30a6f8 ("scsi: push request restart to SCSIDevice") removed the only user of SCSIDiskState->bh. Signed-off-by: Stefan Hajnoczi --- hw/scsi/scsi-disk.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index e7f738b484..caf6c1437f 100644 ---

[PATCH 08/12] virtio-blk: extract cleanup_iothread_vq_mapping() function

2025-02-13 Thread Stefan Hajnoczi
This is the cleanup function that must be called after apply_iothread_vq_mapping() succeeds. virtio-scsi will need this function too, so extract it. Signed-off-by: Stefan Hajnoczi --- hw/block/virtio-blk.c | 27 +-- 1 file changed, 21 insertions(+), 6 deletions(-) diff -

[PATCH 11/12] virtio-scsi: add iothread-vq-mapping parameter

2025-02-13 Thread Stefan Hajnoczi
Allow virtio-scsi virtqueues to be assigned to different IOThreads. This makes it possible to take advantage of host multi-queue block layer scalability by assigning virtqueues that have affinity with vCPUs to different IOThreads that have affinity with host CPUs. The same feature was introduced fo

[PATCH 09/12] virtio-blk: tidy up iothread_vq_mapping functions

2025-02-13 Thread Stefan Hajnoczi
Use noun_verb() function naming instead of verb_noun() because the former is the most common naming style for APIs. The next commit will move these functions into a header file so that virtio-scsi can call them. Shorten iothread_vq_mapping_apply()'s iothread_vq_mapping_list argument to just "list"

[PATCH 03/12] scsi: track per-SCSIRequest AioContext

2025-02-13 Thread Stefan Hajnoczi
Until now, a SCSIDevice's I/O requests have run in a single AioContext. In order to support multiple IOThreads it will be necessary to move to the concept of a per-SCSIRequest AioContext. Signed-off-by: Stefan Hajnoczi --- include/hw/scsi/scsi.h | 1 + hw/scsi/scsi-bus.c | 1 + hw/scsi/scs

[PATCH 07/12] virtio-scsi: perform TMFs in appropriate AioContexts

2025-02-13 Thread Stefan Hajnoczi
With IOThread Virtqueue Mapping there will be multiple AioContexts processing SCSI requests. scsi_req_cancel() and other SCSI request operations must be performed from the AioContext where the request is running. Introduce a virtio_scsi_defer_tmf_to_aio_context() function and the necessary VirtIOS

[PATCH 10/12] virtio: extract iothread-vq-mapping.h API

2025-02-13 Thread Stefan Hajnoczi
The code that builds an array of AioContext pointers indexed by the virtqueue is not specific to virtio-blk. virtio-scsi will need to do the same thing, so extract the functions. Signed-off-by: Stefan Hajnoczi --- include/hw/virtio/iothread-vq-mapping.h | 45 hw/block/virtio-blk.c

[PATCH 02/12] dma: use current AioContext for dma_blk_io()

2025-02-13 Thread Stefan Hajnoczi
In the past a single AioContext was used for block I/O and it was fetched using blk_get_aio_context(). Nowadays the block layer supports running I/O from any AioContext and multiple AioContexts at the same time. Remove the dma_blk_io() AioContext argument and use the current AioContext instead. Th

[PATCH 05/12] virtio-scsi: introduce event and ctrl virtqueue locks

2025-02-13 Thread Stefan Hajnoczi
Virtqueues are not thread-safe. Until now this was not a major issue since all virtqueue processing happened in the same thread. The ctrl queue's Task Management Function (TMF) requests sometimes need the main loop, so a BH was used to schedule the virtqueue completion back in the thread that has v

[PATCH v3 6/9] migration: Don't set FAILED state when cancelling

2025-02-13 Thread Fabiano Rosas
The expected outcome from qmp_migrate_cancel() is that the source migration goes to the terminal state MIGRATION_STATUS_CANCELLED. Anything different from this is a bug when cancelling. Make sure there is never a state transition from an unspecified state into FAILED. Code that sets FAILED, should

[PATCH 04/12] scsi: introduce requests_lock

2025-02-13 Thread Stefan Hajnoczi
SCSIDevice keeps track of in-flight requests for device reset and Task Management Functions (TMFs). The request list requires protection so that multi-threaded SCSI emulation can be implemented in commits that follow. Signed-off-by: Stefan Hajnoczi --- include/hw/scsi/scsi.h | 7 ++- hw/scsi/s

[PATCH 06/12] virtio-scsi: protect events_dropped field

2025-02-13 Thread Stefan Hajnoczi
The block layer can invoke the resize callback from any AioContext that is processing requests. The virtqueue is already protected but the events_dropped field also needs to be protected against races. Cover it using the event virtqueue lock because it is closely associated with accesses to the vir

[PATCH v3 3/9] migration: Change migrate_fd_ to migration_

2025-02-13 Thread Fabiano Rosas
Remove all instances of _fd_ from the migration generic code. These functions have grown over time and the _fd_ part is now just confusing. migration_fd_error() -> migration_error() makes it a little vague. Since it's only used for migration_connect() failures, change it to migration_connect_set_e

[PATCH 00/12] virtio-scsi: add iothread-vq-mapping parameter

2025-02-13 Thread Stefan Hajnoczi
Implement --device virtio-scsi-pci,iothread-vq-mapping= support so that virtqueues can be assigned to different IOThreads. This improves SMP guest scalability where I/O-intensive applications can become bottlenecked on a single IOThread. The following benchmark results show the effect of iothread-

[PATCH v3 7/9] tests/qtest/migration: Introduce migration_test_add_suffix

2025-02-13 Thread Fabiano Rosas
Introduce a new migration_test_add_suffix to allow programmatic creation of tests based on a suffix. Pass the test name into the test so it can know which variant to run. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- tests/qtest/migration/migration-util.c | 24

[PATCH v3 9/9] migration: Update migrate_cancel documentation

2025-02-13 Thread Fabiano Rosas
Update the migrate_cancel command documentation with a few words about postcopy and the expected state of the machine after migration. Acked-by: Markus Armbruster Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- qapi/migration.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)

[PATCH v3 1/9] migration: Set migration error outside of migrate_cancel

2025-02-13 Thread Fabiano Rosas
There's no point passing the error into migration cancel only for it to call migrate_set_error(). Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/migration.c | 7 ++- migration/migration.h | 2 +- migration/ram.c | 4 +++- 3 files changed, 6 insertions(+), 7 deletions

[PATCH v3 5/9] migration: Reject qmp_migrate_cancel after postcopy

2025-02-13 Thread Fabiano Rosas
After postcopy has started, it's not possible to recover the source machine in case a migration error occurs because the destination has already been changing the state of the machine. For that same reason, it doesn't make sense to try to cancel the migration after postcopy has started. Reject the

[PATCH v3 4/9] migration: Fix hang after error in destination setup phase

2025-02-13 Thread Fabiano Rosas
If the destination side fails at migration_ioc_process_incoming() before starting the coroutine, it will report the error but QEMU will not exit. Set the migration state to FAILED and exit the process if exit-on-error allows. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2633 Reported-b

[PATCH v3 0/9] migration: Fix issues during qmp_migrate_cancel

2025-02-13 Thread Fabiano Rosas
changes from v2: Added more if != CANCELLING where it was missing. We have other work [1] pending around migration states, so I've kept this simple for correctness only. CI run: https://gitlab.com/farosas/qemu/-/pipelines/1670135398 1- https://lore.kernel.org/r/20250110100707.4805-1-shivam.kum..

[PATCH v3 2/9] migration: Unify migration_cancel and migrate_fd_cancel

2025-02-13 Thread Fabiano Rosas
There's no need for two separate functions and this _fd_ is a historic artifact that makes little sense nowadays. Reviewed-by: Peter Xu Signed-off-by: Fabiano Rosas --- migration/migration.c | 18 +++--- migration/trace-events | 2 +- 2 files changed, 8 insertions(+), 12 deletions

[PATCH v3 8/9] tests/qtest/migration: Add a cancel test

2025-02-13 Thread Fabiano Rosas
The qmp_migrate_cancel() command is poorly tested and code inspection reveals that there might be concurrency issues with its usage. Add a test that runs a migration and calls qmp_migrate_cancel() at specific moments. In order to make the test more deterministic, instead of calling qmp_migrate_can

Re: [PATCH 1/6] tcg: Introduce the 'z' constraint for a hardware zero register

2025-02-13 Thread Richard Henderson
On 2/13/25 07:45, Philippe Mathieu-Daudé wrote: On 12/2/25 04:46, Richard Henderson wrote: For loongarch, mips, riscv and sparc, a zero register is available all the time.  For aarch64, register index 31 depends on context: sometimes it is the stack pointer, and sometimes it is the zero register

Re: [PATCH v4] hw/arm/virt: Support larger highmem MMIO regions

2025-02-13 Thread Eric Auger
On 2/12/25 3:54 PM, Matthew R. Ochs wrote: > The MMIO region size required to support virtualized environments with > large PCI BAR regions can exceed the hardcoded limit configured in QEMU. > For example, a VM with multiple NVIDIA Grace-Hopper GPUs passed through > requires more MMIO memory th

Re: [PATCH v8 6/6] hw/ssi/xilinx_spi: Make device endianness configurable

2025-02-13 Thread Richard Henderson
On 2/13/25 04:22, Philippe Mathieu-Daudé wrote: Replace the DEVICE_NATIVE_ENDIAN MemoryRegionOps by a pair of DEVICE_LITTLE_ENDIAN / DEVICE_BIG_ENDIAN. Add the "endianness" property to select the device endianness. This property is unspecified by default, and machines need to make it explicit.

Re: [PATCH v8 5/6] hw/char/xilinx_uartlite: Make device endianness configurable

2025-02-13 Thread Richard Henderson
On 2/13/25 04:22, Philippe Mathieu-Daudé wrote: Replace the DEVICE_NATIVE_ENDIAN MemoryRegionOps by a pair of DEVICE_LITTLE_ENDIAN / DEVICE_BIG_ENDIAN. Add the "endianness" property to select the device endianness. This property is unspecified by default, and machines need to make it explicit.

Re: [PATCH v8 1/6] hw/qdev-properties-system: Introduce EndianMode QAPI enum

2025-02-13 Thread Richard Henderson
On 2/13/25 04:22, Philippe Mathieu-Daudé wrote: Introduce the EndianMode type and the DEFINE_PROP_ENDIAN() macros. Endianness can be BIG, LITTLE or unspecified (default). Reviewed-by: Thomas Huth Acked-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daudé --- qapi/common.json

Re: [PATCH v8 4/6] hw/timer/xilinx_timer: Make device endianness configurable

2025-02-13 Thread Richard Henderson
On 2/13/25 04:22, Philippe Mathieu-Daudé wrote: Replace the DEVICE_NATIVE_ENDIAN MemoryRegionOps by a pair of DEVICE_LITTLE_ENDIAN / DEVICE_BIG_ENDIAN. Add the "endianness" property to select the device endianness. This property is unspecified by default, and machines need to make it explicit.

Re: [PATCH v8 3/6] hw/net/xilinx_ethlite: Make device endianness configurable

2025-02-13 Thread Richard Henderson
On 2/13/25 04:22, Philippe Mathieu-Daudé wrote: Replace the DEVICE_NATIVE_ENDIAN MemoryRegionOps by a pair of DEVICE_LITTLE_ENDIAN / DEVICE_BIG_ENDIAN. Add the "endianness" property to select the device endianness. This property is unspecified by default, and machines need to make it explicit.

Re: [PATCH v8 2/6] hw/intc/xilinx_intc: Make device endianness configurable

2025-02-13 Thread Richard Henderson
On 2/13/25 04:22, Philippe Mathieu-Daudé wrote: Replace the DEVICE_NATIVE_ENDIAN MemoryRegionOps by a pair of DEVICE_LITTLE_ENDIAN / DEVICE_BIG_ENDIAN. Add the "endianness" property to select the device endianness. This property is unspecified by default, and machines need to make it explicit.

Re: [PATCH] target/sparc: Fix gdbstub incorrectly handling registers f32-f62

2025-02-13 Thread Richard Henderson
On 2/3/25 06:50, Mikael Szreder wrote: The gdbstub implementation for the Sparc architecture would incorectly calculate the the floating point register offset. This would cause register pairs(eg f32,f33) to point to the same value. Fixes: 30038fd81808 ("target-sparc: Change fpr representation

Re: [PATCH] target/loongarch: Add full type support for query-cpu-model-expansion

2025-02-13 Thread Igor Mammedov
On Thu, 13 Feb 2025 17:40:56 +0800 bibo mao wrote: > please discard this patch :( > > libvirt uses static type already on LoongArch platform, there is > compatibility issue. Static type cannot be removed, although I do > not know the difference between static type and full type. looking at loo

[PULL 11/27] rust: irq: define ObjectType for IRQState

2025-02-13 Thread Paolo Bonzini
This is a small preparation in order to use an Owned for the argument to sysbus_connect_irq. Signed-off-by: Paolo Bonzini --- rust/qemu-api/src/irq.rs | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/rust/qemu-api/src/irq.rs b/rust/qemu-api/src/irq.rs index 63

[PULL 08/27] rust: qdev: switch from legacy reset to Resettable

2025-02-13 Thread Paolo Bonzini
Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- meson.build | 1 + rust/hw/char/pl011/src/device.rs | 10 ++- rust/qemu-api/src/qdev.rs| 111 --- rust/qemu-api/tests/tests.rs | 5 +- 4 files changed, 99 insertions(+), 28 de

Re: [PATCH] target/loongarch: Add full type support for query-cpu-model-expansion

2025-02-13 Thread David Hildenbrand
On 13.02.25 17:17, Igor Mammedov wrote: On Thu, 13 Feb 2025 12:48:30 +0100 Markus Armbruster wrote: gaosong writes: Cc: Markus hi, Markus What is the difference between CPU_MODEL_EXPANSION_TYPE_STATIC and CPU_MODEL_EXPANSION_TYPE_FULL? the only difference is that 'static' expansion will

Re: [PATCH] vhost-user-snd: Use virtio_get_config_size()

2025-02-13 Thread Stefano Garzarella
On Thu, 13 Feb 2025 at 16:43, Stefano Garzarella wrote: > > Unrelated to this patch, but since we are talking about > VIRTIO_SND_F_CTLS, I think it would be good to send a patch to Linux to > make it clear that `controls` depends on VIRTIO_SND_F_CTLS. Patch posted here: https://lore.kernel.org/vi

[PULL 14/27] i386/fw_cfg: move hpet_cfg definition to hpet.c

2025-02-13 Thread Paolo Bonzini
From: Zhao Liu HPET device needs to access and update hpet_cfg variable, but now it is defined in hw/i386/fw_cfg.c and Rust code can't access it. Move hpet_cfg definition to hpet.c (and rename it to hpet_fw_cfg). This allows Rust HPET device implements its own global hpet_fw_cfg variable, and wi

Re: [PATCH] target/loongarch: Add full type support for query-cpu-model-expansion

2025-02-13 Thread Igor Mammedov
On Thu, 13 Feb 2025 12:48:30 +0100 Markus Armbruster wrote: > gaosong writes: > > > Cc: Markus > > > > hi, Markus > > > > What is the difference between CPU_MODEL_EXPANSION_TYPE_STATIC and > > CPU_MODEL_EXPANSION_TYPE_FULL? the only difference is that 'static' expansion will not report prop

[PULL 02/27] rust: qom: add reference counting functionality

2025-02-13 Thread Paolo Bonzini
Add a smart pointer that allows to add and remove references from QOM objects. It's important to note that while all QOM objects have a reference count, in practice not all of them have their lifetime guarded by it. Embedded objects, specifically, are confined to the lifetime of the owner. When

[PULL 07/27] rust: qdev: make ObjectImpl a supertrait of DeviceImpl

2025-02-13 Thread Paolo Bonzini
In practice it has to be implemented always in order to access an implementation of ClassInitImpl. Make the relationship explicit in the code. Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- rust/qemu-api/src/qdev.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PULL 25/27] rust: vmstate: remove redundant link targets

2025-02-13 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- rust/qemu-api/src/vmstate.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rust/qemu-api/src/vmstate.rs b/rust/qemu-api/src/vmstate.rs index 164effc6553..c6dfb609356 100644 --- a/rust/qemu-api/src/vmstate.rs +++ b/rust/qemu-api/src/vmsta

[PULL 13/27] rust: pl011: convert pl011_create to safe Rust

2025-02-13 Thread Paolo Bonzini
Not a major change but, as a small but significant step in creating qdev bindings, show how pl011_create can be written without "unsafe" calls (apart from converting pointers to references). This also provides a starting point for creating Error** bindings. Reviewed-by: Zhao Liu Signed-off-by: P

[PULL 10/27] rust: bindings for MemoryRegionOps

2025-02-13 Thread Paolo Bonzini
Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- docs/devel/rust.rst | 1 + rust/hw/char/pl011/src/device.rs | 51 +++ rust/hw/char/pl011/src/lib.rs| 1 - rust/hw/char/pl011/src/memory_ops.rs | 34 - rust/qemu-api/meson.build| 1 + r

Re: [PATCH 4/9] target/microblaze: Use uint64_t for CPUMBState.ear

2025-02-13 Thread Richard Henderson
On 2/13/25 04:42, Philippe Mathieu-Daudé wrote: On 12/2/25 23:01, Richard Henderson wrote: Use an explicit 64-bit type for EAR. Signed-off-by: Richard Henderson ---   target/microblaze/cpu.h   | 2 +-   target/microblaze/translate.c | 2 +-   2 files changed, 2 insertions(+), 2 deletions(-)

[PULL 19/27] rust: add bindings for timer

2025-02-13 Thread Paolo Bonzini
From: Zhao Liu Add timer bindings to help handle idiomatic Rust callbacks. Additionally, wrap QEMUClockType in ClockType binding to avoid unsafe calls in device code. Signed-off-by: Zhao Liu Link: https://lore.kernel.org/r/20250210030051.2562726-7-zhao1@intel.com Signed-off-by: Paolo Bonzi

[PULL 00/27] rust, Windows patches for 2025-02-13

2025-02-13 Thread Paolo Bonzini
The following changes since commit de278e54aefed143526174335f8286f7437d20be: Merge tag 'pull-loongarch-20250212' of https://gitlab.com/bibo-mao/qemu into staging (2025-02-12 09:16:36 -0500) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream for yo

  1   2   3   >