Re: Question about (and problem with) pflash data access

2020-02-12 Thread Alexey Kardashevskiy
On 13/02/2020 10:50, Philippe Mathieu-Daudé wrote: > Cc'ing Paolo and Alexey. > > On 2/13/20 12:09 AM, Guenter Roeck wrote: >> On Wed, Feb 12, 2020 at 10:39:30PM +0100, Philippe Mathieu-Daudé wrote: >>> Cc'ing Jean-Christophe and Peter. >>> >>> On 2/12/20 7:46 PM, Guenter Roeck wrote: Hi,

[PATCH 2/2] vhost-use-blk: convert to new virtio_delete_queue

2020-02-12 Thread pannengyuan
From: Pan Nengyuan use the new virtio_delete_queue function to cleanup. Signed-off-by: Pan Nengyuan --- hw/block/vhost-user-blk.c | 11 +++ include/hw/virtio/vhost-user-blk.h | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/block/vhost-user-blk.c

[PATCH 1/2] vhost-user-blk: delete virtioqueues in unrealize to fix memleaks

2020-02-12 Thread pannengyuan
From: Pan Nengyuan virtio queues forgot to delete in unrealize, and aslo error path in realize, this patch fix these memleaks, the leak stack is as follow: Direct leak of 114688 byte(s) in 16 object(s) allocated from: #0 0x7f24024fdbf0 in calloc (/lib64/libasan.so.3+0xcabf0) #1

[PATCH 0/2] delete virtio queues in vhost-user-blk-unrealize

2020-02-12 Thread pannengyuan
From: Pan Nengyuan This series patch fix memleaks when detaching vhost-user-blk device. 1. use old virtio_del_queue to fix memleaks, it's easier for stable branches to merge. As the discussion in https://lists.nongnu.org/archive/html/qemu-devel/2020-01/msg02903.html 2. convert

Re: Question about (and problem with) pflash data access

2020-02-12 Thread Philippe Mathieu-Daudé
Cc'ing Paolo and Alexey. On 2/13/20 12:09 AM, Guenter Roeck wrote: On Wed, Feb 12, 2020 at 10:39:30PM +0100, Philippe Mathieu-Daudé wrote: Cc'ing Jean-Christophe and Peter. On 2/12/20 7:46 PM, Guenter Roeck wrote: Hi, I have been playing with pflash recently. For the most part it works, but

Re: Question about (and problem with) pflash data access

2020-02-12 Thread Guenter Roeck
On Wed, Feb 12, 2020 at 10:39:30PM +0100, Philippe Mathieu-Daudé wrote: > Cc'ing Jean-Christophe and Peter. > > On 2/12/20 7:46 PM, Guenter Roeck wrote: > > Hi, > > > > I have been playing with pflash recently. For the most part it works, > > but I do have an odd problem when trying to

Re: [PATCH] block: make BlockConf.*_size properties 32-bit

2020-02-12 Thread Eric Blake
On 2/11/20 5:54 AM, Roman Kagan wrote: Devices (virtio-blk, scsi, etc.) and the block layer are happy to use 32-bit for logical_block_size, physical_block_size, and min_io_size. However, the properties in BlockConf are defined as uint16_t limiting the values to 32768. This appears unnecessary

Re: Question about (and problem with) pflash data access

2020-02-12 Thread Philippe Mathieu-Daudé
Cc'ing Jean-Christophe and Peter. On 2/12/20 7:46 PM, Guenter Roeck wrote: Hi, I have been playing with pflash recently. For the most part it works, but I do have an odd problem when trying to instantiate pflash on sx1. My data file looks as follows. 000 0001

Question about (and problem with) pflash data access

2020-02-12 Thread Guenter Roeck
Hi, I have been playing with pflash recently. For the most part it works, but I do have an odd problem when trying to instantiate pflash on sx1. My data file looks as follows. 000 0001 020 * 0002000 0002

Re: [PATCH v2] virtio: increase virtuqueue size for virtio-scsi and virtio-blk

