[PATCH] linux-user/ppc: Narrow type of ccr in save_user_regs

2022-04-01 Thread Richard Henderson
Coverity warns that we shift a 32-bit value by N, and then accumulate it into a 64-bit type (target_ulong on ppc64). The ccr is always 8 * 4-bit fields, and thus is always a 32-bit quantity; narrow the type to avoid the warning. Fixes: Coverity CID 1487223 Signed-off-by: Richard Henderson --- l

[PATCH] target/s390x: Fix the accumulation of ccm in op_icm

2022-04-01 Thread Richard Henderson
Coverity rightly reports that 0xff << pos can overflow. This would affect the ICMH instruction. Fixes: Coverity CID 1487161 Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/tcg/translate.c b/target/

[PATCH 0/1] xlnx-bbram: hw/nvram: Fix Coverity CID 1487233

2022-04-01 Thread Tong Ho
This patch addresses Coverity CID 1487233 by adding the required initialiation of a local variable of type Error *. Tong Ho (1): xlnx-bbram: hw/nvram: Fix uninitialized Error * hw/nvram/xlnx-bbram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.25.1

Re: [PATCH] ppc/pnv: Fix number of registers in the PCIe controller on POWER9

2022-04-01 Thread Daniel Henrique Barboza
On 4/1/22 06:19, Frederic Barrat wrote: The spec defines 3 registers, even though only index 0 and 2 are valid on POWER9. The same model is used on POWER10. Register 1 is defined there but we currently don't use it in skiboot. So we can keep reporting an error on write. Reported by Coverity (

Re: [PATCH v5 00/13] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-04-01 Thread Andy Lutomirski
On Fri, Apr 1, 2022, at 7:59 AM, Quentin Perret wrote: > On Thursday 31 Mar 2022 at 09:04:56 (-0700), Andy Lutomirski wrote: > To answer your original question about memory 'conversion', the key > thing is that the pKVM hypervisor controls the stage-2 page-tables for > everyone in the system, all

Re: [PATCH 1/3] softfloat: Fix declaration of partsN_compare

2022-04-01 Thread Richard Henderson
On 4/1/22 12:12, Peter Maydell wrote: The types are compatible, but it's weird that the compiler doesn't warn that the prototype and definition are different types: it seems like the kind of "technically valid but usually a bug" that a warning would be nice for. Good point. Submitted https://g

Re: [PATCH v3 0/3] block/dirty-bitmaps: fix and improve bitmap merge

2022-04-01 Thread Eric Blake
On Fri, Apr 01, 2022 at 01:08:01PM +0300, Vladimir Sementsov-Ogievskiy wrote: > v3: rebase on master, one patch is already merged. > > Vladimir Sementsov-Ogievskiy (3): > block: block_dirty_bitmap_merge(): fix error path > block: improve block_dirty_bitmap_merge(): don't allocate extra bitmap

Re: [PATCH 4/7] virtio: don't read pending event on host notifier if disabled

2022-04-01 Thread Si-Wei Liu
On 3/31/2022 1:36 AM, Jason Wang wrote: On Thu, Mar 31, 2022 at 12:41 AM Si-Wei Liu wrote: On 3/30/2022 2:14 AM, Jason Wang wrote: On Wed, Mar 30, 2022 at 2:33 PM Si-Wei Liu wrote: Previous commit prevents vhost-user and vhost-vdpa from using userland vq handler via disable_ioeventfd_ha

[PATCH 1/1] xlnx-bbram: hw/nvram: Fix uninitialized Error *

2022-04-01 Thread Tong Ho
This adds required initialization of Error * variable. Signed-off-by: Tong Ho --- hw/nvram/xlnx-bbram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/nvram/xlnx-bbram.c b/hw/nvram/xlnx-bbram.c index b70828e5bf..6ed32adad9 100644 --- a/hw/nvram/xlnx-bbram.c +++ b/hw/nvram

Re: [PATCH v3 0/3] block/dirty-bitmaps: fix and improve bitmap merge

