Re: FSFreeze on Windows VM

2022-04-13 Thread Shelly Kagan
Hi Konstantin, The Guest Agent version "guestAgentVersion": "100.0.0", I'm running with a 2019 windows image which I understand the GA is part of the virtio drivers. Don't know if the following info also helps but: "hostname": "WIN-CUCKQ65DH6K", "os": { "name": "Microsoft Windows", "ke

RE: [RFC PATCH 0/4] 9pfs: Add 9pfs support for Windows host

2022-04-13 Thread Shi, Guohuai
> We have 3 fs drivers: local, synth, proxy. I don't mind about proxy, it is in > bad shape and we will probably deprecate it in near future anyway. But it > would be good to have support for the synth driver, because we are using it > for running test cases and fuzzing tests (QA). synth driver

Re: [PATCH v7 12/12] target/riscv: Update the privilege field for sscofpmf CSRs

2022-04-13 Thread Alistair Francis
On Thu, Mar 31, 2022 at 10:31 AM Atish Patra wrote: > > The sscofpmf extension was ratified as a part of priv spec v1.12. > Mark the csr_ops accordingly. > > Signed-off-by: Atish Patra Reviewed-by: Alistair Francis Alistair > --- > target/riscv/csr.c | 90 ++--

Re: [PATCH v7 08/12] target/riscv: Add sscofpmf extension support

2022-04-13 Thread Alistair Francis
On Thu, Mar 31, 2022 at 10:19 AM Atish Patra wrote: > > The Sscofpmf ('Ss' for Privileged arch and Supervisor-level extensions, > and 'cofpmf' for Count OverFlow and Privilege Mode Filtering) > extension allows the perf to handle overflow interrupts and filtering > support. This patch provides a f

Re: [PATCH for-7.1 1/8] nbd: actually implement reply_possible safeguard

2022-04-13 Thread Paolo Bonzini
On 4/13/22 00:05, Eric Blake wrote: +s->requests[ind2].reply_possible = nbd_reply_is_structured(&s->reply); If the reply is simple (not structured), then we expect no further replies, so this sets things to false. But if the reply is structured, the answer depends on NBD_REPLY_FLAG_DONE

Re: [PATCH for-7.1 0/8] nbd: actually make s->state thread-safe

2022-04-13 Thread Paolo Bonzini
On 4/12/22 20:26, Vladimir Sementsov-Ogievskiy wrote: 12.04.2022 20:32, Paolo Bonzini wrote: The main point of this series is patch 6, which removes the dubious and probably wrong use of atomics in block/nbd.c.  This in turn is enabled mostly by the cleanups in patches 3-5.  Together, they intro

Re: [PATCH for-7.1 5/8] nbd: use a QemuMutex to synchronize reconnection with coroutines

2022-04-13 Thread Paolo Bonzini
On 4/12/22 21:42, Paolo Bonzini wrote: Because s->state is written in the main thread too, for example by the reconnect timer callback, it cannot be protected by a CoMutex. Actually by the yank callback, not the timer (which runs in the "right" AioContext). Paolo

Re: [PATCH v5 04/13] mm/shmem: Restrict MFD_INACCESSIBLE memory against RLIMIT_MEMLOCK

2022-04-13 Thread Chao Peng
On Tue, Apr 12, 2022 at 10:28:21PM +0300, Kirill A. Shutemov wrote: > On Tue, Apr 12, 2022 at 09:39:25PM +0800, Chao Peng wrote: > > On Mon, Apr 11, 2022 at 06:32:33PM +0300, Kirill A. Shutemov wrote: > > > On Thu, Apr 07, 2022 at 04:05:36PM +, Sean Christopherson wrote: > > > > Hmm, shmem_writ

Re: [libvirt] [PATCH RESEND v2 0/4] re-introduce

2022-04-13 Thread Ani Sinha
On Tue, Apr 12, 2022 at 12:34 PM Michael S. Tsirkin wrote: > > On Tue, Apr 12, 2022 at 09:50:15AM +0530, Ani Sinha wrote: > > On Tue, Mar 8, 2022 at 10:28 PM Michael S. Tsirkin wrote: > > > > > > On Tue, Mar 08, 2022 at 10:15:49PM +0530, Ani Sinha wrote: > > > > > > > > Change log: > > > > v2: re

Re: [libvirt] [PATCH RESEND v2 0/4] re-introduce

2022-04-13 Thread Ani Sinha
On Tue, Apr 12, 2022 at 12:41 PM Michael S. Tsirkin wrote: > > On Tue, Apr 12, 2022 at 09:52:26AM +0530, Ani Sinha wrote: > > On Tue, Apr 12, 2022 at 9:50 AM Ani Sinha wrote: > > > > > > On Tue, Mar 8, 2022 at 10:28 PM Michael S. Tsirkin > > > wrote: > > > > > > > > On Tue, Mar 08, 2022 at 10:1

[PATCH] migration: Read state once

2022-04-13 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The 'status' field for the migration is updated normally using an atomic operation from the migration thread. Most readers of it aren't that careful, and in most cases it doesn't matter. In query_migrate->fill_source_migration_info the 'state' is read twice; the fi

Re: [PATCH v5 1/4] qapi/machine.json: Add cluster-id

2022-04-13 Thread wangyanan (Y)
Hi Gavin, On 2022/4/3 22:59, Gavin Shan wrote: This adds cluster-id in CPU instance properties, which will be used by arm/virt machine. Besides, the cluster-id is also verified or dumped in various spots: * hw/core/machine.c::machine_set_cpu_numa_node() to associate CPU with its NUMA no

[RFC PATCH] tests/guest-debug: better handle gdb crashes

2022-04-13 Thread Alex Bennée
There are a number of GDB's on various distros which fail fairly hard when attempting to talk to a cross-arch guest. The previous attempt to catch this was incorrect as the shell will deliver signals as 128+n. Fix the detection and while we are it improve the logging we dump into the test output.

Re: [PATCH for-7.1 2/8] nbd: mark more coroutine_fns

2022-04-13 Thread Eric Blake
On Tue, Apr 12, 2022 at 09:41:58PM +0200, Paolo Bonzini wrote: > Several coroutine functions in block/nbd.c are not marked as such. This > patch adds a few more markers; it is not exhaustive, but it focuses > especially on: > > - places that wake other coroutines, because aio_co_wake() has very >

[PATCH] block/rbd: support driver-specific reopen

2022-04-13 Thread Raphael Pour
This patch completes the reopen functionality for an attached RBD where altered driver options can be passed to. This is necessary to move RBDs between ceph clusters without interrupting QEMU, where some ceph settings need to be adjusted. The reopen_prepare method early returns if no rbd-specific

Re: [PATCH v5 2/4] hw/arm/virt: Consider SMP configuration in CPU topology

2022-04-13 Thread wangyanan (Y)
Hi Gavin, On 2022/4/3 22:59, Gavin Shan wrote: Currently, the SMP configuration isn't considered when the CPU topology is populated. In this case, it's impossible to provide the default CPU-to-NUMA mapping or association based on the socket ID of the given CPU. This takes account of SMP configu

Re: [PATCH qemu v7 00/14] Add tail agnostic behavior for rvv instructions

2022-04-13 Thread eop Chen
Gentle ping, it is not picked to `riscv-to-apply.next` yet. Thank you. Yueh-Ting (eop) Chen > Alistair Francis 於 2022年3月31日 上午11:18 寫道: > > On Thu, Mar 31, 2022 at 11:24 AM Weiwei Li > wrote: >> >> >> 在 2022/3/31 上午8:11, Alistair Francis 写道: >>> On Wed, Mar 30,

Re: [PATCH for-7.1 3/8] nbd: remove peppering of nbd_client_connected

2022-04-13 Thread Eric Blake
On Tue, Apr 12, 2022 at 09:41:59PM +0200, Paolo Bonzini wrote: > It is unnecessary to check nbd_client_connected() because every time > s->state is moved out of NBD_CLIENT_CONNECTED the socket is shut down > and all coroutines are resumed. > > The only case where it was actually needed is when the

Re: [PATCH v2 11/39] tcg: Pass the locked filepointer to tcg_dump_ops

2022-04-13 Thread Alex Bennée
Richard Henderson writes: > We have already looked up and locked the filepointer. > Use fprintf instead of qemu_log directly for output > in and around tcg_dump_ops. > > Signed-off-by: Richard Henderson > --- > tcg/tcg.c | 109 ++ > 1 file c

Re: [PATCH v2] hw/ppc: change indentation to spaces from TABs

2022-04-13 Thread Daniel Henrique Barboza
On 4/11/22 23:12, Guo Zhi wrote: Resolves: https://gitlab.com/qemu-project/qemu/-/issues/374 There are still some files in the QEMU PPC code base that use TABs for indentation instead of using spaces. The TABs should be replaced so that we have a consistent coding style. I forgot to men

adding 'official' way to dump SEV VMSA

2022-04-13 Thread Cole Robinson
Hi all, SEV-ES and SEV-SNP attestation require a copy of the initial VMSA to validate the launch measurement. For developers dipping their toe into SEV-* work, the easiest way to get sample VMSA data for their machine is to grab it from a running VM. There's two techniques I've seen for that: pat

Re: [RFC PATCH 0/5] Removal of AioContext lock, bs->parents and ->children: proof of concept

2022-04-13 Thread Emanuele Giuseppe Esposito
So this is a more concrete and up-to-date header. Few things to notice: - we have a list of AioContext. They are registered once an aiocontext is created, and deleted when it is destroyed. This list is helpful because each aiocontext can only modify its own number of readers, avoiding unnecessary

Re: FSFreeze on Windows VM

2022-04-13 Thread Konstantin Kostiuk
Hi Shelly, Thanks for your answer. Your version of GuestAgent is too old. The latest version is 103.0.0. Version 100.0.0 has a bug related to wrong error messages. When you try to freeze FS, GA can return an error that the GA is not available. Please try again with the latest version. I think it

Re: [PATCH v5 4/4] hw/acpi/aml-build: Use existing CPU topology to build PPTT table

2022-04-13 Thread Igor Mammedov
On Sun, 3 Apr 2022 22:59:53 +0800 Gavin Shan wrote: > When the PPTT table is built, the CPU topology is re-calculated, but > it's unecessary because the CPU topology has been populated in > virt_possible_cpu_arch_ids() on arm/virt machine. > > This reworks build_pptt() to avoid by reusing the e

Re: [PATCH v2 09/39] *: Use fprintf between qemu_log_trylock/unlock

2022-04-13 Thread Alex Bennée
Richard Henderson writes: > Inside qemu_log, we perform qemu_log_trylock/unlock, which need > not be done if we have already performed the lock beforehand. > > Always check the result of qemu_log_trylock -- only checking > qemu_loglevel_mask races with the acquisition of the lock on > the logfi

Re: [PATCH v2 12/39] exec/translator: Pass the locked filepointer to disas_log hook

2022-04-13 Thread Alex Bennée
Richard Henderson writes: > We have fetched and locked the logfile in translator_loop. > Pass the filepointer down to the disas_log hook so that it > need not be fetched and locked again. > > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée -- Alex Bennée

Re: FSFreeze on Windows VM

2022-04-13 Thread Shelly Kagan
Hi Konstantin, Thanks for the quick response. I will look into getting a newer GA version. Regarding the GA not available, is it relevant to the newer versions? Is there a way to make sure the GA is available when running the freeze? when it is not available it takes a lot of time to get a response

Re: [PATCH v7 12/17] vfio-user: IOMMU support for remote device

2022-04-13 Thread Igor Mammedov
On Fri, 25 Mar 2022 15:19:41 -0400 Jagannathan Raman wrote: > Assign separate address space for each device in the remote processes. > > Signed-off-by: Elena Ufimtseva > Signed-off-by: John G Johnson > Signed-off-by: Jagannathan Raman > --- > include/hw/remote/iommu.h | 18 > hw/rem

Re: FSFreeze on Windows VM

2022-04-13 Thread Konstantin Kostiuk
Hi Shelly, You can use guest-ping commend to check that GA is alive. This command should work always. Best Regards, Konstantin Kostiuk. On Wed, Apr 13, 2022 at 5:21 PM Shelly Kagan wrote: > Hi Konstantin, > Thanks for the quick response. > I will look into getting a newer GA version. > Regard

Re: [PATCH v7 12/17] vfio-user: IOMMU support for remote device

2022-04-13 Thread Igor Mammedov
On Thu, 31 Mar 2022 08:41:01 -0400 Peter Xu wrote: > On Thu, Mar 31, 2022 at 10:47:33AM +0100, Stefan Hajnoczi wrote: > > On Wed, Mar 30, 2022 at 01:13:03PM -0400, Peter Xu wrote: > > > On Wed, Mar 30, 2022 at 05:08:24PM +0100, Stefan Hajnoczi wrote: > > > > On Wed, Mar 30, 2022 at 08:53:16AM

Re: [RFC PATCH 0/5] Removal of AioContext lock, bs->parents and ->children: proof of concept

2022-04-13 Thread Kevin Wolf
Am 13.04.2022 um 15:43 hat Emanuele Giuseppe Esposito geschrieben: > So this is a more concrete and up-to-date header. > > Few things to notice: > - we have a list of AioContext. They are registered once an aiocontext > is created, and deleted when it is destroyed. > This list is helpful because e

Re: [PATCH v2] hw/ppc: change indentation to spaces from TABs

2022-04-13 Thread Guo Zhi
Thanks for your help, I'll pay attention to the commit specification next time. Guo - Original Message - From: "Daniel Henrique Barboza" To: "Guo Zhi" , "Cédric Le Goater" , "David Gibson" , "Greg Kurz" Cc: "qemu-ppc" , "qemu-devel@nongnu.org Developers" Sent: Wednesday, April 13, 20

Re: [RFC PATCH 0/5] Removal of AioContext lock, bs->parents and ->children: proof of concept

2022-04-13 Thread Emanuele Giuseppe Esposito
Am 13/04/2022 um 16:51 schrieb Kevin Wolf: > Am 13.04.2022 um 15:43 hat Emanuele Giuseppe Esposito geschrieben: >> So this is a more concrete and up-to-date header. >> >> Few things to notice: >> - we have a list of AioContext. They are registered once an aiocontext >> is created, and deleted wh

Re: [RFC PATCH 0/5] Removal of AioContext lock, bs->parents and ->children: proof of concept

2022-04-13 Thread Emanuele Giuseppe Esposito
Am 13/04/2022 um 17:14 schrieb Emanuele Giuseppe Esposito: > > > Am 13/04/2022 um 16:51 schrieb Kevin Wolf: >> Am 13.04.2022 um 15:43 hat Emanuele Giuseppe Esposito geschrieben: >>> So this is a more concrete and up-to-date header. >>> >>> Few things to notice: >>> - we have a list of AioConte

Re: [PATCH for-7.1 4/8] nbd: keep send_mutex/free_sema handling outside nbd_co_do_establish_connection

2022-04-13 Thread Eric Blake
On Tue, Apr 12, 2022 at 09:42:00PM +0200, Paolo Bonzini wrote: > Elevate s->in_flight early so that other incoming requests will wait > on the CoQueue in nbd_co_send_request; restart them after getting back > from nbd_reconnect_attempt. This could be after the reconnect timer or > nbd_cancel_in_fl

Re: [PATCH for-7.1 5/8] nbd: use a QemuMutex to synchronize reconnection with coroutines

2022-04-13 Thread Eric Blake
On Tue, Apr 12, 2022 at 09:42:01PM +0200, Paolo Bonzini wrote: > The condition for waiting on the s->free_sema queue depends on > both s->in_flight and s->state. The latter is currently using > atomics, but this is quite dubious and probably wrong. > > Because s->state is written in the main thre

[PATCH] target/i386: do not access beyond the low 128 bits of SSE registers

2022-04-13 Thread Paolo Bonzini
The i386 target consolidates all vector registers so that instead of XMMReg, YMMReg and ZMMReg structs there is a single ZMMReg that can fit all of SSE, AVX and AVX512. When TCG copies data from and to the SSE registers, it uses the full 64-byte width. This is not a correctness issue because TCG

Re: [PATCH for-7.1 6/8] nbd: move s->state under requests_lock

2022-04-13 Thread Eric Blake
On Tue, Apr 12, 2022 at 09:42:02PM +0200, Paolo Bonzini wrote: > Remove the confusing, and most likely wrong, atomics. The only function > that used to be somewhat in a hot path was nbd_client_connected(), > but it is not anymore after the previous patches. > > The function nbd_client_connecting_

Re: [PATCH v5 04/13] mm/shmem: Restrict MFD_INACCESSIBLE memory against RLIMIT_MEMLOCK

2022-04-13 Thread David Hildenbrand
On 12.04.22 16:36, Jason Gunthorpe wrote: > On Fri, Apr 08, 2022 at 08:54:02PM +0200, David Hildenbrand wrote: > >> RLIMIT_MEMLOCK was the obvious candidate, but as we discovered int he >> past already with secretmem, it's not 100% that good of a fit (unmovable >> is worth than mlocked). But it ge

Re: [PATCH] target/i386: do not access beyond the low 128 bits of SSE registers

2022-04-13 Thread Peter Maydell
On Wed, 13 Apr 2022 at 17:09, Paolo Bonzini wrote: > > The i386 target consolidates all vector registers so that instead of > XMMReg, YMMReg and ZMMReg structs there is a single ZMMReg that can > fit all of SSE, AVX and AVX512. > > When TCG copies data from and to the SSE registers, it uses the >

Re: [RFC PATCH 0/5] Removal of AioContext lock, bs->parents and ->children: proof of concept

2022-04-13 Thread Kevin Wolf
Am 13.04.2022 um 17:14 hat Emanuele Giuseppe Esposito geschrieben: > Am 13/04/2022 um 16:51 schrieb Kevin Wolf: > > Am 13.04.2022 um 15:43 hat Emanuele Giuseppe Esposito geschrieben: > >> So this is a more concrete and up-to-date header. > >> > >> Few things to notice: > >> - we have a list of AioC

Re: [PATCH v5 04/13] mm/shmem: Restrict MFD_INACCESSIBLE memory against RLIMIT_MEMLOCK

2022-04-13 Thread David Hildenbrand
> > So this is another situation where the actual backend (TDX, SEV, pKVM, pure > software) makes a difference -- depending on exactly what backend we're > using, the memory may not be unmoveable. It might even be swappable (in the > potentially distant future). Right. And on a system without

[RFC PATCH v7 00/25] Net Control VQ support with asid in vDPA SVQ

2022-04-13 Thread Eugenio Pérez
Control virtqueue is used by networking device for accepting various commands from the driver. It's a must to support multiqueue and other configurations. Shadow VirtQueue (SVQ) already makes possible migration of virtqueue states, effectively intercepting them so qemu can track what regions of me

[RFC PATCH v7 01/25] vhost: Track descriptor chain in private at SVQ

2022-04-13 Thread Eugenio Pérez
Only the first one of them were properly enqueued back. While we're at it, harden SVQ: The device could have access to modify them, and it definitely have access when we implement packed vq. Harden SVQ maintaining a private copy of the descriptor chain. Other fields like buffer addresses are alrea

[RFC PATCH v7 04/25] util: Return void on iova_tree_remove

2022-04-13 Thread Eugenio Pérez
It always returns IOVA_OK so nobody uses it. Signed-off-by: Eugenio Pérez --- include/qemu/iova-tree.h | 4 +--- util/iova-tree.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/include/qemu/iova-tree.h b/include/qemu/iova-tree.h index c938fb0793..16bbfdf5f8 1006

[RFC PATCH v7 05/25] hw/virtio: Replace g_memdup() by g_memdup2()

2022-04-13 Thread Eugenio Pérez
From: Philippe Mathieu-Daudé Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize t

[RFC PATCH v7 06/25] vdpa: Send all updates in memory listener commit

2022-04-13 Thread Eugenio Pérez
With the introduction of many ASID it can happen that many changes on different listeners come before the commit call. Since kernel vhost-vdpa still does not support it, send it all in one shot. This also have one extra advantage: If there is no update to notify, we save the iotlb_{begin,end} call

[RFC PATCH v7 02/25] vdpa: Add missing tracing to batch mapping functions

2022-04-13 Thread Eugenio Pérez
These functions were not traced properly. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 2 ++ hw/virtio/trace-events | 2 ++ 2 files changed, 4 insertions(+) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 8adf7c0b92..9e5fe15d03 100644 --- a/hw/virtio/vhost-vdpa.c

[RFC PATCH v7 09/25] vhost: move descriptor translation to vhost_svq_vring_write_descs

2022-04-13 Thread Eugenio Pérez
It's done for both in and out descriptors so it's better placed here. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/hw/virtio/vhost-shadow-virtqueue.c b/hw/virtio/vhost-shadow-

[RFC PATCH v7 08/25] vdpa: Add x-svq to NetdevVhostVDPAOptions

2022-04-13 Thread Eugenio Pérez
Finally offering the possibility to enable SVQ from the command line. Signed-off-by: Eugenio Pérez --- qapi/net.json| 9 - net/vhost-vdpa.c | 48 2 files changed, 48 insertions(+), 9 deletions(-) diff --git a/qapi/net.json b/qapi/net

[RFC PATCH v7 10/25] vdpa: Fix index calculus at vhost_vdpa_svqs_start

2022-04-13 Thread Eugenio Pérez
Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 27ee678dc9..6b370c918c 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -1019,7 +1019,7 @@ static bo

[RFC PATCH v7 13/25] virtio: Make virtqueue_alloc_element non-static

2022-04-13 Thread Eugenio Pérez
So SVQ can allocate elements using it Signed-off-by: Eugenio Pérez --- include/hw/virtio/virtio.h | 1 + hw/virtio/virtio.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index b31c4507f5..1e85833897 100644 --

[RFC PATCH v7 07/25] vhost: Add reference counting to vhost_iova_tree

2022-04-13 Thread Eugenio Pérez
Now that different vqs can have different ASIDs its easier to track them using reference counters. QEMU's glib version still does not have them so we've copied g_rc_box, so the implementation can be converted to glib's one when the minimum version is raised. Signed-off-by: Eugenio Pérez --- hw/

[RFC PATCH v7 12/25] vdpa: Extract get features part from vhost_vdpa_get_max_queue_pairs

2022-04-13 Thread Eugenio Pérez
To know the device features is also needed for CVQ SVQ. Extract from vhost_vdpa_get_max_queue_pairs so we can reuse it. Report errno in case of failure getting them while we're at it. Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 30 -- 1 file changed, 20 inser

[RFC PATCH v7 03/25] vdpa: Fix bad index calculus at vhost_vdpa_get_vring_base

2022-04-13 Thread Eugenio Pérez
Fixes: 6d0b222666 ("vdpa: Adapt vhost_vdpa_get_vring_base to SVQ") Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 9e5fe15d03..1f229ff4cb 100644 --- a/hw/virtio/v

[RFC PATCH v7 16/25] vdpa: control virtqueue support on shadow virtqueue

2022-04-13 Thread Eugenio Pérez
Introduce the control virtqueue support for vDPA shadow virtqueue. This is needed for advanced networking features like multiqueue. To demonstrate command handling, VIRTIO_NET_F_CTRL_MACADDR and VIRTIO_NET_CTRL_MQ are implemented. If vDPA device is started with SVQ support and virtio-net driver ch

[RFC PATCH v7 11/25] virtio-net: Expose ctrl virtqueue logic

2022-04-13 Thread Eugenio Pérez
This allows external vhost-net devices to modify the state of the VirtIO device model once vhost-vdpa device has acknowledge the control commands. Signed-off-by: Eugenio Pérez --- include/hw/virtio/virtio-net.h | 3 ++ hw/net/virtio-net.c| 83 -- 2 fi

[RFC PATCH v7 22/25] vhost: Update kernel headers

2022-04-13 Thread Eugenio Pérez
Signed-off-by: Eugenio Pérez --- include/standard-headers/linux/vhost_types.h | 11 - linux-headers/linux/vhost.h | 25 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/include/standard-headers/linux/vhost_types.h b/include/standard-he

[RFC PATCH v7 15/25] vhost: Add custom used buffer callback

2022-04-13 Thread Eugenio Pérez
The callback allows SVQ users to know the VirtQueue requests and responses. QEMU can use this to synchronize virtio device model state, allowing to migrate it with minimum changes to the migration code. In the case of networking, this will be used to inspect control virtqueue messages. Signed-off

[RFC PATCH v7 14/25] vhost: Add SVQElement

2022-04-13 Thread Eugenio Pérez
This allows SVQ to add metadata to the different queue elements Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 8 -- hw/virtio/vhost-shadow-virtqueue.c | 46 -- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/hw/virtio/vhos

[RFC PATCH v7 21/25] vdpa: Add vhost_vdpa_start_control_svq

2022-04-13 Thread Eugenio Pérez
This will send CVQ commands in the destination machine, seting up everything o there is no guest-visible change. Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 63 1 file changed, 63 insertions(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vd

[RFC PATCH v7 18/25] vdpa: Add map/unmap operation callback to SVQ

2022-04-13 Thread Eugenio Pérez
Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 21 +++-- hw/virtio/vhost-shadow-virtqueue.c | 8 +++- hw/virtio/vhost-vdpa.c | 20 +++- 3 files changed, 45 insertions(+), 4 deletions(-) diff --git a/hw/virtio/vhost-shadow-vi

[RFC PATCH v7 17/25] vhost: Add vhost_iova_tree_find

2022-04-13 Thread Eugenio Pérez
Just a simple wrapper so we can find DMAMap entries based on iova Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-iova-tree.h | 2 ++ hw/virtio/vhost-iova-tree.c | 14 ++ 2 files changed, 16 insertions(+) diff --git a/hw/virtio/vhost-iova-tree.h b/hw/virtio/vhost-iova-tree.h index

[RFC PATCH v7 20/25] vdpa: add NetClientState->start() callback

2022-04-13 Thread Eugenio Pérez
It allows to inject custom code on device success start, right before release lock. Signed-off-by: Eugenio Pérez --- include/net/net.h | 2 ++ hw/net/vhost_net.c | 4 2 files changed, 6 insertions(+) diff --git a/include/net/net.h b/include/net/net.h index 523136c7ac..2fc3002ab4 100644 --

[RFC PATCH v7 19/25] vhost: Add vhost_svq_inject

2022-04-13 Thread Eugenio Pérez
This allows qemu to inject packets to the device without guest's notice. This will be use to inject net CVQ messages to restore status in the destination Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 5 + hw/virtio/vhost-shadow-virtqueue.c | 179 +++

[RFC PATCH v7 25/25] vdpa: Add x-cvq-svq

2022-04-13 Thread Eugenio Pérez
This isolates shadow cvq in its own group. Signed-off-by: Eugenio Pérez --- qapi/net.json| 8 +++- net/vhost-vdpa.c | 98 ++-- 2 files changed, 100 insertions(+), 6 deletions(-) diff --git a/qapi/net.json b/qapi/net.json index 92848e4362..39c245e

[RFC PATCH v7 24/25] vdpa: Add asid attribute to vdpa device

2022-04-13 Thread Eugenio Pérez
We can configure ASID per group, but we still use asid 0 for every vdpa device. Multiple asid support for cvq will be introduced in next patches Signed-off-by: Eugenio Pérez --- include/hw/virtio/vhost.h | 4 ++ hw/net/vhost_net.c| 5 +++ hw/virtio/vhost-vdpa.c| 95

[RFC PATCH v7 23/25] vhost: Make possible to check for device exclusive vq group

2022-04-13 Thread Eugenio Pérez
CVQ needs to be in its own group, not shared with any data vq. Enable the checking of it here, before introducing address space id concepts. Signed-off-by: Eugenio Pérez --- include/hw/virtio/vhost.h | 2 + hw/net/vhost_net.c| 4 +- hw/virtio/vhost-vdpa.c| 79 ++

[PATCH v2] Warn user if the vga flag is passed but no vga device is created

2022-04-13 Thread Gautam Agrawal
A global boolean variable "vga_interface_created"(declared in softmmu/globals.c) has been used to track the creation of vga interface. If the vga flag is passed in the command line "default_vga"(declared in softmmu/vl.c) variable is set to 0. To warn user, the condition checks if vga_interface_cre

Re: [PATCH v5 04/13] mm/shmem: Restrict MFD_INACCESSIBLE memory against RLIMIT_MEMLOCK

2022-04-13 Thread Jason Gunthorpe
On Wed, Apr 13, 2022 at 06:24:56PM +0200, David Hildenbrand wrote: > On 12.04.22 16:36, Jason Gunthorpe wrote: > > On Fri, Apr 08, 2022 at 08:54:02PM +0200, David Hildenbrand wrote: > > > >> RLIMIT_MEMLOCK was the obvious candidate, but as we discovered int he > >> past already with secretmem, it'

Re: [PATCH v7 12/17] vfio-user: IOMMU support for remote device

2022-04-13 Thread Jag Raman
> On Apr 13, 2022, at 10:25 AM, Igor Mammedov wrote: > > On Fri, 25 Mar 2022 15:19:41 -0400 > Jagannathan Raman wrote: > >> Assign separate address space for each device in the remote processes. >> >> Signed-off-by: Elena Ufimtseva >> Signed-off-by: John G Johnson >> Signed-off-by: Jaganna

Re: [PATCH v2 13/39] exec/log: Remove log_disas and log_target_disas

2022-04-13 Thread Alex Bennée
Richard Henderson writes: > These functions are no longer used. > > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée -- Alex Bennée

Re: [PATCH] target/i386: do not access beyond the low 128 bits of SSE registers

2022-04-13 Thread Alex Bennée
Paolo Bonzini writes: > The i386 target consolidates all vector registers so that instead of > XMMReg, YMMReg and ZMMReg structs there is a single ZMMReg that can > fit all of SSE, AVX and AVX512. > > When TCG copies data from and to the SSE registers, it uses the > full 64-byte width. This is

Re: [PATCH v7 12/17] vfio-user: IOMMU support for remote device

2022-04-13 Thread Peter Xu
On Wed, Apr 13, 2022 at 04:37:35PM +0200, Igor Mammedov wrote: > On Thu, 31 Mar 2022 08:41:01 -0400 > Peter Xu wrote: > > > On Thu, Mar 31, 2022 at 10:47:33AM +0100, Stefan Hajnoczi wrote: > > > On Wed, Mar 30, 2022 at 01:13:03PM -0400, Peter Xu wrote: > > > > On Wed, Mar 30, 2022 at 05:08:24PM

Re: [PATCH] target/i386: do not access beyond the low 128 bits of SSE registers

2022-04-13 Thread Paolo Bonzini
On 4/13/22 20:44, Alex Bennée wrote: And: Fixes: b7711471f5 ("target-i386: make xmm_regs 512-bit wide") Resolves:https://gitlab.com/qemu-project/qemu/-/issues/420 It's not really a bug, beyond the possibility of uninitialized data in the migration stream. The reporter was probably using a fo

Re: [PATCH for-7.1 2/8] nbd: mark more coroutine_fns

2022-04-13 Thread Paolo Bonzini
On 4/13/22 14:25, Eric Blake wrote: -static bool nbd_recv_coroutine_wake_one(NBDClientRequest *req) +static bool coroutine_fn nbd_recv_coroutine_wake_one(NBDClientRequest *req) This already has_coroutine_ in the name, would it be better as_co_? { if (req->receiving) { req->r

Re: [PATCH for-7.1 5/8] nbd: use a QemuMutex to synchronize reconnection with coroutines

2022-04-13 Thread Paolo Bonzini
On 4/13/22 17:55, Eric Blake wrote: -g_assert(qemu_in_coroutine()); Why is this assert dropped? Is it because we've marked the function with coroutine_fn? If so, should we drop it earlier in the series, when you added the label? The label doesn't guarantee much, but in this case it's pre

Re: [PATCH for-7.1 6/8] nbd: move s->state under requests_lock

2022-04-13 Thread Paolo Bonzini
On 4/13/22 18:23, Eric Blake wrote: The function nbd_client_connecting_wait() was used mostly to check if a request had to be reissued (outside requests_lock), but also under requests_lock in nbd_client_connecting_wait(). The two uses have to "Function A was used mostly..., but also under requ

Re: [RFC PATCH 0/5] Removal of AioContext lock, bs->parents and ->children: proof of concept

2022-04-13 Thread Paolo Bonzini
On 4/13/22 18:29, Kevin Wolf wrote: A reader does not have to be a coroutine. AIO_WAIT_WHILE is not mandatory to allow it to finish, it helps to ensure progress in case some reader is waiting for something, but other than that is not necessary IMO. When it's outside of a coroutine, how would you

Re: [RFC PATCH 0/5] Removal of AioContext lock, bs->parents and ->children: proof of concept

2022-04-13 Thread Paolo Bonzini
On 4/13/22 16:51, Kevin Wolf wrote: So the idea is that we can do bdrv_graph_co_rdlock() in one thread and the corresponding bdrv_graph_co_rdunlock() in a different thread? Would the unlock somehow remember the original thread, or do you use the "sum is correct" argument and allow negative count

Re: [PATCH for-7.1 7/8] nbd: take receive_mutex when reading requests[].receiving

2022-04-13 Thread Eric Blake
On Tue, Apr 12, 2022 at 09:42:03PM +0200, Paolo Bonzini wrote: > requests[].receiving is set by nbd_receive_replies() under the receive_mutex; > Read it under the same mutex as well. Waking up receivers on errors happens > after each reply finishes processing, in nbd_co_receive_one_chunk(). > If t

Re: [PATCH for-7.1 8/8] nbd: document what is protected by the CoMutexes

2022-04-13 Thread Eric Blake
On Tue, Apr 12, 2022 at 09:42:04PM +0200, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini > --- > block/nbd.c | 8 +++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/block/nbd.c b/block/nbd.c > index 8954243f50..8297da7e89 100644 > --- a/block/nbd.c > +++ b/block/nbd.

Re: [PATCH v7 12/17] vfio-user: IOMMU support for remote device

2022-04-13 Thread Jag Raman
> On Apr 13, 2022, at 2:24 PM, Jag Raman wrote: > > > >> On Apr 13, 2022, at 10:25 AM, Igor Mammedov wrote: >> >> On Fri, 25 Mar 2022 15:19:41 -0400 >> Jagannathan Raman wrote: >> >>> Assign separate address space for each device in the remote processes. >>> >>> Signed-off-by: Elena Ufim

[PATCH v2 4/5] qga/commands-posix: Log all net stats failures

2022-04-13 Thread Andrew Deason
guest_get_network_stats can silently fail in a couple of ways. Add debug messages to these cases, so we're never completely silent on failure. Signed-off-by: Andrew Deason --- Changes since v1: - new in v2 qga/commands-posix.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --g

[PATCH v2 1/5] qga/commands-posix: Use getifaddrs when available

2022-04-13 Thread Andrew Deason
Currently, commands-posix.c assumes that getifaddrs() is only available on Linux, and so the related guest agent command guest-network-get-interfaces is only implemented for #ifdef __linux__. This function does exist on other platforms, though, such as Solaris. So, add a meson check for getifaddrs(

[PATCH v2 0/5] qga: Implement shutdown/network-get-interfaces on Solaris

2022-04-13 Thread Andrew Deason
This implements the guest agent commands guest-network-get-interfaces and guest-shutdown on Solaris. The implementation for these on Solaris is very similar as on Linux, since both platforms have a similar getifaddrs() and a 'shutdown' command. Changes since v1: - Add debug messages for failing to

[PATCH v2 3/5] qga/commands-posix: Fix listing ifaces for Solaris

2022-04-13 Thread Andrew Deason
The code for guest-network-get-interfaces needs a couple of small adjustments for Solaris: - The results from SIOCGIFHWADDR are documented as being in ifr_addr, not ifr_hwaddr (ifr_hwaddr doesn't exist on Solaris). - The implementation of guest_get_network_stats is Linux-specific, so hide it

[PATCH v2 5/5] qga/commands-posix: 'guest-shutdown' for Solaris

2022-04-13 Thread Andrew Deason
On Solaris, instead of the -P, -H, and -r flags, we need to provide the target init state to the 'shutdown' command: state 5 is poweroff, 0 is halt, and 6 is reboot. We also need to pass -g0 to avoid the default 60-second delay, and -y to avoid a confirmation prompt. Implement this logic under an

[PATCH v2 2/5] qga/commands-posix: Fix iface hw address detection

2022-04-13 Thread Andrew Deason
Since its introduction in commit 3424fc9f16a1 ("qemu-ga: add guest-network-get-interfaces command"), guest-network-get-interfaces seems to check if a given interface has a hardware address by checking 'ifa->ifa_flags & SIOCGIFHWADDR'. But ifa_flags is a field for IFF_* flags (IFF_UP, IFF_LOOPBACK,

[PATCH] hw/arm/virt: impact of gic-version on max CPUs

2022-04-13 Thread Heinrich Schuchardt
Describe that the gic-version influences the maximum number of CPUs. Signed-off-by: Heinrich Schuchardt --- docs/system/arm/virt.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/system/arm/virt.rst b/docs/system/arm/virt.rst index 1544632b67..1af3f6a0a8 100644 ---

Re: [PATCH] target/riscv/pmp: fix NAPOT range computation overflow

2022-04-13 Thread Alistair Francis
On Sat, Apr 9, 2022 at 2:25 AM Nicolas Pitre wrote: > > There is an overflow with the current code where a pmpaddr value of > 0x1fff is decoded as sa=0 and ea=0 whereas it should be sa=0 and > ea=0x. > > Fix that by simplifying the computation. There is in fact no need for > ctz64() no

Re: [PATCH v9 12/14] target/riscv: rvk: add CSR support for Zkr

2022-04-13 Thread Alistair Francis
On Mon, Apr 11, 2022 at 2:46 PM Weiwei Li wrote: > > Hi, any comments on this patch or patchset? > > Currently, read-only instruction to access Seed CSR is checked as a > special case in helper_csrr as suggested in > > https://lists.nongnu.org/archive/html/qemu-riscv/2022-03/msg00146.html. Ah sor

Re: [PULL v2 29/35] hw/intc: Add RISC-V AIA APLIC device emulation

2022-04-13 Thread Alistair Francis
On Wed, Apr 13, 2022 at 12:53 AM Peter Maydell wrote: > > On Wed, 16 Feb 2022 at 08:43, Alistair Francis > wrote: > > > > From: Anup Patel > > > > The RISC-V AIA (Advanced Interrupt Architecture) defines a new > > interrupt controller for wired interrupts called APLIC (Advanced > > Platform Leve

Re: [PATCH v5 1/4] qapi/machine.json: Add cluster-id

2022-04-13 Thread Gavin Shan
Hi Yanan, On 4/13/22 7:49 PM, wangyanan (Y) wrote: On 2022/4/3 22:59, Gavin Shan wrote: This adds cluster-id in CPU instance properties, which will be used by arm/virt machine. Besides, the cluster-id is also verified or dumped in various spots:    * hw/core/machine.c::machine_set_cpu_numa_nod

Re: [PATCH v5 2/4] hw/arm/virt: Consider SMP configuration in CPU topology

2022-04-13 Thread Gavin Shan
Hi Yanan, On 4/13/22 8:39 PM, wangyanan (Y) wrote: On 2022/4/3 22:59, Gavin Shan wrote: Currently, the SMP configuration isn't considered when the CPU topology is populated. In this case, it's impossible to provide the default CPU-to-NUMA mapping or association based on the socket ID of the giv

Re: [PATCH v5 4/4] hw/acpi/aml-build: Use existing CPU topology to build PPTT table

2022-04-13 Thread Gavin Shan
Hi Igor, On 4/13/22 9:52 PM, Igor Mammedov wrote: On Sun, 3 Apr 2022 22:59:53 +0800 Gavin Shan wrote: When the PPTT table is built, the CPU topology is re-calculated, but it's unecessary because the CPU topology has been populated in virt_possible_cpu_arch_ids() on arm/virt machine. This re

fwcfg: Wrong callback behaviour after fw_cfg_modify_bytes_read

2022-04-13 Thread Christian A. Ehrhardt
Hi, there's a long story behind this (see below). However, I'll start with the result: fw_cfg_modify_bytes_read() sets the callback data of an existing fw_cfg file to NULL but leaves the actual callbacks in place. Additioanlly, this function sets ->allow_write to false for no good reason AFAICS

RE: [PATCH V2 0/4] COLO net and runstate bugfix/optimization

2022-04-13 Thread Zhang, Chen
No update for a while. Ping... Thanks Chen > -Original Message- > From: Zhang, Chen > Sent: Friday, April 1, 2022 11:47 AM > To: Jason Wang ; Li Zhijian > Cc: Zhang, Chen ; qemu-dev de...@nongnu.org> > Subject: [PATCH V2 0/4] COLO net and runstate bugfix/optimization > > This series f

Re: [PATCH v9 12/14] target/riscv: rvk: add CSR support for Zkr

2022-04-13 Thread Weiwei Li
Thanks for your comments. 在 2022/4/14 上午7:57, Alistair Francis 写道: On Mon, Apr 11, 2022 at 2:46 PM Weiwei Li wrote: Hi, any comments on this patch or patchset? Currently, read-only instruction to access Seed CSR is checked as a special case in helper_csrr as suggested in https://lists.nongnu

Re: [PATCH v5 2/4] hw/arm/virt: Consider SMP configuration in CPU topology

2022-04-13 Thread wangyanan (Y)
On 2022/4/14 8:08, Gavin Shan wrote: Hi Yanan, On 4/13/22 8:39 PM, wangyanan (Y) wrote: On 2022/4/3 22:59, Gavin Shan wrote: Currently, the SMP configuration isn't considered when the CPU topology is populated. In this case, it's impossible to provide the default CPU-to-NUMA mapping or associa

  1   2   >