[PATCH v3 00/11] block/nvme: Rework error reporting

2021-09-02 Thread Philippe Mathieu-Daudé
(Series fully reviewed) Hi, This series contains various patches sent last year with review comments addressed, few more cleanups, and a new patch which remove the spurious "VFIO_MAP_DMA failed: No space left on device" now poping up since commit 15a730e7a. (it is the expected behavior, which is

[PATCH v3 09/11] util/vfio-helpers: Simplify qemu_vfio_dma_map() returning directly

2021-09-02 Thread Philippe Mathieu-Daudé
To simplify qemu_vfio_dma_map(): - reduce 'ret' (returned value) scope by returning errno directly, - remove the goto 'out' label. Reviewed-by: Klaus Jensen Signed-off-by: Philippe Mathieu-Daudé --- util/vfio-helpers.c | 23 ++- 1 file changed, 10 insertions(+), 13 deletions

[PATCH v3 02/11] util/vfio-helpers: Let qemu_vfio_verify_mappings() use error_report()

2021-09-02 Thread Philippe Mathieu-Daudé
Instead of displaying the error on stderr, use error_report() which also report to the monitor. Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Reviewed-by: Klaus Jensen Signed-off-by: Philippe Mathieu-Daudé --- util/vfio-helpers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH v3 01/11] block/nvme: Use safer trace format string

2021-09-02 Thread Philippe Mathieu-Daudé
Fix when building with -Wshorten-64-to-32: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] Reviewed-by: Klaus Jensen Signed-off-by: Philippe Mathieu-Daudé --- block/trace-events | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -

[PATCH v3 06/11] util/vfio-helpers: Pass Error handle to qemu_vfio_dma_map()

2021-09-02 Thread Philippe Mathieu-Daudé
Currently qemu_vfio_dma_map() displays errors on stderr. When using management interface, this information is simply lost. Pass qemu_vfio_dma_map() an Error** handle so it can propagate the error to callers. Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Reviewed-by: Klaus Jensen Signed-of

[PATCH v3 03/11] util/vfio-helpers: Replace qemu_mutex_lock() calls with QEMU_LOCK_GUARD

2021-09-02 Thread Philippe Mathieu-Daudé
Simplify qemu_vfio_dma_[un]map() handlers by replacing a pair of qemu_mutex_lock/qemu_mutex_unlock calls by the WITH_QEMU_LOCK_GUARD macro. Reviewed-by: Klaus Jensen Signed-off-by: Philippe Mathieu-Daudé --- util/vfio-helpers.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) dif

[PATCH v3 04/11] util/vfio-helpers: Remove unreachable code in qemu_vfio_dma_map()

2021-09-02 Thread Philippe Mathieu-Daudé
qemu_vfio_add_mapping() returns a pointer to an indexed entry in pre-allocated QEMUVFIOState::mappings[], thus can not be NULL. Remove the pointless check. Reviewed-by: Klaus Jensen Signed-off-by: Philippe Mathieu-Daudé --- util/vfio-helpers.c | 4 1 file changed, 4 deletions(-) diff --gi

[PATCH v3 07/11] util/vfio-helpers: Extract qemu_vfio_water_mark_reached()

2021-09-02 Thread Philippe Mathieu-Daudé
Extract qemu_vfio_water_mark_reached() for readability, and have it provide an error hint it its Error* handle. Suggested-by: Klaus Jensen Reviewed-by: Klaus Jensen Signed-off-by: Philippe Mathieu-Daudé --- util/vfio-helpers.c | 17 - 1 file changed, 16 insertions(+), 1 deletio

[PATCH v3 08/11] util/vfio-helpers: Use error_setg in qemu_vfio_find_[fixed/temp]_iova

