Re: [RFC QEMU PATCH v8 2/2] virtio-pci: implement No_Soft_Reset bit

2024-03-29 Thread Chen, Jiqian
On 2024/3/28 20:36, Michael S. Tsirkin wrote: +} + static void virtio_pci_bus_reset_hold(Object *obj) { PCIDevice *dev = PCI_DEVICE(obj); DeviceState *qdev = DEVICE(obj); +if (virtio_pci_no_soft_reset(dev)) { +return; +

[PULL 0/5] Net patches

2024-03-29 Thread Jason Wang
The following changes since commit 5012e522aca161be5c141596c66e5cc6082538a9: Update version for v9.0.0-rc1 release (2024-03-26 19:46:55 +) are available in the Git repository at: https://github.com/jasowang/qemu.git tags/net-pull-request for you to fetch changes up to d9b33018a0da51eddc

[PULL 5/5] Revert "tap: setting error appropriately when calling net_init_tap_one()"

2024-03-29 Thread Jason Wang
From: Akihiko Odaki This reverts commit 46d4d36d0bf2b24b205f2f604f0905db80264eef. The reverted commit changed to emit warnings instead of errors when vhost is requested but vhost initialization fails if vhostforce option is not set. However, vhostforce is not meant to ignore vhost errors. It wa

[PULL 1/5] virtio-net: Fix vhost virtqueue notifiers for RSS

2024-03-29 Thread Jason Wang
From: Akihiko Odaki virtio_net_guest_notifier_pending() and virtio_net_guest_notifier_mask() checked VIRTIO_NET_F_MQ to know there are multiple queues, but VIRTIO_NET_F_RSS also enables multiple queues. Refer to n->multiqueue, which is set to true either of VIRTIO_NET_F_MQ or VIRTIO_NET_F_RSS is

[PULL 4/5] tap-win32: Remove unnecessary stubs

2024-03-29 Thread Jason Wang
From: Akihiko Odaki Some of them are only necessary for POSIX systems. The others are assigned to function pointers in NetClientInfo that can actually be NULL. Signed-off-by: Akihiko Odaki Signed-off-by: Jason Wang --- net/tap-win32.c | 54 - 1

[PULL 2/5] ebpf: Fix indirections table setting

2024-03-29 Thread Jason Wang
From: Akihiko Odaki The kernel documentation says: > The value stored can be of any size, however, all array elements are > aligned to 8 bytes. https://www.kernel.org/doc/html/v6.8/bpf/map_array.html Fixes: 333b3e5fab75 ("ebpf: Added eBPF map update through mmap.") Signed-off-by: Akihiko Odaki

[PULL 3/5] hw/net/net_tx_pkt: Fix virtio header without checksum offloading

2024-03-29 Thread Jason Wang
From: Akihiko Odaki It is incorrect to have the VIRTIO_NET_HDR_F_NEEDS_CSUM set when checksum offloading is disabled so clear the bit. TCP/UDP checksum is usually offloaded when the peer requires virtio headers because they can instruct the peer to compute checksum. However, igb disables TX chec

Re: [RFC QEMU PATCH v8 2/2] virtio-pci: implement No_Soft_Reset bit

2024-03-29 Thread Jason Wang
On Fri, Mar 29, 2024 at 3:07 PM Chen, Jiqian wrote: > > On 2024/3/28 20:36, Michael S. Tsirkin wrote: > +} > + > static void virtio_pci_bus_reset_hold(Object *obj) > { > PCIDevice *dev = PCI_DEVICE(obj); > DeviceState *qdev = DEVICE(obj); > > +

Re: [RFC QEMU PATCH v8 2/2] virtio-pci: implement No_Soft_Reset bit

2024-03-29 Thread Chen, Jiqian
On 2024/3/29 15:20, Jason Wang wrote: > On Fri, Mar 29, 2024 at 3:07 PM Chen, Jiqian wrote: >> >> On 2024/3/28 20:36, Michael S. Tsirkin wrote: >> +} >> + >> static void virtio_pci_bus_reset_hold(Object *obj) >> { >> PCIDevice *dev = PCI_DEVICE(obj); >> DeviceSt

Re: [PATCH 05/19] block/mirror: fix -Werror=maybe-uninitialized false-positive

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
On 28.03.24 13:20, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau ../block/mirror.c:1066:22: error: ‘iostatus’ may be used uninitialized [-Werror=maybe-uninitialized] Actually that's a false-positive.. Compiler can't believe that body of WITH_JOB_LOCK_GUARD() will be executed un

Re: [PATCH 06/19] block/stream: fix -Werror=maybe-uninitialized false-positives

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
On 28.03.24 13:20, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau ../block/stream.c:193:19: error: ‘unfiltered_bs’ may be used uninitialized [-Werror=maybe-uninitialized] ../block/stream.c:176:5: error: ‘len’ may be used uninitialized [-Werror=maybe-uninitialized] trace/trace-bloc

RE: [PATCH] migration: Yield coroutine when receiving MIG_CMD_POSTCOPY_LISTEN

2024-03-29 Thread Wang, Wei W
On Friday, March 29, 2024 11:32 AM, Wang, Lei4 wrote: > When using the post-copy preemption feature to perform post-copy live > migration, the below scenario could lead to a deadlock and the migration will > never finish: > > - Source connect() the preemption channel in postcopy_start(). > - Sou

Re: [PATCH-for-9.1 v2 0/3] rdma: Remove RDMA subsystem and pvrdma device

2024-03-29 Thread Michael S. Tsirkin
On Thu, Mar 28, 2024 at 02:02:52PM +0100, Philippe Mathieu-Daudé wrote: > Since v1: > - split in 3 (Thomas) > - justify gluster removal Reviewed-by: Michael S. Tsirkin > Philippe Mathieu-Daudé (3): > hw/rdma: Remove pvrdma device and rdmacm-mux helper > migration: Remove RDMA protocol handl

Re: [PATCH v4] blockcommit: Reopen base image as RO after abort

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
On 28.03.24 12:16, Alexander Ivanov wrote: If a blockcommit is aborted the base image remains in RW mode, that leads to a fail of subsequent live migration. How to reproduce: $ virsh snapshot-create-as vm snp1 --disk-only *** write something to the disk inside the guest *** $ virsh bl

[PATCH for-9.0] tests/qtest: Fix STM32L4x5 GPIO test on 32-bit

2024-03-29 Thread Cédric Le Goater
The test mangles the GPIO address and the pin number in the qtest_add_data_func data parameter. Doing so, it assumes that the host pointer size is always 64-bit, which breaks on 32-bit : ../tests/qtest/stm32l4x5_gpio-test.c: In function ‘test_gpio_output_mode’: ../tests/qtest/stm32l4x5_gpio-test.c

Re: [PATCH for-9.1 v5 07/14] migration: Add Error** argument to .save_setup() handler

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
On 20.03.24 09:49, Cédric Le Goater wrote: diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c index 2708abf3d762de774ed294d3fdb8e56690d2974c..542a8c297b329abc30d1b3a205d29340fa59a961 100644 --- a/migration/block-dirty-bitmap.c +++ b/migration/block-dirty-bitmap.c @@ -1

[PATCH for-9.1 4/7] target/i386/kvm: Save/load MSRs of new kvmclock (KVM_FEATURE_CLOCKSOURCE2)

2024-03-29 Thread Zhao Liu
From: Zhao Liu MSR_KVM_SYSTEM_TIME_NEW and MSR_KVM_WALL_CLOCK_NEW are bound to new kvmclock (KVM_FEATURE_CLOCKSOURCE2). Add the save/load support for these 2 MSRs. Signed-off-by: Zhao Liu --- target/i386/cpu.h | 2 ++ target/i386/kvm/kvm.c | 16 2 files changed, 18 inser

[PATCH for-9.1 0/7] target/i386/kvm: Cleanup the kvmclock feature name

2024-03-29 Thread Zhao Liu
From: Zhao Liu Hi list, This series is based on Paolo's guest_phys_bits patchset [1]. Currently, the old and new kvmclocks have the same feature name "kvmclock" in FeatureWordInfo[FEAT_KVM]. When I tried to dig into the history of this unusual naming and fix it, I realized that Tim was already

[PATCH for-9.1 7/7] target/i386/kvm: Update comment in kvm_cpu_realizefn()

2024-03-29 Thread Zhao Liu
From: Zhao Liu With the guest_phys_bits and legacy_kvmclock change, update the comment about function call flow. Signed-off-by: Zhao Liu --- target/i386/kvm/kvm-cpu.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/target/i386/kvm/kvm-cpu.c b/target/i386/kvm/kvm-cpu.c i

[PATCH for-9.1 1/7] target/i386/kvm: Add feature bit definitions for KVM CPUID

2024-03-29 Thread Zhao Liu
From: Zhao Liu Add feature definiations for KVM_CPUID_FEATURES in CPUID ( CPUID[4000_0001].EAX and CPUID[4000_0001].EDX), to get rid of lots of offset calculations. Signed-off-by: Zhao Liu --- hw/i386/kvm/clock.c | 5 ++--- target/i386/cpu.h | 23 +++ target/i386/kvm

[PATCH for-9.1 5/7] target/i386/kvm: Add legacy_kvmclock cpu property

2024-03-29 Thread Zhao Liu
From: Zhao Liu Currently, the old kvmclock (KVM_FEATURE_CLOCKSOURCE) and the new (KVM_FEATURE_CLOCKSOURCE2) are always set/unset together since they have the same feature name "kvmclock" since the commit 642258c6c7 ("kvm: add kvmclock to its second bit"). Before renaming the new kvmclock, introd

[PATCH for-9.1 3/7] target/i386/kvm: Only Save/load kvmclock MSRs when kvmclock enabled

2024-03-29 Thread Zhao Liu
From: Zhao Liu MSR_KVM_SYSTEM_TIME and MSR_KVM_WALL_CLOCK are attached with the (old) kvmclock feature (KVM_FEATURE_CLOCKSOURCE). So, just save/load them only when kvmclock (KVM_FEATURE_CLOCKSOURCE) is enabled. Signed-off-by: Zhao Liu --- target/i386/kvm/kvm.c | 12 1 file change

[PATCH for-9.1 2/7] target/i386/kvm: Remove local MSR_KVM_WALL_CLOCK and MSR_KVM_SYSTEM_TIME definitions

2024-03-29 Thread Zhao Liu
From: Zhao Liu These 2 MSRs have been already defined in the kvm_para header (standard-headers/asm-x86/kvm_para.h). Remove QEMU local definitions to avoid duplication. Signed-off-by: Zhao Liu --- target/i386/kvm/kvm.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/target/i386/kvm/kvm.c

[PATCH for-9.1 6/7] target/i386: Fix duplicated kvmclock name in FEAT_KVM

2024-03-29 Thread Zhao Liu
From: Tim Wiederhake The commit 642258c6c7 ("kvm: add kvmclock to its second bit") gave the old and new kvmclocks with the same name "kvmclock", to facilitate user to set/unset the feature bits for both 2 kvmclock features together. This could work because: * QEMU side: - x86_cpu_register_bit_

Re: [PATCH 1/2] copy-before-write: allow specifying minimum cluster size

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
On 08.03.24 18:51, Fiona Ebner wrote: Useful to make discard-source work in the context of backup fleecing when the fleecing image has a larger granularity than the backup target. Copy-before-write operations will use at least this granularity and in particular, discard requests to the source no

Re: [PATCH 2/2] backup: add minimum cluster size to performance options

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
On 08.03.24 18:51, Fiona Ebner wrote: Useful to make discard-source work in the context of backup fleecing when the fleecing image has a larger granularity than the backup target. Backup/block-copy will use at least this granularity for copy operations and in particular, discard requests to the

Re: [PATCH for-9.0] docs/about: Mark the iaspc machine type as deprecated

2024-03-29 Thread Bernhard Beschow
Am 28. März 2024 14:09:52 UTC schrieb Mark Cave-Ayland : >On 27/03/2024 07:09, Gerd Hoffmann wrote: > >> On Tue, Mar 26, 2024 at 01:30:48PM +, Mark Cave-Ayland wrote: >>> Heh I've actually been using isapc over the past couple of weeks to fire up >>> some old programs in a Windows 3 VM :) >

Re: [RFC PATCH-for-9.1 09/29] hw/i386/pc: Pass PCMachineState argument to acpi_setup()

2024-03-29 Thread Philippe Mathieu-Daudé
On 28/3/24 19:45, BALATON Zoltan wrote: On Thu, 28 Mar 2024, Philippe Mathieu-Daudé wrote: acpi_setup() caller knows about the machine state, so pass it as argument to avoid a qdev_get_machine() call. We already resolved X86_MACHINE(pcms) as 'x86ms' so use the latter. Signed-off-by: Philippe M

Re: [PATCH-for-9.0 v2] hw/i386/pc: Deprecate 64-bit CPUs on ISA-only PC machine

2024-03-29 Thread Philippe Mathieu-Daudé
On 28/3/24 16:39, Thomas Huth wrote: On 28/03/2024 16.12, Mark Cave-Ayland wrote: On 27/03/2024 16:54, Philippe Mathieu-Daudé wrote: Per Daniel suggestion [*]:   > isapc could arguably be restricted to just 32-bit CPU models,   > because we should not need it to support any feature that didn'

Re: [PATCH-for-9.1 v2 2/3] migration: Remove RDMA protocol handling

2024-03-29 Thread Philippe Mathieu-Daudé
Hi Zhijian, On 29/3/24 02:53, Zhijian Li (Fujitsu) wrote: On 28/03/2024 23:01, Peter Xu wrote: On Thu, Mar 28, 2024 at 11:18:04AM -0300, Fabiano Rosas wrote: Philippe Mathieu-Daudé writes: The whole RDMA subsystem was deprecated in commit e9a54265f5 ("hw/rdma: Deprecate the pvrdma device

Re: [RFC QEMU PATCH v8 2/2] virtio-pci: implement No_Soft_Reset bit

2024-03-29 Thread Jason Wang
On Fri, Mar 29, 2024 at 4:00 PM Chen, Jiqian wrote: > > On 2024/3/29 15:20, Jason Wang wrote: > > On Fri, Mar 29, 2024 at 3:07 PM Chen, Jiqian wrote: > >> > >> On 2024/3/28 20:36, Michael S. Tsirkin wrote: > >> +} > >> + > >> static void virtio_pci_bus_reset_hold(Object *obj) > >

Re: [RFC QEMU PATCH v8 2/2] virtio-pci: implement No_Soft_Reset bit

2024-03-29 Thread Michael S. Tsirkin
On Fri, Mar 29, 2024 at 03:20:59PM +0800, Jason Wang wrote: > On Fri, Mar 29, 2024 at 3:07 PM Chen, Jiqian wrote: > > > > On 2024/3/28 20:36, Michael S. Tsirkin wrote: > > +} > > + > > static void virtio_pci_bus_reset_hold(Object *obj) > > { > > PCIDevice *dev = PCI

Re: [PATCH for-9.1 v5 07/14] migration: Add Error** argument to .save_setup() handler

2024-03-29 Thread Cédric Le Goater
Hello Vladimir, On 3/29/24 10:32, Vladimir Sementsov-Ogievskiy wrote: On 20.03.24 09:49, Cédric Le Goater wrote: diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c index 2708abf3d762de774ed294d3fdb8e56690d2974c..542a8c297b329abc30d1b3a205d29340fa59a961 100644 --- a/m

[PATCH for-9.1] migration: Add Error** argument to add_bitmaps_to_list()

2024-03-29 Thread Cédric Le Goater
This allows to report more precise errors in the migration handler dirty_bitmap_save_setup(). Suggested-by Vladimir Sementsov-Ogievskiy Signed-off-by: Cédric Le Goater --- To apply on top of : https://lore.kernel.org/qemu-devel/20240320064911.545001-1-...@redhat.com/ migration/block-dirt

Re: [RFC] util/error-report: Add "error: " prefix for error-level report

2024-03-29 Thread Paolo Bonzini
On Fri, Mar 29, 2024 at 10:37 AM wrote: > > This was done in the context of inheriting the original error_report() > > interface without the prefix style. And it was also useful to have a > > means of error handling, such as exit(), when error occurs, so that the > > error message - the most serio

[PATCH 1/1] ebpf: Added traces back. Changed source set for eBPF to 'system'.

2024-03-29 Thread Andrew Melnychenko
There was an issue with Qemu build with "--disable-system". The traces could be generated and the build fails. The traces were 'cut out' for previous patches, and overall, the 'system' source set should be used like in pre-'eBPF blob' patches. Signed-off-by: Andrew Melnychenko --- ebpf/ebpf_rss.

Re: [PATCH for-9.1 v5 07/14] migration: Add Error** argument to .save_setup() handler

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
On 29.03.24 13:53, Cédric Le Goater wrote: Hello Vladimir, On 3/29/24 10:32, Vladimir Sementsov-Ogievskiy wrote: On 20.03.24 09:49, Cédric Le Goater wrote: diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c index 2708abf3d762de774ed294d3fdb8e56690d2974c..542a8c297b32

[PATCH v2] riscv: thead: Add th.sxstatus CSR emulation

2024-03-29 Thread Christoph Müllner
The th.sxstatus CSR can be used to identify available custom extension on T-Head CPUs. The CSR is documented here: https://github.com/T-head-Semi/thead-extension-spec/pull/46 An important property of this patch is, that the th.sxstatus MAEE field is not set (indicating that XTheadMaee is not ava

Re: [PATCH] spapr: nested: use bitwise NOT operator for flags check

2024-03-29 Thread Philippe Mathieu-Daudé
On 29/3/24 05:34, Harsh Prateek Bora wrote: Check for flag bit in H_GUEST_GETSET_STATE_FLAG_GUEST_WIDE need to use bitwise NOT operator to ensure no other flag bits are set. Reported by Coverity as CID 1540008, 1540009. Reported-by: Peter Maydell Signed-off by: Harsh Prateek Bora --- hw/ppc/

Re: QEMU NVMe Emulation does not seem to work without Shadow Buffers Config

2024-03-29 Thread Constantine Gavrilov
Please ignore. The issue was on my side. On Fri, Mar 29, 2024 at 1:07 PM Constantine Gavrilov wrote: > > I am trying to write a custom NVMe driver and I tested it with QEMU > NVMe emulation on Fedora 39. > I have not tried to set shadow buffers, even though the controller > reports such support.

QEMU NVMe Emulation does not seem to work without Shadow Buffers Config

2024-03-29 Thread Constantine Gavrilov
I am trying to write a custom NVMe driver and I tested it with QEMU NVMe emulation on Fedora 39. I have not tried to set shadow buffers, even though the controller reports such support. What I see is the following: 1. Only the first command in the Admin queue generates interrupt and completes (Iden

[PATCH] hw/xen_evtchn: Initialize flush_kvm_routes

2024-03-29 Thread Artem Chernyshev
In xen_evtchn_soft_reset() variable flush_kvm_routes can be used before being initialized. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Oleg Sviridov Signed-off-by: Artem Chernyshev --- hw/i386/kvm/xen_evtchn.c | 2 +- 1 file changed, 1 insertion(+), 1 delet

Re: [PATCH] linux-user/syscall: xtensa: fix target_msqid_ds and ipc_perm conversion

2024-03-29 Thread Philippe Mathieu-Daudé
Hi Max, On 29/3/24 07:31, Max Filippov wrote: - target_ipc_perm::mode and target_ipc_perm::__seq fields are 32-bit wide on xtensa and thus need to use tswap32 - target_msqid_ds::msg_*time field pairs are reversed on big-endian xtensa Please split in 2 distinct patches. Both issues resu

Re: [PATCH for-9.0] tests/qtest: Fix STM32L4x5 GPIO test on 32-bit

2024-03-29 Thread Philippe Mathieu-Daudé
Hi Cédric, Thomas, On 29/3/24 10:27, Cédric Le Goater wrote: The test mangles the GPIO address and the pin number in the qtest_add_data_func data parameter. Doing so, it assumes that the host pointer size is always 64-bit, which breaks on 32-bit : ../tests/qtest/stm32l4x5_gpio-test.c: In functi

Re: [PATCH for-9.1] migration: Add Error** argument to add_bitmaps_to_list()

2024-03-29 Thread Philippe Mathieu-Daudé
On 29/3/24 11:56, Cédric Le Goater wrote: This allows to report more precise errors in the migration handler dirty_bitmap_save_setup(). Suggested-by Vladimir Sementsov-Ogievskiy Signed-off-by: Cédric Le Goater --- To apply on top of : https://lore.kernel.org/qemu-devel/20240320064911.5450

Re: [PATCH] hw/xen_evtchn: Initialize flush_kvm_routes

2024-03-29 Thread Philippe Mathieu-Daudé
On 29/3/24 12:39, Artem Chernyshev wrote: In xen_evtchn_soft_reset() variable flush_kvm_routes can be used before being initialized. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Oleg Sviridov Signed-off-by: Artem Chernyshev --- hw/i386/kvm/xen_evtchn.c |

Re: [PATCH for-9.1 v5 1/3] hw: Add compat machines for 9.1

2024-03-29 Thread Paolo Bonzini
On Thu, Mar 28, 2024 at 11:07 AM Zhao Liu wrote: > > Hi Paolo, > > Just meet typos when compiling ;-) Thank you very much! Fixed both. Paolo > On Mon, Mar 25, 2024 at 03:14:20PM +0100, Paolo Bonzini wrote: > > Date: Mon, 25 Mar 2024 15:14:20 +0100 > > From: Paolo Bonzini > > Subject: [PATCH fo

Re: [PATCH v1] coroutine: avoid inserting duplicate coroutine to co_queue_wakeup

2024-03-29 Thread Zhu Yangyang via
On Thu, 28 Mar 2024 07:40:14 -0500, Eric Blake wrote: > On Mon, Mar 25, 2024 at 05:18:50PM +0800, zhuyangyang via wrote: > > If g_main_loop_run()/aio_poll() is called in the coroutine context, > > the pending coroutine may be woken up repeatedly, and the co_queue_wakeup > > may be disordered. > >

Re: [RFC PATCH-for-9.1 14/21] system: Introduce QMP generic_query_cpu_definitions()

2024-03-29 Thread Philippe Mathieu-Daudé
Hi Markus, On 26/3/24 14:28, Markus Armbruster wrote: Philippe Mathieu-Daudé writes: Each target use a common template for qmp_query_cpu_definitions(). Extract it as generic_query_cpu_definitions(), keeping the target-specific implementations as the following SysemuCPUOps handlers: - cpu_l

QEMU Community Call Agenda Items (April 2nd, 2024)

2024-03-29 Thread Philippe Mathieu-Daudé
Hi, The KVM/QEMU community call is at: https://meet.jit.si/kvmcallmeeting @ 2/4/2024 14:00 UTC Are there any agenda items for the sync-up? Alex maintains the invite on our Linaro project calendar here: https://calendar.google.com/calendar/event?action=TEMPLATE&tmeid=MWd2dWI5NDM1bzdocnJ

[PATCH] target/riscv/cpu_helper.c: fix wrong exception raise

2024-03-29 Thread Alexei Filippov
Successed two stage translation, but failed pmp check can cause guest page fault instead of regular page fault. In case of execution ld instuction in VS mode we can face situation when two stages of translation was passed successfully, and if PMP check was failed first_stage_error variable going t

[PATCH] raspi4b: Reduce RAM to 1Gb on 32-bit hosts

2024-03-29 Thread Cédric Le Goater
Change the board revision number and RAM size to 1Gb on 32-bit hosts. On these systems, RAM has a 2047 MB limit and this breaks the tests. Fixes: 7785e8ea2204 ("hw/arm: Introduce Raspberry PI 4 machine") Signed-off-by: Cédric Le Goater --- hw/arm/raspi4b.c | 4 1 file changed, 4 insertions(

Re: [PATCH v1 01/11] Introduce a common abstract struct HostIOMMUDevice

2024-03-29 Thread Cédric Le Goater
Hello Zhenzhong, On 3/28/24 04:06, Duan, Zhenzhong wrote: Hi Cédric, -Original Message- From: Cédric Le Goater Subject: Re: [PATCH v1 01/11] Introduce a common abstract struct HostIOMMUDevice Hello Zhenzhong, On 3/19/24 12:58, Duan, Zhenzhong wrote: Hi Cédric, -Original Messa

[PATCH v6 0/2] Implement SSH commands in QEMU GA for Windows

2024-03-29 Thread aidan_leuck
From: aidaleuc This patch aims to implement guest-ssh-add-authorized-keys, guest-ssh-remove-authorized-keys, and guest-ssh-get-authorized-keys for Windows. This PR is based on Microsoft's OpenSSH implementation https://github.com/PowerShell/Win32-OpenSSH. The guest agents will support Kubevirt

[PATCH v6 2/2] Implement SSH commands in QEMU GA for Windows

2024-03-29 Thread aidan_leuck
From: aidaleuc Signed-off-by: aidaleuc --- qga/commands-windows-ssh.c | 789 + qga/commands-windows-ssh.h | 26 ++ qga/meson.build| 5 +- qga/qapi-schema.json | 17 +- 4 files changed, 826 insertions(+), 11 deletions(-) create mode 1006

[PATCH v6 1/2] Refactor common functions between POSIX and Windows implementation

2024-03-29 Thread aidan_leuck
From: aidaleuc Signed-off-by: aidaleuc --- qga/commands-common-ssh.c | 50 +++ qga/commands-common-ssh.h | 10 qga/commands-posix-ssh.c | 47 +--- qga/meson.build | 1 + 4 files changed, 62 insertions(+), 4

[PATCH 1/1] e1000: Get debug flags from an environment variable

2024-03-29 Thread Don Porter
From: Austin Clements The E1000 debug messages are very useful for developing drivers, so this introduces an E1000_DEBUG environment variable that lets the debug flags be set without recompiling QEMU. Signed-off-by: Austin Clements [geo...@ldpreload.com: Rebased on top of 2.9.0] Signed-off-by:

[PATCH 0/1] Upstreaming Course Debugging Changes

2024-03-29 Thread Don Porter
Hi all, I am a CS professor (and first time contributor) and have been using qemu in my courses for over a decade, especially a course that asks students to write major pieces of an OS kernel from starter code. I have some patches, originally from Austin Clements at MIT, that I have found useful

Re: [RFC] util/error-report: Add "error: " prefix for error-level report

2024-03-29 Thread Zhao Liu
Hi Paolo, On Fri, Mar 29, 2024 at 12:10:17PM +0100, Paolo Bonzini wrote: > Date: Fri, 29 Mar 2024 12:10:17 +0100 > From: Paolo Bonzini > Subject: Re: [RFC] util/error-report: Add "error: " prefix for error-level > report > > On Fri, Mar 29, 2024 at 10:37 AM wrote: > > > This was done in the co

[PATCH net v3] virtio_net: Do not send RSS key if it is not supported

2024-03-29 Thread Breno Leitao
There is a bug when setting the RSS options in virtio_net that can break the whole machine, getting the kernel into an infinite loop. Running the following command in any QEMU virtual machine with virtionet will reproduce this problem: # ethtool -X eth0 hfunc toeplitz This is how the proble

Re: [RFC PATCH v2 0/6] cxl: add poison event handler

2024-03-29 Thread Alison Schofield
On Fri, Mar 29, 2024 at 02:36:08PM +0800, Shiyang Ruan wrote: > Changes: > RFCv1 -> RFCv2: > 1. update commit message of PATCH 1 > 2. use memory_failure_queue() instead of MCE > 3. also report poison in debugfs when injecting poison > 4. correct DPA->HPA logic: > find memdev's endpoint decoder

[PATCH v3 0/5] hw/char: Implement the STM32L4x5 USART, UART and LPUART

2024-03-29 Thread Arnaud Minier
This patch adds the STM32L4x5 USART (Universal Synchronous/Asynchronous Receiver/Transmitter) device and is part of a series implementing the STM32L4x5 with a few peripherals. It implements the necessary functionalities to receive/send characters over the serial port, which are useful to communica

[PATCH v3 2/5] hw/char/stm32l4x5_usart: Enable serial read and write

2024-03-29 Thread Arnaud Minier
Implement the ability to read and write characters to the usart using the serial port. The character transmission is based on the cmsdk-apb-uart implementation. Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol Reviewed-by: Peter Maydell --- hw/char/stm32l4x5_usart.c | 140 +

[PATCH v3 1/5] hw/char: Implement STM32L4x5 USART skeleton

2024-03-29 Thread Arnaud Minier
Add the basic infrastructure (register read/write, type...) to implement the STM32L4x5 USART. Also create different types for the USART, UART and LPUART of the STM32L4x5 to deduplicate code and enable the implementation of different behaviors depending on the type. Signed-off-by: Arnaud Minier S

[PATCH v3 5/5] tests/qtest: Add tests for the STM32L4x5 USART

2024-03-29 Thread Arnaud Minier
Test: - read/write from/to the usart registers - send/receive a character/string over the serial port Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol --- tests/qtest/meson.build| 4 +- tests/qtest/stm32l4x5_usart-test.c | 325 + 2 files changed,

[PATCH v3 4/5] hw/arm: Add the USART to the stm32l4x5 SoC

2024-03-29 Thread Arnaud Minier
Add the USART to the SoC and connect it to the other implemented devices. Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol Reviewed-by: Peter Maydell --- docs/system/arm/b-l475e-iot01a.rst | 2 +- hw/arm/Kconfig | 1 + hw/arm/stm32l4x5_soc.c | 82 ++

[PATCH v3 3/5] hw/char/stm32l4x5_usart: Add options for serial parameters setting

2024-03-29 Thread Arnaud Minier
Add a function to change the settings of the serial connection. Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol Reviewed-by: Peter Maydell --- hw/char/stm32l4x5_usart.c | 98 +++ hw/char/trace-events | 1 + 2 files changed, 99 insertions(+) di

Re: [PATCH 1/1] e1000: Get debug flags from an environment variable

2024-03-29 Thread Richard Henderson
On 3/29/24 05:04, Don Porter wrote: From: Austin Clements The E1000 debug messages are very useful for developing drivers, so this introduces an E1000_DEBUG environment variable that lets the debug flags be set without recompiling QEMU. Signed-off-by: Austin Clements [geo...@ldpreload.com: Re

Backdoor in xz, should we switch compression format for tarballs?

2024-03-29 Thread Paolo Bonzini
For more info, see https://lwn.net/ml/oss-security/20240329155126.kjjfduxw2yrlx...@awork3.anarazel.de/ but, essentially, xz was backdoored and it seems like upstream was directly responsible for this. Based on this, should we switch our distribution from bz2+xz to bz2+zstd or bz2+lzip? Thanks, P

Re: [RFC PATCH v2 4/6] cxl/core: report poison when injecting from debugfs

2024-03-29 Thread Alison Schofield
On Fri, Mar 29, 2024 at 02:36:12PM +0800, Shiyang Ruan wrote: > Poison injection from debugfs is silent too. Add calling > cxl_mem_report_poison() to make it able to do memory_failure(). Curious as to why it is silent? Will a GMER poison event occur and trigger the path to report it via memory_fa

Re: [RFC PATCH v2 0/6] cxl: add poison event handler

2024-03-29 Thread Dan Williams
Alison Schofield wrote: [..] > Upon receipt of that new poison list, call memory_failture_queue() > on *any* poison in a mapped space. Is that OK? Can we call > memory_failure_queue() on any and every poison report that is in > HPA space regardless of whether it first came to us through a GMER? >

Re: [RFC PATCH v2 6/6] cxl/core: add poison injection event handler

2024-03-29 Thread Alison Schofield
On Fri, Mar 29, 2024 at 02:36:14PM +0800, Shiyang Ruan wrote: > Currently driver only traces cxl events, poison injection (for both vmem > and pmem type) on cxl memdev is silent. OS needs to be notified then it > could handle poison range in time. Per CXL spec, the device error event > could be s

Re: Backdoor in xz, should we switch compression format for tarballs?

2024-03-29 Thread Alex Bennée
Um maybe? >From what I've read so far it doesn't seem the format is compromised but it certainly seems like a concerted attempt to subvert an upstream. However a knee-jerk jump to another format might be premature without carefully considering if other upstreams have been targeted. I guess zstd i

[PATCH v3 3/5] qdev-monitor: add option to report GenericError from find_device_state

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
Here we just prepare for the following patch, making possible to report GenericError as recommended. This patch doesn't aim to prevent further use of DeviceNotFound by future interfaces: - find_device_state() is used in blk_by_qdev_id() and qmp_get_blk() functions, which may lead to spread of

[PATCH v3 2/5] qdev-monitor: fix error message in find_device_state()

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
This "hotpluggable" here is misleading. Actually we check is object a device or not. Let's drop the word. Suggested-by: Markus Armbruster Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Markus Armbruster --- system/qdev-monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH v3 1/5] vhost-user-blk: simplify and fix vhost_user_blk_handle_config_change

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
Let's not care about what was changed and update the whole config, reasons: 1. config->geometry should be updated together with capacity, so we fix a bug. 2. Vhost-user protocol doesn't say anything about config change limitation. Silent ignore of changes doesn't seem to be correct. 3. vho

[PATCH v3 0/5] vhost-user-blk: live resize additional APIs

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
v3: 02: add r-b by Markus 03: improve commit message 04: improve documentation, merge race-fix here (which was v2:05), rebase on master (migration_is_running() now without arguments) 05: improve documentation Vladimir Sementsov-Ogievskiy (5): vhost-user-blk: simplify and fix vhost_user_blk_h

[PATCH v3 5/5] qapi: introduce CONFIG_READ event

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
Send a new event when guest reads virtio-pci config after virtio_notify_config() call. That's useful to check that guest fetched modified config, for example after resizing disk backend. Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/virtio/virtio-pci.c | 9 + include/monitor/qdev.

[PATCH v3 4/5] qapi: introduce device-sync-config

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
Add command to sync config from vhost-user backend to the device. It may be helpful when VHOST_USER_SLAVE_CONFIG_CHANGE_MSG failed or not triggered interrupt to the guest or just not available (not supported by vhost-user server). Command result is racy if allow it during migration. Let's allow th

Re: [PATCH for-9.1] migration: Add Error** argument to add_bitmaps_to_list()

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
On 29.03.24 13:56, Cédric Le Goater wrote: This allows to report more precise errors in the migration handler dirty_bitmap_save_setup(). Suggested-by Vladimir Sementsov-Ogievskiy Signed-off-by: Cédric Le Goater Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [RFC PATCH v2 0/6] cxl: add poison event handler

2024-03-29 Thread Alison Schofield
On Fri, Mar 29, 2024 at 11:22:32AM -0700, Dan Williams wrote: > Alison Schofield wrote: > [..] > > Upon receipt of that new poison list, call memory_failture_queue() > > on *any* poison in a mapped space. Is that OK? Can we call > > memory_failure_queue() on any and every poison report that is in

Re: [PATCH-for-9.1 v2 2/3] migration: Remove RDMA protocol handling

2024-03-29 Thread Daniel P . Berrangé
On Fri, Mar 29, 2024 at 11:28:54AM +0100, Philippe Mathieu-Daudé wrote: > Hi Zhijian, > > On 29/3/24 02:53, Zhijian Li (Fujitsu) wrote: > > > > > > On 28/03/2024 23:01, Peter Xu wrote: > > > On Thu, Mar 28, 2024 at 11:18:04AM -0300, Fabiano Rosas wrote: > > > > Philippe Mathieu-Daudé writes: >

Re: Backdoor in xz, should we switch compression format for tarballs?

2024-03-29 Thread Daniel P . Berrangé
On Fri, Mar 29, 2024 at 06:59:30PM +0100, Paolo Bonzini wrote: > For more info, see > https://lwn.net/ml/oss-security/20240329155126.kjjfduxw2yrlx...@awork3.anarazel.de/ > but, essentially, xz was backdoored and it seems like upstream was directly > responsible for this. > > Based on this, should

Re: Backdoor in xz, should we switch compression format for tarballs?

2024-03-29 Thread Alex Bennée
Also does qemu link to libarchive? The original analysis wasn't a full reverse engineer of the payload so we don't know if it only affects sshd. On Sat, 30 Mar 2024, 07:01 Daniel P. Berrangé, wrote: > On Fri, Mar 29, 2024 at 06:59:30PM +0100, Paolo Bonzini wrote: > > For more info, see > > > htt

Re: [RFC PATCH v2 0/6] cxl: add poison event handler

2024-03-29 Thread Dan Williams
Alison Schofield wrote: > On Fri, Mar 29, 2024 at 11:22:32AM -0700, Dan Williams wrote: > > Alison Schofield wrote: > > [..] > > > Upon receipt of that new poison list, call memory_failture_queue() > > > on *any* poison in a mapped space. Is that OK? Can we call > > > memory_failure_queue() on any

Re: [PATCH] linux-user/syscall: xtensa: fix target_msqid_ds and ipc_perm conversion

2024-03-29 Thread Max Filippov
On Fri, Mar 29, 2024 at 5:48 AM Philippe Mathieu-Daudé wrote: > > Hi Max, > > On 29/3/24 07:31, Max Filippov wrote: > > - target_ipc_perm::mode and target_ipc_perm::__seq fields are 32-bit wide > >on xtensa and thus need to use tswap32 > > - target_msqid_ds::msg_*time field pairs are reversed

[PULL 1/7] linux-user: Fix semctl() strace

2024-03-29 Thread Richard Henderson
From: Ilya Leoshkevich The indices of arguments used with semctl() are all off-by-1, because arg1 is the ipc() command. Fix them. While at it, reuse print_semctl(). New output (for a small test program): 3540333 semctl(999,888,SEM_INFO,0x7fe5051ee9a0) = -1 errno=14 (Bad address) Fixes

[PULL 0/7] tcg + linux-user patch queue

2024-03-29 Thread Richard Henderson
The following changes since commit 5012e522aca161be5c141596c66e5cc6082538a9: Update version for v9.0.0-rc1 release (2024-03-26 19:46:55 +) are available in the Git repository at: https://gitlab.com/rth7680/qemu.git tags/pull-tcg-20240329 for you to fetch changes up to

[PULL 5/7] tcg/optimize: Fix sign_mask for logical right-shift

2024-03-29 Thread Richard Henderson
The 'sign' computation is attempting to locate the sign bit that has been repeated, so that we can test if that bit is known zero. That computation can be zero if there are no known sign repetitions. Cc: qemu-sta...@nongnu.org Fixes: 93a967fbb57 ("tcg/optimize: Propagate sign info for shifting")

[PULL 3/7] linux-user: Fix shmat(NULL) for h != g

2024-03-29 Thread Richard Henderson
From: Ilya Leoshkevich In the h != g && shmaddr == NULL && !reserved_va case, target_shmat() incorrectly mmap()s the initial anonymous range with MAP_FIXED_NOREPLACE, even though the earlier mmap_find_vma() has already reserved the respective address range. Fix by using MAP_FIXED when "mapped",

[PULL 7/7] accel/tcg: Use CPUState.get_pc in cpu_io_recompile

2024-03-29 Thread Richard Henderson
Using log_pc produces the pc at the beginning of TB, not the actual pc installed by cpu_restore_state_from_tb, which could be any of the guest instructions within TB. Signed-off-by: Richard Henderson --- accel/tcg/translate-all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PULL 4/7] tests/tcg: Test shmat(NULL)

2024-03-29 Thread Richard Henderson
From: Ilya Leoshkevich Add a small test to prevent regressions. Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich Message-Id: <20240325192436.561154-5-...@linux.ibm.com> Signed-off-by: Richard Henderson --- tests/tcg/multiarch/linux/linux-shmat-null.c | 38

[PULL 6/7] disas: Show opcodes for target_disas and monitor_disas

2024-03-29 Thread Richard Henderson
Fixes: 83b4613ba83 ("disas: introduce show_opcodes") Signed-off-by: Richard Henderson --- disas/disas-mon.c | 1 + disas/disas.c | 1 + 2 files changed, 2 insertions(+) diff --git a/disas/disas-mon.c b/disas/disas-mon.c index 48ac492c6c..5d6d9aa02d 100644 --- a/disas/disas-mon.c +++ b/disas/

[PULL 2/7] linux-user: Fix shmat() strace

2024-03-29 Thread Richard Henderson
From: Ilya Leoshkevich The indices of arguments passed to print_shmat() are all off-by-1, because arg1 is the ipc() command. Fix them. New output for linux-shmat-maps test: 3501769 shmat(4784214,0x0080,SHM_RND) = 0 Fixes: 9f7c97324c27 ("linux-user: Add strace for shmat") Review

[PULL 07/18] target/hppa: Fix EIRR, EIEM versus icount

2024-03-29 Thread Richard Henderson
Call translator_io_start before write to EIRR. Move evaluation of EIRR vs EIEM to hppa_cpu_exec_interrupt. Exit TB after write to EIEM, but otherwise use a straight store. Reviewed-by: Helge Deller Tested-by: Helge Deller Signed-off-by: Richard Henderson --- target/hppa/helper.h | 1 - ta

[PULL 00/18] target/hppa patch queue

2024-03-29 Thread Richard Henderson
The following changes since commit 5012e522aca161be5c141596c66e5cc6082538a9: Update version for v9.0.0-rc1 release (2024-03-26 19:46:55 +) are available in the Git repository at: https://gitlab.com/rth7680/qemu.git tags/pull-pa-20240329 for you to fetch changes up to

[PULL 12/18] target/hppa: Squash d for pa1.x during decode

2024-03-29 Thread Richard Henderson
The cond_need_ext predicate was created while we still had a 32-bit compilation mode. It now makes more sense to treat D as an absolute indicator of a 64-bit operation. Tested-by: Helge Deller Reviewed-by: Helge Deller Signed-off-by: Richard Henderson --- target/hppa/insns.decode | 20 +++

[PULL 17/18] target/hppa: Add diag instructions to set/restore shadow registers

2024-03-29 Thread Richard Henderson
From: Helge Deller The 32-bit PA-7300LC (PCX-L2) CPU and the 64-bit PA8700 (PCX-W2) CPU use different diag instructions to save or restore the CPU registers to/from the shadow registers. Implement those per-CPU architecture diag instructions to fix those parts of the HP ODE testcases (L2DIAG and

[PULL 06/18] target/hppa: Tidy read of interval timer

2024-03-29 Thread Richard Henderson
The call to gen_helper_read_interval_timer is identical on both sides of the IF. Reviewed-by: Helge Deller Tested-by: Helge Deller Signed-off-by: Richard Henderson --- target/hppa/translate.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/hppa/translate.c b/targe

[PULL 08/18] target/hppa: Use gva_offset_mask() everywhere

2024-03-29 Thread Richard Henderson
From: Sven Schnelle Move it to cpu.h, so it can also be used in hppa_form_gva_psw(). Signed-off-by: Sven Schnelle Reviewed-by: Helge Deller Reviewed-by: Richard Henderson Message-Id: <20240324080945.991100-2-sv...@stackframe.org> Signed-off-by: Richard Henderson --- target/hppa/cpu.h

  1   2   >