Re: [Qemu-devel] qemu-user-linux: how could I measure performance for aarch64 and arm?

2019-01-12 Thread Matwey V. Kornilov
пт, 11 янв. 2019 г. в 22:24, Matwey V. Kornilov : > > пт, 11 янв. 2019 г. в 12:52, Peter Maydell : > > > > On Thu, 10 Jan 2019 at 19:33, Matwey V. Kornilov > > wrote: > > > I am running the same application compiled for aarch64 and armv7l on > > > x86_64 platform using qemu-user-linux tools. > > >

Re: [Qemu-devel] [PATCH 1/2 v2] usb-mtp: Reallocate buffer in multiples of MTP_WRITE_BUF_SZ

2019-01-12 Thread Bandan Das
Eric Blake writes: > On 1/11/19 2:20 AM, Bandan Das wrote: >> This is a "pre-patch" to breaking up the write buffer for >> MTP writes. Instead of allocating a mtp buffer equal to size >> sent by the initiator, we start with a small size and reallocate >> multiples (of that small size) as needed.

Re: [Qemu-devel] [PATCH 2/4] linuxboot_dma: move common functions in a new header

2019-01-12 Thread Eric Blake
On 1/12/19 12:25 PM, Stefano Garzarella wrote: >>> Better to just pull in qemu/osdep.h >> >> Except that qemu/osdep.h should already have been pulled in by whatever >> .c file is including this header. We specifically document that .h files >> shouldn't need to include osdep.h (and in turn, anythi

Re: [Qemu-devel] [PATCH v3 0/5] kvm "virtio pmem" device

2019-01-12 Thread Pankaj Gupta
> > > > > > > > > > > > On Thu 10-01-19 12:26:17, Dave Chinner wrote: > > > > On Wed, Jan 09, 2019 at 08:17:31PM +0530, Pankaj Gupta wrote: > > > > > This patch series has implementation for "virtio pmem". > > > > > "virtio pmem" is fake persistent memory(nvdimm) in guest > > > > > which allow

Re: [Qemu-devel] [PATCH v3 0/5] kvm "virtio pmem" device

