Re: [PATCH v7 03/48] nvme: move device parameters to separate struct

2020-04-14 Thread Philippe Mathieu-Daudé
On 4/15/20 7:50 AM, Klaus Jensen wrote: From: Klaus Jensen Move device configuration parameters to separate struct to make it explicit what is configurable and what is set internally. Signed-off-by: Klaus Jensen Signed-off-by: Klaus Jensen Acked-by: Keith Busch Reviewed-by: Maxim Levitsky

Re: [PATCH v7 02/48] nvme: remove superfluous breaks

2020-04-14 Thread Philippe Mathieu-Daudé
On 4/15/20 7:50 AM, Klaus Jensen wrote: From: Klaus Jensen These break statements was left over when commit 3036a626e9ef ("nvme: add Get/Set Feature Timestamp support") was merged. Signed-off-by: Klaus Jensen Acked-by: Keith Busch Reviewed-by: Maxim Levitsky --- hw/block/nvme.c | 4

Re: [EXTERNAL] [PATCH] target/ppc: Fix mtmsr(d) L=1 variant that loses interrupts

2020-04-14 Thread Cédric Le Goater
On 4/14/20 1:11 PM, Nicholas Piggin wrote: > If mtmsr L=1 sets MSR[EE] while there is a maskable exception pending, > it does not cause an interrupt. This causes the test case to hang: > > https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.gnu.org_archive_html_qemu-2Dppc_2019-2D10_msg00826

Re: [PATCH v41 01/21] target/avr: Add outward facing interfaces and core CPU logic

2020-04-14 Thread Philippe Mathieu-Daudé
Hi Michael, On 4/12/20 11:14 AM, Michael Rolnik wrote: > hi all. > > are there any news / updates about AVR support? Aleksandar is not very active on qemu-devel recently, I suppose he is busy. I have ~15 patches on top of your series, but I'm waiting update on the status on this target before p

Re: [Qemu devel PATCH v5 1/3] hw/net: Add Smartfusion2 emac block

2020-04-14 Thread Philippe Mathieu-Daudé
On 4/14/20 5:02 PM, sundeep.l...@gmail.com wrote: > From: Subbaraya Sundeep > > Modelled Ethernet MAC of Smartfusion2 SoC. > Micrel KSZ8051 PHY is present on Emcraft's > SOM kit hence same PHY is emulated. > > Signed-off-by: Subbaraya Sundeep > Reviewed-by: Philippe Mathieu-Daudé > Tested-by:

Re: [PATCH v5 for-5.0] configure: warn if not using a separate build directory

2020-04-14 Thread Markus Armbruster
Peter Maydell writes: > On Mon, 6 Apr 2020 at 16:33, Daniel P. Berrangé wrote: >> >> Running configure directly from the source directory is a build >> configuration that will go away in future. It is also not currently >> covered by any automated testing. Display a deprecation warning if >> the

[PATCH v7 46/48] pci: allocate pci id for nvme

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen 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 Cc: Gerd Hoffmann Acked-by: Keith Busch Reviewed-by: Maxim Levi

[PATCH v7 47/48] nvme: change controller pci id

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen 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 device no longer has the quirks that the Lin

[PATCH v7 41/48] nvme: harden cmb access

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen Since the controller has only supported PRPs so far it has not been required to check the ending address (addr + len - 1) of the CMB access for validity since it has been guaranteed to be in range of the CMB. This changes when the controller adds support for SGLs (next patch),

[PATCH v7 36/48] nvme: allow multiple aios per command

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen 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 have been completed will the device post a

[PATCH v7 28/48] nvme: pass request along for tracing

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen Signed-off-by: Klaus Jensen Reviewed-by: Maxim Levitsky --- hw/block/nvme.c | 67 +-- hw/block/trace-events | 2 +- 2 files changed, 40 insertions(+), 29 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 2ff7dd6

Re: [PATCH-for-5.1 v3 02/24] scripts/coccinelle: Script to simplify DeviceClass error propagation

2020-04-14 Thread Philippe Mathieu-Daudé
On 4/14/20 3:17 PM, Markus Armbruster wrote: > Philippe Mathieu-Daudé writes: > >> On 4/14/20 2:24 PM, Markus Armbruster wrote: >>> Philippe Mathieu-Daudé writes: >>> When a device uses an Error* with data not modified before realize(), this call can be moved to init(). Add a Coccinell

