[PULL 03/18] numa: Validate cluster and NUMA node boundary if required

2023-06-26 Thread Paolo Bonzini
From: Gavin Shan For some architectures like ARM64, multiple CPUs in one cluster can be associated with different NUMA nodes, which is irregular configuration because we shouldn't have this in baremetal environment. The irregular configuration causes Linux guest to misbehave, as the following war

[PULL 06/18] kvm: reuse per-vcpu stats fd to avoid vcpu interruption

2023-06-26 Thread Paolo Bonzini
From: Marcelo Tosatti A regression has been detected in latency testing of KVM guests. More specifically, it was observed that the cyclictest numbers inside of an isolated vcpu (running on isolated pcpu) are: Where a maximum of 50us is acceptable. The implementation of KVM_GET_STATS_FD uses run

[PULL 02/18] hw/remote/proxy: Remove dubious 'event_notifier-posix.c' include

2023-06-26 Thread Paolo Bonzini
From: Philippe Mathieu-Daudé event_notifier-posix.c is registered in meson's util_ss[] source set, which is built as libqemuutil.a.p library. Both tools and system emulation binaries are linked with qemuutil, so there is no point in including this source file. Introduced in commit bd36adb8df ("m

[PULL 11/18] target/i386: TCG supports XSAVEERPTR

2023-06-26 Thread Paolo Bonzini
XSAVEERPTR is actually a fix for an errata; TCG does not have the issue. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index fc4246223d4..bce0cb73e85

[PULL 14/18] target/i386: AMD only supports SYSENTER/SYSEXIT in 32-bit mode

2023-06-26 Thread Paolo Bonzini
Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index ed4016f554b..a20b5af71e7 100644 --- a/target/i386/tcg/transla

[PULL 05/18] hw/riscv: Validate cluster and NUMA node boundary

2023-06-26 Thread Paolo Bonzini
From: Gavin Shan There are two RISCV machines where NUMA is aware: 'virt' and 'spike'. Both of them are required to follow cluster-NUMA-node boundary. To enable the validation to warn about the irregular configuration where multiple CPUs in one cluster has been associated with multiple NUMA nodes

[PULL 18/18] git-submodule.sh: allow running in validate mode without previous update