2022-04-01 Thread Vladimir Sementsov-Ogievskiy
01.04.2022 23:17, Eric Blake wrote: On Fri, Apr 01, 2022 at 01:08:01PM +0300, Vladimir Sementsov-Ogievskiy wrote: v3: rebase on master, one patch is already merged. Vladimir Sementsov-Ogievskiy (3): block: block_dirty_bitmap_merge(): fix error path block: improve block_dirty_bitmap_merge(

Re: [PATCH] linux-user/ppc: Narrow type of ccr in save_user_regs

2022-04-01 Thread Cédric Le Goater
On 4/1/22 21:16, Richard Henderson wrote: Coverity warns that we shift a 32-bit value by N, and then accumulate it into a 64-bit type (target_ulong on ppc64). The ccr is always 8 * 4-bit fields, and thus is always a 32-bit quantity; narrow the type to avoid the warning. Fixes: Coverity CID 1487

Re: [PATCH 1/7] virtio-net: align ctrl_vq index for non-mq guest for vhost_vdpa

2022-04-01 Thread Si-Wei Liu
On 3/31/2022 1:39 AM, Jason Wang wrote: On Wed, Mar 30, 2022 at 11:48 PM Si-Wei Liu wrote: On 3/30/2022 2:00 AM, Jason Wang wrote: On Wed, Mar 30, 2022 at 2:33 PM Si-Wei Liu wrote: With MQ enabled vdpa device and non-MQ supporting guest e.g. booting vdpa with mq=on over OVMF of single v

[RFC PATCH v1 1/8] qapi: golang: Generate qapi's enum types in Go

2022-04-01 Thread Victor Toso
This patch handles QAPI enum types and generates its equivalent in Go. The highlights of this implementation are: 1. For each QAPI enum, we will define an int32 type in Go to be the assigned type of this specific enum 2. While in the Go codebase we can use the generated enum values, the sp

[RFC PATCH v1 0/8] qapi: add generator for Golang interface

2022-04-01 Thread Victor Toso
Hi, Happy 1st April. Not a joke :) /* ugh, took me too long to send */ This series is about adding a generator in scripts/qapi to produce Go data structures that can be used to communicate with QEMU over QMP. * Why Go? There are quite a few Go projects that interact with QEMU over QMP and they

[RFC PATCH v1 5/8] qapi: golang: Generate qapi's event types in Go

2022-04-01 Thread Victor Toso
This patch handles QAPI event types and generates data structures in Go that handles it. At the moment of this writing, it generates 51 structures (49 events) In Golang, each event is handled as a Go structure and there is no big difference, in the Go generated code, between what is a QAPI event

[RFC PATCH v1 2/8] qapi: golang: Generate qapi's alternate types in Go

2022-04-01 Thread Victor Toso
This patch handles QAPI alternate types and generates data structures in Go that handles it. At this moment, there are 5 alternates in qemu/qapi, they are: * BlockDirtyBitmapMergeSource * Qcow2OverlapChecks * BlockdevRef * BlockdevRefOrNull * StrOrNull Alternate types are similar to Union bu

[RFC PATCH v1 4/8] qapi: golang: Generate qapi's union types in Go

2022-04-01 Thread Victor Toso
This patch handles QAPI union types and generates the equivalent data structures and methods in Go to handle it. At the moment of this writing, it generates 67 structures. The QAPI union type can be summarized by its common members that are defined in a @base struct and a @value. The @value type

[RFC PATCH v1 7/8] qapi: golang: Add CommandResult type to Go

2022-04-01 Thread Victor Toso
This patch adds a struct type in Go that will handle return values for QAPI's command types. The return value of a Command is, encouraged to be, QAPI's complext types or an Array of those. The 'CommandResult' type acts in similar fashion to 'Event' and 'Command', in order to map the right return

[RFC PATCH v1 3/8] qapi: golang: Generate qapi's struct types in Go

2022-04-01 Thread Victor Toso
This patch handles QAPI struct types and generates the equivalent types in Go. At the time of this writing, it generates 375 structures. The highlights of this implementation are: 1. Generating an Go struct that requires a @base type, the @base type is embedded in this Go structure. Examp

[RFC PATCH v1 6/8] qapi: golang: Generate qapi's command types in Go

2022-04-01 Thread Victor Toso
This patch handles QAPI command types and generates data structures in Go that decodes from QMP JSON Object to Go data structure and vice versa. At the time of this writing, it generates 210 structures (208 commands) This is very similar to previous commit, that handles QAPI union types in Go. E

[RFC PATCH v1 8/8] qapi: golang: document skip function visit_array_types

2022-04-01 Thread Victor Toso
Signed-off-by: Victor Toso --- scripts/qapi/golang.py | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/qapi/golang.py b/scripts/qapi/golang.py index 5d3395514d..9a775d0691 100644 --- a/scripts/qapi/golang.py +++ b/scripts/qapi/golang.py @@ -321,7 +321,12 @@ def vi

Re: [PATCH v4] vdpa: reset the backend device in the end of vhost_net_stop()

2022-04-01 Thread Si-Wei Liu
On 3/31/2022 7:53 PM, Jason Wang wrote: On Fri, Apr 1, 2022 at 9:31 AM Michael Qiu wrote: Currently, when VM poweroff, it will trigger vdpa device(such as mlx bluefield2 VF) reset many times(with 1 datapath queue pair and one control queue, triggered 3 times), this leads to below issue: vho

