Re: [PATCH v9 02/12] hw/block/nvme: Generate namespace UUIDs

2020-11-04 Thread Klaus Jensen
On Nov 5 11:53, Dmitry Fomichev wrote: > In NVMe 1.4, a namespace must report an ID descriptor of UUID type > if it doesn't support EUI64 or NGUID. Add a new namespace property, > "uuid", that provides the user the option to either specify the UUID > explicitly or have a UUID generated automatical

Re: [PATCH 1/5] file-posix: split hdev_refresh_limits from raw_refresh_limits

2020-11-04 Thread Tom Yan
Actually I made a mistake in this. BLKSECTGET (the one in the block layer) returns the number of "sectors", which is "defined" as 512-byte block. So we shouldn't use BLKSSZGET here, but simply 512 (1 << 9). See logical_to_sectors() in sd.h of the kernel. On Thu, 5 Nov 2020 at 01:32, Maxim Levitsky

[PATCH] block: Fix integer promotion error in bdrv_getlength()

2020-11-04 Thread Tuguoyi
As BDRV_SECTOR_SIZE is of type uint64_t, the expression will automatically convert the @ret to uint64_t. When an error code returned from bdrv_nb_sectors(), the promoted @ret will be a very large number, as a result the -EFBIG will be returned which is not the real error code. Signed-off-by: Guoyi

RE: [PATCH] block: Return the real error code in bdrv_getlength

2020-11-04 Thread Tuguoyi
Sorry, please ignore this patch, it's not a right fix -- Best regards, Guoyi > -Original Message- > From: tuguoyi (Cloud) > Sent: Thursday, November 05, 2020 11:11 AM > To: 'Kevin Wolf' ; 'Max Reitz' ; > 'qemu-block@nongnu.org' > Cc: 'qemu-de...@nongnu.org' > Subject: [PATCH] block: Re

[PATCH] block: Return the real error code in bdrv_getlength

2020-11-04 Thread Tuguoyi
The return code from bdrv_nb_sectors() should be checked before doing the following sanity check. Signed-off-by: Guoyi Tu --- block.c | 4 1 file changed, 4 insertions(+) diff --git a/block.c b/block.c index 430edf7..19ebbc0 100644 --- a/block.c +++ b/block.c @@ -5082,6 +5082,10 @@ int64_

[PATCH v9 07/12] block/nvme: Make ZNS-related definitions

2020-11-04 Thread Dmitry Fomichev
Define values and structures that are needed to support Zoned Namespace Command Set (NVMe TP 4053). Signed-off-by: Dmitry Fomichev --- include/block/nvme.h | 114 ++- 1 file changed, 113 insertions(+), 1 deletion(-) diff --git a/include/block/nvme.h b/inc

[PATCH v9 11/12] hw/block/nvme: Add injection of Offline/Read-Only zones

2020-11-04 Thread Dmitry Fomichev
ZNS specification defines two zone conditions for the zones that no longer can function properly, possibly because of flash wear or other internal fault. It is useful to be able to "inject" a small number of such zones for testing purposes. This commit defines two optional device properties, "offl

[PATCH v9 10/12] hw/block/nvme: Support Zone Descriptor Extensions

2020-11-04 Thread Dmitry Fomichev
Zone Descriptor Extension is a label that can be assigned to a zone. It can be set to an Empty zone and it stays assigned until the zone is reset. This commit adds a new optional module property, "zoned.descr_ext_size". Its value must be a multiple of 64 bytes. If this value is non-zero, it become

[PATCH v9 12/12] hw/block/nvme: Document zoned parameters in usage text

2020-11-04 Thread Dmitry Fomichev
Added brief descriptions of the new device properties that are now available to users to configure features of Zoned Namespace Command Set in the emulator. This patch is for documentation only, no functionality change. Signed-off-by: Dmitry Fomichev Reviewed-by: Niklas Cassel --- hw/block/nvme

[PATCH v9 09/12] hw/block/nvme: Introduce max active and open zone limits

2020-11-04 Thread Dmitry Fomichev
Add two module properties, "zoned.max_active" and "zoned.max_open" to control the maximum number of zones that can be active or open. Once these variables are set to non-default values, these limits are checked during I/O and Too Many Active or Too Many Open command status is returned if they are e

[PATCH v9 06/12] hw/block/nvme: Support allocated CNS command variants

