[PULL 55/57] target/loongarch: Implement xvld xvst

2023-09-20 Thread Song Gao
This patch includes: - XVLD[X], XVST[X]; - XVLDREPL.{B/H/W/D}; - XVSTELM.{B/H/W/D}. Signed-off-by: Song Gao Reviewed-by: Richard Henderson Message-Id: <20230914022645.1151356-56-gaos...@loongson.cn> --- target/loongarch/insns.decode | 18 ++ target/loongarch/disas.c

Re: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Zhu, Lingshan
On 9/20/2023 2:33 PM, Chen, Jiqian wrote: Hi Lingshan, On 2023/9/20 13:59, Zhu, Lingshan wrote: On 9/19/2023 8:31 PM, Michael S. Tsirkin wrote: On Tue, Sep 19, 2023 at 07:42:42PM +0800, Jiqian Chen wrote: When guest vm does S3, Qemu will reset and clear some things of virtio devices, but

Re: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Zhu, Lingshan
On 9/20/2023 2:58 PM, Parav Pandit wrote: From: Chen, Jiqian Sent: Wednesday, September 20, 2023 12:03 PM If driver write 0 to reset device, can the SUSPEND bit be cleared? It must as reset operation, resets everything else and so the suspend too. (pci_pm_resume->virtio_pci_restore->virtio

RE: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Parav Pandit
> From: Zhu, Lingshan > Sent: Wednesday, September 20, 2023 12:37 PM > > The problem to overcome in [1] is, resume operation needs to be synchronous > as it involves large part of context to resume back, and hence just > asynchronously setting DRIVER_OK is not enough. > > The sw must verify back

Re: [PATCH v2 03/12] vfio: Collect container iova range info

2023-09-20 Thread Eric Auger
Hi Alex, On 9/19/23 17:44, Alex Williamson wrote: > On Wed, 13 Sep 2023 10:01:38 +0200 > Eric Auger wrote: > >> Collect iova range information if VFIO_IOMMU_TYPE1_INFO_CAP_IOVA_RANGE >> capability is supported. >> >> This allows to propagate the information though the IOMMU MR >> set_iova_ranges(

Re: [virtio-comment] Re: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Chen, Jiqian
Hi Lingshan, On 2023/9/20 14:58, Zhu, Lingshan wrote: > > > On 9/20/2023 2:33 PM, Chen, Jiqian wrote: >> Hi Lingshan, >> >> On 2023/9/20 13:59, Zhu, Lingshan wrote: >>> >>> On 9/19/2023 8:31 PM, Michael S. Tsirkin wrote: On Tue, Sep 19, 2023 at 07:42:42PM +0800, Jiqian Chen wrote: > Whe

Re: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Chen, Jiqian
Hi Lingshan, It seems you reply to the wrong email thread. They are not related to my patch. On 2023/9/20 15:06, Zhu, Lingshan wrote: > > > On 9/20/2023 2:58 PM, Parav Pandit wrote: >>> From: Chen, Jiqian >>> Sent: Wednesday, September 20, 2023 12:03 PM >>> If driver write 0 to reset device, ca

Re: [PATCH v2 06/12] range: Introduce range_inverse_array()

2023-09-20 Thread Eric Auger
Hi Alex, On 9/19/23 18:29, Alex Williamson wrote: > On Wed, 13 Sep 2023 10:01:41 +0200 > Eric Auger wrote: > >> This helper reverses an array of regions, turning original >> regions into holes and original holes into actual regions, >> covering the whole UINT64_MAX span. >> >> Signed-off-by: Eric

Re: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Zhu, Lingshan
On 9/20/2023 3:10 PM, Parav Pandit wrote: From: Zhu, Lingshan Sent: Wednesday, September 20, 2023 12:37 PM The problem to overcome in [1] is, resume operation needs to be synchronous as it involves large part of context to resume back, and hence just asynchronously setting DRIVER_OK is not

Re: [PATCH v2 12/12] vfio: Remove 64-bit IOVA address space assumption

2023-09-20 Thread Eric Auger
Hi Alex, On 9/19/23 19:22, Alex Williamson wrote: > On Wed, 13 Sep 2023 10:01:47 +0200 > Eric Auger wrote: > >> Now we retrieve the usable IOVA ranges from the host, >> we now the physical IOMMU aperture and we can remove >> the assumption of 64b IOVA space when calling >> vfio_host_win_add(). >>

Re: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Zhu, Lingshan
On 9/20/2023 3:24 PM, Chen, Jiqian wrote: Hi Lingshan, It seems you reply to the wrong email thread. They are not related to my patch. These reply to Parva's comments. @Parva, if you want to discuss more about live migration, please reply in my thread, lets don't flood here. On 2023/9/20 1

Re: [RFC PATCH v2 03/21] HostMem: Add private property and associate it with RAM_KVM_GMEM

2023-09-20 Thread Markus Armbruster
Xiaoyao Li writes: > On 9/19/2023 5:46 PM, Markus Armbruster wrote: >> Xiaoyao Li writes: >> >>> From: Isaku Yamahata >>> >>> Add a new property "private" to memory backends. When it's set to true, >>> it indicates the RAMblock of the backend also requires kvm gmem. >> Can you add a brief expl

RE: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Parav Pandit
> From: Zhu, Lingshan > Sent: Wednesday, September 20, 2023 12:58 PM > > On 9/20/2023 3:10 PM, Parav Pandit wrote: > >> From: Zhu, Lingshan > >> Sent: Wednesday, September 20, 2023 12:37 PM > >>> The problem to overcome in [1] is, resume operation needs to be > >>> synchronous > >> as it invol

RE: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Parav Pandit
> From: Zhu, Lingshan > Sent: Wednesday, September 20, 2023 1:00 PM > > On 9/20/2023 3:24 PM, Chen, Jiqian wrote: > > Hi Lingshan, > > It seems you reply to the wrong email thread. They are not related to my > patch. > These reply to Parva's comments. > @Parva, if you want to discuss more about

Re: [PATCH v2 03/12] vfio: Collect container iova range info

2023-09-20 Thread Eric Auger
Hi Cédric, On 9/13/23 14:55, Cédric Le Goater wrote: > On 9/13/23 10:01, Eric Auger wrote: >> Collect iova range information if VFIO_IOMMU_TYPE1_INFO_CAP_IOVA_RANGE >> capability is supported. >> >> This allows to propagate the information though the IOMMU MR >> set_iova_ranges() callback so that

Re: [PATCH v2 03/12] vfio: Collect container iova range info

2023-09-20 Thread Eric Auger
Hi Alex, On 9/19/23 17:44, Alex Williamson wrote: > On Wed, 13 Sep 2023 10:01:38 +0200 > Eric Auger wrote: > >> Collect iova range information if VFIO_IOMMU_TYPE1_INFO_CAP_IOVA_RANGE >> capability is supported. >> >> This allows to propagate the information though the IOMMU MR >> set_iova_ranges(

Re: [PATCH v2 02/12] memory: Introduce memory_region_iommu_set_iova_ranges

2023-09-20 Thread Eric Auger
Hi Cedric, On 9/13/23 14:43, Cédric Le Goater wrote: > On 9/13/23 10:01, Eric Auger wrote: >> This helper will allow to convey information about valid >> IOVA ranges to virtual IOMMUS. >> >> Signed-off-by: Eric Auger > > > Reviewed-by: Cédric Le Goater Thanks! Eric > > Thanks, > > C. > >> --- >

Re: [virtio-comment] Re: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Zhu, Lingshan
On 9/20/2023 3:17 PM, Chen, Jiqian wrote: Hi Lingshan, On 2023/9/20 14:58, Zhu, Lingshan wrote: On 9/20/2023 2:33 PM, Chen, Jiqian wrote: Hi Lingshan, On 2023/9/20 13:59, Zhu, Lingshan wrote: On 9/19/2023 8:31 PM, Michael S. Tsirkin wrote: On Tue, Sep 19, 2023 at 07:42:42PM +0800, Jiqia

Re: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Zhu, Lingshan
On 9/20/2023 3:32 PM, Parav Pandit wrote: From: Zhu, Lingshan Sent: Wednesday, September 20, 2023 12:58 PM On 9/20/2023 3:10 PM, Parav Pandit wrote: From: Zhu, Lingshan Sent: Wednesday, September 20, 2023 12:37 PM The problem to overcome in [1] is, resume operation needs to be synchrono

Re: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Zhu, Lingshan
On 9/20/2023 3:35 PM, Parav Pandit wrote: From: Zhu, Lingshan Sent: Wednesday, September 20, 2023 1:00 PM On 9/20/2023 3:24 PM, Chen, Jiqian wrote: Hi Lingshan, It seems you reply to the wrong email thread. They are not related to my patch. These reply to Parva's comments. @Parva, if you w

RE: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Parav Pandit
> From: Zhu, Lingshan > Sent: Wednesday, September 20, 2023 1:16 PM [..] > > In my view, setting the DRIVER_OK is the signal regardless of hypervisor or > physical device. > > Hence the re-read is must. > Yes, as I said below, should verify by re-read. > > Thanks.

Re: Concerns regarding e17bebd049 ("dump: Set correct vaddr for ELF dump")

2023-09-20 Thread Jon Doron
Hi Stephen, Like you have said the reason is as I wrote in the commit message, without "fixing" the vaddr GDB is messing up mapping and working with the generated core file. This patch is almost 4 years old, perhaps some changes to GDB has been introduced to resolve this, I have not checked

RE: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Parav Pandit
> From: Zhu, Lingshan > Sent: Wednesday, September 20, 2023 1:17 PM > > This is not live or device migration. This is restoring the device context > initiated by the driver owning the device. > restore the device context should be done by the hypervisor before setting > DRIVER_OK and waking up t

Re: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Chen, Jiqian
Hi Lingshan, Please reply to your own email thread, below are not related to my patches. Thanks a lot. On 2023/9/20 15:47, Zhu, Lingshan wrote: > > > On 9/20/2023 3:35 PM, Parav Pandit wrote: >>> From: Zhu, Lingshan >>> Sent: Wednesday, September 20, 2023 1:00 PM >>> >>> On 9/20/2023 3:24 PM,

Re: [QEMU PATCH v5 10/13] virtio-gpu: Resource UUID

2023-09-20 Thread Huang Rui
On Sat, Sep 16, 2023 at 12:48:14AM +0800, Akihiko Odaki wrote: > On 2023/09/15 20:11, Huang Rui wrote: > > From: Antonio Caggiano > > > > Enable resource UUID feature and implement command resource assign UUID. > > This is done by introducing a hash table to map resource IDs to their > > UUIDs. >

Re: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Zhu, Lingshan
On 9/20/2023 3:51 PM, Parav Pandit wrote: From: Zhu, Lingshan Sent: Wednesday, September 20, 2023 1:17 PM This is not live or device migration. This is restoring the device context initiated by the driver owning the device. restore the device context should be done by the hypervisor before

RE: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Parav Pandit
Hi Jiquian, > From: Chen, Jiqian > Sent: Wednesday, September 20, 2023 1:24 PM > > Hi Lingshan, > Please reply to your own email thread, below are not related to my patches. > Thanks a lot. They are related to your patch. Both the patches have overlapping functionalities. You probably missed

Re: [QEMU PATCH v5 05/13] virtio-gpu: Configure context init for virglrenderer

2023-09-20 Thread Huang Rui
On Tue, Sep 19, 2023 at 04:17:43PM +0800, Marc-André Lureau wrote: > Hi > > On Fri, Sep 15, 2023 at 6:16 PM Huang Rui wrote: > > > > Configure context init feature flag for virglrenderer. > > > > Originally-by: Antonio Caggiano > > Signed-off-by: Huang Rui > > --- > > > > V4 -> V5: > > - In

[PATCH v5 4/5] vfio-user: Message-based DMA support

2023-09-20 Thread Mattias Nissler
Wire up support for DMA for the case where the vfio-user client does not provide mmap()-able file descriptors, but DMA requests must be performed via the VFIO-user protocol. This installs an indirect memory region, which already works for pci_dma_{read,write}, and pci_dma_map works thanks to the ex

[PATCH v5 0/5] Support message-based DMA in vfio-user server

2023-09-20 Thread Mattias Nissler
This series adds basic support for message-based DMA in qemu's vfio-user server. This is useful for cases where the client does not provide file descriptors for accessing system memory via memory mappings. My motivating use case is to hook up device models as PCIe endpoints to a hardware design. Th

[PATCH v5 3/5] Update subprojects/libvfio-user

2023-09-20 Thread Mattias Nissler
Brings in assorted bug fixes. The following are of particular interest with respect to message-based DMA support: * bb308a2 "Fix address calculation for message-based DMA" Corrects a bug in DMA address calculation. * 1569a37 "Pass server->client command over a separate socket pair" Adds suppo

[PATCH v5 1/5] softmmu: Per-AddressSpace bounce buffering

2023-09-20 Thread Mattias Nissler
Instead of using a single global bounce buffer, give each AddressSpace its own bounce buffer. The MapClient callback mechanism moves to AddressSpace accordingly. This is in preparation for generalizing bounce buffer handling further to allow multiple bounce buffers, with a total allocation limit c

[PATCH v5 5/5] vfio-user: Fix config space access byte order

2023-09-20 Thread Mattias Nissler
PCI config space is little-endian, so on a big-endian host we need to perform byte swaps for values as they are passed to and received from the generic PCI config space access machinery. Signed-off-by: Mattias Nissler --- hw/remote/vfio-user-obj.c | 4 ++-- 1 file changed, 2 insertions(+), 2 del

[PATCH v5 2/5] softmmu: Support concurrent bounce buffers

2023-09-20 Thread Mattias Nissler
When DMA memory can't be directly accessed, as is the case when running the device model in a separate process without shareable DMA file descriptors, bounce buffering is used. It is not uncommon for device models to request mapping of several DMA regions at the same time. Examples include: * net

Re: [virtio-comment] RE: [virtio-dev] Re: [virtio-comment] Re: [VIRTIO PCI PATCH v5 1/1] transport-pci: Add freeze_mode to virtio_pci_common_cfg

2023-09-20 Thread Chen, Jiqian
On 2023/9/20 15:56, Parav Pandit wrote: > Hi Jiquian, > >> From: Chen, Jiqian >> Sent: Wednesday, September 20, 2023 1:24 PM >> >> Hi Lingshan, >> Please reply to your own email thread, below are not related to my patches. >> Thanks a lot. > > They are related to your patch. > Both the patche

[PATCH] ramfb: avoid potential leak

2023-09-20 Thread marcandre . lureau
From: Marc-André Lureau If the fwcfg is written several times (without surface being displayed in the meantime), we may leak surfaces. Signed-off-by: Marc-André Lureau --- hw/display/ramfb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/display/ramfb.c b/hw/display/ramfb.c index 4cd90

[PATCH] ramfb: implement migration support

2023-09-20 Thread marcandre . lureau
From: Marc-André Lureau Implementing RAMFB migration seems quite straightforward. Unfortunately, current QEMU didn't block migration when RAMFB was used. Having an extra "ramfb" VMState doesn't seem to "break" migration forward compatibility. Surprisingly, missing sections are being ignored? Ba

Re: [QEMU PATCH v5 09/13] virtio-gpu: Handle resource blob commands

2023-09-20 Thread Huang Rui
On Tue, Sep 19, 2023 at 04:44:01PM +0800, Marc-André Lureau wrote: > Hi > > On Fri, Sep 15, 2023 at 3:14 PM Huang Rui wrote: > > > > From: Antonio Caggiano > > > > Support BLOB resources creation, mapping and unmapping by calling the > > new stable virglrenderer 0.10 interface. Only enabled when

RE: [PATCH v1 13/22] vfio: Add base container

2023-09-20 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Sent: Wednesday, September 20, 2023 1:24 AM >Subject: Re: [PATCH v1 13/22] vfio: Add base container > >On 8/30/23 12:37, Zhenzhong Duan wrote: >> From: Yi Liu >> >> Abstract the VFIOContainer to be a base object. It is supposed to be >> embed

Re: [QEMU PATCH v5 07/13] softmmu/memory: enable automatic deallocation of memory regions

2023-09-20 Thread Xenia Ragiadakou
On 20/9/23 01:18, Akihiko Odaki wrote: On 2023/09/19 23:21, Xenia Ragiadakou wrote: On 19/9/23 13:44, Akihiko Odaki wrote: On 2023/09/19 19:28, Xenia Ragiadakou wrote: On 15/9/23 18:11, Akihiko Odaki wrote: On 2023/09/15 20:11, Huang Rui wrote: From: Xenia Ragiadakou When the memory re

[PATCH 2/2] migration/rdma: zore out head.repeat to make the error more clear

2023-09-20 Thread Li Zhijian
From: Li Zhijian Previously, we got a confusion error that complains the RDMAControlHeader.repeat: qemu-system-x86_64: rdma: Too many requests in this message (3638950032).Bailing. Actually, it's caused by an unexpected RDMAControlHeader.type. After this patch, error will become: qemu-system-x8

[PATCH 1/2] migration: Fix rdma migration failed

2023-09-20 Thread Li Zhijian
From: Li Zhijian Destination will fail with: qemu-system-x86_64: rdma: Too many requests in this message (3638950032).Bailing. migrate with RDMA is different from tcp. RDMA has its own control message, and all traffic between RDMA_CONTROL_REGISTER_REQUEST and RDMA_CONTROL_REGISTER_FINISHED shou

Re: stable-8.1.1: which bug do we keep?

2023-09-20 Thread Daniel P . Berrangé
On Wed, Sep 20, 2023 at 07:46:36AM +0300, Michael Tokarev wrote: > Hi! > > I'm in somewhat doubt what to do with 8.1.1 release. > > There are 2 compelling issues, fixing one discovers the other. > > https://gitlab.com/qemu-project/qemu/-/issues/1864 > "x86 VM with TCG and SMP fails to start on 8

[PULL 03/22] parallels: fix memory leak in parallels_open()

2023-09-20 Thread Denis V. Lunev
We should free opts allocated through qemu_opts_create() at the end. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- block/parallels.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/parallels.c b/block/parallels.c index 428f72de1c..af7be427c9 100644 --- a/block/parall

[PULL 09/22] tests: ensure that image validation will not cure the corruption

2023-09-20 Thread Denis V. Lunev
Since commit cfce1091d55322789582480798a891cbaf66924e Author: Alexander Ivanov Date: Tue Jul 18 12:44:29 2023 +0200 parallels: Image repairing in parallels_open() there is a potential pit fall with calling qemu-io -c "read" The image is opened in read-write mode and thus coul

[PULL 05/22] parallels: return earler in fail_format branch in parallels_open()

2023-09-20 Thread Denis V. Lunev
We do not need to perform any deallocation/cleanup if wrong format is detected. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- block/parallels.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/parallels.c b/block/parallels.c index ae006e7fc7..12f38cf

[PULL 18/22] parallels: improve readability of allocate_clusters

2023-09-20 Thread Denis V. Lunev
Replace 'space' representing the amount of data to preallocate with 'bytes'. Rationale: * 'space' at each place is converted to bytes * the unit is more close to the variable name Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- block/parallels.c | 13 + 1 file chang

[PULL 22/22] tests: extend test 131 to cover availability of the write-zeroes

2023-09-20 Thread Denis V. Lunev
This patch contains test which minimally tests write-zeroes on top of working discard. The following checks are added: * write 2 clusters, write-zero to the first allocated cluster * write 2 cluster, write-zero to the half the first allocated cluster Signed-off-by: Denis V. Lunev Reviewed-by: Al

[PULL 11/22] parallels: add test which will validate data_off fixes through repair

2023-09-20 Thread Denis V. Lunev
We have only check through self-repair and that proven to be not enough. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- tests/qemu-iotests/tests/parallels-checks | 17 + tests/qemu-iotests/tests/parallels-checks.out | 18 ++ 2 files changed,

[PULL 12/22] parallels: collect bitmap of used clusters at open

2023-09-20 Thread Denis V. Lunev
If the operation is failed, we need to check image consistency if the problem is not about memory allocation. Bitmap adjustments in allocate_cluster are not performed yet. They worth to be separate. This was proven useful during debug of this series. Kept as is for future bissecting. It should be

[PULL 00/22] implement discard operation for Parallels images

2023-09-20 Thread Denis V. Lunev
The following changes since commit 4907644841e3200aea6475c0f72d3d987e9f3d93: Merge tag 'mem-2023-09-19' of https://github.com/davidhildenbrand/qemu into staging (2023-09-19 13:22:19 -0400) are available in the Git repository at: https://src.openvz.org/scm/~den/qemu.git tags/pull-parallels-2

[PULL 21/22] parallels: naive implementation of parallels_co_pwrite_zeroes

2023-09-20 Thread Denis V. Lunev
The zero flag is missed in the Parallels format specification. We can resort to discard if we have no backing file. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- block/parallels.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/block/parallels.c b/block/par

[PULL 16/22] parallels: update used bitmap in allocate_cluster

2023-09-20 Thread Denis V. Lunev
We should extend the bitmap if the file is extended and set the bit in the image used bitmap once the cluster is allocated. Sanity check at that moment also looks like a good idea. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- block/parallels.c | 14 ++ 1 file chan

[PULL 02/22] parallels: mark driver as supporting CBT

2023-09-20 Thread Denis V. Lunev
Parallels driver indeed support Parallels Dirty Bitmap Feature in read-only mode. The patch adds bdrv_supports_persistent_dirty_bitmap() callback which always return 1 to indicate that. This will allow to copy CBT from Parallels image with qemu-img. Note: read-write support is signalled through b

[PULL 08/22] parallels: create mark_used() helper which sets bit in used bitmap

2023-09-20 Thread Denis V. Lunev
This functionality is used twice already and next patch will add more code with it. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- block/parallels.c | 34 +- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/block/parallels.c b/block

[PULL 14/22] tests: test self-cure of parallels image with duplicated clusters

2023-09-20 Thread Denis V. Lunev
The test is quite similar with the original one for duplicated clusters. There is the only difference in the operation which should fix the image. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- tests/qemu-iotests/tests/parallels-checks | 36 +++ tests/qemu-i

[PULL 01/22] parallels: fix formatting in bdrv_parallels initialization

2023-09-20 Thread Denis V. Lunev
Old code is ugly and contains tabulations. There are no functional changes in this patch. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- block/parallels.c | 36 +++- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/block/parallels.

[PULL 07/22] parallels: refactor path when we need to re-check image in parallels_open

2023-09-20 Thread Denis V. Lunev
More conditions follows thus the check should be more scalable. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- block/parallels.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index bd26c8db63..a

[PULL 10/22] parallels: fix broken parallels_check_data_off()

2023-09-20 Thread Denis V. Lunev
Once we have repaired data_off field in the header we should update s->data_start which is calculated on the base of it. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- block/parallels.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/parallels.c b/block/parallels.c in

[PULL 20/22] tests: extend test 131 to cover availability of the discard operation

2023-09-20 Thread Denis V. Lunev
This patch contains test which minimally tests discard and new cluster allocation logic. The following checks are added: * write 2 clusters, discard the first allocated * write another cluster, check that the hole is filled * write 2 clusters, discard the first allocated, write 1 cluster at non-

[PULL 06/22] parallels: return earlier from parallels_open() function on error

2023-09-20 Thread Denis V. Lunev
At the beginning of the function we can return immediately until we really allocate s->header. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- block/parallels.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/block/parallels.c b/block/parallels

[PULL 04/22] parallels: invent parallels_opts_prealloc() helper to parse prealloc opts

2023-09-20 Thread Denis V. Lunev
This patch creates above mentioned helper and moves its usage to the beginning of parallels_open(). This simplifies parallels_open() a bit. The patch also ensures that we store prealloc_size on block driver state always in sectors. This makes code cleaner and avoids wrong opinion at the assignment

[PULL 19/22] parallels: naive implementation of parallels_co_pdiscard

2023-09-20 Thread Denis V. Lunev
* Discarding with backing stores is not supported by the format. * There is no buffering/queueing of the discard operation. * Only operations aligned to the cluster are supported. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- block/parallels.c | 46

[PULL 13/22] tests: fix broken deduplication check in parallels format test

2023-09-20 Thread Denis V. Lunev
Original check is broken as supposed reading from 2 different clusters results in read from the same file offset twice. This is definitely wrong. We should be sure that * the content of both clusters is correct after repair * clusters are at the different offsets after repair In order to check the

[PULL 15/22] parallels: accept multiple clusters in mark_used()

2023-09-20 Thread Denis V. Lunev
This would be useful in the next patch in allocate_clusters(). This change would not imply serious performance drawbacks as usually image is full of data or are at the end of the bitmap. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- block/parallels.c | 18 ++ 1

[PULL 17/22] parallels: naive implementation of allocate_clusters with used bitmap

2023-09-20 Thread Denis V. Lunev
The access to the bitmap is not optimized completely. Signed-off-by: Denis V. Lunev Reviewed-by: Alexander Ivanov --- block/parallels.c | 51 --- 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/block/parallels.c b/block/parallels.c ind

Re: [QEMU PATCH v5 10/13] virtio-gpu: Resource UUID

2023-09-20 Thread Huang Rui
On Tue, Sep 19, 2023 at 05:00:05PM +0800, Marc-André Lureau wrote: > Hi > > On Fri, Sep 15, 2023 at 3:14 PM Huang Rui wrote: > > > > From: Antonio Caggiano > > > > Enable resource UUID feature and implement command resource assign UUID. > > This is done by introducing a hash table to map resourc

Re: [PATCH v2 1/1] migration: skip poisoned memory pages on "ram saving" phase

2023-09-20 Thread Zhijian Li (Fujitsu)
On 15/09/2023 19:31, William Roche wrote: > On 9/15/23 05:13, Zhijian Li (Fujitsu) wrote: >> >> >> I'm okay with "RDMA isn't touched". >> BTW, could you share your reproducing program/hacking to poison the page, so >> that >> i am able to take a look the RDMA part later when i'm free. >> >> Not

Re: [QEMU PATCH v5 11/13] virtio-gpu: Support Venus capset

2023-09-20 Thread Huang Rui
On Tue, Sep 19, 2023 at 05:02:36PM +0800, Marc-André Lureau wrote: > Hi > > On Fri, Sep 15, 2023 at 3:14 PM Huang Rui wrote: > > > > From: Antonio Caggiano > > > > Add support for the Venus capset, which enables Vulkan support through > > the Venus Vulkan driver for virtio-gpu. > > > > Signed-of

Re: [QEMU PATCH v5 07/13] softmmu/memory: enable automatic deallocation of memory regions

2023-09-20 Thread Akihiko Odaki
On 2023/09/20 17:57, Xenia Ragiadakou wrote: On 20/9/23 01:18, Akihiko Odaki wrote: On 2023/09/19 23:21, Xenia Ragiadakou wrote: On 19/9/23 13:44, Akihiko Odaki wrote: On 2023/09/19 19:28, Xenia Ragiadakou wrote: On 15/9/23 18:11, Akihiko Odaki wrote: On 2023/09/15 20:11, Huang Rui wrote:

Re: [PATCH v23 01/20] CPU topology: extend with s390 specifics

2023-09-20 Thread Markus Armbruster
Nina Schoetterl-Glausch writes: > On Tue, 2023-09-19 at 14:47 +0200, Markus Armbruster wrote: >> Nina Schoetterl-Glausch writes: >> >> > From: Pierre Morel >> > >> > S390 adds two new SMP levels, drawers and books to the CPU >> > topology. >> > S390 CPUs have specific topology features like d

Re: [PATCH v1 02/22] Update linux-header to support iommufd cdev and hwpt alloc

2023-09-20 Thread Eric Auger
On 9/15/23 05:02, Duan, Zhenzhong wrote: > Hi Eric, > >> -Original Message- >> From: Eric Auger >> Sent: Thursday, September 14, 2023 10:46 PM >> Subject: Re: [PATCH v1 02/22] Update linux-header to support iommufd cdev and >> hwpt alloc >> >> Hi Zhenzhong, >> >> On 8/30/23 12:37, Zhenz

Re: [PATCH v23 01/20] CPU topology: extend with s390 specifics

2023-09-20 Thread Markus Armbruster
Nina Schoetterl-Glausch writes: > From: Pierre Morel > > S390 adds two new SMP levels, drawers and books to the CPU > topology. > S390 CPUs have specific topology features like dedication and > entitlement. These indicate to the guest information on host > vCPU scheduling and help the guest make

Re: [PATCH v4 2/3] i386: Explicitly ignore unsupported BUS_MCEERR_AO MCE on AMD guest

2023-09-20 Thread Joao Martins
On 18/09/2023 23:00, William Roche wrote: > Hi John, > > I'd like to put the emphasis on the fact that ignoring the SRAO error > for a VM is a real problem at least for a specific (rare) case I'm > currently working on: The VM migration. > > Context: > > - In the case of a poisoned page in the V

Re: [PATCH v23 03/20] target/s390x/cpu topology: handle STSI(15) and build the SYSIB

2023-09-20 Thread Markus Armbruster
Nina Schoetterl-Glausch writes: > From: Pierre Morel > > On interception of STSI(15.1.x) the System Information Block > (SYSIB) is built from the list of pre-ordered topology entries. > > Signed-off-by: Pierre Morel > Reviewed-by: Nina Schoetterl-Glausch > Co-developed-by: Nina Schoetterl-Glau

RE: [PATCH v1 02/22] Update linux-header to support iommufd cdev and hwpt alloc

2023-09-20 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Sent: Wednesday, September 20, 2023 7:05 PM >Subject: Re: [PATCH v1 02/22] Update linux-header to support iommufd cdev and >hwpt alloc > > > >On 9/15/23 05:02, Duan, Zhenzhong wrote: >> Hi Eric, >> >>> -Original Message- >>> From: Eric Auger

[PATCH v3 07/19] target/riscv/cpu.c: mark extensions arrays as 'const'

2023-09-20 Thread Daniel Henrique Barboza
We'll need to export these arrays to the accelerator classes in the next patches. Mark them as 'const' now because they should not be modified at runtime. Note that 'riscv_cpu_options' will also be exported, but can't be marked as 'const', because the properties are changed via qdev_property_add_s

[PATCH v3 04/19] target/riscv: move riscv_tcg_ops to tcg-cpu.c

2023-09-20 Thread Daniel Henrique Barboza
Move the remaining of riscv_tcg_ops now that we have a working realize() implementation. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Andrew Jones Reviewed-by: LIU Zhiwei --- target/riscv/cpu.c | 58 targe

[PATCH v3 03/19] target/riscv: move riscv_cpu_validate_set_extensions() to tcg-cpu.c

2023-09-20 Thread Daniel Henrique Barboza
This function is the core of the RISC-V validations for TCG CPUs, and it has a lot going on. Functions in cpu.c were made public to allow them to be used by the KVM accelerator class later on. 'cpu_cfg_ext_get_min_version()' is notably hard to move it to another file due to its dependency with isa

[PATCH v3 01/19] target/riscv: introduce TCG AccelCPUClass

2023-09-20 Thread Daniel Henrique Barboza
target/riscv/cpu.c needs to handle all possible accelerators (TCG and KVM at this moment) during both init() and realize() time. This forces us to resort to a lot of "if tcg" and "if kvm" throughout the code, which isn't wrong, but can get cluttered over time. Splitting acceleration specific code f

[PATCH v3 10/19] target/riscv: remove kvm-stub.c

2023-09-20 Thread Daniel Henrique Barboza
This file is not needed for some time now. Both kvm_riscv_reset_vcpu() and kvm_riscv_set_irq() have public declarations in kvm_riscv.h and are wrapped in 'if kvm_enabled()' blocks that the compiler will rip it out in non-KVM builds. Signed-off-by: Daniel Henrique Barboza --- target/riscv/kvm-stu

[PATCH v3 12/19] target/riscv: move KVM only files to kvm subdir

2023-09-20 Thread Daniel Henrique Barboza
Move the files to a 'kvm' dir to promote more code separation between accelerators and making our lives easier supporting build options such as --disable-tcg. Rename kvm.c to kvm-cpu.c to keep it in line with its TCG counterpart. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Andrew Jones

[PATCH v3 08/19] target/riscv: move riscv_cpu_add_kvm_properties() to kvm.c

2023-09-20 Thread Daniel Henrique Barboza
We'll introduce the KVM accelerator class with a 'cpu_instance_init' implementation that is going to be invoked during the common riscv_cpu_post_init() (via accel_cpu_instance_init()). This instance_init will execute KVM exclusive code that TCG doesn't care about, such as adding KVM specific proper

[PATCH v3 06/19] target/riscv: move 'host' CPU declaration to kvm.c

2023-09-20 Thread Daniel Henrique Barboza
This CPU only exists if we're compiling with KVM so move it to the kvm specific file. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Andrew Jones Reviewed-by: LIU Zhiwei --- target/riscv/cpu.c | 15 --- target/riscv/kvm.c | 21 +

[PATCH v3 17/19] target/riscv/tcg: move riscv_cpu_add_misa_properties() to tcg-cpu.c

2023-09-20 Thread Daniel Henrique Barboza
All code related to MISA TCG properties is also moved. At this point, all TCG properties handling is done in tcg-cpu.c, all KVM properties handling is done in kvm-cpu.c. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Andrew Jones --- target/riscv/cpu.c | 90 ---

[PATCH v3 18/19] target/riscv/cpu.c: export isa_edata_arr[]

2023-09-20 Thread Daniel Henrique Barboza
This array will be read by the TCG accel class, allowing it to handle priv spec verifications on its own. The array will remain here in cpu.c because it's also used by the riscv,isa string function. To export it we'll finish it with an empty element since ARRAY_SIZE() won't work outside of cpu.c.

[PATCH v3 14/19] target/riscv/cpu.c: export set_misa()

2023-09-20 Thread Daniel Henrique Barboza
We'll move riscv_init_max_cpu_extensions() to tcg-cpu.c in the next patch and set_misa() needs to be usable from there. Rename it to riscv_cpu_set_misa() and make it public. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Andrew Jones --- target/riscv/c

[PATCH v3 15/19] target/riscv/tcg: introduce tcg_cpu_instance_init()

2023-09-20 Thread Daniel Henrique Barboza
tcg_cpu_instance_init() will be the 'cpu_instance_init' impl for the TCG accelerator. It'll be called from within riscv_cpu_post_init(), via accel_cpu_instance_init(), similar to what happens with KVM. In fact, to preserve behavior, the implementation will be similar to what riscv_cpu_post_init() a

[PATCH v3 19/19] target/riscv/cpu: move priv spec functions to tcg-cpu.c

2023-09-20 Thread Daniel Henrique Barboza
Priv spec validation is TCG specific. Move it to the TCG accel class. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Andrew Jones --- target/riscv/cpu.c | 38 -- target/riscv/cpu.h | 2 -- target/riscv/tcg/tcg-cpu.c | 38

[PATCH v3 09/19] target/riscv: make riscv_add_satp_mode_properties() public

2023-09-20 Thread Daniel Henrique Barboza
This function is used for both accelerators. Make it public, and call it from kvm_riscv_cpu_add_kvm_properties(). This will make it easier to split KVM specific code for the KVM accelerator class in the next patch. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Andrew Jones Reviewed-by: LIU

[PATCH v3 05/19] target/riscv/cpu.c: add .instance_post_init()

2023-09-20 Thread Daniel Henrique Barboza
All generic CPUs call riscv_cpu_add_user_properties(). The 'max' CPU calls riscv_init_max_cpu_extensions(). Both can be moved to a common instance_post_init() callback, implemented in riscv_cpu_post_init(), called by all CPUs. The call order then becomes: riscv_cpu_init() -> cpu_init() of each CPU

[PATCH v3 13/19] target/riscv/kvm: do not use riscv_cpu_add_misa_properties()

2023-09-20 Thread Daniel Henrique Barboza
riscv_cpu_add_misa_properties() is being used to fill the missing KVM MISA properties but it is a TCG helper that was adapted to do so. We'll move it to tcg-cpu.c in the next patches, meaning that KVM needs to fill the remaining MISA properties on its own. Do not use riscv_cpu_add_misa_properties(

Re: [PATCH v1 04/22] vfio/common: Introduce vfio_container_add|del_section_window()

2023-09-20 Thread Eric Auger
Hi Zhenzhong, On 8/30/23 12:37, Zhenzhong Duan wrote: > From: Eric Auger > > Introduce helper functions that isolate the code used for > VFIO_SPAPR_TCE_v2_IOMMU. This code reliance is IOMMU backend > specific whereas the rest of the code in the callers, ie. this last sentence should be rephrased i

[PATCH v3 16/19] target/riscv/cpu.c: make misa_ext_cfgs[] 'const'

2023-09-20 Thread Daniel Henrique Barboza
The array isn't marked as 'const' because we're initializing their elements in riscv_cpu_add_misa_properties(), 'name' and 'description' fields. In a closer look we can see that we're not using these 2 fields after creating the MISA properties. And we can create the properties by using riscv_get_m

[PATCH v3 11/19] target/riscv: introduce KVM AccelCPUClass

2023-09-20 Thread Daniel Henrique Barboza
Add a KVM accelerator class like we did with TCG. The difference is that, at least for now, we won't be using a realize() implementation for this accelerator. We'll start by assiging kvm_riscv_cpu_add_kvm_properties(), renamed to kvm_cpu_instance_init(), as a 'cpu_instance_init' implementation. Ch

[PATCH v3 00/19] riscv: split TCG/KVM accelerators from cpu.c

2023-09-20 Thread Daniel Henrique Barboza
Hi, In this version we changed patch 10 (remove kvm-stub.c) as suggested by Phil to not include non-KVM stubs in kvm_riscv.h. A change in patch 05 requested by Zhiwei was also made. Patches based on Alistair's riscv-to-apply.next. Patches missing acks: patch 10 Changes from v2: - patch 05: -

[PATCH v3 02/19] target/riscv: move riscv_cpu_realize_tcg() to TCG::cpu_realizefn()

2023-09-20 Thread Daniel Henrique Barboza
riscv_cpu_realize_tcg() was added to allow TCG cpus to have a different realize() path during the common riscv_cpu_realize(), making it a good choice to start moving TCG exclusive code to tcg-cpu.c. Rename it to tcg_cpu_realizefn() and assign it as a implementation of accel::cpu_realizefn(). tcg_c

Re: [PATCH v23 08/20] qapi/s390x/cpu topology: set-cpu-topology qmp command

2023-09-20 Thread Markus Armbruster
Nina Schoetterl-Glausch writes: > From: Pierre Morel > > The modification of the CPU attributes are done through a monitor > command. > > It allows to move the core inside the topology tree to optimize > the cache usage in the case the host's hypervisor previously > moved the CPU. > > The same c

Re: [PATCH v3 2/4] hw/cxl: Use switch statements for read and write of cachemem registers

2023-09-20 Thread Jonathan Cameron via
On Wed, 20 Sep 2023 08:08:39 +0300 Michael Tokarev wrote: > 19.09.2023 12:34, Jonathan Cameron via wrote: > > Establishing that only register accesses of size 4 and 8 can occur > > using these functions requires looking at their callers. Make it > > easier to see that by using switch statements.

Re: [PATCH v13 6/9] gfxstream + rutabaga: add initial support for gfxstream

2023-09-20 Thread Akihiko Odaki
On 2023/08/29 9:36, Gurchetan Singh wrote: This adds initial support for gfxstream and cross-domain. Both features rely on virtio-gpu blob resources and context types, which are also implemented in this patch. gfxstream has a long and illustrious history in Android graphics paravirtualization.

  1   2   3   >