Re: [PATCH 1/3] vhost: Refactor vhost_reset_device() in VhostOps

2022-04-01 Thread Si-Wei Liu
On 4/1/2022 4:06 AM, Michael Qiu wrote: Currently in vhost framwork, vhost_reset_device() is misnamed. Actually, it should be vhost_reset_owner(). In vhost user, it make compatible with reset device ops, but vhost kernel does not compatible with it, for vhost vdpa, it only implement reset dev

Re: [PATCH 2/3] vhost: add vhost_dev_reset()

2022-04-01 Thread Si-Wei Liu
On 4/1/2022 4:06 AM, Michael Qiu wrote: Not all vhost-user backends support ops->vhost_reset_device(). Instead of adding backend check and call backend ops directly, it's better to implement a function in vhost framework, so that it could hide vhost_ops details. SIgned-off-by: Michael Qiu --

Re: [PATCH] vhost: Fix bad return of descriptors to SVQ

2022-04-01 Thread Jason Wang
On Fri, Apr 1, 2022 at 3:31 PM Eugenio Perez Martin wrote: > > On Fri, Apr 1, 2022 at 4:30 AM Jason Wang wrote: > > > > On Fri, Apr 1, 2022 at 2:14 AM Eugenio Pérez wrote: > > > > > > Only the first one of them were properly enqueued back. > > > > > > Fixes: 100890f7ca ("vhost: Shadow virtqueue

Re: [PATCH 7/7] vhost-vdpa: backend feature should set only once

2022-04-01 Thread Jason Wang
On Fri, Apr 1, 2022 at 12:18 PM Si-Wei Liu wrote: > > > > On 3/31/2022 7:39 PM, Jason Wang wrote: > > On Thu, Mar 31, 2022 at 5:20 PM Eugenio Perez Martin > > wrote: > >> On Thu, Mar 31, 2022 at 10:54 AM Jason Wang wrote: > >>> > >>> 在 2022/3/31 下午4:02, Eugenio Perez Martin 写道: > On Thu, Ma

Re: [PATCH v4] vdpa: reset the backend device in the end of vhost_net_stop()

2022-04-01 Thread Jason Wang
On Fri, Apr 1, 2022 at 11:22 AM Michael Qiu wrote: > > > > On 2022/4/1 10:53, Jason Wang wrote: > > On Fri, Apr 1, 2022 at 9:31 AM Michael Qiu wrote: > >> > >> Currently, when VM poweroff, it will trigger vdpa > >> device(such as mlx bluefield2 VF) reset many times(with 1 datapath > >> queue pair

Re: [PATCH V2 4/4] intel-iommu: PASID support

2022-04-01 Thread Jason Wang
On Fri, Apr 1, 2022 at 9:43 PM Yi Liu wrote: > > > > On 2022/3/29 12:54, Jason Wang wrote: > > > > 在 2022/3/28 下午4:45, Yi Liu 写道: > >> > >> > >> On 2022/3/21 13:54, Jason Wang wrote: > >>> This patch introduce ECAP_PASID via "x-pasid-mode". Based on the > >>> existing support for scalable mode, we

Re: [PATCH 4/7] virtio: don't read pending event on host notifier if disabled

2022-04-01 Thread Jason Wang
On Sat, Apr 2, 2022 at 4:37 AM Si-Wei Liu wrote: > > > > On 3/31/2022 1:36 AM, Jason Wang wrote: > > On Thu, Mar 31, 2022 at 12:41 AM Si-Wei Liu wrote: > >> > >> > >> On 3/30/2022 2:14 AM, Jason Wang wrote: > >>> On Wed, Mar 30, 2022 at 2:33 PM Si-Wei Liu wrote: > Previous commit prevents v

Re: [PATCH v3 2/4] hw/arm/virt: Fix CPU's default NUMA node ID

2022-04-01 Thread wangyanan (Y)
On 2022/3/23 15:24, Gavin Shan wrote: When CPU-to-NUMA association isn't explicitly provided by users, the default on is given by mc->get_default_cpu_node_id(). However, s/on/one the CPU topology isn't fully considered in the default association and this causes CPU topology broken warnings on

Re: [PATCH 1/3] vhost: Refactor vhost_reset_device() in VhostOps

2022-04-01 Thread Michael Qiu
On 2022/4/2 8:44, Si-Wei Liu wrote: On 4/1/2022 4:06 AM, Michael Qiu wrote: Currently in vhost framwork, vhost_reset_device() is misnamed. Actually, it should be vhost_reset_owner(). In vhost user, it make compatible with reset device ops, but vhost kernel does not compatible with it, for

Re: [PATCH 1/7] virtio-net: align ctrl_vq index for non-mq guest for vhost_vdpa

2022-04-01 Thread Jason Wang
On Sat, Apr 2, 2022 at 6:32 AM Si-Wei Liu wrote: > > > > On 3/31/2022 1:39 AM, Jason Wang wrote: > > On Wed, Mar 30, 2022 at 11:48 PM Si-Wei Liu wrote: > >> > >> > >> On 3/30/2022 2:00 AM, Jason Wang wrote: > >>> On Wed, Mar 30, 2022 at 2:33 PM Si-Wei Liu wrote: > With MQ enabled vdpa devic

Re: [PATCH v2 0/4] Dirty ring and auto converge optimization

2022-04-01 Thread Chongyun Wu
Thanks for review. On 4/1/2022 9:13 PM, Peter Xu wrote: Chongyun, On Mon, Mar 28, 2022 at 09:32:10AM +0800, wuc...@chinatelecom.cn wrote: From: Chongyun Wu v2: -patch 1: remove patch_1 v1: -rebase to qemu/master Overview This series of patches is to optimize the performance of

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

2022-04-01 Thread wangyanan (Y)
Hi Gavin, On 2022/3/23 15:24, 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 config

Re: [PATCH v4] vdpa: reset the backend device in the end of vhost_net_stop()

2022-04-01 Thread Jason Wang
Adding Michael. On Sat, Apr 2, 2022 at 7:08 AM Si-Wei Liu wrote: > > > > On 3/31/2022 7:53 PM, Jason Wang wrote: > > On Fri, Apr 1, 2022 at 9:31 AM Michael Qiu wrote: > >> Currently, when VM poweroff, it will trigger vdpa > >> device(such as mlx bluefield2 VF) reset many times(with 1 datapath >

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

2022-04-01 Thread wangyanan (Y)
On 2022/3/30 20:50, Igor Mammedov wrote: On Sat, 26 Mar 2022 02:49:59 +0800 Gavin Shan wrote: Hi Igor, On 3/25/22 9:19 PM, Igor Mammedov wrote: On Wed, 23 Mar 2022 15:24:35 +0800 Gavin Shan wrote: Currently, the SMP configuration isn't considered when the CPU topology is populated. In this

Re: [PATCH v5 3/4] hw/intc/exynos4210: replace 'qemu_split_irq' in combiner and gic

2022-04-01 Thread Zongyuan Li
On Fri, Apr 1, 2022 at 9:35 PM Peter Maydell wrote: > > On Thu, 24 Mar 2022 at 18:16, Zongyuan Li wrote: > > > > Signed-off-by: Zongyuan Li > > --- > > hw/arm/exynos4210.c | 26 +++ > > hw/intc/exynos4210_combiner.c | 81 +++ > > hw/intc/exynos4

Re: [PATCH 1/3] vhost: Refactor vhost_reset_device() in VhostOps

2022-04-01 Thread Jason Wang
在 2022/4/1 下午7:06, Michael Qiu 写道: Currently in vhost framwork, vhost_reset_device() is misnamed. Actually, it should be vhost_reset_owner(). In vhost user, it make compatible with reset device ops, but vhost kernel does not compatible with it, for vhost vdpa, it only implement reset device ac

Re: [PATCH v4] vdpa: reset the backend device in the end of vhost_net_stop()

2022-04-01 Thread Michael Qiu
On 2022/4/2 9:48, Jason Wang wrote: On Fri, Apr 1, 2022 at 11:22 AM Michael Qiu wrote: On 2022/4/1 10:53, Jason Wang wrote: On Fri, Apr 1, 2022 at 9:31 AM Michael Qiu wrote: Currently, when VM poweroff, it will trigger vdpa device(such as mlx bluefield2 VF) reset many times(with 1 dat

Re: [PATCH v4] vdpa: reset the backend device in the end of vhost_net_stop()

2022-04-01 Thread Michael Qiu
On 2022/4/2 10:20, Jason Wang wrote: Adding Michael. On Sat, Apr 2, 2022 at 7:08 AM Si-Wei Liu wrote: On 3/31/2022 7:53 PM, Jason Wang wrote: On Fri, Apr 1, 2022 at 9:31 AM Michael Qiu wrote: Currently, when VM poweroff, it will trigger vdpa device(such as mlx bluefield2 VF) reset man

Re: [PATCH 1/3] vhost: Refactor vhost_reset_device() in VhostOps

2022-04-01 Thread Michael Qiu
On 2022/4/2 10:38, Jason Wang wrote: 在 2022/4/1 下午7:06, Michael Qiu 写道: Currently in vhost framwork, vhost_reset_device() is misnamed. Actually, it should be vhost_reset_owner(). In vhost user, it make compatible with reset device ops, but vhost kernel does not compatible with it, for vhost

<    1   2   3