2020-11-04 Thread Dmitry Fomichev
From: Niklas Cassel Many CNS commands have "allocated" command variants. These include a namespace as long as it is allocated, that is a namespace is included regardless if it is active (attached) or not. While these commands are optional (they are mandatory for controllers supporting the namesp

[PATCH v9 04/12] hw/block/nvme: Merge nvme_write_zeroes() with nvme_write()

2020-11-04 Thread Dmitry Fomichev
nvme_write() now handles WRITE, WRITE ZEROES and ZONE_APPEND. Signed-off-by: Dmitry Fomichev Reviewed-by: Niklas Cassel Acked-by: Klaus Jensen --- hw/block/nvme.c | 72 +-- hw/block/trace-events | 1 - 2 files changed, 28 insertions(+), 45 deletio

[PATCH v9 08/12] hw/block/nvme: Support Zoned Namespace Command Set

2020-11-04 Thread Dmitry Fomichev
The emulation code has been changed to advertise NVM Command Set when "zoned" device property is not set (default) and Zoned Namespace Command Set otherwise. Define values and structures that are needed to support Zoned Namespace Command Set (NVMe TP 4053) in PCI NVMe controller emulator. Define t

[PATCH v9 02/12] hw/block/nvme: Generate namespace UUIDs

2020-11-04 Thread Dmitry Fomichev
In NVMe 1.4, a namespace must report an ID descriptor of UUID type if it doesn't support EUI64 or NGUID. Add a new namespace property, "uuid", that provides the user the option to either specify the UUID explicitly or have a UUID generated automatically every time a namespace is initialized. Sugge

[PATCH v9 05/12] hw/block/nvme: Add support for Namespace Types

2020-11-04 Thread Dmitry Fomichev
From: Niklas Cassel Define the structures and constants required to implement Namespace Types support. Namespace Types introduce a new command set, "I/O Command Sets", that allows the host to retrieve the command sets associated with a namespace. Introduce support for the command set and enable

[PATCH v9 01/12] hw/block/nvme: Add Commands Supported and Effects log

2020-11-04 Thread Dmitry Fomichev
This log page becomes necessary to implement to allow checking for Zone Append command support in Zoned Namespace Command Set. This commit adds the code to report this log page for NVM Command Set only. The parts that are specific to zoned operation will be added later in the series. All incoming

[PATCH v9 03/12] hw/block/nvme: Separate read and write handlers

2020-11-04 Thread Dmitry Fomichev
With ZNS support in place, the majority of code in nvme_rw() has become read- or write-specific. Move these parts to two separate handlers, nvme_read() and nvme_write() to make the code more readable and to remove multiple is_write checks that so far existed in the i/o path. This is a refactoring

[PATCH v9 00/12] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

2020-11-04 Thread Dmitry Fomichev
v8 -> v9: - Move the modifications to "include/block/nvme.h" made to introduce ZNS-related definitions into a separate patch. - Add a new struct, NvmeZonedResult, along the same lines as the existing NvmeAerResult, to carry Zone Append LBA returned to the host. Now, there is no need to

Re: [PULL 00/33] Block patches

2020-11-04 Thread Peter Maydell
On Wed, 4 Nov 2020 at 15:18, Stefan Hajnoczi wrote: > > The following changes since commit 8507c9d5c9a62de2a0e281b640f995e26eac46af: > > Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging > (2020-11-03 15:59:44 +) > > are available in the Git repository at: > > ht

Re: [PATCH v2 2/2] iotests: rewrite iotest 240 in python

2020-11-04 Thread Maxim Levitsky
On Tue, 2020-11-03 at 13:53 +0100, Max Reitz wrote: > On 01.11.20 17:15, Maxim Levitsky wrote: > > The recent changes that brought RCU delayed device deletion, > > broke few tests and this test breakage went unnoticed. > > > > Fix this test by rewriting it in python > > (which allows to wait for D

[PULL v3 29/31] block/export: make vhost-user-blk config space little-endian

2020-11-04 Thread Michael S. Tsirkin
From: Stefan Hajnoczi VIRTIO 1.0 devices have little-endian configuration space. The vhost-user-blk-server.c code already uses little-endian for virtqueue processing but not for the configuration space fields. Fix this so the vhost-user-blk export works on big-endian hosts. Signed-off-by: Stefan

[PULL v3 28/31] configure: introduce --enable-vhost-user-blk-server

2020-11-04 Thread Michael S. Tsirkin
From: Stefan Hajnoczi Make it possible to compile out the vhost-user-blk server. It is enabled by default on Linux. Note that vhost-user-server.c depends on libvhost-user, which requires CONFIG_LINUX. The CONFIG_VHOST_USER dependency was erroneous since that option controls vhost-user frontends

[PATCH v3 2/2] iotests: rewrite iotest 240 in python

2020-11-04 Thread Maxim Levitsky
The recent changes that brought RCU delayed device deletion, broke few tests and this test breakage went unnoticed. Fix this test by rewriting it in python (which allows to wait for DEVICE_DELETED events before continuing). Signed-off-by: Maxim Levitsky Tested-by: Christian Borntraeger Reviewed

[PATCH v3 1/2] iotests: add filter_qmp_virtio_scsi function

2020-11-04 Thread Maxim Levitsky
filter_qmp_virtio_scsi can be used to filter virtio-scsi-pci/ccw differences. Note that this patch was only tested on x86. Suggested-by: Paolo Bonzini Signed-off-by: Maxim Levitsky Tested-by: Christian Borntraeger Reviewed-by: Paolo Bonzini --- tests/qemu-iotests/iotests.py | 10 ++ 1

[PULL v3 30/31] block/export: fix vhost-user-blk get_config() information leak

2020-11-04 Thread Michael S. Tsirkin
From: Stefan Hajnoczi Refuse get_config() requests in excess of sizeof(struct virtio_blk_config). Signed-off-by: Stefan Hajnoczi Message-Id: <20201027173528.213464-5-stefa...@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- block/export/vhost-user-blk-server.

[PATCH v3 0/2] Assorted fixes to tests that were broken by recent scsi changes

2020-11-04 Thread Maxim Levitsky
While most of the patches in V1 of this series are already merged upstream, the patch that fixes iotest 240 was broken on s390 and was not accepted. This is an updated version of this patch, based on Paulo's suggestion, that hopefully makes this iotest work on both x86 and s390. V3: addressed rev

[PULL v3 25/31] Revert "vhost-blk: set features before setting inflight feature"

2020-11-04 Thread Michael S. Tsirkin
From: Stefan Hajnoczi This reverts commit adb29c027341ba095a3ef4beef6aaef86d3a520e. The commit broke -device vhost-user-blk-pci because the vhost_dev_prepare_inflight() function it introduced segfaults in vhost_dev_set_features() when attempting to access struct vhost_dev's vdev pointer before i

[PULL v3 26/31] vhost-blk: set features before setting inflight feature

2020-11-04 Thread Michael S. Tsirkin
From: Jin Yu Virtqueue has split and packed, so before setting inflight, you need to inform the back-end virtqueue format. Signed-off-by: Jin Yu Acked-by: Raphael Norwitz Message-Id: <20201103123617.28256-1-jin...@intel.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin -

Re: [PATCH 0/5] SCSI: fix transfer limits for SCSI passthrough

2020-11-04 Thread Maxim Levitsky
On Wed, 2020-11-04 at 09:48 -0800, no-re...@patchew.org wrote: > Patchew URL: > https://patchew.org/QEMU/20201104173217.417538-1-mlevi...@redhat.com/ > > > > Hi, > > This series seems to have some coding style problems. See output below for > more information: > > Type: series > Message-id: 2

[PATCH] quorum: Implement bdrv_co_block_status()

2020-11-04 Thread Alberto Garcia
The quorum driver does not implement bdrv_co_block_status() and because of that it always reports to contain data even if all its children are known to be empty. One consequence of this is that if we for example create a quorum with a size of 10GB and we mirror it to a new image the operation will

Re: Libvirt driver iothread property for virtio-scsi disks

2020-11-04 Thread Nir Soffer
On Wed, Nov 4, 2020 at 6:54 PM Daniel P. Berrangé wrote: > > On Wed, Nov 04, 2020 at 05:48:40PM +0200, Nir Soffer wrote: > > The docs[1] say: > > > > - The optional iothread attribute assigns the disk to an IOThread as > > defined by > > the range for the domain iothreads value. Multiple disks

Re: Libvirt driver iothread property for virtio-scsi disks

2020-11-04 Thread Nir Soffer
On Wed, Nov 4, 2020 at 6:42 PM Sergio Lopez wrote: > > On Wed, Nov 04, 2020 at 05:48:40PM +0200, Nir Soffer wrote: > > The docs[1] say: > > > > - The optional iothread attribute assigns the disk to an IOThread as > > defined by > > the range for the domain iothreads value. Multiple disks may be

Re: [PATCH 0/5] SCSI: fix transfer limits for SCSI passthrough

2020-11-04 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20201104173217.417538-1-mlevi...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20201104173217.417538-1-mlevi...@redhat.com Subject: [PATCH 0/5] SCSI: fix transfer limi

Re: [PATCH v2 17/20] backup: move to block-copy

2020-11-04 Thread Max Reitz
On 26.10.20 16:18, Vladimir Sementsov-Ogievskiy wrote: > 23.07.2020 12:47, Max Reitz wrote: >>> +static void coroutine_fn backup_set_speed(BlockJob *job, int64_t speed) >>> +{ >>> +    BackupBlockJob *s = container_of(job, BackupBlockJob, common); >>> + >>> +    if (s->bcs) { >>> +    /* In blo

[PATCH 4/5] block: use blk_get_max_ioctl_transfer for SCSI passthrough

2020-11-04 Thread Maxim Levitsky
Switch file-posix to expose only the max_ioctl_transfer limit. Let the iscsi driver work as it did before since it is bound by the transfer limit in both regular read/write and in SCSI passthrough case. Switch the scsi-disk and scsi-block drivers to read the SG max transfer limits using the new b

[PATCH 1/5] file-posix: split hdev_refresh_limits from raw_refresh_limits

2020-11-04 Thread Maxim Levitsky
From: Tom Yan We can and should get max transfer length and max segments for all host devices / cdroms (on Linux). Also use MIN_NON_ZERO instead when we clamp max transfer length against max segments. Signed-off-by: Tom Yan Signed-off-by: Maxim Levitsky --- block/file-posix.c | 61 ++

[PATCH 5/5] block/scsi: correctly emulate the VPD block limits page

2020-11-04 Thread Maxim Levitsky
When the device doesn't support the VPD block limits page, we emulate it even for SCSI passthrough. As a part of the emulation we need to add it to the 'Supported VPD Pages' The code that does this adds it to the page, but it doesn't increase the length of the data to be copied to the guest, thus

Re: [PATCH v2 13/20] iotests: 129: prepare for backup over block-copy

2020-11-04 Thread Max Reitz
On 22.10.20 23:10, Vladimir Sementsov-Ogievskiy wrote: > 23.07.2020 11:03, Max Reitz wrote: >> On 01.06.20 20:11, Vladimir Sementsov-Ogievskiy wrote: >>> After introducing parallel async copy requests instead of plain >>> cluster-by-cluster copying loop, backup job may finish earlier than >>> final

[PATCH 2/5] file-posix: add sg_get_max_segments that actually works with sg

2020-11-04 Thread Maxim Levitsky
From: Tom Yan sg devices have different major/minor than their corresponding block devices. Using sysfs to get max segments never really worked for them. Fortunately the sg driver provides an ioctl to get sg_tablesize, which is apparently equivalent to max segments. Signed-off-by: Tom Yan Sign

[PATCH 3/5] block: add max_ioctl_transfer to BlockLimits

2020-11-04 Thread Maxim Levitsky
Maximum transfer size when accessing a kernel block device is only relevant when using SCSI passthrough (SG_IO ioctl) since only in this case the requests are passed directly to underlying hardware with no pre-processing. Same is true when using /dev/sg* character devices (which only support SG_IO)

[PATCH 0/5] SCSI: fix transfer limits for SCSI passthrough

2020-11-04 Thread Maxim Levitsky
This patch series attempts to provide a solution to the problem of the transfer limits of the raw file driver (host_device/file-posix), some of which I already tried to fix in the past. I included 2 patches from Tom Yan which fix two issues with reading the limits correctly from the */dev/sg* char

[PATCH 6/7] qom: Add FIELD_PTR, a type-safe wrapper for object_field_prop_ptr()

2020-11-04 Thread Eduardo Habkost
Introduce a FIELD_PTR macro that will ensure the size of the area we are accessing has the correct size, and will return a pointer of the correct type. Signed-off-by: Eduardo Habkost --- Cc: Stefan Berger Cc: Stefano Stabellini Cc: Anthony Perard Cc: Paul Durrant Cc: Kevin Wolf Cc: Max Reitz

Re: [PATCH v2 22/44] qdev: Move dev->realized check to qdev_property_set()

2020-11-04 Thread Stefan Berger
On 11/4/20 10:59 AM, Eduardo Habkost wrote: Every single qdev property setter function manually checks dev->realized. We can just check dev->realized inside qdev_property_set() instead. The check is being added as a separate function (qdev_prop_allow_set()) because it will become a callback lat

Re: [PATCH v2 08/20] block/block-copy: add block_copy_cancel

2020-11-04 Thread Max Reitz
On 22.10.20 22:50, Vladimir Sementsov-Ogievskiy wrote: > 22.07.2020 14:28, Max Reitz wrote: >> On 01.06.20 20:11, Vladimir Sementsov-Ogievskiy wrote: >>> Add function to cancel running async block-copy call. It will be used >>> in backup. >>> >>> Signed-off-by: Vladimir Sementsov-Ogievskiy >>> ---

[PATCH 4/7] qom: Replace void* parameter with Property* on field getters/setters

2020-11-04 Thread Eduardo Habkost
All field property getters and setters must interpret the fourth argument as Property*. Change the function signature of field property getters and setters to indicate that. Signed-off-by: Eduardo Habkost --- Cc: Stefan Berger Cc: Stefano Stabellini Cc: Anthony Perard Cc: Paul Durrant Cc: Ke

Re: [PATCH v2] block: Remove unused BlockDeviceMapEntry

2020-11-04 Thread Max Reitz
On 30.10.20 07:24, Markus Armbruster wrote: > BlockDeviceMapEntry has never been used. It was added in commit > facd6e2 "so that it is published through the introspection mechanism." > What exactly introspecting types that aren't used for anything could > accomplish isn't clear. What "introspecti

Re: [PATCH v2 11/20] qapi: backup: add x-max-chunk and x-max-workers parameters

2020-11-04 Thread Max Reitz
On 22.10.20 22:35, Vladimir Sementsov-Ogievskiy wrote: > 22.07.2020 15:22, Max Reitz wrote: >> On 01.06.20 20:11, Vladimir Sementsov-Ogievskiy wrote: >>> Add new parameters to configure future backup features. The patch >>> doesn't introduce aio backup requests (so we actually have only one >>> wor

[PATCH 1/2] qapi/block-core: Improve MapEntry documentation

2020-11-04 Thread Max Reitz
MapEntry and BlockDeviceMapEntry are kind of the same thing, and the latter is not used, so we want to remove it. However, the documentation it provides for some fields is better than that of MapEntry, so steal some of it for the latter. (And adjust them a bit in the process, because I feel like

[PATCH 2/2] block: Remove unused BlockDeviceMapEntry

2020-11-04 Thread Max Reitz
From: Markus Armbruster BlockDeviceMapEntry has never been used. It was added in commit facd6e2 "so that it is published through the introspection mechanism." What exactly introspecting types that aren't used for anything could accomplish isn't clear. What "introspection mechanism" to use is al

[PATCH 0/2] block: Remove unused BlockDeviceMapEntry

2020-11-04 Thread Max Reitz
Hi, Markus has revived a rather old patch to remove an unused QAPI structure: https://lists.nongnu.org/archive/html/qemu-block/2020-10/msg01902.html He quoted a response of mine to the original patch, where I noted that removing this structure is OK because it is superseded by another structure

Re: Libvirt driver iothread property for virtio-scsi disks

2020-11-04 Thread Daniel P . Berrangé
On Wed, Nov 04, 2020 at 05:48:40PM +0200, Nir Soffer wrote: > The docs[1] say: > > - The optional iothread attribute assigns the disk to an IOThread as defined > by > the range for the domain iothreads value. Multiple disks may be assigned to > the same IOThread and are numbered from 1 to the

[PATCH v2] Prefer 'on' | 'off' over 'yes' | 'no' for bool options

2020-11-04 Thread Daniel P . Berrangé
Update some docs and test cases to use 'on' | 'off' as the preferred value for bool options. Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Daniel P. Berrangé --- docs/system/vnc-security.rst | 10 +- include/authz/listfile.h | 2 +- qemu-options.hx

Re: Libvirt driver iothread property for virtio-scsi disks

2020-11-04 Thread Sergio Lopez
On Wed, Nov 04, 2020 at 05:48:40PM +0200, Nir Soffer wrote: > The docs[1] say: > > - The optional iothread attribute assigns the disk to an IOThread as defined > by > the range for the domain iothreads value. Multiple disks may be assigned to > the same IOThread and are numbered from 1 to the

[PATCH v2 36/44] qdev: Rename qdev_get_prop_ptr() to object_field_prop_ptr()

2020-11-04 Thread Eduardo Habkost
The function will be moved to common QOM code, as it is not specific to TYPE_DEVICE anymore. Signed-off-by: Eduardo Habkost --- Changes v1 -> v2: * Rename to object_field_prop_ptr() instead of object_static_prop_ptr() --- Cc: Stefan Berger Cc: Stefano Stabellini Cc: Anthony Perard Cc: Paul Dur

[PATCH v2 22/44] qdev: Move dev->realized check to qdev_property_set()

2020-11-04 Thread Eduardo Habkost
Every single qdev property setter function manually checks dev->realized. We can just check dev->realized inside qdev_property_set() instead. The check is being added as a separate function (qdev_prop_allow_set()) because it will become a callback later. Signed-off-by: Eduardo Habkost --- Chang

[PATCH v2 09/44] qdev: Make qdev_get_prop_ptr() get Object* arg

2020-11-04 Thread Eduardo Habkost
Make the code more generic and not specific to TYPE_DEVICE. Reviewed-by: Marc-André Lureau Signed-off-by: Eduardo Habkost --- Changes v1 -> v2: - Fix build error with CONFIG_XEN I took the liberty of keeping the Reviewed-by line from Marc-André as the build fix is a trivial one line change -

Libvirt driver iothread property for virtio-scsi disks

2020-11-04 Thread Nir Soffer
The docs[1] say: - The optional iothread attribute assigns the disk to an IOThread as defined by the range for the domain iothreads value. Multiple disks may be assigned to the same IOThread and are numbered from 1 to the domain iothreads value. Available for a disk device target configured

Re: [PATCH] Prefer 'on' | 'off' over 'yes' | 'no' for bool options

2020-11-04 Thread Kevin Wolf
Am 04.11.2020 um 15:05 hat Daniel P. Berrangé geschrieben: > Update some docs and test cases to use 'on' | 'off' as the preferred > value for bool options. > > Signed-off-by: Daniel P. Berrangé > --- > docs/system/vnc-security.rst | 6 +++--- > include/authz/listfile.h | 2 +- > qemu-optio

[PULL 33/33] util/vfio-helpers: Assert offset is aligned to page size

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé mmap(2) states: 'offset' must be a multiple of the page size as returned by sysconf(_SC_PAGE_SIZE). Add an assertion to be sure we don't break this contract. Signed-off-by: Philippe Mathieu-Daudé Message-id: 20201103020733.2303148-8-phi...@redhat.com Signed-o

[PULL 32/33] util/vfio-helpers: Convert vfio_dump_mapping to trace events

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé The QEMU_VFIO_DEBUG definition is only modifiable at build-time. Trace events can be enabled at run-time. As we prefer the latter, convert qemu_vfio_dump_mappings() to use trace events instead of fprintf(). Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Signed

[PULL 30/33] util/vfio-helpers: Trace where BARs are mapped

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé For debugging purpose, trace where a BAR is mapped. Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Daudé Message-id: 20201103020733.2303148-5-phi...@redhat.com Signed-off-by: Stefan Hajnoczi Tested-by: Eric Auger --- util/vf

[PULL 31/33] util/vfio-helpers: Improve DMA trace events

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé For debugging purpose, trace where DMA regions are mapped. Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Daudé Message-id: 20201103020733.2303148-6-phi...@redhat.com Signed-off-by: Stefan Hajnoczi Tested-by: Eric Auger ---

[PULL 29/33] util/vfio-helpers: Trace PCI BAR region info

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé For debug purpose, trace BAR regions info. Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Daudé Message-id: 20201103020733.2303148-4-phi...@redhat.com Signed-off-by: Stefan Hajnoczi Tested-by: Eric Auger --- util/vfio-helper

[PULL 27/33] util/vfio-helpers: Improve reporting unsupported IOMMU type

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé Change the confuse "VFIO IOMMU check failed" error message by the explicit "VFIO IOMMU Type1 is not supported" once. Example on POWER: $ qemu-system-ppc64 -drive if=none,id=nvme0,file=nvme://0001:01:00.0/1,format=raw qemu-system-ppc64: -drive if=none,id=nvme0,fi

[PULL 24/33] block/nvme: Align iov's va and size on host page size

2020-11-04 Thread Stefan Hajnoczi
From: Eric Auger Make sure iov's va and size are properly aligned on the host page size. Signed-off-by: Eric Auger Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi Tested-by: Eric Auger Signed-off-by: Philippe Mathieu-Daudé Message-id: 20201029093306.1063879-23-phi...@redhat

[PULL 26/33] block/nvme: Fix nvme_submit_command() on big-endian host

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé The Completion Queue Command Identifier is a 16-bit value, so nvme_submit_command() is unlikely to work on big-endian hosts, as the relevant bits are truncated. Fix by using the correct byte-swap function. Fixes: bdd6a90a9e5 ("block: Add VFIO based NVMe driver") Repo

[PULL 25/33] block/nvme: Fix use of write-only doorbells page on Aarch64 arch

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé qemu_vfio_pci_map_bar() calls mmap(), and mmap(2) states: 'offset' must be a multiple of the page size as returned by sysconf(_SC_PAGE_SIZE). In commit f68453237b9 we started to use an offset of 4K which broke this contract on Aarch64 arch. Fix by mapping at o

[PULL 19/33] block/nvme: Set request_alignment at initialization

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé Commit bdd6a90a9e5 ("block: Add VFIO based NVMe driver") sets the request_alignment in nvme_refresh_limits(). For consistency, also set it during initialization. Reported-by: Stefan Hajnoczi Reviewed-by: Eric Auger Reviewed-by: Stefan Hajnoczi Tested-by: Eric Auge

[PULL 28/33] util/vfio-helpers: Trace PCI I/O config accesses

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé We sometime get kernel panic with some devices on Aarch64 hosts. Alex Williamson suggests it might be broken PCIe root complex. Add trace event to record the latest I/O access before crashing. In case, assert our accesses are aligned. Reviewed-by: Fam Zheng Reviewed

[PULL 23/33] block/nvme: Change size and alignment of prp_list_pages

2020-11-04 Thread Stefan Hajnoczi
From: Eric Auger In preparation of 64kB host page support, let's change the size and alignment of the prp_list_pages so that the VFIO DMA MAP succeeds with 64kB host page size. We align on the host page size. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Eric Auger Reviewed-by: Stefan Haj

[PULL 21/33] block/nvme: Change size and alignment of IDENTIFY response buffer

2020-11-04 Thread Stefan Hajnoczi
From: Eric Auger In preparation of 64kB host page support, let's change the size and alignment of the IDENTIFY command response buffer so that the VFIO DMA MAP succeeds. We align on the host page size. Signed-off-by: Eric Auger Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi

[PULL 22/33] block/nvme: Change size and alignment of queue

2020-11-04 Thread Stefan Hajnoczi
From: Eric Auger In preparation of 64kB host page support, let's change the size and alignment of the queue so that the VFIO DMA MAP succeeds. We align on the host page size. Signed-off-by: Eric Auger Reviewed-by: Stefan Hajnoczi Tested-by: Eric Auger Signed-off-by: Philippe Mathieu-Daudé Me

[PULL 20/33] block/nvme: Correct minimum device page size

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé While trying to simplify the code using a macro, we forgot the 12-bit shift... Correct that. Fixes: fad1eb68862 ("block/nvme: Use register definitions from 'block/nvme.h'") Reported-by: Eric Auger Reviewed-by: Stefan Hajnoczi Reviewed-by: Eric Auger Tested-by: Eri

[PULL 15/33] block/nvme: Use definitions instead of magic values in add_io_queue()

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé Replace magic values by definitions, and simplifiy since the number of queues will never reach 64K. Reviewed-by: Eric Auger Reviewed-by: Stefan Hajnoczi Tested-by: Eric Auger Signed-off-by: Philippe Mathieu-Daudé Message-id: 20201029093306.1063879-14-phi...@redha

[PULL 14/33] block/nvme: Introduce Completion Queue definitions

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé Rename Submission Queue flags with 'Sq' to differentiate submission queue flags from command queue flags, and introduce Completion Queue flag definitions. Reviewed-by: Eric Auger Tested-by: Eric Auger Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajno

[PULL 16/33] block/nvme: Correctly initialize Admin Queue Attributes

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé From the specification chapter 3.1.8 "AQA - Admin Queue Attributes" the Admin Submission Queue Size field is a 0’s based value: Admin Submission Queue Size (ASQS): Defines the size of the Admin Submission Queue in entries. Enabling a controller while this

[PULL 18/33] block/nvme: Simplify nvme_cmd_sync()

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé As all commands use the ADMIN queue, it is pointless to pass it as argument each time. Remove the argument, and rename the function as nvme_admin_cmd_sync() to make this new behavior clearer. Reviewed-by: Eric Auger Tested-by: Eric Auger Signed-off-by: Philippe Mat

[PULL 17/33] block/nvme: Simplify ADMIN queue access

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé We don't need to dereference from BDRVNVMeState each time. Use a NVMeQueuePair pointer on the admin queue. The nvme_init() becomes easier to review, matching the style of nvme_add_io_queue(). Reviewed-by: Eric Auger Reviewed-by: Stefan Hajnoczi Tested-by: Eric Auge

[PULL 12/33] block/nvme: Make nvme_identify() return boolean indicating error

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé Just for consistency, following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), return a boolean value indicating an error is set or not. Directly pass errp as the local_err is not requested in our case. Tested-by: Eric Auger

[PULL 13/33] block/nvme: Make nvme_init_queue() return boolean indicating error

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé Just for consistency, following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), return a boolean value indicating an error is set or not. Directly pass errp as the local_err is not requested in our case. This simplifies a bit

[PULL 06/33] block/nvme: Trace controller capabilities

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé Controllers have different capabilities and report them in the CAP register. We are particularly interested by the page size limits. Reviewed-by: Stefan Hajnoczi Reviewed-by: Eric Auger Tested-by: Eric Auger Signed-off-by: Philippe Mathieu-Daudé Message-id: 20201

[PULL 10/33] block/nvme: Move definitions before structure declarations

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé To be able to use some definitions in structure declarations, move them earlier. No logical change. Reviewed-by: Eric Auger Reviewed-by: Stefan Hajnoczi Tested-by: Eric Auger Signed-off-by: Philippe Mathieu-Daudé Message-id: 20201029093306.1063879-9-phi...@redhat

[PULL 11/33] block/nvme: Use unsigned integer for queue counter/size

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé We can not have negative queue count/size/index, use unsigned type. Rename 'nr_queues' as 'queue_count' to match the spec naming. Reviewed-by: Eric Auger Reviewed-by: Stefan Hajnoczi Tested-by: Eric Auger Signed-off-by: Philippe Mathieu-Daudé Message-id: 20201029

[PULL 07/33] block/nvme: Trace nvme_poll_queue() per queue

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé As we want to enable multiple queues, report the event in each nvme_poll_queue() call, rather than once in the callback calling nvme_poll_queues(). Reviewed-by: Eric Auger Reviewed-by: Stefan Hajnoczi Tested-by: Eric Auger Signed-off-by: Philippe Mathieu-Daudé Me

[PULL 09/33] block/nvme: Trace queue pair creation/deletion

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé Reviewed-by: Eric Auger Reviewed-by: Stefan Hajnoczi Tested-by: Eric Auger Signed-off-by: Philippe Mathieu-Daudé Message-id: 20201029093306.1063879-8-phi...@redhat.com Signed-off-by: Stefan Hajnoczi Tested-by: Eric Auger --- block/nvme.c | 3 +++ block/tr

[PULL 04/33] block/nvme: Use hex format to display offset in trace events

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé Use the same format used for the hw/vfio/ trace events. Suggested-by: Eric Auger Reviewed-by: Eric Auger Reviewed-by: Stefan Hajnoczi Tested-by: Eric Auger Signed-off-by: Philippe Mathieu-Daudé Message-id: 20201029093306.1063879-3-phi...@redhat.com Signed-off-by

[PULL 05/33] block/nvme: Report warning with warn_report()

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé Instead of displaying warning on stderr, use warn_report() which also displays it on the monitor. Reviewed-by: Eric Auger Reviewed-by: Stefan Hajnoczi Tested-by: Eric Auger Signed-off-by: Philippe Mathieu-Daudé Message-id: 20201029093306.1063879-4-phi...@redhat.c

[PULL 08/33] block/nvme: Improve nvme_free_req_queue_wait() trace information

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé What we want to trace is the block driver state and the queue index. Suggested-by: Stefan Hajnoczi Reviewed-by: Eric Auger Reviewed-by: Stefan Hajnoczi Tested-by: Eric Auger Signed-off-by: Philippe Mathieu-Daudé Message-id: 20201029093306.1063879-7-phi...@redhat

[PULL 03/33] MAINTAINERS: Cover "block/nvme.h" file

2020-11-04 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé The "block/nvme.h" header is shared by both the NVMe block driver and the NVMe emulated device. Add the 'F:' entry on both sections, so all maintainers/reviewers are notified when it is changed. Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Stefan Hajnoczi R

[PULL 01/33] accel/kvm: add PIO ioeventfds only in case kvm_eventfds_allowed is true

2020-11-04 Thread Stefan Hajnoczi
From: Elena Afanasova Signed-off-by: Stefan Hajnoczi Signed-off-by: Elena Afanasova Message-Id: <20201017210102.26036-1-eafanas...@gmail.com> Signed-off-by: Stefan Hajnoczi --- accel/kvm/kvm-all.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/accel/kvm/kvm-all.c b/

[PULL 02/33] softmmu/memory: fix memory_region_ioeventfd_equal()

2020-11-04 Thread Stefan Hajnoczi
From: Elena Afanasova Eventfd can be registered with a zero length when fast_mmio is true. Handle this case properly when dispatching through QEMU. Signed-off-by: Elena Afanasova Message-id: cf71a62eb04e61932ff8ffdd02e0b2aab4f495a0.ca...@gmail.com Signed-off-by: Stefan Hajnoczi --- softmmu/me

[PULL 00/33] Block patches

2020-11-04 Thread Stefan Hajnoczi
The following changes since commit 8507c9d5c9a62de2a0e281b640f995e26eac46af: Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2020-11-03 15:59:44 +) are available in the Git repository at: https://gitlab.com/stefanha/qemu.git tags/block-pull-request for you

Re: [PATCH] Prefer 'on' | 'off' over 'yes' | 'no' for bool options

2020-11-04 Thread Philippe Mathieu-Daudé
On 11/4/20 3:05 PM, Daniel P. Berrangé wrote: > Update some docs and test cases to use 'on' | 'off' as the preferred > value for bool options. > > Signed-off-by: Daniel P. Berrangé > --- > docs/system/vnc-security.rst | 6 +++--- > include/authz/listfile.h | 2 +- > qemu-options.hx

Re: [PATCH] Prefer 'on' | 'off' over 'yes' | 'no' for bool options

2020-11-04 Thread Thomas Huth
On 04/11/2020 15.05, Daniel P. Berrangé wrote: > Update some docs and test cases to use 'on' | 'off' as the preferred > value for bool options. > > Signed-off-by: Daniel P. Berrangé > --- > docs/system/vnc-security.rst | 6 +++--- > include/authz/listfile.h | 2 +- > qemu-options.hx

[PATCH] Prefer 'on' | 'off' over 'yes' | 'no' for bool options

2020-11-04 Thread Daniel P . Berrangé
Update some docs and test cases to use 'on' | 'off' as the preferred value for bool options. Signed-off-by: Daniel P. Berrangé --- docs/system/vnc-security.rst | 6 +++--- include/authz/listfile.h | 2 +- qemu-options.hx | 4 ++-- tests/qemu-iotests/233 | 4 ++-- 4 files c

Re: [PULL 0/6] Mips fixes patches

2020-11-04 Thread Peter Maydell
On Tue, 3 Nov 2020 at 17:33, Philippe Mathieu-Daudé wrote: > > The following changes since commit 83851c7c60c90e9fb6a23ff48076387a77bc33cd: > > Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2020-10-27-v3-ta= > g' into staging (2020-11-03 12:47:58 +) > > are available in the Git

Re: [PATCH for-5.2 0/3] hw/block/nvme: coverity fixes

2020-11-04 Thread Max Reitz
On 04.11.20 11:22, Klaus Jensen wrote: > From: Klaus Jensen > > Fix three issues reported by coverity (CIDs 1436128, 1436129 and > 1436131). > > Klaus Jensen (3): > hw/block/nvme: fix null ns in register namespace > hw/block/nvme: fix uint16_t use of uint32_t sgls member > hw/block/nvme: f

Re: [PATCH for-5.2 3/3] hw/block/nvme: fix free of array-typed value

2020-11-04 Thread Max Reitz
On 04.11.20 12:04, Klaus Jensen wrote: > On Nov 4 11:59, Max Reitz wrote: >> On 04.11.20 11:22, Klaus Jensen wrote: >>> From: Klaus Jensen >>> >>> Since 7f0f1acedf15 ("hw/block/nvme: support multiple namespaces"), the >>> namespaces member of NvmeCtrl is no longer a dynamically allocated >>> arra

Re: [PATCH for-5.2 2/3] hw/block/nvme: fix uint16_t use of uint32_t sgls member

2020-11-04 Thread Philippe Mathieu-Daudé
On 11/4/20 11:22 AM, Klaus Jensen wrote: > From: Klaus Jensen > > nvme_map_sgl_data erroneously uses the sgls member of NvmeIdNs as a > uint16_t. > > Reported-by: Coverity (CID 1436129) > Fixes: cba0a8a344fe ("hw/block/nvme: add support for scatter gather lists") > Signed-off-by: Klaus Jensen >

Re: [PATCH for-5.2 1/3] hw/block/nvme: fix null ns in register namespace

2020-11-04 Thread Philippe Mathieu-Daudé
On 11/4/20 11:22 AM, Klaus Jensen wrote: > From: Klaus Jensen > > Fix dereference after NULL check. > > Reported-by: Coverity (CID 1436128) > Fixes: b20804946bce ("hw/block/nvme: update nsid when registered") > Signed-off-by: Klaus Jensen > --- > hw/block/nvme.c | 3 +-- > 1 file changed, 1 in

  1   2   >