2021-09-02 Thread Philippe Mathieu-Daudé
Both qemu_vfio_find_fixed_iova() and qemu_vfio_find_temp_iova() return an errno which is unused (or overwritten). Have them propagate eventual errors to callers, returning a boolean (which is what the Error API recommends, see commit e3fe3988d78 "error: Document Error API usage rules" for rationale

[PATCH v3 05/11] block/nvme: Have nvme_create_queue_pair() report errors consistently

2021-09-02 Thread Philippe Mathieu-Daudé
nvme_create_queue_pair() does not return a boolean value (indicating eventual error) but a pointer, and is inconsistent in how it fills the error handler. To fulfill callers expectations, always set an error message on failure. Reported-by: Auger Eric Reviewed-by: Klaus Jensen Signed-off-by: Phi

[PATCH v3 11/11] block/nvme: Only report VFIO error on failed retry

2021-09-02 Thread Philippe Mathieu-Daudé
We expect the first qemu_vfio_dma_map() to fail (indicating DMA mappings exhaustion, see commit 15a730e7a3a). Do not report the first failure as error, since we are going to flush the mappings and retry. This removes spurious error message displayed on the monitor: (qemu) c (qemu) qemu-kvm: V

[PATCH v3 10/11] util/vfio-helpers: Let qemu_vfio_do_mapping() propagate Error

2021-09-02 Thread Philippe Mathieu-Daudé
Pass qemu_vfio_do_mapping() an Error* argument so it can propagate any error to callers. Replace error_report() which only report to the monitor by the more generic error_setg_errno(). Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Reviewed-by: Klaus Jensen Signed-off-by: Philippe Mathieu-

Re: How to comminicate between two QOM model?

2021-09-02 Thread Klaus Jensen
On Sep 2 14:40, Duo jia wrote: > HI, > I has two QOM model,A and B, When A‘s register changed,B’s register will > should also be change . > > I dont konw how to change B's reg in A device . There are a couple of ways you can "plumb" devices and objects together. For devices you can use a qdev b

Re: [PATCH v1 2/3] io: Add zerocopy and errqueue

2021-09-02 Thread Leonardo Bras Soares Passos
Hello Daniel,. A few more comments: On Wed, Sep 1, 2021 at 5:51 AM Daniel P. Berrangé wrote: > > On Tue, Aug 31, 2021 at 04:27:04PM -0400, Peter Xu wrote: > > On Tue, Aug 31, 2021 at 01:57:33PM +0100, Daniel P. Berrangé wrote: > > > On Tue, Aug 31, 2021 at 08:02:38AM -0300, Leonardo Bras wrote: >

Re: [PATCH v3 08/11] util/vfio-helpers: Use error_setg in qemu_vfio_find_[fixed/temp]_iova

2021-09-02 Thread Klaus Jensen
On Sep 2 09:00, Philippe Mathieu-Daudé wrote: > Both qemu_vfio_find_fixed_iova() and qemu_vfio_find_temp_iova() > return an errno which is unused (or overwritten). Have them propagate > eventual errors to callers, returning a boolean (which is what the > Error API recommends, see commit e3fe3988d7

Re: [PATCH v1 3/3] migration: multifd: Enable zerocopy

2021-09-02 Thread Leonardo Bras Soares Passos
Hello Daniel, thanks for the feedback ! On Tue, Aug 31, 2021 at 10:17 AM Daniel P. Berrangé wrote: > > On Tue, Aug 31, 2021 at 08:02:39AM -0300, Leonardo Bras wrote: > > Call qio_channel_set_zerocopy(true) in the start of every multifd thread. > > > > Change the send_write() interface of multifd,

Re: [PATCH v1 3/3] migration: multifd: Enable zerocopy

2021-09-02 Thread Jason Wang
在 2021/9/1 下午11:35, Peter Xu 写道: On Wed, Sep 01, 2021 at 09:53:07AM +0100, Daniel P. Berrangé wrote: On Tue, Aug 31, 2021 at 04:29:09PM -0400, Peter Xu wrote: On Tue, Aug 31, 2021 at 02:16:42PM +0100, Daniel P. Berrangé wrote: On Tue, Aug 31, 2021 at 08:02:39AM -0300, Leonardo Bras wrote: C

Re: [PATCH v1 3/3] migration: multifd: Enable zerocopy

2021-09-02 Thread Leonardo Bras Soares Passos
Hello Peter, thank you for this feedback! On Tue, Aug 31, 2021 at 5:29 PM Peter Xu wrote: > Yes it would be great to be a migration capability in parallel to multifd. At > initial phase if it's easy to be implemented on multi-fd only, we can add a > dependency between the caps. In the future we

Re: [PATCH] tcg/arm: Increase stack alignment for function generation

2021-09-02 Thread Peter Maydell
On Wed, 1 Sept 2021 at 21:24, Richard W.M. Jones wrote: > > On Wed, Sep 01, 2021 at 09:17:07PM +0100, Peter Maydell wrote: > > On Wed, 1 Sept 2021 at 19:51, Richard W.M. Jones wrote: > > > > > > On Wed, Sep 01, 2021 at 07:41:21PM +0100, Peter Maydell wrote: > > > > Is the failure case short enoug

Re: [PATCH v1] kvm: unsigned datatype in ioctl wrapper

2021-09-02 Thread Peter Maydell
On Wed, 1 Sept 2021 at 22:34, Johannes Stoelp wrote: > > Change the data type of the ioctl _request_ argument from 'int' to > 'unsigned long' for the kvm ioctl wrappers. > > POSIX defines the request argument as 'int' but the glibc defines the ioctl > call as follows > int ioctl (int fd, unsig

Re: How does qemu detect the completion of interrupt execution?

2021-09-02 Thread Peter Maydell
On Thu, 2 Sept 2021 at 03:18, Duo jia wrote: > > Hi, >thank you for your response. >As you say >> >> "End of interrupt handling is entirely dependent on what the >> guest hardware being emulated is. Usually the guest software >> will indicate "interrupt handled" back to the interrupt >>

Re: [PATCH 4/4] vl: Prioritize realizations of devices

2021-09-02 Thread Igor Mammedov
On Thu, 26 Aug 2021 09:43:59 -0400 Peter Xu wrote: > On Thu, Aug 26, 2021 at 01:36:29PM +0200, Igor Mammedov wrote: > > On Thu, 26 Aug 2021 10:01:01 +0200 > > Markus Armbruster wrote: > > > > > Peter Xu writes: > > > > > > > On Wed, Aug 25, 2021 at 05:50:23PM -0400, Peter Xu wrote: >

Re: [PATCH v5 4/4] hw/arm/virt: Add PL330 DMA controller and connect with SMMU v3

2021-09-02 Thread Eric Auger
Hi, On 9/2/21 8:46 AM, Li, Chunming wrote: > Hi, > >> -Original Message- >> From: Eric Auger [mailto:eric.au...@redhat.com] >> Sent: Wednesday, September 01, 2021 6:23 PM >> To: Li, Chunming; chunming; peter.mayd...@linaro.org >> Cc: qemu-...@nongnu.org; qemu-devel@nongnu.org; Wen, Jianxia

Re: [PULL 00/51] target-arm queue

2021-09-02 Thread Peter Maydell
On Wed, 1 Sept 2021 at 11:36, Peter Maydell wrote: > > The following changes since commit ec397e90d21269037280633b6058d1f280e27667: > > Merge remote-tracking branch > 'remotes/alistair/tags/pull-riscv-to-apply-20210901-2' into staging > (2021-09-01 08:33:02 +0100) > > are available in the Git

Re: [PATCH v1 3/3] migration: multifd: Enable zerocopy

2021-09-02 Thread Leonardo Bras Soares Passos
A few more comments on this one: On Wed, Sep 1, 2021 at 12:44 PM Daniel P. Berrangé wrote: > > > From the safe side we may want to only enable one of them until we prove > > they'll work together I guess.. > > MPTCP is good when we're network limited for migration > > KTLS will be good when we're

Re: [PATCH] tcg/arm: Increase stack alignment for function generation

2021-09-02 Thread Richard W.M. Jones
On Thu, Sep 02, 2021 at 08:36:56AM +0100, Peter Maydell wrote: > On Wed, 1 Sept 2021 at 21:24, Richard W.M. Jones wrote: > > > > On Wed, Sep 01, 2021 at 09:17:07PM +0100, Peter Maydell wrote: > > > On Wed, 1 Sept 2021 at 19:51, Richard W.M. Jones > > > wrote: > > > > > > > > On Wed, Sep 01, 2021

Re: [PATCH v1 3/3] migration: multifd: Enable zerocopy

2021-09-02 Thread Leonardo Bras Soares Passos
Thanks for contributing Jason! On Thu, Sep 2, 2021 at 4:23 AM Jason Wang wrote: > > > 在 2021/9/1 下午11:35, Peter Xu 写道: > > On Wed, Sep 01, 2021 at 09:53:07AM +0100, Daniel P. Berrangé wrote: > >> On Tue, Aug 31, 2021 at 04:29:09PM -0400, Peter Xu wrote: > >>> On Tue, Aug 31, 2021 at 02:16:42PM +0

Re: [PATCH] coroutine: resize pool periodically instead of limiting size

2021-09-02 Thread Stefan Hajnoczi
On Wed, Sep 01, 2021 at 05:09:23PM +0100, Stefan Hajnoczi wrote: > It was reported that enabling SafeStack reduces IOPS significantly > (>25%) with the following fio benchmark on virtio-blk using a NVMe host > block device: > > # fio --rw=randrw --bs=4k --iodepth=64 --runtime=1m --direct=1 \ >

Re: [PATCH 0/1] hw/arm/aspeed: Add Fuji machine type

2021-09-02 Thread Cédric Le Goater
Hello, On 9/2/21 12:59 AM, p...@fb.com wrote: > From: Peter Delevoryas > > Adding a new Aspeed AST2600 machine type, uses MAC3 for ethernet1 and > UART1 for the serial console, which is different than the existing > ast2600-evb. Otherwise though, my usage so far hasn't required a > different set

[PATCH v6 3/4] hw/arm/virt: Update SMMU v3 creation to support non PCI/PCIe device connection

2021-09-02 Thread chunming
From: chunming . Add "smmuv3_sidmap" to set non PCI/PCIe devices SID value . Pass non PCI/PCIe devices SID value to SMMU v3 model creation Signed-off-by: chunming --- hw/arm/virt.c | 14 ++ include/hw/arm/virt.h | 1 + 2 files changed, 15 insertions(+) diff --git a/hw

[PATCH v6 2/4] hw/arm/smmuv3: Update CFGI commands to support non PCI/PCIe devices

2021-09-02 Thread chunming
From: chunming "smmu_iommu_mr" function can't get MR according to SID for non PCI/PCIe devices. Look up in the platform device list: peri_sdev_list for non PCI/PCIe devices. Signed-off-by: chunming --- hw/arm/smmuv3.c | 29 ++--- include/hw/arm/smmu-co

[PATCH v6 0/4] hw/arm/smmuv3: Support non PCI/PCIe devices

2021-09-02 Thread chunming
From: chunming The current SMMU v3 model only support PCI/PCIe devices, so we update it for non-PCI/PCIe devices. . Add independent IOMMU memory regions for non-PCI/PCIe devices . Add SID value property setting for non-PCI/PCIe devices . Add PL330 DMA controller into "virt" machine and con

[PATCH v6 1/4] hw/arm/smmuv3: Support non PCI/PCIe device connect with SMMU v3

2021-09-02 Thread chunming
From: chunming . Add peri-sid-map property to store non PCI/PCIe devices SID . Create IOMMU memory regions for non PCI/PCIe devices based on their SID . Update SID getting strategy for PCI/PCIe and non PCI/PCIe devices Signed-off-by: chunming --- hw/arm/smmuv3.c | 46 +++

[PATCH v6 4/4] hw/arm/virt: Add PL330 DMA controller and connect with SMMU v3

2021-09-02 Thread chunming
From: chunming . Store SMMU v3 device in virtual machine then non PCI/PCIe can get its memory region later . Add PL330 DMA controller to test SMMU v3 connection and function . The default SID for PL330 is 1 but we test other values, it works well Signed-off-by: chunming --- hw/arm/virt.

Re: [PATCH v1 3/3] migration: multifd: Enable zerocopy

2021-09-02 Thread Daniel P . Berrangé
On Thu, Sep 02, 2021 at 04:22:55AM -0300, Leonardo Bras Soares Passos wrote: > Hello Daniel, thanks for the feedback ! > > On Tue, Aug 31, 2021 at 10:17 AM Daniel P. Berrangé > wrote: > > > > On Tue, Aug 31, 2021 at 08:02:39AM -0300, Leonardo Bras wrote: > > > Call qio_channel_set_zerocopy(true)

RE: [PATCH v5 4/4] hw/arm/virt: Add PL330 DMA controller and connect with SMMU v3

2021-09-02 Thread Li, Chunming
Hi, > -Original Message- > From: Eric Auger [mailto:eric.au...@redhat.com] > Sent: Thursday, September 02, 2021 3:46 PM > To: Li, Chunming; chunming; peter.mayd...@linaro.org > Cc: qemu-...@nongnu.org; qemu-devel@nongnu.org; Wen, Jianxian; Liu, > Renwei > Subject: Re: [PATCH v5 4/4] hw/arm

Re: [PATCH v1 1/3] io: Enable write flags for QIOChannel

2021-09-02 Thread Leonardo Bras Soares Passos
Thanks for the feedback Eric! On Wed, Sep 1, 2021 at 5:54 PM Eric Blake wrote: > > On Tue, Aug 31, 2021 at 08:02:37AM -0300, Leonardo Bras wrote: > > Some syscalls used for writting, such as sendmsg(), accept flags that > > can modify their behavior, even allowing the usage of features such as >

Re: [PATCH 4/4] vl: Prioritize realizations of devices

2021-09-02 Thread Igor Mammedov
On Mon, 30 Aug 2021 15:02:53 -0400 Peter Xu wrote: > On Thu, Aug 26, 2021 at 09:43:59AM -0400, Peter Xu wrote: > > > > A simple state machine can track "has IOMMU" state. It has three states > > > > "no so far", "yes", and "no", and two events "add IOMMU" and "add device > > > > that needs to kn

Re: [PATCH v1 2/3] io: Add zerocopy and errqueue

2021-09-02 Thread Daniel P . Berrangé
On Thu, Sep 02, 2021 at 03:38:11AM -0300, Leonardo Bras Soares Passos wrote: > Hello Daniel, thank you for the feedback! > > Comments inline. > > On Tue, Aug 31, 2021 at 9:57 AM Daniel P. Berrangé > wrote: > > > > On Tue, Aug 31, 2021 at 08:02:38AM -0300, Leonardo Bras wrote: > > > MSG_ZEROCOPY

Re: [PATCH v1 3/3] migration: multifd: Enable zerocopy

2021-09-02 Thread Leonardo Bras Soares Passos
On Thu, Sep 2, 2021 at 5:21 AM Daniel P. Berrangé wrote: > > On Thu, Sep 02, 2021 at 04:22:55AM -0300, Leonardo Bras Soares Passos wrote: > > Hello Daniel, thanks for the feedback ! > > > > On Tue, Aug 31, 2021 at 10:17 AM Daniel P. Berrangé > > wrote: > > > > > > On Tue, Aug 31, 2021 at 08:02:3

Re: [PATCH v1 3/3] migration: multifd: Enable zerocopy

2021-09-02 Thread Daniel P . Berrangé
On Thu, Sep 02, 2021 at 05:52:15AM -0300, Leonardo Bras Soares Passos wrote: > On Thu, Sep 2, 2021 at 5:21 AM Daniel P. Berrangé wrote: > > > > On Thu, Sep 02, 2021 at 04:22:55AM -0300, Leonardo Bras Soares Passos wrote: > > > Hello Daniel, thanks for the feedback ! > > > > > > On Tue, Aug 31, 202

Re: [PATCH RFC 0/8] blockdev-replace

2021-09-02 Thread Vladimir Sementsov-Ogievskiy
ping 02.08.2021 21:54, Vladimir Sementsov-Ogievskiy wrote: Hi all! As a continuation of "Qemu block filter insertion/removal API" discussion, here is my proposal of blockdev-replace. The realization allows: - replace children of different parents: BDS, block devices, block exports - autom

Re: [RFC] qemu_cleanup: do vm_shutdown() before bdrv_drain_all_begin()

2021-09-02 Thread Vladimir Sementsov-Ogievskiy
ping 30.07.2021 17:29, Vladimir Sementsov-Ogievskiy wrote: That doesn't seem good to stop handling io when guest is still running. For example it leads to the following: After bdrv_drain_all_begin(), during vm_shutdown() scsi_dma_writev() calls blk_aio_pwritev(). As we are in drained section th

Re: [PATCH v1 2/3] io: Add zerocopy and errqueue

2021-09-02 Thread Leonardo Bras Soares Passos
On Thu, Sep 2, 2021 at 5:47 AM Daniel P. Berrangé wrote: > > On Thu, Sep 02, 2021 at 03:38:11AM -0300, Leonardo Bras Soares Passos wrote: > > Hello Daniel, thank you for the feedback! > > > > Comments inline. > > > > On Tue, Aug 31, 2021 at 9:57 AM Daniel P. Berrangé > > wrote: > > > > > > On Tu

[PATCH v2 2/8] i386: docs: Briefly describe KVM PV features

2021-09-02 Thread Vitaly Kuznetsov
KVM PV features don't seem to be documented anywhere, in particular, the fact that some of the features are enabled by default and some are not can only be figured out from the code. Signed-off-by: Vitaly Kuznetsov --- docs/kvm-pv.txt | 92 + 1 fil

[PATCH v2 6/8] i386: Implement pseudo 'hv-avic' ('hv-apicv') enlightenment

2021-09-02 Thread Vitaly Kuznetsov
The enlightenment allows to use Hyper-V SynIC with hardware APICv/AVIC enabled. Normally, Hyper-V SynIC disables these hardware features and suggests the guest to use paravirtualized AutoEOI feature. Linux-4.15 gains support for conditional APICv/AVIC disablement, the feature stays on until the gue

[PATCH v2 7/8] i386: Make Hyper-V version id configurable

2021-09-02 Thread Vitaly Kuznetsov
Currently, we hardcode Hyper-V version id (CPUID 0x4002) to WS2008R2 and it is known that certain tools in Windows check this. It seems useful to provide some flexibility by making it possible to change this info at will. CPUID information is defined in TLFS as: EAX: Build Number EBX Bits 31-1

[PATCH v2 4/8] i386: Support KVM_CAP_HYPERV_ENFORCE_CPUID

2021-09-02 Thread Vitaly Kuznetsov
By default, KVM allows the guest to use all currently supported Hyper-V enlightenments when Hyper-V CPUID interface was exposed, regardless of if some features were not announced in guest visible CPUIDs. hv-enforce-cpuid feature alters this behavior and only allows the guest to use exposed Hyper-V

Re: [PATCH 6/6] pc: Allow instantiating a virtio-iommu device

2021-09-02 Thread Eric Auger
Hi Jean, On 8/27/21 3:26 PM, Jean-Philippe Brucker wrote: > On Tue, Aug 17, 2021 at 04:11:49PM +0200, Eric Auger wrote: >> Hi Jean, >> >> On 8/10/21 10:45 AM, Jean-Philippe Brucker wrote: >>> From: Eric Auger >>> >>> Add a hotplug handler for virtio-iommu on x86 and set the necessary >>> reserved

[PATCH v2 1/8] i386: Add 6.2 machine types

2021-09-02 Thread Vitaly Kuznetsov
Introduce 6.2 machine types and the required infrastructure for adding compat properties to pre-6.2 machine types. Signed-off-by: Vitaly Kuznetsov --- hw/core/machine.c| 3 +++ hw/i386/pc.c | 3 +++ hw/i386/pc_piix.c| 14 +- hw/i386/pc_q35.c | 13 -

[PATCH v2 8/8] i386: Change the default Hyper-V version to match WS2016

2021-09-02 Thread Vitaly Kuznetsov
KVM implements some Hyper-V 2016 functions so providing WS2008R2 version is somewhat incorrect. While generally guests shouldn't care about it and always check feature bits, it is known that some tools in Windows actually check version info. For compatibility reasons make the change for 7.2 machin

[PATCH v4 4/5] mirror-top-perms: Fix AbnormalShutdown path

2021-09-02 Thread Hanna Reitz
The AbnormalShutdown exception class is not in qemu.machine, but in qemu.machine.machine. (qemu.machine.AbnormalShutdown was enough for Python to find it in order to run this test, but pylint complains about it.) Signed-off-by: Hanna Reitz --- tests/qemu-iotests/tests/mirror-top-perms | 2 +- 1

[PATCH v2 3/8] i386: Support KVM_CAP_ENFORCE_PV_FEATURE_CPUID

2021-09-02 Thread Vitaly Kuznetsov
By default, KVM allows the guest to use all currently supported PV features even when they were not announced in guest visible CPUIDs. Introduce a new "kvm-pv-enforce-cpuid" flag to limit the supported feature set to the exposed features. The feature is supported by Linux >= 5.10 and is not enabled

[PATCH v2] block: drop BLK_PERM_GRAPH_MOD

2021-09-02 Thread Vladimir Sementsov-Ogievskiy
First, this permission never protected a node from being changed, as generic child-replacing functions don't check it. Second, it's a strange thing: it presents a permission of parent node to change its child. But generally, children are replaced by different mechanisms, like jobs or qmp commands,

[PATCH v2 0/8] i386: Assorted KVM PV and Hyper-V feature improvements

2021-09-02 Thread Vitaly Kuznetsov
This is a continuation of "[PATCH 0/3] i386/kvm: Paravirtualized features usage enforcement" series, thus v2. This series implements several unrelated features but as there are code dependencies between them I'm sending it as one series. PATCH1 adds empty 6.2 machine types and the required compa

[PATCH v4 5/5] iotests/297: Cover tests/

2021-09-02 Thread Hanna Reitz
297 so far does not check the named tests, which reside in the tests/ directory (i.e. full path tests/qemu-iotests/tests). Fix it. Thanks to the previous two commits, all named tests pass its scrutiny, so we do not have to add anything to SKIP_FILES. Signed-off-by: Hanna Reitz Reviewed-by: Will

[PATCH v4 1/5] iotests/297: Drop 169 and 199 from the skip list

2021-09-02 Thread Hanna Reitz
169 and 199 have been renamed and moved to tests/ (commit a44be0334be: "iotests: rename and move 169 and 199 tests"), so we can drop them from the skip list. Signed-off-by: Hanna Reitz Reviewed-by: Willian Rampazzo Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Kevin Wolf --- tests/qe

[PATCH v2 5/8] i386: Move HV_APIC_ACCESS_RECOMMENDED bit setting to hyperv_fill_cpuids()

2021-09-02 Thread Vitaly Kuznetsov
In preparation to enabling Hyper-V + APICv/AVIC move HV_APIC_ACCESS_RECOMMENDED setting out of kvm_hyperv_properties[]: the 'real' feature bit for the vAPIC features is HV_APIC_ACCESS_AVAILABLE, HV_APIC_ACCESS_RECOMMENDED is a recommendation to use the feature which we may not always want to give.

[PATCH v4 2/5] migrate-bitmaps-postcopy-test: Fix pylint warnings

2021-09-02 Thread Hanna Reitz
pylint complains that discards1_sha256 and all_discards_sha256 are first set in non-__init__ methods. These variables are not really class-variables anyway, so let them instead be returned by start_postcopy(), thus silencing pylint. Suggested-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Hanna

[PATCH v4 0/5] iotests/297: Cover tests/

2021-09-02 Thread Hanna Reitz
v1: https://lists.nongnu.org/archive/html/qemu-block/2021-03/msg01471.html v2: https://lists.nongnu.org/archive/html/qemu-block/2021-05/msg00492.html v3: https://lists.nongnu.org/archive/html/qemu-block/2021-05/msg00569.html Hi, Sorry for the long delay, here is v4 to make our lint checking iote

[PATCH v4 3/5] migrate-bitmaps-test: Fix pylint warnings

2021-09-02 Thread Hanna Reitz
There are a couple of things pylint takes issue with: - The "time" import is unused - The import order (iotests should come last) - get_bitmap_hash() doesn't use @self and so should be a function - Semicolons at the end of some lines - Parentheses after "if" - Some lines are too long (80 characters

Re: [PATCH 0/5] optimize the downtime for vfio migration

2021-09-02 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
Hi maintainers, Ping... 在 2021/8/25 15:56, Longpeng(Mike) 写道: > In vfio migration resume phase, the cost would increase if the > vfio device has more unmasked vectors. We try to optimize it in > this series. > > Patch 1 & 2 are simple code cleanups. > Patch 3 defers to set irqs to vfio core. > P

Re: [PATCH v1 2/3] io: Add zerocopy and errqueue

2021-09-02 Thread Daniel P . Berrangé
On Thu, Sep 02, 2021 at 06:34:01AM -0300, Leonardo Bras Soares Passos wrote: > On Thu, Sep 2, 2021 at 5:47 AM Daniel P. Berrangé wrote: > > > > On Thu, Sep 02, 2021 at 03:38:11AM -0300, Leonardo Bras Soares Passos wrote: > > > > > > I would suggest checkig in close(), but as mentioned > > > > earl

Re: [PATCH v3 00/11] block/nvme: Rework error reporting

2021-09-02 Thread Stefan Hajnoczi
On Thu, Sep 02, 2021 at 09:00:14AM +0200, Philippe Mathieu-Daudé wrote: > (Series fully reviewed) > > Hi, > > This series contains various patches sent last year with > review comments addressed, few more cleanups, and a new > patch which remove the spurious "VFIO_MAP_DMA failed: No > space left

Re: [PATCH v1 3/3] migration: multifd: Enable zerocopy

2021-09-02 Thread Leonardo Bras Soares Passos
On Thu, Sep 2, 2021 at 6:20 AM Daniel P. Berrangé wrote: > > On Thu, Sep 02, 2021 at 05:52:15AM -0300, Leonardo Bras Soares Passos wrote: > > On Thu, Sep 2, 2021 at 5:21 AM Daniel P. Berrangé > > wrote: > > > > > > On Thu, Sep 02, 2021 at 04:22:55AM -0300, Leonardo Bras Soares Passos > > > wrot

Re: [PATCH v4 3/5] migrate-bitmaps-test: Fix pylint warnings

2021-09-02 Thread Vladimir Sementsov-Ogievskiy
02.09.2021 12:40, Hanna Reitz wrote: There are a couple of things pylint takes issue with: - The "time" import is unused - The import order (iotests should come last) - get_bitmap_hash() doesn't use @self and so should be a function - Semicolons at the end of some lines - Parentheses after "if" -

Re: [PATCH v4 4/5] mirror-top-perms: Fix AbnormalShutdown path

2021-09-02 Thread Vladimir Sementsov-Ogievskiy
02.09.2021 12:40, Hanna Reitz wrote: The AbnormalShutdown exception class is not in qemu.machine, but in qemu.machine.machine. (qemu.machine.AbnormalShutdown was enough for Python to find it in order to run this test, but pylint complains about it.) Signed-off-by: Hanna Reitz --- tests/qemu-

Re: [PATCH v1 3/3] migration: multifd: Enable zerocopy

2021-09-02 Thread Daniel P . Berrangé
On Thu, Sep 02, 2021 at 06:49:06AM -0300, Leonardo Bras Soares Passos wrote: > On Thu, Sep 2, 2021 at 6:20 AM Daniel P. Berrangé wrote: > > > > On Thu, Sep 02, 2021 at 05:52:15AM -0300, Leonardo Bras Soares Passos wrote: > > > On Thu, Sep 2, 2021 at 5:21 AM Daniel P. Berrangé > > > wrote: > > >

Re: [PATCH v4 4/5] mirror-top-perms: Fix AbnormalShutdown path

2021-09-02 Thread Philippe Mathieu-Daudé
On 9/2/21 11:58 AM, Vladimir Sementsov-Ogievskiy wrote: > 02.09.2021 12:40, Hanna Reitz wrote: >> The AbnormalShutdown exception class is not in qemu.machine, but in >> qemu.machine.machine.  (qemu.machine.AbnormalShutdown was enough for >> Python to find it in order to run this test, but pylint co

Re: [PATCH 2/2] iotests: Fix use-{list,dict}-literal warnings

2021-09-02 Thread Vladimir Sementsov-Ogievskiy
24.08.2021 18:35, Hanna Reitz wrote: pylint proposes using `[]` instead of `list()` and `{}` instead of `dict()`, because it is faster. That seems simple enough, so heed its advice. Signed-off-by: Hanna Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH v1 2/3] io: Add zerocopy and errqueue

2021-09-02 Thread Leonardo Bras Soares Passos
On Thu, Sep 2, 2021 at 6:50 AM Daniel P. Berrangé wrote: > > On Thu, Sep 02, 2021 at 06:34:01AM -0300, Leonardo Bras Soares Passos wrote: > > On Thu, Sep 2, 2021 at 5:47 AM Daniel P. Berrangé > > wrote: > > > > > > On Thu, Sep 02, 2021 at 03:38:11AM -0300, Leonardo Bras Soares Passos > > > wrot

[PATCH v2 1/9] escc: checkpatch fixes

2021-09-02 Thread Mark Cave-Ayland
Also fix a couple of spelling mistakes in comments. Signed-off-by: Mark Cave-Ayland Reviewed-by: Peter Maydell --- hw/char/escc.c | 162 + 1 file changed, 97 insertions(+), 65 deletions(-) diff --git a/hw/char/escc.c b/hw/char/escc.c index 52e797

[PATCH v2 2/9] escc: reset register values to zero in escc_reset()

2021-09-02 Thread Mark Cave-Ayland
This is to ensure that a device reset always returns the ESCC to a known state. Note that this is currently redundant with the same code in escc_reset_chn() but that will change shortly. Signed-off-by: Mark Cave-Ayland --- hw/char/escc.c | 19 +-- 1 file changed, 17 insertions(+

[PATCH v2 6/9] escc: implement hard reset as described in the datasheet

2021-09-02 Thread Mark Cave-Ayland
The hardware reset differs from a device reset in that it only changes the contents of specific registers. Remove the code that resets all the registers to zero during hardware reset and implement the default values listed in the table in the "Z85C30 Reset" section. Signed-off-by: Mark Cave-Ayl

[PATCH v2 8/9] escc: re-use escc_reset_chn() for hard and soft reset

2021-09-02 Thread Mark Cave-Ayland
This removes duplication of the internal device state initialisation from all of device reset, soft reset and hard reset. Signed-off-by: Mark Cave-Ayland --- hw/char/escc.c | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/hw/char/escc.c b/hw/char/escc.c ind

[PATCH v2 3/9] escc: introduce escc_soft_reset_chn() for software reset

2021-09-02 Thread Mark Cave-Ayland
This new software reset function is to be called when the appropriate channel software reset bit is written to register WR9. Its initial implementation is the same as the existing escc_reset_chn() function used for device reset. Signed-off-by: Mark Cave-Ayland --- hw/char/escc.c | 38 +++

[PATCH v2 5/9] escc: implement soft reset as described in the datasheet

2021-09-02 Thread Mark Cave-Ayland
The software reset differs from a device reset in that it only changes the contents of specific registers. Remove the code that resets all the registers to zero during soft reset and implement the default values listed in the table in the "Z85C30 Reset" section. Signed-off-by: Mark Cave-Ayland

[PATCH v2 7/9] escc: remove register changes from escc_reset_chn()

2021-09-02 Thread Mark Cave-Ayland
Now that register values at reset are handled elsewhere for all of device reset, soft reset and hard reset, escc_reset_chn() only needs to handle initialisation of internal device state. Signed-off-by: Mark Cave-Ayland --- hw/char/escc.c | 25 - 1 file changed, 25 deletio

Re: [PATCH] coroutine: resize pool periodically instead of limiting size

2021-09-02 Thread Philippe Mathieu-Daudé
On 9/1/21 6:09 PM, Stefan Hajnoczi wrote: > It was reported that enabling SafeStack reduces IOPS significantly > (>25%) with the following fio benchmark on virtio-blk using a NVMe host > block device: > > # fio --rw=randrw --bs=4k --iodepth=64 --runtime=1m --direct=1 \ > --filename=/dev/vd

[PATCH v2 0/9] escc: fix reset and R_STATUS when SDLC mode is enabled

2021-09-02 Thread Mark Cave-Ayland
Here are another set of ESCC fixes from my attempts to boot MacOS on the q800 machine. Patch 1 fixes up the formatting so that the remainder of the patchset keeps checkpatch happy. Patches 2-8 rework the reset handling so that the QEMU device reset is separate from the ESCC in-built hardware and

[PATCH v2 9/9] escc: fix STATUS_SYNC bit in R_STATUS register

2021-09-02 Thread Mark Cave-Ayland
After an SDLC "Enter hunt" command has been sent the STATUS_SYNC bit should remain high until the flag byte has been detected. Whilst the ESCC device doesn't yet implement SDLC mode, without this change the active low STATUS_SYNC is constantly asserted causing the MacOS OpenTransport extension to

Re: [PATCH v2 8/9] escc: re-use escc_reset_chn() for hard and soft reset

2021-09-02 Thread Philippe Mathieu-Daudé
On 9/2/21 12:22 PM, Mark Cave-Ayland wrote: > This removes duplication of the internal device state initialisation from all > of device reset, soft reset and hard reset. > > Signed-off-by: Mark Cave-Ayland > --- > hw/char/escc.c | 18 -- > 1 file changed, 4 insertions(+), 14 dele

Re: [PATCH v1 2/3] io: Add zerocopy and errqueue

2021-09-02 Thread Daniel P . Berrangé
On Thu, Sep 02, 2021 at 07:19:58AM -0300, Leonardo Bras Soares Passos wrote: > On Thu, Sep 2, 2021 at 6:50 AM Daniel P. Berrangé wrote: > > > > On Thu, Sep 02, 2021 at 06:34:01AM -0300, Leonardo Bras Soares Passos wrote: > > > On Thu, Sep 2, 2021 at 5:47 AM Daniel P. Berrangé > > > wrote: > > >

[PATCH v2 4/9] escc: introduce escc_hard_reset_chn() for hardware reset

2021-09-02 Thread Mark Cave-Ayland
This new hardware reset function is to be called for both channels when the hardware reset bit is written to register WR9. Its initial implementation is the same as the existing escc_reset_chn() function used for device reset. Signed-off-by: Mark Cave-Ayland --- hw/char/escc.c | 37 +

Re: [PATCH v1 3/3] migration: multifd: Enable zerocopy

2021-09-02 Thread Leonardo Bras Soares Passos
On Thu, Sep 2, 2021 at 6:59 AM Daniel P. Berrangé wrote: > > On Thu, Sep 02, 2021 at 06:49:06AM -0300, Leonardo Bras Soares Passos wrote: > > On Thu, Sep 2, 2021 at 6:20 AM Daniel P. Berrangé > > wrote: > > > > > > On Thu, Sep 02, 2021 at 05:52:15AM -0300, Leonardo Bras Soares Passos > > > wrot

proposed schedule for 6.2 release

2021-09-02 Thread Peter Maydell
Draft schedule for 6.2. This is just starting from "don't want a possibly-late release to get too close to xmas holiday season" and working backwards. 2021-11-02 Soft feature freeze. Only bug fixes after this point. All feature changes must be already in a sub maintainer tree

[PATCH v6 0/5] block/nbd: drop connection_co

2021-09-02 Thread Vladimir Sementsov-Ogievskiy
v6: 01,02: add Eric's r-b 03: make new interface clearer 04,05: rebased on updated 03 Vladimir Sementsov-Ogievskiy (5): block/nbd: nbd_channel_error() shutdown channel unconditionally block/nbd: move nbd_recv_coroutines_wake_all() up block/nbd: refactor nbd_recv_coroutines_wake_all() block

[PATCH v6 2/5] block/nbd: move nbd_recv_coroutines_wake_all() up

2021-09-02 Thread Vladimir Sementsov-Ogievskiy
We are going to use it in nbd_channel_error(), so move it up. Note, that we are going also refactor and rename nbd_recv_coroutines_wake_all() in future anyway, so keeping it where it is and making forward declaration doesn't make real sense. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by

[PATCH v6 3/5] block/nbd: refactor nbd_recv_coroutines_wake_all()

2021-09-02 Thread Vladimir Sementsov-Ogievskiy
Split out nbd_recv_coroutine_wake_one(), as it will be used in separate. Rename the function and add a possibility to wake only first found sleeping coroutine. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd.c | 26 +- 1 file changed, 17 insertions(+), 9 deletio

[PATCH v6 1/5] block/nbd: nbd_channel_error() shutdown channel unconditionally

2021-09-02 Thread Vladimir Sementsov-Ogievskiy
Don't rely on connection being totally broken in case of -EIO. More safe and correct just shutdown the channel anyway, as we change the state and going to reconnect. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- block/nbd.c | 7 --- 1 file changed, 4 insertions(+),

[PATCH v6 4/5] block/nbd: drop connection_co

2021-09-02 Thread Vladimir Sementsov-Ogievskiy
OK, that's a big rewrite of the logic. Pre-patch we have an always running coroutine - connection_co. It does reply receiving and reconnecting. And it leads to a lot of difficult and unobvious code around drained sections and context switch. We also abuse bs->in_flight counter which is increased f

[PATCH v6 5/5] block/nbd: check that received handle is valid

2021-09-02 Thread Vladimir Sementsov-Ogievskiy
If we don't have active request, that waiting for this handle to be received, we should report an error. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/block/nbd.c b/block/nbd.c index 170a8c8eeb..306b2de

Re: [PATCH v2 3/3] softmmu/vl: Deprecate the -sdl and -curses option

2021-09-02 Thread Thomas Huth
On 31/08/2021 15.53, Paolo Bonzini wrote: As an alternative, you may want to turn it into "-display sdl" rather than poke at dpy. This isn't much more code, but it keeps the shortcut isolated within a single "case". This follows a lot of recently cleaned up command line parsing code such as -no

Re: [PATCH v2 3/3] softmmu/vl: Deprecate the -sdl and -curses option

2021-09-02 Thread Daniel P . Berrangé
On Thu, Sep 02, 2021 at 12:51:02PM +0200, Thomas Huth wrote: > On 31/08/2021 15.53, Paolo Bonzini wrote: > > As an alternative, you may want to turn it into "-display sdl" rather > > than poke at dpy. This isn't much more code, but it keeps the shortcut > > isolated within a single "case". This fol

Re: [PULL v1 00/10] Merge tpm 2021/09/01 v1

2021-09-02 Thread Peter Maydell
On Wed, 1 Sept 2021 at 13:22, Stefan Berger wrote: > > This series of patches adds an ACPI test case for TPM 1.2 support. > >Stefan > > The following changes since commit d52dff5d8048d4982437db9606c27bb4127cf9d0: > > Merge remote-tracking branch 'remotes/marcandre/tags/clip-pull-request' >

[PATCH v8 06/14] machine: Prefer cores over sockets in smp parsing since 6.2

2021-09-02 Thread Yanan Wang
In the real SMP hardware topology world, it's much more likely that we have high cores-per-socket counts and few sockets totally. While the current preference of sockets over cores in smp parsing results in a virtual cpu topology with low cores-per-sockets counts and a large number of sockets, whic

[PATCH v8 03/14] machine: Uniformly use maxcpus to calculate the omitted parameters

2021-09-02 Thread Yanan Wang
We are currently using maxcpus to calculate the omitted sockets but using cpus to calculate the omitted cores/threads. This makes cmdlines like: -smp cpus=8,maxcpus=16 -smp cpus=8,cores=4,maxcpus=16 -smp cpus=8,threads=2,maxcpus=16 work fine but the ones like: -smp cpus=8,sockets=2,maxcpus=

[PATCH v8 01/14] machine: Deprecate "parameter=0" SMP configurations

2021-09-02 Thread Yanan Wang
In the SMP configuration, we should either provide a topology parameter with a reasonable value (greater than zero) or just omit it and QEMU will compute the missing value. The users shouldn't provide a configuration with any parameter of it specified as zero (e.g. -smp 8,sockets=0) which could po

[PATCH v8 00/14] machine: smp parsing fixes and improvement

2021-09-02 Thread Yanan Wang
I'm resending a new version, as one patch (hw: Add compat machines for 6.2) of the series has been merged into upstream. There are no changes of the other patches since v7 though. Series has been fully reviewed. Description: This series introduces some fixes and improvement for the SMP parsing. 1

[PATCH v8 08/14] machine: Tweak the order of topology members in struct CpuTopology

2021-09-02 Thread Yanan Wang
Now that all the possible topology parameters are integrated in struct CpuTopology, tweak the order of topology members to be "cpus/sockets/ dies/cores/threads/maxcpus" for readability and consistency. We also tweak the comment by adding explanation of dies parameter. Signed-off-by: Yanan Wang Re

  1   2   3   4   5   >