[PATCH v7 39/48] pci: pass along the return value of dma_memory_rw

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen The nvme device needs to know the return value of dma_memory_rw to pass block/011 from blktests. So pass it along instead of ignoring it. There are no existing users of the return value, so this patch should be safe. Signed-off-by: Klaus Jensen Reviewed-by: Philippe Mathieu-

[PATCH v7 37/48] nvme: add nvme_check_rw helper

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen Signed-off-by: Klaus Jensen --- hw/block/nvme.c | 26 -- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index c123be10fd0d..ffc49985321b 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -651,6 +651

[PATCH v7 33/48] nvme: be consistent about zeros vs zeroes

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen The spec in general uses 'zeroes' and not 'zeros'. Now, according to the Oxford dictionary, 'zeroes' is the action of zeroing something, i.e. "he zeroes the range" and 'zeros' is the plural of zero. Thus, Write Zeroes should actually be called Write Zeros, but alas, let us ali

[PATCH v7 27/48] nvme: refactor dma read/write

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen Refactor the nvme_dma_{read,write}_prp functions into a common function taking a DMADirection parameter. Signed-off-by: Klaus Jensen Reviewed-by: Maxim Levitsky --- hw/block/nvme.c | 88 - 1 file changed, 43 insertions(+), 45

[PATCH v7 48/48] nvme: make lba data size configurable

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen Signed-off-by: Klaus Jensen Acked-by: Keith Busch Reviewed-by: Maxim Levitsky --- hw/block/nvme-ns.c | 7 ++- hw/block/nvme-ns.h | 4 +++- hw/block/nvme.c| 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/block/nvme-ns.c b/hw/block/nvme-ns.c i

[PATCH v7 45/48] nvme: support multiple namespaces

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen 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 device. This changes how an nvme device is cr

[PATCH v7 44/48] nvme: refactor identify active namespace id list

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen Prepare to support inactive namespaces. Signed-off-by: Klaus Jensen Reviewed-by: Maxim Levitsky --- hw/block/nvme.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index f295f027b8e2..05a6fa334a70 100644 --- a/hw

[PATCH v7 38/48] nvme: use preallocated qsg/iov in nvme_dma_prp

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen 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 Acked-by: Keith Busch Reviewed-by: Maxim Levitsky --- hw/block/nvme.c | 1

[PATCH v7 42/48] nvme: add support for scatter gather lists

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen 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 Signed-off-by: Klaus Jensen Acked-by: Keith Busch --- hw/block/nvme.c | 332 +