2020-02-12 Thread Stefan Hajnoczi
On Tue, Feb 11, 2020 at 05:14:14PM +0300, Denis Plotnikov wrote: > The goal is to reduce the amount of requests issued by a guest on > 1M reads/writes. This rises the performance up to 4% on that kind of > disk access pattern. > > The maximum chunk size to be used for the guest disk accessing is

Re: [PATCH] nbd-client: Support leading / in NBD URI

2020-02-12 Thread Maxim Levitsky
On Wed, 2020-02-12 at 14:33 +0100, Ján Tomko wrote: > On Tue, Feb 11, 2020 at 08:31:01PM -0600, Eric Blake wrote: > > The NBD URI specification [1] states that only one leading slash at > > the beginning of the URI path component is stripped, not all such > > slashes. This becomes important to a

Re: [PATCH] nbd-client: Support leading / in NBD URI

2020-02-12 Thread Richard W.M. Jones
On Tue, Feb 11, 2020 at 08:31:01PM -0600, Eric Blake wrote: > The NBD URI specification [1] states that only one leading slash at > the beginning of the URI path component is stripped, not all such > slashes. This becomes important to a patch I just proposed to nbdkit > [2], which would allow the

Re: [PATCH] nbd-client: Support leading / in NBD URI

2020-02-12 Thread Ján Tomko
On Tue, Feb 11, 2020 at 08:31:01PM -0600, Eric Blake wrote: The NBD URI specification [1] states that only one leading slash at the beginning of the URI path component is stripped, not all such slashes. This becomes important to a patch I just proposed to nbdkit [2], which would allow the

Re: [PATCH v5 01/26] nvme: rename trace events to nvme_dev

2020-02-12 Thread Maxim Levitsky
On Wed, 2020-02-12 at 14:08 +0100, Klaus Birkelund Jensen wrote: > On Feb 12 11:08, Maxim Levitsky wrote: > > On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > > > Change the prefix of all nvme device related trace events to 'nvme_dev' > > > to not clash with trace events from the nvme

Re: [PATCH v5 01/26] nvme: rename trace events to nvme_dev

2020-02-12 Thread Klaus Birkelund Jensen
On Feb 12 11:08, Maxim Levitsky wrote: > On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > > Change the prefix of all nvme device related trace events to 'nvme_dev' > > to not clash with trace events from the nvme block driver. > > Hi Maxim, Thank you very much for your thorough reviews!

Re: Cross-project NBD extension proposal: NBD_INFO_INIT_STATE

2020-02-12 Thread Eric Blake
On 2/12/20 6:36 AM, Richard W.M. Jones wrote: Okay, in v2, I will start with just two bits, NBD_INIT_SPARSE (entire image is sparse, nothing is allocated) and NBD_INIT_ZERO (entire image reads as zero), and save any future bits for later additions. Do we think that 16 bits is sufficient for

Re: [PATCH v5 26/26] nvme: make lba data size configurable

2020-02-12 Thread Maxim Levitsky
On Thu, 2020-02-06 at 08:24 +0100, Klaus Birkelund Jensen wrote: > On Feb 5 01:43, Keith Busch wrote: > > On Tue, Feb 04, 2020 at 10:52:08AM +0100, Klaus Jensen wrote: > > > Signed-off-by: Klaus Jensen > > > --- > > > hw/block/nvme-ns.c | 2 +- > > > hw/block/nvme-ns.h | 4 +++- > > >

Re: [PATCH v5 24/26] nvme: change controller pci id

2020-02-12 Thread Maxim Levitsky
On Tue, 2020-02-04 at 10:52 +0100, Klaus Jensen wrote: > There are two reasons for changing this: > > 1. The nvme device currently uses an internal Intel device id. > > 2. Since commits "nvme: fix write zeroes offset and count" and "nvme: > support multiple namespaces" the controller

Re: [PATCH v5 25/26] nvme: remove redundant NvmeCmd pointer parameter