2023-06-26 Thread Paolo Bonzini
The call to git-submodule.sh done in configure may happen without a previous checkout of the roms/SLOF submodule, or even without a previous run of the script. So, handle creating a .git-submodule-status file even in validate mode. If git is absent, ensure that all passed directories exists (beca

[PULL 09/18] target/i386: TCG supports RDSEED

2023-06-26 Thread Paolo Bonzini
TCG implements RDSEED, and in fact uses qcrypto_random_bytes which is secure enough to match hardware behavior. Expose it to guests. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/target

[PULL 10/18] target/i386: do not accept RDSEED if CPUID bit absent

2023-06-26 Thread Paolo Bonzini
Suggested-by: Richard Henderson Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 8 1 file changed, 8 insertions(+) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 0de068d4b79..4ef45bbd71e 100644 --- a/target/i3

[PULL 07/18] target/i386: fix INVD vmexit

2023-06-26 Thread Paolo Bonzini
Due to a typo or perhaps a brain fart, the INVD vmexit was never generated. Fix it (but not that fixing just the typo would break both INVD and WBINVD, due to a case of two wrongs making a right). Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 2 +-

[PULL 01/18] build: further refine build.ninja rules

2023-06-26 Thread Paolo Bonzini
In commit b0fcc6fc7fc1 ("build: rebuild build.ninja using "meson setup --reconfigure"", 2023-05-19) I changed the build.ninja rule in the Makefile to use "meson setup" so that the Makefile would pick up a changed path to the meson binary. However, there was a reason why build.ninja was rebuilt usi

[PULL 08/18] target/i386: TCG supports 3DNow! prefetch(w)

2023-06-26 Thread Paolo Bonzini
The AMD prefetch(w) instructions have not been deprecated together with the rest of 3DNow!, and in fact are even supported by newer Intel processor. Mark them as supported by TCG, as it supports all of 3DNow!. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/cpu.c |

[PULL 15/18] target/i386: sysret and sysexit are privileged

2023-06-26 Thread Paolo Bonzini
Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/tcg/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index a20b5af71e7..66800392bb9 100644 --- a/target/i386/tcg/translate.c ++

[PULL 04/18] hw/arm: Validate cluster and NUMA node boundary

2023-06-26 Thread Paolo Bonzini
From: Gavin Shan There are two ARM machines where NUMA is aware: 'virt' and 'sbsa-ref'. Both of them are required to follow cluster-NUMA-node boundary. To enable the validation to warn about the irregular configuration where multiple CPUs in one cluster have been associated with different NUMA no

[PULL 12/18] target/i386: TCG supports WBNOINVD

2023-06-26 Thread Paolo Bonzini
WBNOINVD is the same as INVD or WBINVD as far as TCG is concerned, since there is no cache in TCG and therefore no invalidation side effect in WBNOINVD. With respect to SVM emulation, processors that do not support WBNOINVD will ignore the prefix and treat it as WBINVD, while those that support it

Re: [PATCH v2 4/5] tests/qtest/hd-geo-test: fix test by removing unnecessary pcie-root-port

2023-06-26 Thread Igor Mammedov
On Thu, 22 Jun 2023 16:02:54 +0530 Ani Sinha wrote: > A SCSI controller can be attached to a pcie-to-pci bridge which in turn can be > attached directly to the root bus (peie.0). There is no need to attach a > pcie-root-port on the root bus in order to attach the pcie-ro-pci bridge. > Fix it. br

[PULL 13/18] target/i386: Intel only supports SYSCALL/SYSRET in long mode

2023-06-26 Thread Paolo Bonzini
Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 4 target/i386/tcg/translate.c | 9 - 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 695e01582bf..978d24b5ec7 100644 --- a/target

[PULL 16/18] target/i386: implement RDPID in TCG

2023-06-26 Thread Paolo Bonzini
RDPID corresponds to a RDMSR(TSC_AUX); however, it is unprivileged so for user-mode emulation we must provide the value that the kernel places in the MSR. For Linux, it is a combination of the current CPU and the current NUMA node, both of which can be retrieved with getcpu(2). Also try sched_getc

[PULL 17/18] target/i386: implement SYSCALL/SYSRET in 32-bit emulators

2023-06-26 Thread Paolo Bonzini
AMD supports both 32-bit and 64-bit SYSCALL/SYSRET, but the TCG only exposes it for 64-bit targets. For system emulation just reuse the helper; for user-mode emulation the ABI is the same as "int $80". The BSDs does not support any fast system call mechanism in 32-bit mode so add to bsd-user the

Re: [PATCH] pnv/xive2: Allow indirect TIMA accesses of all sizes

2023-06-26 Thread Frederic Barrat
On 26/06/2023 11:48, Philippe Mathieu-Daudé wrote: On 26/6/23 11:40, Frederic Barrat wrote: Booting linux on the powernv10 machine logs a few errors like: Invalid read at addr 0x38, size 1, region 'xive-ic-tm-indirect', reason: invalid size (min:8 max:8) Invalid write at addr 0x38, size 1,

Re: [PATCH v3 09/14] target/ppc: Move patching nip from exception handler to helper_scv

2023-06-26 Thread Nicholas Piggin
On Tue Jun 20, 2023 at 8:47 PM AEST, BALATON Zoltan wrote: > On Tue, 20 Jun 2023, Nicholas Piggin wrote: > > On Fri Jun 16, 2023 at 9:03 AM AEST, BALATON Zoltan wrote: > >> From: Nicholas Piggin > >> > >> Unlike sc, for scv a facility unavailable interrupt must be generated > >> if FSCR[SCV]=0 so

Is it possible to boot a riscv32 guest on riscv64 host using KVM?

2023-06-26 Thread Philippe Mathieu-Daudé
Hi, I'm working on a tree-wide accelerator refactor and want to run various configs to be sure I didn't broke anything. QEMU theoretically supports running a riscv32 guest using KVM on a riscv64 host, however the documentation I'm finding only refers to riscv64 guests: https://github.com/kvm-ris

Re: [PATCH v3 09/14] target/ppc: Move patching nip from exception handler to helper_scv

2023-06-26 Thread Nicholas Piggin
On Fri Jun 16, 2023 at 9:03 AM AEST, BALATON Zoltan wrote: > From: Nicholas Piggin > > Unlike sc, for scv a facility unavailable interrupt must be generated > if FSCR[SCV]=0 so we can't raise the exception with nip set to next > instruction but we can move advancing nip if the FSCR check passes to

Re: [PATCH v2 4/5] tests/qtest/hd-geo-test: fix test by removing unnecessary pcie-root-port

2023-06-26 Thread Ani Sinha
> On 26-Jun-2023, at 4:45 PM, Igor Mammedov wrote: > > On Thu, 22 Jun 2023 16:02:54 +0530 > Ani Sinha wrote: > >> A SCSI controller can be attached to a pcie-to-pci bridge which in turn can >> be >> attached directly to the root bus (peie.0). There is no need to attach a >> pcie-root-port o

Re: [PATCH 1/3] vfio/migration: Move from STOP_COPY to STOP in vfio_save_cleanup()

2023-06-26 Thread Avihai Horon
On 26/06/2023 12:56, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 6/26/23 10:23, Avihai Horon wrote: Changing the device state from STOP_COPY to STOP can take time as the device may need to free resources and do other operations as part of the transitio

Re: [PATCH v4] 9pfs: deprecate 'proxy' backend

2023-06-26 Thread Christian Schoenebeck
On Monday, June 26, 2023 9:27:35 AM CEST Greg Kurz wrote: > On Fri, 23 Jun 2023 14:41:15 +0200 > Christian Schoenebeck wrote: > > > As recent CVE-2023-2861 once again showed, the 9p 'proxy' fs driver is in > > bad shape. Using the 'proxy' backend was already discouraged for safety > > reasons bef

Re: [PATCH v1] virtio-gpu: Make non-gl display updates work again when blob=true

2023-06-26 Thread Marc-André Lureau
On Fri, Jun 23, 2023 at 8:27 AM Vivek Kasireddy wrote: > In the case where the console does not have gl capability, and > if blob is set to true, make sure that the display updates still > work. Commit e86a93f55463 accidentally broke this by misplacing > the return statement (in resource_flush) c

Re: [PATCH 2/2] tests/avocado: record_replay test for ppc powernv machine

2023-06-26 Thread Cédric Le Goater
On 6/25/23 12:37, Nicholas Piggin wrote: The powernv machine can boot Linux to VFS mount with icount enabled. Add a test case for it. Signed-off-by: Nicholas Piggin Reviewed-by: Cédric Le Goater Thanks, C. --- tests/avocado/replay_kernel.py | 16 1 file changed, 16 in

Re: [PATCH] virtio-gpu-udmabuf: create udmabuf for blob even when iov_cnt == 1

2023-06-26 Thread Marc-André Lureau
On Thu, Jun 22, 2023 at 12:47 AM Dongwon Kim wrote: > There were often cases where a scanout blob sometimes has just 1 entry > that is linked to many pages in it. So just checking whether iov_cnt is 1 > is not enough for screening small, non-scanout blobs. Therefore adding > iov_len check as well

Re: [PATCH 2/3] vfio/migration: Reset bytes_transferred properly

2023-06-26 Thread Avihai Horon
On 26/06/2023 12:52, Cédric Le Goater wrote: External email: Use caution opening links or attachments Hello Avihai, On 6/26/23 10:23, Avihai Horon wrote: Currently, VFIO bytes_transferred is not reset properly: 1. bytes_transferred is not reset after a VM snapshot (so a migration     follow

[PATCH v5] 9pfs: deprecate 'proxy' backend

2023-06-26 Thread Christian Schoenebeck
As recent CVE-2023-2861 (fixed by f6b0de53fb) once again showed, the 9p 'proxy' fs driver is in bad shape. Using the 'proxy' backend was already discouraged for safety reasons before and we recommended to use the 'local' backend (preferably in conjunction with its 'mapped' security model) instead,

Re: [PATCH] ui/gtk: set the area of the scanout texture correctly

2023-06-26 Thread Marc-André Lureau
Hi On Wed, Jun 21, 2023 at 11:53 PM Dongwon Kim wrote: > x and y offsets and width and height of the scanout texture > is not correctly configured in case guest scanout frame is > dmabuf. > > Cc: Gerd Hoffmann > Cc: Marc-André Lureau > Cc: Vivek Kasireddy > Signed-off-by: Dongwon Kim > I fi

Re: [PATCH 2/3] vfio/migration: Reset bytes_transferred properly

2023-06-26 Thread Cédric Le Goater
On 6/26/23 13:46, Avihai Horon wrote: On 26/06/2023 12:52, Cédric Le Goater wrote: External email: Use caution opening links or attachments Hello Avihai, On 6/26/23 10:23, Avihai Horon wrote: Currently, VFIO bytes_transferred is not reset properly: 1. bytes_transferred is not reset after a

Re: [PATCH v2 1/2] qmp: remove virtio_list, search QOM tree instead

2023-06-26 Thread Jonah Palmer
On 6/23/23 01:47, Michael S. Tsirkin wrote: On Fri, Jun 09, 2023 at 09:20:39AM -0400, Jonah Palmer wrote: The virtio_list duplicates information about virtio devices that already exist in the QOM composition tree. Instead of creating this list of realized virtio devices, search the QOM composit

Re: [PATCH v2 2/2] qmp: update virtio feature maps, vhost-user-gpio instrospection

2023-06-26 Thread Jonah Palmer
On 6/23/23 01:43, Michael S. Tsirkin wrote: On Fri, Jun 09, 2023 at 09:20:40AM -0400, Jonah Palmer wrote: Add new virtio transport feature to transport feature map: - VIRTIO_F_RING_RESET Add new vhost-user protocol feature to vhost-user protocol feature map and enumeration: - VHOST_USER_PR

Re: [PATCH 2/3] vfio/migration: Reset bytes_transferred properly

2023-06-26 Thread Avihai Horon
On 26/06/2023 11:23, Avihai Horon wrote: Currently, VFIO bytes_transferred is not reset properly: 1. bytes_transferred is not reset after a VM snapshot (so a migration following a snapshot will report incorrect value). 2. bytes_transferred is a single counter for all VFIO devices, however

Re: [PATCH v2 4/5] tests/qtest/hd-geo-test: fix test by removing unnecessary pcie-root-port

2023-06-26 Thread Igor Mammedov
On Mon, 26 Jun 2023 17:01:29 +0530 Ani Sinha wrote: > > On 26-Jun-2023, at 4:45 PM, Igor Mammedov wrote: > > > > On Thu, 22 Jun 2023 16:02:54 +0530 > > Ani Sinha wrote: > > > >> A SCSI controller can be attached to a pcie-to-pci bridge which in turn > >> can be > >> attached directly to th

Re: [PATCH v2 1/2] qmp: remove virtio_list, search QOM tree instead

2023-06-26 Thread Michael S. Tsirkin
On Mon, Jun 26, 2023 at 08:08:28AM -0400, Jonah Palmer wrote: > > On 6/23/23 01:47, Michael S. Tsirkin wrote: > > On Fri, Jun 09, 2023 at 09:20:39AM -0400, Jonah Palmer wrote: > > The virtio_list duplicates information about virtio devices that > already > exist in the QOM c

Re: [PULL v2 1/3] target/hppa: Fix OS reboot issues

2023-06-26 Thread Michael Tokarev
25.06.2023 14:20, Helge Deller wrote: Is this a -stable material?  It applies cleanly to 8.0 and 7.2. Yes, please. At least for 8.0 I think it should be added. I didn't tested 7.2, but can do and would prefer it if could be added there too. Just tested: The patches work nicely when applied t

Re: [PULL 10/30] ppc/spapr: H_ENTER_NESTED should restore host XER ca field

2023-06-26 Thread Michael Tokarev
26.06.2023 08:56, Cédric Le Goater wrote: From: Nicholas Piggin Fix missing env->ca restore when going from L2 back to the host. Fixes: 120f738a467 ("spapr: implement nested-hv capability for the virtual hypervisor") Reviewed-by: Harsh Prateek Bora Signed-off-by: Nicholas Piggin Signed-off-

[PULL 03/53] hw/cxl: Add poison injection via the mailbox.

2023-06-26 Thread Michael S. Tsirkin
From: Jonathan Cameron Very simple implementation to allow testing of corresponding kernel code. Note that for now we track each 64 byte section independently. Whilst a valid implementation choice, it may make sense to fuse entries so as to prove out more complex corners of the kernel code. Rev

[PULL 05/53] hw/cxl/events: Add event status register

2023-06-26 Thread Michael S. Tsirkin
From: Ira Weiny The device status register block was defined. However, there were no individual registers nor any data wired up. Define the event status register [CXL 3.0; 8.2.8.3.1] as part of the device status register block. Wire up the register and initialize the event status for each log.

[PULL 11/53] hw/cxl/events: Add injection of Memory Module Events

2023-06-26 Thread Michael S. Tsirkin
From: Jonathan Cameron These events include a copy of the device health information at the time of the event. Actually using the emulated device health would require a lot of controls to manipulate that state. Given the aim of this injection code is to just test the flows when events occur, inje

[PULL 07/53] hw/cxl/events: Wire up get/clear event mailbox commands

2023-06-26 Thread Michael S. Tsirkin
From: Ira Weiny CXL testing is benefited from an artificial event log injection mechanism. Add an event log infrastructure to insert, get, and clear events from the various logs available on a device. Replace the stubbed out CXL Get/Clear Event mailbox commands with commands that operate on the

[PULL 04/53] hw/cxl: Add clear poison mailbox command support.

2023-06-26 Thread Michael S. Tsirkin
From: Jonathan Cameron Current implementation is very simple so many of the corner cases do not exist (e.g. fragmenting larger poison list entries) Reviewed-by: Fan Ni Reviewed-by: Ira Weiny Signed-off-by: Jonathan Cameron Message-Id: <20230526170010.574-5-jonathan.came...@huawei.com> Reviewe

[PULL 24/53] vhost: release virtqueue objects in error path

2023-06-26 Thread Michael S. Tsirkin
From: Prasad Pandit vhost_dev_start function does not release virtqueue objects when event_notifier_init() function fails. Release virtqueue objects and log a message about function failure. Signed-off-by: Prasad Pandit Message-Id: <20230529114333.31686-3-ppan...@redhat.com> Reviewed-by: Michae

[PULL 30/53] hw/acpi: Fix PM control register access

2023-06-26 Thread Michael S. Tsirkin
From: BALATON Zoltan On pegasos2 which has ACPI as part of VT8231 south bridge the board firmware writes PM control register by accessing the second byte so addr will be 1. This wasn't handled correctly and the write went to addr 0 instead. Remove the acpi_pm1_cnt_write() function which is used o

[PULL 09/53] hw/cxl/events: Add injection of General Media Events

2023-06-26 Thread Michael S. Tsirkin
From: Ira Weiny To facilitate testing provide a QMP command to inject a general media event. The event can be added to the log specified. Signed-off-by: Ira Weiny Reviewed-by: Fan Ni Acked-by: Markus Armbruster Signed-off-by: Jonathan Cameron Message-Id: <20230530133603.16934-6-jonathan.ca

[PULL 08/53] hw/cxl/events: Add event interrupt support

2023-06-26 Thread Michael S. Tsirkin
From: Ira Weiny Replace the stubbed out CXL Get/Set Event interrupt policy mailbox commands. Enable those commands to control interrupts for each of the event log types. Skip the standard input mailbox length on the Set command due to DCD being optional. Perform the checks separately. Signed-

[PULL 14/53] hw/scsi: Introduce VHOST_SCSI_COMMON symbol in Kconfig

2023-06-26 Thread Michael S. Tsirkin
From: Philippe Mathieu-Daudé Instead of adding 'vhost-scsi-common.c' twice (for VHOST_SCSI and VHOST_USER_SCSI), have it depend on VHOST_SCSI_COMMON, selected by both symbols. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Message-Id: <2023052409

[PULL 02/53] hw/cxl: QMP based poison injection support

2023-06-26 Thread Michael S. Tsirkin
From: Jonathan Cameron Inject poison using QMP command cxl-inject-poison to add an entry to the poison list. For now, the poison is not returned CXL.mem reads, but only via the mailbox command Get Poison List. So a normal memory read to an address that is on the poison list will not yet result i

[PULL 17/53] hw/virtio: Introduce VHOST_VSOCK_COMMON symbol in Kconfig

2023-06-26 Thread Michael S. Tsirkin
From: Philippe Mathieu-Daudé Instead of adding 'vhost-vsock-common.c' twice (for VHOST_VSOCK and VHOST_USER_VSOCK), have it depend on VHOST_VSOCK_COMMON, selected by both symbols. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Message-Id: <202305

[PULL 06/53] hw/cxl: Move CXLRetCode definition to cxl_device.h

2023-06-26 Thread Michael S. Tsirkin
From: Jonathan Cameron Following patches will need access to the mailbox return code type so move it to the header. Reviewed-by: Ira Weiny Reviewed-by: Fan Ni Signed-off-by: Jonathan Cameron Message-Id: <20230530133603.16934-3-jonathan.came...@huawei.com> Reviewed-by: Michael S. Tsirkin Sign

[PULL 37/53] include/hw/virtio: make some VirtIODevice const

2023-06-26 Thread Michael S. Tsirkin
From: Hawkins Jiawei The VirtIODevice structure is not modified in virtio_vdev_has_feature(). Therefore, make it const to allow this function to accept const variables. Signed-off-by: Hawkins Jiawei Reviewed-by: Eugenio Pérez Martin Message-Id: <16c0561b921310a32c240a4fb6e8cee3ffee16fe.168570

[PULL 39/53] hw/net/virtio-net: make some VirtIONet const

2023-06-26 Thread Michael S. Tsirkin
From: Hawkins Jiawei The VirtIONet structure is not modified in virtio_net_supported_guest_offloads(). Therefore, make it const to allow this function to accept const variables. Signed-off-by: Hawkins Jiawei Reviewed-by: Eugenio Pérez Message-Id: <489b09c3998ac09b9135e57a7dd8c56a4be8cdf9.1685

[PULL 21/53] hw/virtio: Remove unnecessary 'virtio-access.h' header

2023-06-26 Thread Michael S. Tsirkin
From: Philippe Mathieu-Daudé None of these files use the VirtIO Load/Store API declared by "hw/virtio/virtio-access.h". This header probably crept in via copy/pasting, remove it. Note, "virtio-access.h" is target-specific, so any file including it also become tainted as target-specific. Signed-

[PULL 52/53] vhost_net: add an assertion for TAP client backends

2023-06-26 Thread Michael S. Tsirkin
From: Ani Sinha An assertion was missing for tap vhost backends that enforces a non-null reference from get_vhost_net(). Both vhost-net-user and vhost-net-vdpa enforces this. Enforce the same for tap. Unit tests pass with this change. Signed-off-by: Ani Sinha Message-Id: <20230619041501.111655-

[PULL 25/53] pci: ROM preallocation for incoming migration

2023-06-26 Thread Michael S. Tsirkin
From: Vladimir Sementsov-Ogievskiy On incoming migration we have the following sequence to load option ROM: 1. On device realize we do normal load ROM from the file 2. Than, on incoming migration we rewrite ROM from the incoming RAM block. If sizes mismatch we fail, like this: Size mism

[PULL 22/53] hw/virtio: Build various target-agnostic objects just once

2023-06-26 Thread Michael S. Tsirkin
From: Philippe Mathieu-Daudé The previous commit remove the unnecessary "virtio-access.h" header. These files no longer have target-specific dependency. Move them to the generic 'softmmu_ss' source set. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Thomas Hu

[PULL 15/53] hw/scsi: Rearrange meson.build

2023-06-26 Thread Michael S. Tsirkin
From: Philippe Mathieu-Daudé We will modify this file shortly. Re-arrange it slightly first, declaring source sets first. No logical change. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20230524093744.88442-4-phi...@linaro.org> Reviewed-by: Michael S. Tsir

[PULL 27/53] vdpa: return errno in vhost_vdpa_get_vring_group error

2023-06-26 Thread Michael S. Tsirkin
From: Eugenio Pérez We need to tell in the caller, as some errors are expected in a normal workflow. In particular, parent drivers in recent kernels with VHOST_BACKEND_F_IOTLB_ASID may not support vring groups. In that case, -ENOTSUP is returned. This is the case of vp_vdpa in Linux 6.2. Next

[PULL 34/53] vdpa: do not block migration if device has cvq and x-svq=on

2023-06-26 Thread Michael S. Tsirkin
From: Eugenio Pérez It was a mistake to forbid in all cases, as SVQ is already able to send all the CVQ messages before start forwarding data vqs. It actually caused a regression, making impossible to migrate device previously migratable. Fixes: 36e4647247f2 ("vdpa: add vhost_vdpa_net_valid_svq

[PULL 26/53] virtio-mem: Simplify bitmap handling and virtio_mem_set_block_state()

2023-06-26 Thread Michael S. Tsirkin
From: David Hildenbrand Let's separate plug and unplug handling to prepare for future changes and make the code a bit easier to read -- working on block states (plugged/unplugged) instead of on a bitmap. Cc: "Michael S. Tsirkin" Cc: Gavin Shan Signed-off-by: David Hildenbrand Message-Id: <202

[PULL 48/53] vhost-user: fully use new backend/frontend naming

2023-06-26 Thread Michael S. Tsirkin
From: Manos Pitsidianakis Slave/master nomenclature was replaced with backend/frontend in commit 1fc19b65279a ("vhost-user: Adopt new backend naming") This patch replaces all remaining uses of master and slave in the codebase. Signed-off-by: Emmanouil Pitsidianakis Message-Id: <20230613080849.

[PULL 20/53] hw/virtio/virtio-iommu: Use target-agnostic qemu_target_page_mask()

2023-06-26 Thread Michael S. Tsirkin
From: Philippe Mathieu-Daudé In order to have virtio-iommu.c become target-agnostic, we need to avoid using TARGET_PAGE_MASK. Get it with the qemu_target_page_mask() helper. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Eric Auger Message-Id: <2023052409374

[PULL 10/53] hw/cxl/events: Add injection of DRAM events

2023-06-26 Thread Michael S. Tsirkin
From: Jonathan Cameron Defined in CXL r3.0 8.2.9.2.1.2 DRAM Event Record, this event provides information related to DRAM devices. Example injection command in QMP: { "execute": "cxl-inject-dram-event", "arguments": { "path": "/machine/peripheral/cxl-mem0", "log": "informati

[PULL 16/53] hw/scsi: Rename target-specific source set as 'specific_virtio_scsi_ss'

2023-06-26 Thread Michael S. Tsirkin
From: Philippe Mathieu-Daudé Following the SCSI variable named '[specific_]scsi_ss', rename the target-specific VirtIO/SCSI set prefixed with 'specific_'. This will help when adding target-agnostic VirtIO/SCSI set in few commits. No logical change. Signed-off-by: Philippe Mathieu-Daudé Reviewe

[PULL 47/53] virtio-scsi: avoid dangling host notifier in ->ioeventfd_stop()

2023-06-26 Thread Michael S. Tsirkin
From: Stefan Hajnoczi virtio_scsi_dataplane_stop() calls blk_drain_all(), which invokes ->drained_begin()/->drained_end() after we've already detached the host notifier. virtio_scsi_drained_end() currently attaches the host notifier again and leaves it dangling after dataplane has stopped. This

[PULL 28/53] vdpa: move CVQ isolation check to net_init_vhost_vdpa

2023-06-26 Thread Michael S. Tsirkin
From: Eugenio Pérez Evaluating it at start time instead of initialization time may make the guest capable of dynamically adding or removing migration blockers. Also, moving to initialization reduces the number of ioctls in the migration, reducing failure possibilities. As a drawback we need to

[PULL 41/53] vdpa: Add vhost_vdpa_net_load_offloads()

2023-06-26 Thread Michael S. Tsirkin
From: Hawkins Jiawei This patch introduces vhost_vdpa_net_load_offloads() to restore offloads state at device's startup. Signed-off-by: Hawkins Jiawei Message-Id: <7e2b5cad9c48c917df53d80dec27dbfeb513e1a3.1685704856.git.yin31...@gmail.com> Tested-by: Lei Yang Reviewed-by: Eugenio Pérez Teste

[PULL 33/53] pc: q35: Bump max_cpus to 1024

2023-06-26 Thread Michael S. Tsirkin
From: Suravee Suthikulpanit Since KVM_MAX_VCPUS is currently defined to 1024 for x86 as shown in arch/x86/include/asm/kvm_host.h, update QEMU limits to the same number. In case KVM could not support the specified number of vcpus, QEMU would return the following error message: qemu-system-x86_

Re: [PATCH 1/7] target/i386: Add FEAT_7_1_EDX to adjust feature level

2023-06-26 Thread Igor Mammedov
On Fri, 16 Jun 2023 11:23:05 +0800 Tao Su wrote: > Considering the case of FEAT_7_1_EAX being 0 and FEAT_7_1_EDX being > non-zero, Can you clarify when/why that happens? > guest may report wrong maximum number sub-leaves in leaf > 07H. So add FEAT_7_1_EDX to adjust feature level. > > Fixes: eaa

[PULL 44/53] vdpa: mask _F_CTRL_GUEST_OFFLOADS for vhost vdpa devices

2023-06-26 Thread Michael S. Tsirkin
From: Eugenio Pérez QEMU does not emulate it so it must be disabled as long as the backend does not support it. Signed-off-by: Eugenio Pérez Message-Id: <20230602173328.1917385-1-epere...@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Teste

[PULL 53/53] vhost-vdpa: do not cleanup the vdpa/vhost-net structures if peer nic is present

2023-06-26 Thread Michael S. Tsirkin
From: Ani Sinha When a peer nic is still attached to the vdpa backend, it is too early to free up the vhost-net and vdpa structures. If these structures are freed here, then QEMU crashes when the guest is being shut down. The following call chain would result in an assertion failure since the poi

[PULL 36/53] vdpa: map shadow vrings with MAP_SHARED

2023-06-26 Thread Michael S. Tsirkin
From: Eugenio Pérez The vdpa devices that use va addresses neeeds these maps shared. Otherwise, vhost_vdpa checks will refuse to accept the maps. The mmap call will always return a page aligned address, so removing the qemu_memalign call. Keeping the ROUND_UP for the size as we still need to DM

[PATCH v3 1/5] tests/acpi: allow changes in DSDT.noacpihp table blob

2023-06-26 Thread Ani Sinha
We are going to fix bio-tables-test in the next patch and hence need to make sure the acpi tests continue to pass. Signed-off-by: Ani Sinha Acked-by: Igor Mammedov --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables-test-al

[PULL 51/53] intel_iommu: Fix address space unmap

2023-06-26 Thread Michael S. Tsirkin
From: Zhenzhong Duan During address space unmap, corresponding IOVA tree entries are also removed. But DMAMap is set beyond notifier's scope by 1, so in theory there is possibility to remove a continuous entry above the notifier's scope but falling in adjacent notifier's scope. There is no issue

[PULL 29/53] cryptodev: fix memory leak during stats query

2023-06-26 Thread Michael S. Tsirkin
From: zhenwei pi object_get_canonical_path already returns newly allocated memory, this means no additional g_strdup required. Remove g_strdup to avoid memory leak. Fixes: Coverity CID 1508074 Fixes: f2b901098 ("cryptodev: Support query-stats QMP command") Cc: Peter Maydell Signed-off-by: zhenw

[PULL 01/53] bswap: Add the ability to store to an unaligned 24 bit field

2023-06-26 Thread Michael S. Tsirkin
From: Ira Weiny CXL has 24 bit unaligned fields which need to be stored to. CXL is specified as little endian. Define st24_le_p() and the supporting functions to store such a field from a 32 bit host native value. The use of b, w, l, q as the size specifier is limiting. So "24" was used for t

[PULL 12/53] cryptodev-vhost-user: add asymmetric crypto support

2023-06-26 Thread Michael S. Tsirkin
From: Gowrishankar Muthukrishnan Add asymmetric crypto support in vhost_user backend. Signed-off-by: Gowrishankar Muthukrishnan Message-Id: <20230516083139.2349744-1-gmuthukri...@marvell.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- backends/cryptodev-vhost-user.

[PULL 32/53] tests/data/acpi: update after SMBIOS 2.0 change

2023-06-26 Thread Michael S. Tsirkin
Switching to SMBIOS3.0 by default shifts some addresses, so we get this change in tests/data/acpi/q35/SSDT.dimmpxm : @@ -389,6 +389,6 @@ } } -Name (MEMA, 0x07FFE000) +Name (MEMA, 0x07FFF000) } update the expected file to match. Signed-off-by: Michael S. Tsirkin --- test

[PULL 46/53] hw/i386/pc: Clean up pc_machine_initfn

2023-06-26 Thread Michael S. Tsirkin
From: Suravee Suthikulpanit To use the newly introduced PC machine class local variable. Suggested-by: Igor Mammedov Signed-off-by: Suravee Suthikulpanit Message-Id: <20230609164107.23404-1-suravee.suthikulpa...@amd.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin ---

[PULL 13/53] softmmu: Introduce qemu_target_page_mask() helper

2023-06-26 Thread Michael S. Tsirkin
From: Philippe Mathieu-Daudé Since TARGET_PAGE_MASK is poisoned in target-agnostic code, introduce the qemu_target_page_mask() helper to get this value from target-agnostic code at runtime. Reviewed-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20230524093744.88442-2-phi..

[PULL 00/53] virtio,pc,pci: fixes, features, cleanups

2023-06-26 Thread Michael S. Tsirkin
The following changes since commit b455ce4c2f300c8ba47cba7232dd03261368a4cb: Merge tag 'q800-for-8.1-pull-request' of https://github.com/vivier/qemu-m68k into staging (2023-06-22 10:18:32 +0200) are available in the Git repository at: https://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tag

[PULL 49/53] intel_iommu: Fix a potential issue in VFIO dirty page sync

2023-06-26 Thread Michael S. Tsirkin
From: Zhenzhong Duan Peter Xu found a potential issue: "The other thing is when I am looking at the new code I found that we actually extended the replay() to be used also in dirty tracking of vfio, in vfio_sync_dirty_bitmap(). For that maybe it's already broken if unmap_all() because afaiu log

[PULL 50/53] intel_iommu: Fix flag check in replay

2023-06-26 Thread Michael S. Tsirkin
From: Zhenzhong Duan Replay doesn't notify registered notifiers but the one passed to it. So it's meaningless to check the registered notifier's synthetic flag. There is no issue currently as all replay use cases have MAP flag set, but let's be robust. Signed-off-by: Zhenzhong Duan Reviewed-by

Re: [PATCH qemu v3 1/2] target/arm: Handle IC IVAU to improve compatibility with JITs

2023-06-26 Thread Peter Maydell
On Tue, 20 Jun 2023 at 02:04, ~jhogberg wrote: > > From: John Högberg > > Unlike architectures with precise self-modifying code semantics > (e.g. x86) ARM processors do not maintain coherency for instruction > execution and memory, and require the explicit use of cache > management instructions a

[PULL 45/53] vdpa: fix not using CVQ buffer in case of error

2023-06-26 Thread Michael S. Tsirkin
From: Eugenio Pérez Bug introducing when refactoring. Otherway, the guest never received the used buffer. Fixes: be4278b65fc1 ("vdpa: extract vhost_vdpa_net_cvq_add from vhost_vdpa_net_handle_ctrl_avail") Signed-off-by: Eugenio Pérez Message-Id: <20230602173451.1917999-1-epere...@redhat.com>

[PULL 42/53] vdpa: Allow VIRTIO_NET_F_CTRL_GUEST_OFFLOADS in SVQ

2023-06-26 Thread Michael S. Tsirkin
From: Hawkins Jiawei Enable SVQ with VIRTIO_NET_F_CTRL_GUEST_OFFLOADS feature. Signed-off-by: Hawkins Jiawei Acked-by: Jason Wang Message-Id: <778d642ecae6deed8a218b0e6232e4d7bb96b439.1685704856.git.yin31...@gmail.com> Tested-by: Lei Yang Reviewed-by: Eugenio Pérez Tested-by: Eugenio Pérez

[PULL 23/53] vhost: release memory_listener object in error path

2023-06-26 Thread Michael S. Tsirkin
From: Prasad Pandit vhost_dev_start function does not release memory_listener object in case of an error. This may crash the guest when vhost is unable to set memory table: stack trace of thread 125653: Program terminated with signal SIGSEGV, Segmentation fault #0 memory_listener_register

[PATCH v3 4/5] tests/qtest/hd-geo-test: fix test by removing unnecessary pcie-root-port

2023-06-26 Thread Ani Sinha
The test attaches both a SCSI controller and a pcie-to-pci bridge on the same pcie-root-port. This is incorrect since only one downstream device can be attached to a pcie-root-port. Further, in the test scenario, there is no need to attach a pcie-root-port to the root complex. A SCSI controller can

[PULL 40/53] virtio-net: expose virtio_net_supported_guest_offloads()

2023-06-26 Thread Michael S. Tsirkin
From: Hawkins Jiawei To support restoring offloads state in vdpa, it is necessary to expose the function virtio_net_supported_guest_offloads(). According to VirtIO standard, "Upon feature negotiation corresponding offload gets enabled to preserve backward compatibility.". Therefore, QEMU uses th

[PATCH v3 2/5] tests/acpi/bios-tables-test: use the correct slot on the pcie-root-port

2023-06-26 Thread Ani Sinha
PCIE ports only have one slot, slot 0. Hence, non-zero slots are not available for PCIE devices on PCIE root ports. Fix test_acpi_q35_tcg_no_acpi_hotplug() so that the test does not use them. Signed-off-by: Ani Sinha Reviewed-by: Igor Mammedov --- tests/qtest/bios-tables-test.c | 4 ++-- 1 file

[PULL 18/53] hw/virtio/virtio-mem: Use qemu_ram_get_fd() helper

2023-06-26 Thread Michael S. Tsirkin
From: Philippe Mathieu-Daudé Avoid accessing RAMBlock internals, use the provided qemu_ram_get_fd() getter to get the file descriptor. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Hildenbrand Reviewed-by: Richard Henderson Message-Id: <20230524093744.88442-7-phi...@linaro.org> Rev

[PULL 43/53] vhost: fix vhost_dev_enable_notifiers() error case

2023-06-26 Thread Michael S. Tsirkin
From: Laurent Vivier in vhost_dev_enable_notifiers(), if virtio_bus_set_host_notifier(true) fails, we call vhost_dev_disable_notifiers() that executes virtio_bus_set_host_notifier(false) on all queues, even on queues that have failed to be initialized. This triggers a core dump in memory_region_

[PATCH v3 0/5] test and QEMU fixes to ensure proper PCIE device usage

2023-06-26 Thread Ani Sinha
Patches 1-4: Fix tests so that devices do not use non-zero slots on the pcie root ports. PCIE ports only have one slot, so PCIE devices can only be plugged into slot 0 on a PCIE port. Patch 5: Enforce only one slot on PCIE port. The test fixes must be applied before the QEMU change that checks fo

[PATCH v3 5/5] hw/pci: ensure PCIE devices are plugged into only slot 0 of PCIE port

2023-06-26 Thread Ani Sinha
PCI Express ports only have one slot, so PCI Express devices can only be plugged into slot 0 on a PCIE port. Enforce it. CC: jus...@redhat.com CC: imamm...@redhat.com Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2128929 Signed-off-by: Ani Sinha Reviewed-by: Julia Suvorova --- hw/pci/pc

[PULL 38/53] vdpa: reuse virtio_vdev_has_feature()

2023-06-26 Thread Michael S. Tsirkin
From: Hawkins Jiawei We can use virtio_vdev_has_feature() instead of manually accessing the features. Signed-off-by: Hawkins Jiawei Acked-by: Eugenio Pérez Message-Id: Tested-by: Lei Yang Reviewed-by: Eugenio Pérez Tested-by: Eugenio Pérez Reviewed-by: Michael S. Tsirkin Signed-off-by: M

[PULL 35/53] vdpa: reorder vhost_vdpa_net_cvq_cmd_page_len function

2023-06-26 Thread Michael S. Tsirkin
From: Eugenio Pérez We need to call it from resource cleanup context, as munmap needs the size of the mappings. Signed-off-by: Eugenio Pérez Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230602143854.1879091-3-epere...@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S.

[PATCH v3 3/5] tests/acpi/bios-tables-test: update acpi blob q35/DSDT.noacpihp

2023-06-26 Thread Ani Sinha
Some fixes were committed in bios-tables-test in the previous commit. Update the acpi blob and clear bios-tables-test-allowed-diff.h so that the test continues to pass with the changes in the bios-tables-test. Following is the asl diff between the old and the newly updated blob: @@ -1,30 +1,30 @@

<    1   2   3   4   5   6   >