[PATCH v7 40/48] nvme: handle dma errors

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen 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 (posting of completion entries and processing of submi

[PATCH v7 29/48] nvme: add request mapping helper

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen Introduce the nvme_map helper to remove some noise in the main nvme_rw function. Signed-off-by: Klaus Jensen Reviewed-by: Maxim Levitsky --- hw/block/nvme.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c

[PATCH v7 24/48] nvme: add mapping helpers

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen Add nvme_map_addr, nvme_map_addr_cmb and nvme_addr_to_cmb helpers and use them in nvme_map_prp. This fixes a bug where in the case of a CMB transfer, the device would map to the buffer with a wrong length. Fixes: b2b2b67a00574 ("nvme: Add support for Read Data and Write Data

[PATCH v7 31/48] nvme: refactor request bounds checking

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen Signed-off-by: Klaus Jensen Reviewed-by: Maxim Levitsky --- hw/block/nvme.c | 28 ++-- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 3e5e99644a4e..7528d75905d4 100644 --- a/hw/block/nvme.c +++ b

[PATCH v7 34/48] nvme: refactor NvmeRequest

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen Add a reference to the NvmeNamespace and move clearing of the structure from "clear before use" to "clear after use". Signed-off-by: Klaus Jensen --- hw/block/nvme.c | 38 +- hw/block/nvme.h | 1 + 2 files changed, 22 insertions(+), 17 de

[PATCH v7 43/48] nvme: add support for sgl bit bucket descriptor

2020-04-14 Thread Klaus Jensen
From: Gollu Appalanaidu This adds support for SGL descriptor type 0x1 (bit bucket descriptor). See the NVM Express v1.3d specification, Section 4.4 ("Scatter Gather List (SGL)"). Signed-off-by: Gollu Appalanaidu Signed-off-by: Klaus Jensen --- hw/block/nvme.c | 33 +++-

[PATCH v7 26/48] nvme: remove redundant has_sg member

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen Remove the has_sg member from NvmeRequest since it's redundant. Signed-off-by: Klaus Jensen Reviewed-by: Maxim Levitsky --- hw/block/nvme.c | 11 ++- hw/block/nvme.h | 1 - 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nv

[PATCH v7 35/48] nvme: remove NvmeCmd parameter

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen Keep a copy of the raw nvme command in the NvmeRequest and remove the now redundant NvmeCmd parameter. Signed-off-by: Klaus Jensen --- hw/block/nvme.c | 177 +--- hw/block/nvme.h | 1 + 2 files changed, 93 insertions(+), 85 delet

[PATCH v7 25/48] nvme: replace dma_acct with blk_acct equivalent

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen The QSG isn't always initialized, so accounting could be wrong. Issue a call to blk_acct_start instead with the size taken from the QSG or IOV depending on the kind of I/O. Signed-off-by: Klaus Jensen Reviewed-by: Maxim Levitsky --- hw/block/nvme.c | 5 - 1 file changed

[PATCH v7 30/48] nvme: verify validity of prp lists in the cmb

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen Before this patch the device already supported this, but it did not check for the validity of it nor announced the support in the LISTS field. If some of the PRPs in a PRP list are in the CMB, then ALL entries must be there. This patch makes sure that is verified as well as pr

[PATCH v7 23/48] nvme: memset preallocated requests structures

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen This is preparatory to subsequent patches that change how QSGs/IOVs are handled. It is important that the qsg and iov members of the NvmeRequest are initially zeroed. Signed-off-by: Klaus Jensen Reviewed-by: Maxim Levitsky --- hw/block/nvme.c | 2 +- 1 file changed, 1 inser

[PATCH v7 16/48] nvme: additional tracing

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen 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 --- hw/block/nvme.c | 20 hw/block/trace-events | 13 +++-- 2 files changed, 3

[PATCH v7 22/48] nvme: bump supported version to v1.3

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen Signed-off-by: Klaus Jensen Reviewed-by: Maxim Levitsky --- hw/block/nvme.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index d5c293476411..59935d4641a6 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -44,6 +

[PATCH v7 32/48] nvme: add check for mdts

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen Add 'mdts' device parameter to control the Maximum Data Transfer Size of the controller and check that it is respected. Signed-off-by: Klaus Jensen Reviewed-by: Maxim Levitsky --- hw/block/nvme.c | 29 - hw/block/nvme.h | 4 +++- hw/

[PATCH v7 19/48] nvme: support identify namespace descriptor list

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen Since we are not providing the NGUID or EUI64 fields, we must support the Namespace UUID. We do not have any way of storing a persistent unique identifier, so conjure up a UUID that is just the namespace id. Signed-off-by: Klaus Jensen --- hw/block/nvme.c | 39

[PATCH v7 13/48] nvme: add support for the get log page command

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen 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 Information log page does not persist information ov

[PATCH v7 21/48] nvme: provide the mandatory subnqn field

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen Signed-off-by: Klaus Jensen Reviewed-by: Maxim Levitsky --- hw/block/nvme.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index d88e21a14b77..d5c293476411 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -1940,6 +1940,9 @@ stat

[PATCH v7 20/48] nvme: enforce valid queue creation sequence

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen Support returning Command Sequence Error if Set Features on Number of Queues is called after queues have been created. Signed-off-by: Klaus Jensen Reviewed-by: Maxim Levitsky --- hw/block/nvme.c | 12 hw/block/nvme.h | 1 + 2 files changed, 13 insertions(+) d

[PATCH v7 18/48] nvme: add log specific field to trace events

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen The LSP field is not used directly now, but include it in the trace. Signed-off-by: Klaus Jensen Reviewed-by: Maxim Levitsky --- hw/block/nvme.c | 3 ++- hw/block/trace-events | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/block/nvme.c b/hw/

[PATCH v7 15/48] nvme: add missing mandatory features

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen Add support for returning a resonable response to Get/Set Features of mandatory features. Signed-off-by: Klaus Jensen Signed-off-by: Klaus Jensen Acked-by: Keith Busch --- hw/block/nvme.c | 60 ++- hw/block/trace-events | 2 ++

[PATCH v7 14/48] nvme: add support for the asynchronous event request command

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen 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 the aer_max_queued device parameter). The sp

[PATCH v7 12/48] nvme: add temperature threshold feature

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen 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. Signed-off-by: Klaus Jensen Acked-by: Keith Busch Reviewed-by:

[PATCH v7 09/48] nvme: add max_ioqpairs device parameter

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen The num_queues device paramater has a slightly confusing meaning because it accounts for the admin queue pair which is not really optional. Secondly, it is really a maximum value of queues allowed. Add a new max_ioqpairs parameter that only accounts for I/O queue pairs, but ke

[PATCH v7 11/48] nvme: refactor device realization

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen This patch splits up nvme_realize into multiple individual functions, each initializing a different subset of the device. Signed-off-by: Klaus Jensen Signed-off-by: Klaus Jensen Acked-by: Keith Busch --- hw/block/nvme.c | 178 +++

[PATCH v7 17/48] nvme: make sure ncqr and nsqr is valid

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen 0x is not an allowed value for NCQR and NSQR in Set Features on Number of Queues. Signed-off-by: Klaus Jensen Acked-by: Keith Busch Reviewed-by: Maxim Levitsky --- hw/block/nvme.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/block/nvme.c b/hw/block/nv

[PATCH v7 07/48] nvme: add support for the abort command

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen 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: Klaus Jensen Signed-off-by: Klaus Jensen Acked-by:

[PATCH v7 08/48] nvme: fix pci doorbell size calculation

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen The size of the BAR is 0x1000 (main registers) + 8 bytes for each queue. Currently, the size of the BAR is calculated like so: n->reg_size = pow2ceil(0x1004 + 2 * (n->params.num_queues + 1) * 4); Since the 'num_queues' parameter already accounts for the admin queue, this

[PATCH v7 06/48] nvme: refactor nvme_addr_read

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen 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 Acked-by: Keith Busch --- hw/block/nvme.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/hw/bl

[PATCH v7 01/48] nvme: rename trace events to nvme_dev

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen 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 Acked-by: Keith Busch Reviewed-by: Maxim Levitsky --- hw/block/nvme.c | 190 +---

[PATCH v7 05/48] nvme: use constants in identify

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen Signed-off-by: Klaus Jensen Reviewed-by: Maxim Levitsky --- hw/block/nvme.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 088668f28bae..622103c42d0a 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -6

[PATCH v7 04/48] nvme: bump spec data structures to v1.3

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen Add missing fields in the Identify Controller and Identify Namespace data structures to bring them in line with NVMe v1.3. This also adds data structures and defines for SGL support which requires a couple of trivial changes to the nvme block driver as well. Signed-off-by: Kl

[PATCH v7 10/48] nvme: remove redundant cmbloc/cmbsz members

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen Signed-off-by: Klaus Jensen --- hw/block/nvme.c | 7 ++- hw/block/nvme.h | 2 -- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index f45909dad480..123539a5d0ae 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -63,7 +

[PATCH v7 00/48] nvme: support NVMe v1.3d, SGLs and multiple namespaces

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen Hi, v7 is mostly just changes proposed by Maxim. Also, Gollu's patch for the bit bucket sgl descriptor has been added (patch #43), but it is of a pretty manageable size. Changes since v6 * 01/48 ("nvme: rename trace events to nvme_dev") - indentation nit

[PATCH v7 02/48] nvme: remove superfluous breaks

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen These break statements was left over when commit 3036a626e9ef ("nvme: add Get/Set Feature Timestamp support") was merged. Signed-off-by: Klaus Jensen Acked-by: Keith Busch Reviewed-by: Maxim Levitsky --- hw/block/nvme.c | 4 1 file changed, 4 deletions(-) diff --git

[PATCH v7 03/48] nvme: move device parameters to separate struct

2020-04-14 Thread Klaus Jensen
From: Klaus Jensen Move device configuration parameters to separate struct to make it explicit what is configurable and what is set internally. Signed-off-by: Klaus Jensen Signed-off-by: Klaus Jensen Acked-by: Keith Busch Reviewed-by: Maxim Levitsky --- hw/block/nvme.c | 44

[PATCH v2] hvf: use standard CR0 and CR4 register definitions

2020-04-14 Thread Cameron Esfahani via
Signed-off-by: Cameron Esfahani --- v2: + Fix duplicate line Roman Bolshakov found in review. --- target/i386/cpu.h | 2 ++ target/i386/hvf/hvf.c | 2 +- target/i386/hvf/vmx.h | 15 --- target/i386/hvf/x86.c | 6 +++--- target/i386/hvf/x86.h | 34

[PATCH v2] nrf51: Fix last GPIO CNF address

2020-04-14 Thread Cameron Esfahani via
NRF51_GPIO_REG_CNF_END doesn't actually refer to the start of the last valid CNF register: it's referring to the last byte of the last valid CNF register. This hasn't been a problem up to now, as current implementation in memory.c turns an unaligned 4-byte read from 0x77f to a single byte read and

[PATCH v2 1/3] exec: fetch the alignment of Linux devdax pmem character device nodes

2020-04-14 Thread Jingqi Liu
If the backend file is devdax pmem character device, the alignment specified by the option 'align=NUM' in the '-object memory-backend-file' needs to match the alignment requirement of the devdax pmem character device. This patch uses the interfaces of libdaxctl to fetch the devdax pmem file 'align

[PATCH v2 2/3] docs/nvdimm: add description of alignment requirement of device dax

2020-04-14 Thread Jingqi Liu
For device dax (e.g., /dev/dax0.0), the NUM of 'align=NUM' option needs to match the alignment requirement of the device dax. It must be larger than or equal to the 'align' of device dax. Signed-off-by: Jingqi Liu --- docs/nvdimm.txt | 9 + 1 file changed, 9 insertions(+) diff --git a/d

[PATCH v2 0/3] fetch the alignment of device dax

2020-04-14 Thread Jingqi Liu
This series adds libdaxctl support and fetchs the alignment of device dax through libdaxctl [1] APIs. QEMU uses mmap(2) to maps vNVDIMM backends and aligns the mapping address to the page size (getpagesize(2)) by default. However, some types of backends may require an alignment different than the

[PATCH v2 3/3] configure: add libdaxctl support

2020-04-14 Thread Jingqi Liu
Add a pair of configure options --{enable,disable}-libdaxctl to control whether QEMU is compiled with libdaxctl [1]. Libdaxctl is a utility library for managing the device dax subsystem. QEMU uses mmap(2) to maps vNVDIMM backends and aligns the mapping address to the page size (getpagesize(2)) by

[PATCH 3/4] char-socket: avoid double call tcp_chr_free_connection

2020-04-14 Thread Li Feng
double call tcp_chr_free_connection generates a crash. Signed-off-by: Li Feng --- chardev/char-socket.c | 5 + 1 file changed, 5 insertions(+) diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 185fe38dda..43aab8f24b 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket

[PATCH 1/4] vhost-user-blk: delay vhost_user_blk_disconnect

2020-04-14 Thread Li Feng
Since commit b0a335e351103bf92f3f9d0bd5759311be8156ac, a socket write may trigger a disconnect events, calling vhost_user_blk_disconnect() and clearing all the vhost_dev strutures. Then the next socket read will encounter an invalid pointer to vhost_dev. Signed-off-by: Li Feng --- hw/block/vhost

[PATCH 2/4] vhost-user-blk: fix invalid memory access

2020-04-14 Thread Li Feng
when s->inflight is freed, vhost_dev_free_inflight may try to access s->inflight->addr, it will retrigger the following issue. ==7309==ERROR: AddressSanitizer: heap-use-after-free on address 0x604001020d18 at pc 0x55ce948a bp 0x7fffb170 sp 0x7fffb160 READ of size 8 at 0x604001020d18 t

[PATCH 4/4] vhost-user-blk: fix crash in realize process

2020-04-14 Thread Li Feng
The crash could be reproduced like this: 1. break vhost_user_write; 2. kill the vhost-user-blk target; 3. let qemu continue running; 4. start vhost-user-blk; 5. see crash! This fix makes changes: 1. set s->connected to true after vhost_dev_init; 2. call vhost_dev_get_config when s->connected is tr

[PATCH 0/4] fix crashes when inject errors to vhost-user-blk chardev

2020-04-14 Thread Li Feng
The following patches fix various crashes happened when injecting errors to chardev unix domain socket. The crashes are encountered when the socket is from connected to disconnected at vhost-user-blk realize routine. These crashes could be reproduced like this: 1. gdb break at vhost_user_write; 2

[Bug 1805256] Re: qemu-img hangs on rcu_call_ready_event logic in Aarch64 when converting images

2020-04-14 Thread Rafael David Tinoco
** Changed in: qemu (Ubuntu Eoan) Assignee: Rafael David Tinoco (rafaeldtinoco) => (unassigned) ** Changed in: qemu Assignee: Rafael David Tinoco (rafaeldtinoco) => (unassigned) -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEM

Re: [RFC PATCH v1 00/26] VM introspection

2020-04-14 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200415005938.23895-1-ala...@bitdefender.com/ Hi, This series failed the docker-mingw@fedora build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT BEGIN

Re: [PATCH-for-5.1] gdbstub: Rename GByteArray variable 'mem_buf' as 'array'

2020-04-14 Thread David Gibson
On Tue, Apr 14, 2020 at 01:28:48PM +0200, Philippe Mathieu-Daudé wrote: > GByteArray type has should not be treated as a u8[] buffer. > The GLib Byte Arrays API should be used instead. > Rename the 'mem_buf' variable as 'array' to make it more > obvious in the code. > > Signed-off-by: Philippe Mat

Re: [PATCH RFC v2] target/arm: Implement SVE2 MATCH, NMATCH

2020-04-14 Thread Richard Henderson
On 4/14/20 4:16 PM, Stephen Long wrote: > Signed-off-by: Stephen Long > --- > target/arm/helper-sve.h| 10 > target/arm/sve.decode | 5 > target/arm/sve_helper.c| 51 ++ > target/arm/translate-sve.c | 22 > 4 files c

Re: [RFC PATCH v1 00/26] VM introspection

2020-04-14 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200415005938.23895-1-ala...@bitdefender.com/ Hi, This series failed the asan build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT BEGIN === #!/bin/bash

Re: [PATCH v2 for 5.0-rc3 00/17] more randome fixes (user, pie, docker and gdbstub)

2020-04-14 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200414200631.12799-1-alex.ben...@linaro.org/ Hi, This series seems to have some coding style problems. See output below for more information: Subject: [PATCH v2 for 5.0-rc3 00/17] more randome fixes (user, pie, docker and gdbstub) Message-id: 20200414

[RFC PATCH v1 26/26] kvm: vmi: add 'command' and 'event' properties

2020-04-14 Thread Adalbert Lazăr
There are cases when the access to an introspected VM must be limited to certain introspection commands/events. Signed-off-by: Adalbert Lazăr --- accel/kvm/vmi.c | 86 ++--- 1 file changed, 74 insertions(+), 12 deletions(-) diff --git a/accel/kvm/vmi.

[RFC PATCH v1 21/26] kvm: vmi: postpone the OK response from qmp_stop()

2020-04-14 Thread Adalbert Lazăr
The method to postpone the intercepted command (pause/suspend/migrate) until the introspection tool has the chance to remove its hooks (e.g. breakpoints) from guest doesn't work on snapshot+memory (at least as it is done by libvirt/virt-manager 1.3.1). The sequence qmp_stop()+save_vm+qmp_cont() doe

[RFC PATCH v1 16/26] kvm: vmi: intercept pause/resume

2020-04-14 Thread Adalbert Lazăr
From: Marian Rotariu Because the introspection tool can run on another VM, suspending either of these two VMs requires signaling the introspection tool to remove any changes made to the introspected VM. This is done through the KVM_INTROSPECTION_PREUNHOOK ioctl. KVM will send an event through the

[RFC PATCH v1 24/26] kvm: vmi: add 'unhook_on_shutdown' property

2020-04-14 Thread Adalbert Lazăr
Some introspection tools can detect when the guest is shutting down. This new option, 'unhook_on_shutdown' controls if QEMU will notify the introspection tool on a shutdown command at its level. Signed-off-by: Adalbert Lazăr --- accel/kvm/vmi.c | 25 + 1 file changed, 25

[RFC PATCH v1 12/26] kvm: vmi: add 'key' property

2020-04-14 Thread Adalbert Lazăr
The introspection tool can be authenticated if the 'key' parameter is set with the ID of a secret object holding a shared secret between the introspection tool and QEMU of the introspected VM. Signed-off-by: Adalbert Lazăr --- accel/kvm/vmi.c | 66

[RFC PATCH v1 22/26] kvm: vmi: add 'async_unhook' property

2020-04-14 Thread Adalbert Lazăr
The default method to handle the intercepted commands (pause/suspend/migrate) might not be the simplest method. We add an alternative method, used when async_unhook is set to false, that runs the main loop until the introspection tool finish the unhook process and closes the introspection socket.

[RFC PATCH v1 10/26] kvm: vmi: add the handshake with the introspection tool

2020-04-14 Thread Adalbert Lazăr
QEMU sends the name, the UUID and the VM start time and expects the hash of a secret shared with the introspection tool that can be used to authenticate it. Signed-off-by: Adalbert Lazăr --- accel/kvm/vmi.c| 290 + include/sysemu/vmi-handshake.h |

[RFC PATCH v1 23/26] kvm: vmi: intercept shutdown

2020-04-14 Thread Adalbert Lazăr
From: Marian Rotariu On shutdown, it is desirable that the introspection tool removes its changes from the introspected VM, so that they don't reach the hibernation file. CC: Markus Armbruster Signed-off-by: Marian Rotariu Signed-off-by: Adalbert Lazăr --- accel/kvm/vmi.c| 31

[RFC PATCH v1 19/26] kvm: vmi: intercept force-reset

2020-04-14 Thread Adalbert Lazăr
From: Marian Rotariu On forced reset, KVM and the instrospection tool must clean-up the introspection structures. An important thing that must by done by KVM is to unlink the shared memory pages (the introspection tool can map memory pages from the introspected VM in its own process/VM). CC: Mar

[RFC PATCH v1 20/26] kvm: vmi: intercept live migration

2020-04-14 Thread Adalbert Lazăr
From: Marian Rotariu It is possible that the introspection tool has made some changes inside the introspected VM which can make the guest crash if the introspection connection is suddenly closed. When the live migration starts, for now, the introspection tool is signaled to remove its hooks from

[RFC PATCH v1 00/26] VM introspection

2020-04-14 Thread Adalbert Lazăr
The KVM introspection subsystem provides a facility for applications running on the host or in a separate VM, to control the execution of other VMs (pause, resume, shutdown), query the state of the vCPUs (GPRs, MSRs etc.), alter the page access bits in the shadow page tables (only for the hardware

[RFC PATCH v1 25/26] kvm: vmi: extend handshake to include the e820 table

2020-04-14 Thread Adalbert Lazăr
The introspection tool can use the e820 table to avoid accessing (read/write) or modifying access (rwx) for reserved memory pages. Signed-off-by: Adalbert Lazăr --- accel/kvm/vmi.c| 68 ++ include/sysemu/vmi-handshake.h | 23 +++- 2 files c

[RFC PATCH v1 11/26] kvm: vmi: add 'handshake_timeout' property

2020-04-14 Thread Adalbert Lazăr
By having a timer during handshake, the blocked connections can be restored. Signed-off-by: Adalbert Lazăr --- accel/kvm/vmi.c | 66 - 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/accel/kvm/vmi.c b/accel/kvm/vmi.c index 57ded2f69c.

[RFC PATCH v1 17/26] kvm: vmi: add 'unhook_timeout' property

2020-04-14 Thread Adalbert Lazăr
When the introspection tool has to remove all changes made to the introspected VM, the guest must run because some hooks can be removed only in certain conditions. But this shouldn't take too long even with a host under heavy load. So, if the socket is not closed by the introspection tool at the en

[RFC PATCH v1 09/26] kvm: introduce the VM introspection object

2020-04-14 Thread Adalbert Lazăr
This is used to initiate the connection with the introspection tool and hand over the file descriptor to KVM. The object needs a chardev socket (in client mode) created with the 'reconnect' property set. CC: Paolo Bonzini Signed-off-by: Marian Rotariu Signed-off-by: Adalbert Lazăr --- accel/kv

[RFC PATCH v1 18/26] kvm: vmi: store/restore 'vm_start_time' on migrate/snapshot

2020-04-14 Thread Adalbert Lazăr
The VM start time sent during handshake can be used by the introspection tool as a session id. We save this 'VM start time' with the snapshot in order to be sent again to the introspection tool when the VM is restored from snapshot and the introspection connection is reestablished. Signed-off-by:

[RFC PATCH v1 05/26] char-socket: add 'fd' property

2020-04-14 Thread Adalbert Lazăr
This is used by the VM introspection object, after handshake, to hand over the file descriptor to KVM. CC: "Marc-André Lureau" CC: Paolo Bonzini Signed-off-by: Adalbert Lazăr --- chardev/char-socket.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/chardev/char-socket.c

[RFC PATCH v1 08/26] kvm: add VM introspection usage documentation

2020-04-14 Thread Adalbert Lazăr
From: Marian Rotariu Signed-off-by: Marian Rotariu Signed-off-by: Adalbert Lazăr --- qemu-options.hx | 76 + 1 file changed, 76 insertions(+) diff --git a/qemu-options.hx b/qemu-options.hx index 16debd03cb..6c5618e310 100644 --- a/qemu-options.h

[RFC PATCH v1 15/26] kvm: vmi: reconnect the socket on reset

2020-04-14 Thread Adalbert Lazăr
From: Marian Rotariu The guest could be reset from various reasons and by disconnecting the socket (which would reconnect), KVM and the introspection tool will be notified and can clean up the introspection structures. Signed-off-by: Marian Rotariu Signed-off-by: Adalbert Lazăr --- accel/kvm/

[RFC PATCH v1 01/26] chardev: tcp: allow to change the reconnect timer

2020-04-14 Thread Adalbert Lazăr
When the introspected VM is paused/suspended/migrated, the introspection tool removes its hooks from the guest and closes the connection. This is detected by KVM, which in turn will clean the introspection structures. Thanks to the reconnect parameter, the chardev will reconnect with the introspect

[RFC PATCH v1 04/26] char-socket: add 'reconnecting' property

2020-04-14 Thread Adalbert Lazăr
This is used by the VM introspection object to check if the connection will be reestablished in case it disconnects from some reason. The closing of the socket is used by any of the three parties involved, KVM, the introspection tool and QEMU (eg. on force-reset), to signal the other parties that

[RFC PATCH v1 07/26] linux-headers: update with VM introspection interface

2020-04-14 Thread Adalbert Lazăr
Signed-off-by: Adalbert Lazăr --- linux-headers/linux/kvm.h | 20 1 file changed, 20 insertions(+) diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index 265099100e..4e5d390640 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/linux/kvm.h @@ -1010,

[RFC PATCH v1 14/26] kvm: vmi: allow only one instance of the introspection object

2020-04-14 Thread Adalbert Lazăr
Because only one introspection tool must introspect a VM at a given time, we block the completion of the second instance. Signed-off-by: Adalbert Lazăr --- accel/kvm/vmi.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/accel/kvm/vmi.c b/accel/kvm/vmi.c index 2ce8

[RFC PATCH v1 03/26] char-socket: fix the client mode when created through QMP

2020-04-14 Thread Adalbert Lazăr
qmp_chardev_open_socket() ignores the absence of the 'server' argument and always switches to listen/server mode. CC: "Marc-André Lureau" CC: Paolo Bonzini Signed-off-by: Adalbert Lazăr --- chardev/char-socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chardev/char-s

[RFC PATCH v1 06/26] E820: extend the table access interface

2020-04-14 Thread Adalbert Lazăr
This new function is necessary for the VM introspection object. By sending all e820 entries, not just the RAM ones, the introspection tool can differentiate between an invalid address and a reserved one. CC: Paolo Bonzini CC: Richard Henderson CC: Eduardo Habkost CC: "Michael S. Tsirkin" CC: M

[RFC PATCH v1 13/26] kvm: vmi: block the object destruction if the chardev is connected

2020-04-14 Thread Adalbert Lazăr
The introspection tool can modify the VM while it is running (e.g. it can set breakpoints), and when the VM is no longer introspected these changes need to be removed. Until then, we block the destruction of the introspection object that would lead to the unexpected shutdown of the introspection ch

[RFC PATCH v1 02/26] char-socket: allow vsock parameters (cid, port)

2020-04-14 Thread Adalbert Lazăr
The introspection tool can run in a separate VM and the introspected VM will establish a connection using a virtual socket. CC: "Marc-André Lureau" CC: Paolo Bonzini Signed-off-by: Adalbert Lazăr --- chardev/char-socket.c | 27 --- chardev/char.c| 3 +++ 2 file

  1   2   3   4   >