2020-02-12 Thread Maxim Levitsky
On Tue, 2020-02-04 at 10:52 +0100, Klaus Jensen wrote: > The command struct is available in the NvmeRequest that we generally > pass around anyway. > > Signed-off-by: Klaus Jensen > --- > hw/block/nvme.c | 198 > 1 file changed, 98 insertions(+),

Re: Cross-project NBD extension proposal: NBD_INFO_INIT_STATE

2020-02-12 Thread Richard W.M. Jones
On Wed, Feb 12, 2020 at 06:09:11AM -0600, Eric Blake wrote: > On 2/12/20 1:27 AM, Wouter Verhelst wrote: > >Hi, > > > >On Mon, Feb 10, 2020 at 10:52:55PM +, Richard W.M. Jones wrote: > >>But anyway ... could a flag indicating that the whole image is sparse > >>be useful, either as well as

Re: [PATCH v5 23/26] pci: allocate pci id for nvme

2020-02-12 Thread Maxim Levitsky
On Tue, 2020-02-04 at 10:52 +0100, Klaus Jensen wrote: > The emulated nvme device (hw/block/nvme.c) is currently using an > internal Intel device id. > > Prepare to change that by allocating a device id under the 1b36 (Red > Hat, Inc.) vendor id. > > Signed-off-by: Klaus Jensen > --- >

Re: [PATCH v5 22/26] nvme: support multiple namespaces

2020-02-12 Thread Maxim Levitsky
On Tue, 2020-02-04 at 10:52 +0100, Klaus Jensen wrote: > This adds support for multiple namespaces by introducing a new 'nvme-ns' > device model. The nvme device creates a bus named from the device name > ('id'). The nvme-ns devices then connect to this and registers > themselves with the nvme

Re: [PATCH] nbd: Fix regression with multiple meta contexts

2020-02-12 Thread Laurent Vivier
Le 12/02/2020 à 13:10, Eric Blake a écrit : > On 2/12/20 3:24 AM, Laurent Vivier wrote: >> Le 06/02/2020 à 18:38, Eric Blake a écrit : >>> Detected by a hang in the libnbd testsuite.  If a client requests >>> multiple meta contexts (both base:allocation and qemu:dirty-bitmap:x) >>> at the same

Re: [PATCH] nbd: Fix regression with multiple meta contexts

2020-02-12 Thread Eric Blake
On 2/12/20 3:24 AM, Laurent Vivier wrote: Le 06/02/2020 à 18:38, Eric Blake a écrit : Detected by a hang in the libnbd testsuite. If a client requests multiple meta contexts (both base:allocation and qemu:dirty-bitmap:x) at the same time, our attempt to silence a false-positive warning about a

Re: Cross-project NBD extension proposal: NBD_INFO_INIT_STATE

2020-02-12 Thread Eric Blake
On 2/12/20 1:27 AM, Wouter Verhelst wrote: Hi, On Mon, Feb 10, 2020 at 10:52:55PM +, Richard W.M. Jones wrote: But anyway ... could a flag indicating that the whole image is sparse be useful, either as well as NBD_INIT_SPARSE or instead of it? You could use it to avoid an initial disk

Re: [PATCH v5 21/26] nvme: add support for scatter gather lists

2020-02-12 Thread Maxim Levitsky
On Tue, 2020-02-04 at 10:52 +0100, Klaus Jensen wrote: > For now, support the Data Block, Segment and Last Segment descriptor > types. > > See NVM Express 1.3d, Section 4.4 ("Scatter Gather List (SGL)"). > > Signed-off-by: Klaus Jensen > Acked-by: Fam Zheng > --- > block/nvme.c | 18

Re: [PATCH v5 20/26] nvme: handle dma errors

2020-02-12 Thread Maxim Levitsky
On Tue, 2020-02-04 at 10:52 +0100, Klaus Jensen wrote: > Handling DMA errors gracefully is required for the device to pass the > block/011 test ("disable PCI device while doing I/O") in the blktests > suite. > > With this patch the device passes the test by retrying "critical" > transfers