2019-01-12 Thread Dan Williams
On Sat, Jan 12, 2019 at 5:38 PM Pankaj Gupta wrote: > > > > > > > On Thu 10-01-19 12:26:17, Dave Chinner wrote: > > > On Wed, Jan 09, 2019 at 08:17:31PM +0530, Pankaj Gupta wrote: > > > > This patch series has implementation for "virtio pmem". > > > > "virtio pmem" is fake persistent memory(nvdi

Re: [Qemu-devel] [PATCH v3 0/5] kvm "virtio pmem" device

2019-01-12 Thread Pankaj Gupta
> > On Thu 10-01-19 12:26:17, Dave Chinner wrote: > > On Wed, Jan 09, 2019 at 08:17:31PM +0530, Pankaj Gupta wrote: > > > This patch series has implementation for "virtio pmem". > > > "virtio pmem" is fake persistent memory(nvdimm) in guest > > > which allows to bypass the guest page cache.

[Qemu-devel] [Bug 1811543] [NEW] virtio-scsi gives improper discard sysfs entries

2019-01-12 Thread James Harvey
Public bug reported: Apologies if this is just an inherent part of paravirtualization that should be expected. In my host, I have an LVM thin pool with chunk_size 128MB. Within it, I have a thin volume "tmp". In the host: # fdisk -l /dev/lvm/tmp Disk /dev/lvm/tmp: 256 MiB, 268435456 bytes, 524

[Qemu-devel] Various GTK window display problems - sorting bugs from features

2019-01-12 Thread halfdog
Hello List, After filing a Debian bug, the package maintainer gave a hint, that this might be more relevant here: There seems to exist a (minor) usability issue with GTK frontend and detaching a window, that seems to lead to full loss of keyboard input to the guest, in the end. With the first

[Qemu-devel] [Bug 1811533] [NEW] Unstable Win10 guest with qemu 3.1 + huge pages + hv_stimer

2019-01-12 Thread Žilvinas Žaltiena
Public bug reported: Host: Gentoo linux x86_64, kernel 4.20.1 Qemu 3.1.0 CPU: Intel i7 6850K Chipset: X99 Guest: Windows 10 Pro 64bit (1809) Machine type: pc-q35_3.1 Hyper-V enlightenments: hv_stimer,hv_reenlightenment,hv_frequencies,hv_vapic,hv_reset,hv_synic,hv_runtime,hv_vpindex,hv_time,hv_r

Re: [Qemu-devel] [PATCH 2/4] linuxboot_dma: move common functions in a new header

2019-01-12 Thread Stefano Garzarella
On Fri, Jan 11, 2019 at 6:55 PM Eric Blake wrote: > > On 1/11/19 11:48 AM, Michael S. Tsirkin wrote: > > >>> > diff --git a/pc-bios/optionrom/optrom.h b/pc-bios/optionrom/optrom.h > new file mode 100644 > index 00..36f43b43fd > --- /dev/null > +++ b/pc-bios/optionr

Re: [Qemu-devel] [PATCH 2/4] linuxboot_dma: move common functions in a new header

2019-01-12 Thread Stefano Garzarella
On Fri, Jan 11, 2019 at 6:48 PM Michael S. Tsirkin wrote: > > > > +#include "../../include/standard-headers/linux/qemu_fw_cfg.h" > > > > > > This depends on , please include it first. > > Better to just pull in qemu/osdep.h This header is used in the option roms that are bare-metal, so IMHO I can

[Qemu-devel] [PATCH v3 00/19] nbd: add qemu-nbd --list

2019-01-12 Thread Eric Blake
I got tired of debugging whether a server was advertising the correct things during negotiation by inspecting the trace logs of qemu-io as client - not to mention that without SOME sort of client tracing particular commands, we can't easily regression test the server for correct behavior. The fina

[Qemu-devel] [PATCH v3 01/19] maint: Allow for EXAMPLES in texi2pod

2019-01-12 Thread Eric Blake
The next commit will add an EXAMPLES section to qemu-nbd.8; for that to work, we need to recognize EXAMPLES in texi2pod. We also need to add a dependency from all man pages against the generator script, since a change to the generator may cause the resulting man page to differ. Signed-off-by: Eric

[Qemu-devel] [PATCH v3 11/19] nbd/client: Split out nbd_receive_one_meta_context()

2019-01-12 Thread Eric Blake
Extract portions of nbd_negotiate_simple_meta_context() to a new function nbd_receive_one_meta_context() that copies the pattern of nbd_receive_list() for performing the argument validation of one reply. The error message when the server replies with more than one context changes slightly, but tha

[Qemu-devel] [PATCH v3 04/19] nbd/server: Hoist length check to qemp_nbd_server_add

2019-01-12 Thread Eric Blake
We only had two callers to nbd_export_new; qemu-nbd.c always passed a valid offset/length pair (because it already checked the file length, to ensure that offset was in bounds), while blockdev-nbd always passed 0/-1. Then nbd_export_new reduces the size to a multiple of BDRV_SECTOR_SIZE (can only

[Qemu-devel] [PATCH v3 03/19] qemu-nbd: Sanity check partition bounds

2019-01-12 Thread Eric Blake
When the user requests a partition, we were using data read from the disk as disk offsets without a bounds check. We got lucky that even when computed offsets are out-of-bounds, blk_pread() will gracefully catch the error later (so I don't think a malicious image can crash or exploit qemu-nbd, and

[Qemu-devel] [PATCH v3 08/19] nbd/client: Move export name into NBDExportInfo

2019-01-12 Thread Eric Blake
Refactor the 'name' parameter of nbd_receive_negotiate() from being a separate parameter into being part of the in-out 'info'. This also spills over to a simplification of nbd_opt_go(). The main driver for this refactoring is that an upcoming patch would like to add support to qemu-nbd to list inf

[Qemu-devel] [PATCH v3 14/19] nbd/client: Pull out oldstyle size determination

2019-01-12 Thread Eric Blake
Another refactoring creating nbd_negotiate_finish_oldstyle() for further reuse during 'qemu-nbd --list'. Signed-off-by: Eric Blake Message-Id: <20181215135324.152629-18-ebl...@redhat.com> Reviewed-by: Richard W.M. Jones --- nbd/client.c | 49 - 1

[Qemu-devel] [PATCH v3 02/19] qemu-nbd: Enhance man page

2019-01-12 Thread Eric Blake
Document some useful qemu-nbd command lines. Mention some restrictions on particular options, like -p being only for MBR images, or -c/-d being Linux-only. Update some text given the recent change to no longer serve oldstyle protocol (missed in commit 7f7dfe2a). Also, consistently use trailing '.

[Qemu-devel] [PATCH v3 13/19] nbd/client: Split handshake into two functions

2019-01-12 Thread Eric Blake
An upcoming patch will add the ability for qemu-nbd to list the services provided by an NBD server. Share the common code of the TLS handshake by splitting the initial exchange into a separate function, leaving only the export handling in the original function. Functionally, there should be no ch

[Qemu-devel] [PATCH v3 15/19] nbd/client: Add nbd_receive_export_list()

2019-01-12 Thread Eric Blake
We want to be able to detect whether a given qemu NBD server is exposing the right export(s) and dirty bitmaps, at least for regression testing. We could use 'nbd-client -l' from the upstream NBD project to list exports, but it's annoying to rely on out-of-tree binaries; furthermore, nbd-client do

[Qemu-devel] [PATCH v3 10/19] nbd/client: Split out nbd_send_one_meta_context()

2019-01-12 Thread Eric Blake
Refactor nbd_negotiate_simple_meta_context() to pull out the code that can be reused to send a LIST request for 0 or 1 query. No semantic change. The old comment about 'sizeof(uint32_t)' being equivalent to '/* number of queries */' is no longer needed, now that we are computing 'sizeof(queries)'

[Qemu-devel] [PATCH v3 12/19] nbd/client: Refactor return of nbd_receive_negotiate()

2019-01-12 Thread Eric Blake
The function could only ever return 0 or -EINVAL; make this clearer by dropping a useless 'fail:' label. Signed-off-by: Eric Blake Reviewed-by: Richard W.M. Jones Reviewed-by: Vladimir Sementsov-Ogievskiy Message-Id: <20181215135324.152629-16-ebl...@redhat.com> --- nbd/client.c | 51 ++

[Qemu-devel] [PATCH v3 05/19] nbd/server: Favor [u]int64_t over off_t

2019-01-12 Thread Eric Blake
Although our compile-time environment is set up so that we always support long files with 64-bit off_t, we have no guarantee whether off_t is the same type as int64_t. This requires casts when printing values, and prevents us from directly using qemu_strtoi64(). Let's just flip to [u]int64_t (sign

[Qemu-devel] [PATCH v3 09/19] nbd/client: Change signature of nbd_negotiate_simple_meta_context()

2019-01-12 Thread Eric Blake
Pass 'info' instead of three separate parameters related to info, when requesting the server to set the meta context. Update the NBDExportInfo struct to rename the received id field to match the fact that we are currently overloading the field to match whatever context the user supplied through th

[Qemu-devel] [PATCH v3 06/19] qemu-nbd: Avoid strtol open-coding

2019-01-12 Thread Eric Blake
Our copy-and-pasted open-coding of strtol handling forgot to handle overflow conditions. Use qemu_strto*() instead. In the case of --partition, since we insist on a user-supplied partition to be non-zero, we can use 0 rather than -1 for our initial value to distinguish when a partition is not bei

[Qemu-devel] [PATCH v3 19/19] iotests: Enhance 223, 233 to cover 'qemu-nbd --list'

2019-01-12 Thread Eric Blake
Any good new feature deserves some regression testing :) Coverage includes: - 223: what happens when there are 0 or more than 1 export, proof that we can see multiple contexts including qemu:dirty-bitmap - 233: proof that we can list over TLS, and that mix-and-match of plain/TLS listings will behav

[Qemu-devel] [PATCH v3 16/19] nbd/client: Add meta contexts to nbd_receive_export_list()

2019-01-12 Thread Eric Blake
We want to be able to detect whether a given qemu NBD server is exposing the right export(s) and dirty bitmaps, at least for regression testing. We could use 'nbd-client -l' from the upstream NBD project to list exports, but it's annoying to rely on out-of-tree binaries; furthermore, nbd-client do

[Qemu-devel] [PATCH v3 07/19] nbd/client: Refactor nbd_receive_list()

2019-01-12 Thread Eric Blake
Right now, nbd_receive_list() is only called by nbd_receive_query_exports(), which in turn is only called if the server lacks NBD_OPT_GO but has working option negotiation, and is merely used as a quality-of-implementation trick since servers can't give decent errors for NBD_OPT_EXPORT_NAME. Howev

[Qemu-devel] [PATCH v3 17/19] qemu-nbd: Add --list option

2019-01-12 Thread Eric Blake
We want to be able to detect whether a given qemu NBD server is exposing the right export(s) and dirty bitmaps, at least for regression testing. We could use 'nbd-client -l' from the upstream NBD project to list exports, but it's annoying to rely on out-of-tree binaries; furthermore, nbd-client do

[Qemu-devel] [PATCH v3 18/19] nbd/client: Work around 3.0 bug for listing meta contexts

2019-01-12 Thread Eric Blake
Commit 3d068aff forgot to advertise available qemu: contexts when the client requests a list with 0 queries. Furthermore, 3.0 shipped with a qemu-img hack of x-dirty-bitmap (commit 216ee365) that _silently_ acts as though the entire image is clean if a requested bitmap is not present. Both bugs ha

Re: [Qemu-devel] block: Update flags in bdrv_set_read_only()

2019-01-12 Thread Michael Tokarev
commit eeae6a596b0efc092f5101c67683053e245e6250 Author: Kevin Wolf Date: Tue Oct 9 16:57:12 2018 +0200 block: Update flags in bdrv_set_read_only() To fully change the read-only state of a node, we must not only change bs->read_only, but also update bs->open

[Qemu-devel] 3.1: second invocation of migrate crashes qemu

2019-01-12 Thread Michael Tokarev
$ qemu-system-x86_64 -monitor stdio -hda foo.img QEMU 3.1.0 monitor - type 'help' for more information (qemu) stop (qemu) migrate "exec:cat >/dev/null" (qemu) migrate "exec:cat >/dev/null" qemu-system-x86_64: /build/qemu/qemu-3.1/block.c:4647: bdrv_inactivate_recurse: Assertion `!(bs->open_flags

Re: [Qemu-devel] [PATCH] hw/pvrdma: Post CQE when receive invalid gid index

2019-01-12 Thread Marcel Apfelbaum
On 1/9/19 10:15 PM, Yuval Shaia wrote: This error should propagate back to guest. Signed-off-by: Yuval Shaia --- hw/rdma/rdma_backend.h | 1 + hw/rdma/vmw/pvrdma_qp_ops.c | 6 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/rdma/rdma_backend.h b/hw/rdma/rdma

Re: [Qemu-devel] [PATCH] hw/rdma: Delete unused struct member

2019-01-12 Thread Marcel Apfelbaum
On 1/9/19 10:19 PM, Yuval Shaia wrote: This member is used only in init_device_caps function, make it local. Signed-off-by: Yuval Shaia --- hw/rdma/rdma_backend.c | 26 ++ hw/rdma/rdma_backend_defs.h | 1 - 2 files changed, 14 insertions(+), 13 deletions(-)

Re: [Qemu-devel] [PATCH] hw/pvrdma: Remove max-sge command-line param

2019-01-12 Thread Marcel Apfelbaum
On 1/9/19 9:41 PM, Yuval Shaia wrote: This parameter has no effect, fix it. The function init_dev_caps sets the front-end's max-sge to MAX_SGE. Then it checks backend's max-sge and adjust it accordingly (we can't send more than what the device supports). On send and recv we need to make sure

Re: [Qemu-devel] [PATCH] hw/pvrdma: Make function pvrdma_qp_send/recv return void.

2019-01-12 Thread Marcel Apfelbaum
On 1/9/19 10:21 PM, Yuval Shaia wrote: The functions handles errors internaly, callers have nothing to do with the return value. Signed-off-by: Yuval Shaia --- hw/rdma/vmw/pvrdma_qp_ops.c | 14 ++ hw/rdma/vmw/pvrdma_qp_ops.h | 4 ++-- 2 files changed, 8 insertions(+), 10 del

[Qemu-devel] [PATCH 2/3] hw/rdma: modify struct initialization

2019-01-12 Thread Marcel Apfelbaum
Do not initialize structs with {0} since some CLANG versions do not support it. Use memset instead. Signed-off-by: Marcel Apfelbaum --- contrib/rdmacm-mux/main.c | 12 +--- hw/rdma/rdma_backend.c| 16 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/c

[Qemu-devel] [PATCH 1/3] contrib/rdmacm-mux: remove Wno-format-truncation flag

2019-01-12 Thread Marcel Apfelbaum
The flag is not recognized by some CLANG versions. Add proper constraints in code instead. Signed-off-by: Marcel Apfelbaum --- contrib/rdmacm-mux/Makefile.objs | 2 +- contrib/rdmacm-mux/main.c| 6 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/contrib/rdmacm-mux/M

[Qemu-devel] [PATCH 3/3] contrib/rdmacm-mux: fix clang compilation

2019-01-12 Thread Marcel Apfelbaum
Fix Commit a5d2f6f877 (contrib/rdmacm-mux: Add implementation of RDMA User MAD multiplexer). The above commit introduces a new contrib target, adding a global dependency to libumad library in case pvrdma configuration option is enabled. Clang forbids it: clang-6.0: error

[Qemu-devel] [PATCH 0/3] contrib/rdmacm-mux: fix clang compilation

2019-01-12 Thread Marcel Apfelbaum
Fix Commit a5d2f6f877 (contrib/rdmacm-mux: Add implementation of RDMA User MAD multiplexer). The above commit introduces a new contrib target, adding a global dependency to libumad library in case pvrdma configuration option is enabled. Clang forbids it: clang-6.0: error

[Qemu-devel] QEMU 3.1 - Getting Instruction Traces

2019-01-12 Thread Dhruv Agarwal
Dear Developers, I am an undergraduate student trying to generate *a trace of all instructions executed by the QEMU ARM emulator when it runs a given binary*. I have been using the* following command* (from an out-of-tree build from source code): arm-linux-user/qemu-arm -d in_asm ~/Desktop/hello

Re: [Qemu-devel] [PATCH PULL 02/31] contrib/rdmacm-mux: Add implementation of RDMA User MAD multiplexer

2019-01-12 Thread Marcel Apfelbaum
On 1/8/19 11:18 AM, Cornelia Huck wrote: On Tue, 8 Jan 2019 10:41:38 +0200 Marcel Apfelbaum wrote: On 1/7/19 7:54 PM, Cornelia Huck wrote: On Mon, 7 Jan 2019 19:28:10 +0200 Marcel Apfelbaum wrote: On 1/3/19 12:34 PM, Cornelia Huck wrote: clang-6.0: error: -libumad: 'linker' input unu

[Qemu-devel] [Bug 1811499] [NEW] qemu/net/colo-compare.c:288: possible pointless code duplication ?

2019-01-12 Thread dcb
Public bug reported: qemu/net/colo-compare.c:288] -> [qemu/net/colo-compare.c:296]: (style) The if condition is the same as the previous if condition Source code is if (ppkt->tcp_seq == spkt->tcp_seq && ppkt->seq_end == spkt->seq_end) { if (colo_compare_packet_payload(ppkt, spkt,

[Qemu-devel] [PATCH] KVM: MMU: fast cleanup D bit based on fast write protect

2019-01-12 Thread Zhuangyanying
From: Zhuang Yanying Recently I tested live-migration with large-memory guests, find vcpu may hang for a long time while starting migration, such as 9s for 2048G(linux-4.20.1+qemu-3.1.0). The reason is memory_global_dirty_log_start() taking too long, and the vcpu is waiting for BQL. The page-b

Re: [Qemu-devel] [QEMU-devel][PATCH v4 0/2] Fix concurrent aio_poll/set_fd_handler.

2019-01-12 Thread Stefan Hajnoczi
On Thu, Dec 20, 2018 at 04:20:28PM +0100, remy.n...@blade-group.com wrote: > From: Remy Noel > > It is possible for an io_poll/read/write callback to be concurrently executed > along > with an aio_set_fd_handlers. This can cause all sorts of problems, like > a NULL callback or a bad opaque point