Re: [PATCH v5 18/26] nvme: use preallocated qsg/iov in nvme_dma_prp

2020-02-12 Thread Maxim Levitsky
On Tue, 2020-02-04 at 10:52 +0100, Klaus Jensen wrote: > Since clean up of the request qsg/iov has been moved to the common > nvme_enqueue_req_completion function, there is no need to use a > stack allocated qsg/iov in nvme_dma_prp. > > Signed-off-by: Klaus Jensen > --- > hw/block/nvme.c | 18

Re: [PATCH v5 17/26] nvme: allow multiple aios per command

2020-02-12 Thread Maxim Levitsky
On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > This refactors how the device issues asynchronous block backend > requests. The NvmeRequest now holds a queue of NvmeAIOs that are > associated with the command. This allows multiple aios to be issued for > a command. Only when all requests

Re: [PATCH v5 16/26] nvme: refactor prp mapping

2020-02-12 Thread Maxim Levitsky
On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > Refactor nvme_map_prp and allow PRPs to be located in the CMB. The logic > ensures that if some of the PRP is in the CMB, all of it must be located > there, as per the specification. To be honest this looks like not refactoring but a bugfix

Re: [PATCH v4 0/4] qmp: Optionally run handlers in coroutines

2020-02-12 Thread Kevin Wolf
Am 05.02.2020 um 15:00 hat Kevin Wolf geschrieben: > Am 21.01.2020 um 19:11 hat Kevin Wolf geschrieben: > > Some QMP command handlers can block the main loop for a relatively long > > time, for example because they perform some I/O. This is quite nasty. > > Allowing such handlers to run in a

Re: [PATCH v2 2/4] virtio-scsi: default num_queues to -smp N

2020-02-12 Thread Stefan Hajnoczi
On Tue, Feb 11, 2020 at 11:31:17AM -0500, Michael S. Tsirkin wrote: > On Tue, Feb 11, 2020 at 04:20:41PM +, Stefan Hajnoczi wrote: > > On Mon, Feb 03, 2020 at 12:39:49PM +0100, Sergio Lopez wrote: > > > On Mon, Feb 03, 2020 at 10:57:44AM +, Daniel P. Berrangé wrote: > > > > On Mon, Feb 03,

Re: [PATCH v5 15/26] nvme: bump supported specification to 1.3

2020-02-12 Thread Maxim Levitsky
On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > Add new fields to the Identify Controller and Identify Namespace data > structures accoding to NVM Express 1.3d. > > NVM Express 1.3d requires the following additional features: > - addition of the Namespace Identification Descriptor List

Re: [PATCH v5 14/26] nvme: make sure ncqr and nsqr is valid

2020-02-12 Thread Maxim Levitsky
On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > 0x is not an allowed value for NCQR and NSQR in Set Features on > Number of Queues. > > Signed-off-by: Klaus Jensen > --- > hw/block/nvme.c | 4 > 1 file changed, 4 insertions(+) > > diff --git a/hw/block/nvme.c

Re: [PATCH v5 13/26] nvme: additional tracing

2020-02-12 Thread Maxim Levitsky
On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > Add a trace call for nvme_enqueue_req_completion. > > Also, streamline nvme_identify_ns and nvme_identify_ns_list. They do not > need to repeat the command, it is already in the trace name. > > Signed-off-by: Klaus Jensen > --- >

Re: [PATCH v5 12/26] nvme: add missing mandatory features

2020-02-12 Thread Maxim Levitsky
On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > Add support for returning a resonable response to Get/Set Features of > mandatory features. > > Signed-off-by: Klaus Jensen > --- > hw/block/nvme.c | 57 --- > hw/block/trace-events | 2 ++ >

Re: [PATCH v5 11/26] nvme: add support for the asynchronous event request command

2020-02-12 Thread Maxim Levitsky
On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > Required for compliance with NVMe revision 1.2.1. See NVM Express 1.2.1, > Section 5.2 ("Asynchronous Event Request command"). > > Mostly imported from Keith's qemu-nvme tree. Modified with a max number > of queued events (controllable with

Re: [PATCH v5 10/26] nvme: add support for the get log page command

2020-02-12 Thread Maxim Levitsky
On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > Add support for the Get Log Page command and basic implementations of > the mandatory Error Information, SMART / Health Information and Firmware > Slot Information log pages. > > In violation of the specification, the SMART / Health

Re: [PATCH v5 09/26] nvme: add temperature threshold feature

2020-02-12 Thread Maxim Levitsky
On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > It might seem wierd to implement this feature for an emulated device, > but it is mandatory to support and the feature is useful for testing > asynchronous event request support, which will be added in a later > patch. Absolutely but as the

Re: [PATCH v5 08/26] nvme: refactor device realization

2020-02-12 Thread Maxim Levitsky
On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > This patch splits up nvme_realize into multiple individual functions, > each initializing a different subset of the device. > > Signed-off-by: Klaus Jensen > --- > hw/block/nvme.c | 175 +++- >

Re: [PATCH v5 06/26] nvme: refactor nvme_addr_read

2020-02-12 Thread Maxim Levitsky
On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > Pull the controller memory buffer check to its own function. The check > will be used on its own in later patches. > > Signed-off-by: Klaus Jensen > --- > hw/block/nvme.c | 18 +- > 1 file changed, 13 insertions(+), 5

Re: [PATCH v5 07/26] nvme: add support for the abort command

2020-02-12 Thread Maxim Levitsky
On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > Required for compliance with NVMe revision 1.2.1. See NVM Express 1.2.1, > Section 5.1 ("Abort command"). > > The Abort command is a best effort command; for now, the device always > fails to abort the given command. > > Signed-off-by:

Re: [PATCH] nbd: Fix regression with multiple meta contexts

2020-02-12 Thread Laurent Vivier
Le 06/02/2020 à 18:38, Eric Blake a écrit : > Detected by a hang in the libnbd testsuite. If a client requests > multiple meta contexts (both base:allocation and qemu:dirty-bitmap:x) > at the same time, our attempt to silence a false-positive warning > about a potential uninitialized variable

Re: [PATCH v5 05/26] nvme: populate the mandatory subnqn and ver fields

2020-02-12 Thread Maxim Levitsky
On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > Required for compliance with NVMe revision 1.2.1 or later. See NVM > Express 1.2.1, Section 5.11 ("Identify command"), Figure 90 and Section > 7.9 ("NVMe Qualified Names"). > > This also bumps the supported version to 1.2.1. > >

Re: [PATCH v5 04/26] nvme: add missing fields in the identify data structures

2020-02-12 Thread Maxim Levitsky
On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > Not used by the device model but added for completeness. See NVM Express > 1.2.1, Section 5.11 ("Identify command"), Figure 90 and Figure 93. > > Signed-off-by: Klaus Jensen > --- > include/block/nvme.h | 48

Re: [PATCH v5 03/26] nvme: move device parameters to separate struct

2020-02-12 Thread Maxim Levitsky
On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > Move device configuration parameters to separate struct to make it > explicit what is configurable and what is set internally. > > Signed-off-by: Klaus Jensen > --- > hw/block/nvme.c | 44 ++-- >

Re: [PATCH v5 02/26] nvme: remove superfluous breaks

2020-02-12 Thread Maxim Levitsky
On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > These break statements was left over when commit 3036a626e9ef ("nvme: > add Get/Set Feature Timestamp support") was merged. > > Signed-off-by: Klaus Jensen > --- > hw/block/nvme.c | 4 > 1 file changed, 4 deletions(-) > > diff --git

Re: [PATCH v5 01/26] nvme: rename trace events to nvme_dev

2020-02-12 Thread Maxim Levitsky
On Tue, 2020-02-04 at 10:51 +0100, Klaus Jensen wrote: > Change the prefix of all nvme device related trace events to 'nvme_dev' > to not clash with trace events from the nvme block driver. > > Signed-off-by: Klaus Jensen > --- > hw/block/nvme.c | 185