[Qemu-devel] [PATCH v4 01/47] char: add qemu_chr_free()

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau If a chardev is allowed to be created outside of QMP, then it must be also possible to free it. This is useful for ivshmem that creates chardev anonymously and must be able to free them. Signed-off-by: Marc-André Lureau Acked-by: Paolo Bonzini --- include/sysemu/char.h

[Qemu-devel] [PATCH v4 08/47] ivshmem: remove useless doorbell field

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- hw/misc/ivshmem.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 7138b8d..dea4096 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -71,7 +71,6 @@ t

[Qemu-devel] [PATCH v4 06/47] ivshmem: remove unnecessary dup()

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau qemu_chr_fe_get_msgfd() transfers ownership, there is no need to dup the fd. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 21 ++--- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index dd1

[Qemu-devel] [PATCH v4 05/47] ivshmem: factor out the incoming fifo handling

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau Make a new function fifo_update_and_get() that can be reused by other functions (in next commits). Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 59 --- 1 file changed, 39 insertions(+), 20 deletions(-) dif

[Qemu-devel] [PATCH v4 09/47] ivshmem: more qdev conversion

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau Use the latest qemu device modeling API, in particular, convert to realize to fix the error handling; right now a botched device_add ivhsmem command kills the VM. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 119 +++---

[Qemu-devel] [PATCH v4 03/47] ivhsmem: read do not accept more than sizeof(long)

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau ivshmem_read() only reads sizeof(long) from the input buffer. Accepting more could lead to fifo8 abort() on 32bit systems if fifo is not empty. A following patch will change the protocol to 64-bit little-endian instead. Signed-off-by: Marc-André Lureau --- hw/misc/ivs

[Qemu-devel] [PATCH v4 07/47] ivshmem: remove superflous ivshmem_attr field

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index fbeb731..7138b8d 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -85,7 +85,6

[Qemu-devel] [PATCH v4 04/47] ivshmem: fix number of bytes to push to fifo

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau If the fifo has 0 bytes, and the read is of size 1, the call to fifo8_push_all() will copy off boundary data. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c

[Qemu-devel] [PATCH v4 10/47] ivshmem: remove last exit(1)

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau Failing to create a chardev shouldn't be fatal. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 62547c0..e7224b9 100644 --- a/hw/misc/ivshmem.c +++ b/h

[Qemu-devel] [PATCH v4 20/47] ivshmem: simplify a bit the code

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau Use some more explicit variables to simplify the code. nth_eventfd variable is the current eventfd to be manipulated. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git

[Qemu-devel] [PATCH v4 11/47] ivshmem: limit maximum number of peers to G_MAXUINT16

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau Limit the maximum number of peers to MAXUINT16. This is more realistic and better matches the limit of the doorbell register. Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- hw/misc/ivshmem.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)

[Qemu-devel] [PATCH v4 14/47] ivshmem: remove useless ivshmem_update_irq() val argument

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau val isn't used in ivshmem_update_irq() function. Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- hw/misc/ivshmem.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 19640bb..374ecff

[Qemu-devel] [PATCH v4 13/47] ivshmem: allocate eventfds in resize_peers()

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau It simplifies a bit the code to allocate the array when setting the number of peers instead of lazily when receiving the first vector. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/

[Qemu-devel] [PATCH v4 29/47] ivshmem: error on too many eventfd received

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau The number of eventfd that can be handled per peer is limited by the number of vectors. Return an error when receiving too many of them. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/misc/ivshmem.c

[Qemu-devel] [PATCH v4 17/47] ivshmem: improve debug messages

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau Some misc improvements to ivshmem debug. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index c4c130d..71a71fc 100644 --- a/hw/misc/ivshmem.c +++

[Qemu-devel] [PATCH v4 16/47] ivshmem: remove max_peer field

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau max_peer isn't really useful, it tracks the maximum received VM id, but that quickly matches nb_peers, the size of the peers array. Since VM come and go, there might be sparse peers so it doesn't help much in general to have this value around. Signed-off-by: Marc-André Lu

[Qemu-devel] [PATCH v4 12/47] ivshmem: simplify around increase_dynamic_storage()

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau Set the number of peers and array allocation in a single place. Rename to better reflect the function content. Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- hw/misc/ivshmem.c | 27 +++ 1 file changed, 11 insertions(+), 16 del

[Qemu-devel] [PATCH v4 40/47] tests: add ivshmem qtest

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau Adds 4 ivshmemtests: - single qemu instance and basic IO - pair of instances, check memory sharing - pair of instances with server, and MSIX - hot plug/unplug A temporary shm is created as well as a directory to place server socket, both should be clear on exit and abort.

[Qemu-devel] [PATCH v4 15/47] ivshmem: initialize max_peer to -1

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau There is no peer when device is initialized, do not let doorbell for inexisting peer 0. Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- hw/misc/ivshmem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/mi

[Qemu-devel] [PATCH v4 25/47] ivshmem: check shm isn't already initialized

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau The server should not change the shm, and this isn't handled by qemu. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index ea80548..21ef260 100644 --- a/hw/misc/ivshm

[Qemu-devel] [PATCH v4 32/47] ivshmem-client: check the number of vectors

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau Check the number of vectors received from the server, to avoid out of bound array access. Signed-off-by: Marc-André Lureau --- contrib/ivshmem-client/ivshmem-client.c | 4 1 file changed, 4 insertions(+) diff --git a/contrib/ivshmem-client/ivshmem-client.c b/cont

Re: [Qemu-devel] [PATCH v11 02/12] init/cleanup of netfilter object

2015-09-24 Thread Markus Armbruster
Yang Hongyang writes: > On 09/24/2015 04:41 PM, Markus Armbruster wrote: >> Yang Hongyang writes: >> >>> Add a netfilter object based on QOM. >>> >>> A netfilter is attached to a netdev, captures all network packets >>> that pass through the netdev. When we delete the netdev, we also >>> delete

[Qemu-devel] [PATCH v4 21/47] ivshmem: use common return

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau Both if branches return, move this out to common end. Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- hw/misc/ivshmem.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index c59d9ed..8ebc907

[Qemu-devel] [PATCH v4 24/47] ivshmem: shmfd can be 0

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau 0 is a valid fd value, so change conditions and set -1 value early Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- hw/misc/ivshmem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index

[Qemu-devel] [PATCH v4 22/47] ivshmem: use common is_power_of_2()

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau The common version correctly checks for 0 value case. Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- hw/misc/ivshmem.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 8ebc907..8207a

[Qemu-devel] [PATCH v4 42/47] ivshmem: use strtosz()

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau Use the common qemu utility function to parse the memory size. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 36 +--- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 27

[Qemu-devel] [PATCH v4 31/47] contrib: add ivshmem client and server

2015-09-24 Thread marcandre . lureau
From: David Marchand When using ivshmem devices, notifications between guests can be sent as interrupts using a ivshmem-server (typical use described in documentation). The client is provided as a debug tool. Signed-off-by: Olivier Matz Signed-off-by: David Marchand [fix a valgrind warning, op

[Qemu-devel] [PATCH v4 18/47] ivshmem: improve error handling

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau The test whether the chardev is an AF_UNIX socket rejects "-chardev socket,id=chr0,path=/tmp/foo,server,nowait -device ivshmem,chardev=chr0", but fails to explain why. Use an explicit error on why a chardev may be rejected. Signed-off-by: Marc-André Lureau --- hw/misc/

Re: [Qemu-devel] [PATCH] exec: factor out duplicate mmap code

2015-09-24 Thread Michael S. Tsirkin
On Thu, Sep 24, 2015 at 02:44:41PM +0300, Michael S. Tsirkin wrote: > Anonymous and file-backed RAM allocation are now almost exactly the same. > > Reduce code duplication by moving RAM mmap code out of oslib-posix.c and > exec.c. > > Signed-off-by: Michael S. Tsirkin Och forgot to commit. Wil

[Qemu-devel] [PATCH v4 19/47] ivshmem: print error on invalid peer id

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau The server shouldn't send invalid peer id, so print an error if it's the case. Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- hw/misc/ivshmem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index ed1b6f7..6

[Qemu-devel] [PATCH v4 23/47] ivshmem: migrate with VMStateDescription

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau load_state_old() is used to keep compatibility with version 0. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 141 ++ 1 file changed, 88 insertions(+), 53 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/mis

[Qemu-devel] [PATCH v4 27/47] ivshmem: fix pci_ivshmem_exit()

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau Free all objects owned by the device, making sure the device is free, fixing hot-unplug. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 38 +++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/hw/misc/ivshmem.c

Re: [Qemu-devel] [PATCH v3] ui/cocoa.m: Add Mount image file menu item

2015-09-24 Thread Programmingkid
On Sep 24, 2015, at 2:57 AM, Markus Armbruster wrote: > Programmingkid writes: > >> On Sep 23, 2015, at 4:35 PM, Peter Maydell wrote: >> >>> On 17 September 2015 at 21:17, Programmingkid >>> wrote: Add "Mount Image File..." and a "Eject Image File" menu items to cocoa interface. Thi

[Qemu-devel] [PATCH v4 41/47] ivshmem: do not keep shm_fd open

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau Remove shm_fd from device state, closing it as early as possible to avoid leaks. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index fc1d

[Qemu-devel] [PATCH v4 28/47] ivshmem: replace 'guest' for 'peer' appropriately

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau The terms 'guest' and 'peer' are used sometime interchangeably which may be confusing. Instead, use 'peer' for the remote instances of ivshmem clients, and 'guest' for the local VM. Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- hw/misc/ivshmem.c | 2

[Qemu-devel] [PATCH v4 26/47] ivshmem: add device description

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- hw/misc/ivshmem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 21ef260..9be4d1e 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -924,6 +924,7 @

[Qemu-devel] [PATCH v4 44/47] ivshmem: remove EventfdEntry.vector

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau No need to store an extra int for the vector number when it can be computed easily by looking at the position in the array. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/misc/ivshmem

[Qemu-devel] [PATCH v4 33/47] ivshmem-server: use a uint16 for client ID

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau In practice, the number of VM is limited to MAXUINT16 in ivshmem, so use the same limit on the server (removes a theorical infinite loop) Signed-off-by: Marc-André Lureau --- contrib/ivshmem-server/ivshmem-server.c | 11 ++- contrib/ivshmem-server/ivshmem-server

[Qemu-devel] [PATCH v4 30/47] ivshmem: reset mask on device reset

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau The interrupt mask is a state value, it should be reset, like the interrupt status. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 3231a46..9974f25 100644 --- a/hw/mi

Re: [Qemu-devel] [PATCH] tests: Fix test 049 fallout from improved HMP error messages

2015-09-24 Thread Markus Armbruster
Kevin Wolf writes: > Am 23.09.2015 um 01:15 hat Eric Blake geschrieben: >> Commit 50b7b000 improved HMP error messages, but forgot to update >> qemu-iotests to match. >> >> Reported-by: Kevin Wolf >> Signed-off-by: Eric Blake > > Thanks, applied to the block branch. > >> I'm not sure if this s

[Qemu-devel] [PATCH v4 43/47] ivshmem: add hostmem backend

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau Instead of handling allocation, teach ivshmem to use a memory backend. This allows to use hugetlbfs backed memory now. Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- hw/misc/ivshmem.c| 84 +--- test

[Qemu-devel] [PATCH v4 35/47] docs: update ivshmem device spec

2015-09-24 Thread marcandre . lureau
From: David Marchand Add some notes on the parts needed to use ivshmem devices: more specifically, explain the purpose of an ivshmem server and the basic concept to use the ivshmem devices in guests. Move some parts of the documentation and re-organise it. Signed-off-by: David Marchand Reviewed

[Qemu-devel] [PATCH v4 34/47] ivshmem-server: fix hugetlbfs support

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau As pointed out on the ML by Andrew Jones, glibc no longer permits creating POSIX shm on hugetlbfs directly. When given a hugetlbfs path, create a shareable file there. Signed-off-by: Marc-André Lureau Reviewed-by: Vladimir Sementsov-Ogievskiy --- contrib/ivshmem-server

[Qemu-devel] [PATCH v4 45/47] ivshmem: rename MSI eventfd_table

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau The array is used to have vector specific data, so use a more descriptive name. Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 6199

[Qemu-devel] [PATCH v4 37/47] contrib: remove unnecessary strdup()

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau getopt() optarg points to argv memory, no need to dup those values, fixes small leaks detected by clang-analyzer. Signed-off-by: Marc-André Lureau Reviewed-by: Vladimir Sementsov-Ogievskiy --- contrib/ivshmem-client/main.c | 2 +- contrib/ivshmem-server/main.c | 6 +++-

[Qemu-devel] [PATCH v4 36/47] ivshmem: add check on protocol version in QEMU

2015-09-24 Thread marcandre . lureau
From: David Marchand Send a protocol version as the first message from server, clients must close communication if they don't support this protocol version. Older QEMUs should be fine with this change in the protocol since they overrides their own vm_id on reception of an id associated to no eve

[Qemu-devel] [PATCH v4 46/47] ivshmem: use kvm irqfd for msi notifications

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau Use irqfd for improving context switch when notifying the guest. If the host doesn't support kvm irqfd, regular msi notifications are still supported. Note: the ivshmem implementation doesn't allow switching between MSI and IO interrupts, this patch doesn't either. Signe

[Qemu-devel] [PATCH v4 38/47] msix: implement pba write (but read-only)

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau qpci_msix_pending() writes on pba region, causing qemu to SEGV: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x77fba8c0 (LWP 25882)] 0x in ?? () (gdb) bt #0 0x in () #1 0x556556c5 in m

[Qemu-devel] [PATCH v4 47/47] ivshmem: use little-endian int64_t for the protocol

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau The current ivshmem protocol uses 'long' for integers. But the sizeof(long) depends on the host and the endianess is not defined, which may cause portability troubles. Instead, switch to using little-endian int64_t. This breaks the protocol, except on x64 little-endian ho

[Qemu-devel] [PATCH] exec: factor out duplicate mmap code

2015-09-24 Thread Michael S. Tsirkin
Anonymous and file-backed RAM allocation are now almost exactly the same. Reduce code duplication by moving RAM mmap code out of oslib-posix.c and exec.c. Signed-off-by: Michael S. Tsirkin --- This is on top of the patchset: add mitigation against buffer overflows include/qemu/mmap-alloc.

[Qemu-devel] [PATCH v4 39/47] qtest: add qtest_add_abrt_handler()

2015-09-24 Thread marcandre . lureau
From: Marc-André Lureau Allow a test to add abort handlers, use GHook for all handlers. There is currently no way to remove a handler, but it could be later added if needed. Signed-off-by: Marc-André Lureau --- tests/libqtest.c | 37 - tests/libqtest.h | 2

Re: [Qemu-devel] [PATCH v11 02/12] init/cleanup of netfilter object

2015-09-24 Thread Markus Armbruster
Yang Hongyang writes: > On 09/24/2015 04:41 PM, Markus Armbruster wrote: >> Yang Hongyang writes: >> >>> Add a netfilter object based on QOM. >>> >>> A netfilter is attached to a netdev, captures all network packets >>> that pass through the netdev. When we delete the netdev, we also >>> delete

[Qemu-devel] [PATCH v12 1/7] vhost-user: use VHOST_USER_XXX macro for switch statement

2015-09-24 Thread Yuanhan Liu
So that we could let vhost_user_call to handle extented requests, such as VHOST_USER_GET/SET_PROTOCOL_FEATURES, instead of invoking vhost_user_read/write and constructing the msg again by ourself. Signed-off-by: Yuanhan Liu Reviewed-by: Marcel Apfelbaum Tested-by: Marcel Apfelbaum --- hw/virti

[Qemu-devel] [PATCH v12 0/7] vhost-user multiple queue support

2015-09-24 Thread Yuanhan Liu
Hi, Here is the updated patch set for enabling vhost-user multiple queue. It works well in my test, and it also passes Marcel's testing (thank him for testing!). --- There are only few minor changes comparing with last version, such as typo fixes, function rename, and something else. The reason

[Qemu-devel] [PATCH v12 6/7] vhost-user: add multiple queue support

2015-09-24 Thread Yuanhan Liu
From: Changchun Ouyang This patch is initially based a patch from Nikolay Nikolaev. This patch adds vhost-user multiple queue support, by creating a nc and vhost_net pair for each queue. Qemu exits if find that the backend can't support the number of requested queues (by providing queues=# opti

[Qemu-devel] [PATCH v12 2/7] vhost-user: add protocol feature negotiation

2015-09-24 Thread Yuanhan Liu
From: "Michael S. Tsirkin" Support a separate bitmask for vhost-user protocol features, and messages to get/set protocol features. Invoke them at init. No features are defined yet. [ leverage vhost_user_call for request handling -- Yuanhan Liu ] Signed-off-by: Michael S. Tsirkin Signed-off-b

[Qemu-devel] [PATCH v12 4/7] vhost-user: add VHOST_USER_GET_QUEUE_NUM message

2015-09-24 Thread Yuanhan Liu
This is for querying how many queues the backend supports if it has mq support(when VHOST_USER_PROTOCOL_F_MQ flag is set from the queried protocol features). vhost_net_get_max_queues() is the interface to export that value, and to tell if the backend supports # of queues user requested, which is d

[Qemu-devel] [PATCH v12 7/7] vhost-user: add a new message to disable/enable a specific virt queue.

2015-09-24 Thread Yuanhan Liu
From: Changchun Ouyang Add a new message, VHOST_USER_SET_VRING_ENABLE, to enable or disable a specific virt queue, which is similar to attach/detach queue for tap device. virtio driver on guest doesn't have to use max virt queue pair, it could enable any number of virt queue ranging from 1 to ma

Re: [Qemu-devel] [PATCH v4 42/47] ivshmem: use strtosz()

2015-09-24 Thread Marc-André Lureau
On Thu, Sep 24, 2015 at 1:37 PM, wrote: > From: Marc-André Lureau > > Use the common qemu utility function to parse the memory size. > > Signed-off-by: Marc-André Lureau > --- > hw/misc/ivshmem.c | 36 +--- > 1 file changed, 5 insertions(+), 31 deletions(-) > >

[Qemu-devel] [PATCH v12 3/7] vhost: rename VHOST_RESET_OWNER to VHOST_RESET_DEVICE

2015-09-24 Thread Yuanhan Liu
Quote from Michael: > Hi Michael, > > I'm wondering why we need a payload here, as we don't do that for > VHOST_SET_OWNER. I mean, stopping one or few queue pairs when a > connect is about to be close doesn't make sense to me. Instead, > we should clean up all queue pair wh

[Qemu-devel] [PATCH v12 5/7] vhost: introduce vhost_backend_get_vq_index method

2015-09-24 Thread Yuanhan Liu
Subtracting the idx with the base(dev->vq_index) for vhost-kernel, and then adding it back for vhost-user doesn't seem right. Here introduces a new method vhost_backend_get_vq_index() for getting the right vq index for following vhost messages calls. Suggested-by: Jason Wang Signed-off-by: Yuanha

Re: [Qemu-devel] [PATCH 02/14] MAINTAINERS: there is no PPC64 TCG backend anymore

2015-09-24 Thread Markus Armbruster
Paolo Bonzini writes: > PPC32 and PPC64 were unified. > > Signed-off-by: Paolo Bonzini > --- > MAINTAINERS | 5 - > 1 file changed, 5 deletions(-) > > diff --git a/MAINTAINERS b/MAINTAINERS > index 71c652b..7c81848 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -1142,11 +1142,6 @@ M: V

Re: [Qemu-devel] [PATCH] pc: Set broken_reserved_end on pc-*-2.4, not 2.5

2015-09-24 Thread Igor Mammedov
On Thu, 24 Sep 2015 13:44:45 +0300 "Michael S. Tsirkin" wrote: > On Wed, Sep 23, 2015 at 12:04:49PM -0300, Eduardo Habkost wrote: > > Version 1 of the pc-*-2.5 machine class series was applied to the PCI > > tree instead of v3 (which was rebased after the broken_reserved_end > > patch by Igor was

Re: [Qemu-devel] [PATCH v4 42/47] ivshmem: use strtosz()

2015-09-24 Thread Marc-André Lureau
Hi On Thu, Sep 24, 2015 at 2:13 PM, Marc-André Lureau wrote: > scrap this one, it doesn't check the power of 2, and I wonder if > accepting values lower than megabyte is acceptable So the ivshmem server allows kilobytes shm, and with this patch, when giving non-pow2 size to ivshmem device, you g

Re: [Qemu-devel] MAINTAINERS leaves too many files uncovered

2015-09-24 Thread Markus Armbruster
Eric Blake writes: > On 09/22/2015 03:13 AM, Markus Armbruster wrote: > >>> Full list of unmaintained files now: >> [...] >> > >> docs/bitmaps.md >> docs/blkdebug.txt >> docs/blkverify.txt > >> docs/live-block-ops.txt > >> docs/qcow2-cache.txt >> docs/qdev-device-use.txt > >> docs/specs/qcow2.tx

Re: [Qemu-devel] MAINTAINERS leaves too many files uncovered

2015-09-24 Thread Markus Armbruster
Alberto Garcia writes: > On Wed 23 Sep 2015 10:24:55 AM CEST, Kevin Wolf wrote: > >>> > include/qemu/throttle.h >>> >>> Block? >> >> Would be covered if it were in the correct place (include/block/). Let's move it to the correct place then. >> Should we add a separate section for I/O throttli

[Qemu-devel] [PATCH 1/1] migration: fix deadlock

2015-09-24 Thread Denis V. Lunev
From: Igor Redko Release qemu global mutex before call synchronize_rcu(). synchronize_rcu() waiting for all readers to finish their critical sections. There is at least one critical section in which we try to get QGM (critical section is in address_space_rw() and prepare_mmio_access() is trying t

Re: [Qemu-devel] [PATCH] raw-win32: Fix write request error handling

2015-09-24 Thread Eric Blake
On 09/24/2015 03:14 AM, Kevin Wolf wrote: > aio_worker() wrote the return code to the wrong variable. > > Signed-off-by: Kevin Wolf > Tested-by: Guangmu Zhu > --- > block/raw-win32.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Eric Blake > > diff --git a/block/r

Re: [Qemu-devel] [PATCH V2 0/8] virtio 1.0 pci optimizations and fixes

2015-09-24 Thread Michael S. Tsirkin
On Wed, Sep 02, 2015 at 11:25:17AM +0800, Jason Wang wrote: > Hi all: > > This series tries to fix the following issues: > > - qemu abort when trying to adjust endianness for zero length eventfd, > this prevent fast mmio eventfd from being used in ppc. Fixing by > skip the endianness adjustme

[Qemu-devel] [PULL 03/22] q35: Move options common to all classes to pc_q35_machine_options()

2015-09-24 Thread Michael S. Tsirkin
From: Eduardo Habkost The existing default_machine_opts, default_display, no_floppy, and no_tco settings will still apply to future machine classes. So it makes sense to move them to pc_q35_machine_options() instead of keeping them in a version-specific machine_options function. Signed-off-by: E

[Qemu-devel] [PULL 04/22] q35: Move options common to all classes to pc_i440fx_machine_options()

2015-09-24 Thread Michael S. Tsirkin
From: Eduardo Habkost The existing default_machine_opts and default_display settings will still apply to future machine classes. So it makes sense to move them to pc_i440fx_machine_options() instead of keeping them in a version-specific machine_options function. Signed-off-by: Eduardo Habkost R

[Qemu-devel] [PULL 07/22] virtio-ccw: support ring size changes

2015-09-24 Thread Michael S. Tsirkin
From: Cornelia Huck Wire up changing the ring size for virtio-1 devices. Signed-off-by: Cornelia Huck Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/s390x/virtio-ccw.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/hw/s390x/virtio

[Qemu-devel] [PULL 05/22] pc: Introduce pc-*-2.5 machine classes

2015-09-24 Thread Michael S. Tsirkin
From: Eduardo Habkost Signed-off-by: Eduardo Habkost Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/compat.h | 3 +++ include/hw/i386/pc.h | 4 hw/i386/pc_piix.c| 18 +++--- hw/i386/pc_q35.c | 14 -- 4 files changed, 34

[Qemu-devel] [PULL 08/22] virtio-ccw: feature bits > 31 handling

2015-09-24 Thread Michael S. Tsirkin
From: Cornelia Huck We currently switch off the VERSION_1 feature bit if the guest has not negotiated at least revision 1. As no feature bits beyond 31 are valid however unless VERSION_1 has been negotiated, make sure that legacy guests never see a feature bit beyond 31. Reviewed-by: David Hilde

[Qemu-devel] [PULL 02/22] virtio-net: unbreak self announcement and guest offloads after migration

2015-09-24 Thread Michael S. Tsirkin
From: Jason Wang After commit 019a3edbb25f1571e876f8af1ce4c55412939e5d ("virtio: make features 64bit wide"). Device's guest_features was actually set after vdc->load(). This breaks the assumption that device specific load() function can check guest_features. For virtio-net, self announcement and

[Qemu-devel] [PULL 06/22] virtio: ring sizes vs. reset

2015-09-24 Thread Michael S. Tsirkin
From: Cornelia Huck We allow guests to change the size of the virtqueue rings by supplying a number of buffers that is different from the number of buffers the device was initialized with. Current code has some problems, however, since reset does not reset the ringsizes to the default values (as

[Qemu-devel] [PULL 22/22] virtio-net: correctly drop truncated packets

2015-09-24 Thread Michael S. Tsirkin
From: Jason Wang When packet is truncated during receiving, we drop the packets but neither discard the descriptor nor add and signal used descriptor. This will lead several issues: - sg mappings are leaked - rx will be stalled if a lots of packets were truncated In order to be consistent with

[Qemu-devel] [PULL 09/22] virtio-ccw: enable virtio-1

2015-09-24 Thread Michael S. Tsirkin
From: Cornelia Huck Let's enable revision 1 for virtio-ccw devices. We can always offer VERSION_1 as drivers in legacy mode won't be able to see it anyway. We have to introduce a way to set a lower maximum revision for a device to accommodate the following cases: - compat machines (to enforce le

[Qemu-devel] [PULL 20/22] virtio: introduce virtqueue_unmap_sg()

2015-09-24 Thread Michael S. Tsirkin
From: Jason Wang Factor out sg unmapping logic. This will be reused by the patch that can discard descriptor. Cc: Michael S. Tsirkin Signed-off-by: Jason Wang Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio.c | 15 ++- 1 file changed, 10 in

[Qemu-devel] [PULL 10/22] vhost-user: use VHOST_USER_XXX macro for switch statement

2015-09-24 Thread Michael S. Tsirkin
From: Yuanhan Liu So that we could let vhost_user_call to handle extented requests, such as VHOST_USER_GET/SET_PROTOCOL_FEATURES, instead of invoking vhost_user_read/write and constructing the msg again by ourself. Signed-off-by: Yuanhan Liu Reviewed-by: Michael S. Tsirkin Signed-off-by: Micha

[Qemu-devel] [PULL 01/22] virtio: right size for virtio_queue_get_avail_size

2015-09-24 Thread Michael S. Tsirkin
From: Pierre Morel Being working on dataplane I notice something strange: virtio_queue_get_avail_size() used a 64bit size index for the calculation of the available ring size. It is quite strange but it did work with the old calculation of the avail ring, at most with performance penalty, and I

[Qemu-devel] [RFC PATCH v3] os-android: Add support to android platform

2015-09-24 Thread Houcheng Lin
Hi, The v3 patch fix ident error and add error checking on ptsname_r() function. This patch is based on version: 007e620a7576e4ce2ea6955541e87d8ae8ed32ae. --- Building QEMU on android reqiures android NDK r10 cross-compilation t

[Qemu-devel] [PULL 17/22] intel_iommu: Add support for translation for devices behind bridges

2015-09-24 Thread Michael S. Tsirkin
From: Knut Omang - Use a hash table indexed on bus pointers to store information about buses instead of using the bus numbers. Bus pointers are stored in a new VTDBus struct together with the vector of device address space pointers indexed by devfn. - The bus number is still used for lookup

[Qemu-devel] [PULL 11/22] vhost-user: add protocol feature negotiation

2015-09-24 Thread Michael S. Tsirkin
Support a separate bitmask for vhost-user protocol features, and messages to get/set protocol features. Invoke them at init. No features are defined yet. [ leverage vhost_user_call for request handling -- Yuanhan Liu ] Signed-off-by: Michael S. Tsirkin Signed-off-by: Yuanhan Liu Reviewed-by:

[Qemu-devel] [PULL 12/22] vhost: rename VHOST_RESET_OWNER to VHOST_RESET_DEVICE

2015-09-24 Thread Michael S. Tsirkin
From: Yuanhan Liu Quote from Michael: We really should rename VHOST_RESET_OWNER to VHOST_RESET_DEVICE. Suggested-by: Michael S. Tsirkin Signed-off-by: Yuanhan Liu Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Signed-off-by: Yuanhan Liu Reviewed-by: Marcel Apfelbaum

[Qemu-devel] [PULL 16/22] vhost-user: add a new message to disable/enable a specific virt queue.

2015-09-24 Thread Michael S. Tsirkin
From: Changchun Ouyang Add a new message, VHOST_USER_SET_VRING_ENABLE, to enable or disable a specific virt queue, which is similar to attach/detach queue for tap device. virtio driver on guest doesn't have to use max virt queue pair, it could enable any number of virt queue ranging from 1 to ma

Re: [Qemu-devel] [PULL 00/22] virtio,pc features, fixes

2015-09-24 Thread Michael S. Tsirkin
On Thu, Sep 24, 2015 at 04:20:03PM +0300, Michael S. Tsirkin wrote: > The following changes since commit fefa4b128de06cec6d513f00ee61e8208aed4a87: > > Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20150923.0' > into staging (2015-09-23 21:39:46 +0100) > > are available in the

[Qemu-devel] [PULL 19/22] MAINTAINERS: add more devices to the PCI section

2015-09-24 Thread Michael S. Tsirkin
From: Paolo Bonzini Cc: Michael S. Tsirkin Signed-off-by: Paolo Bonzini Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 583d4af..b2e5fbd 100644 --- a/MAINTAINERS +++ b/MAIN

[Qemu-devel] [PULL 21/22] virtio: introduce virtqueue_discard()

2015-09-24 Thread Michael S. Tsirkin
From: Jason Wang This patch introduces virtqueue_discard() to discard a descriptor and unmap the sgs. This will be used by the patch that will discard descriptor when packet is truncated. Cc: Michael S. Tsirkin Signed-off-by: Jason Wang Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S

[Qemu-devel] [PULL 00/22] virtio,pc features, fixes

2015-09-24 Thread Michael S. Tsirkin
The following changes since commit fefa4b128de06cec6d513f00ee61e8208aed4a87: Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20150923.0' into staging (2015-09-23 21:39:46 +0100) are available in the git repository at: git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/f

[Qemu-devel] [PULL 14/22] vhost: introduce vhost_backend_get_vq_index method

2015-09-24 Thread Michael S. Tsirkin
From: Yuanhan Liu Minusing the idx with the base(dev->vq_index) for vhost-kernel, and then adding it back for vhost-user doesn't seem right. Here introduces a new method vhost_backend_get_vq_index() for getting the right vq index for following vhost messages calls. Suggested-by: Jason Wang Sign

[Qemu-devel] [PULL 18/22] MAINTAINERS: add more devices to the PC section

2015-09-24 Thread Michael S. Tsirkin
From: Paolo Bonzini For chipset devices, I can co-maintain it with Michael. Cc: Michael S. Tsirkin Signed-off-by: Paolo Bonzini Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- MAINTAINERS | 19 +++ 1 file changed, 19 insertions(+) diff --git a/MAINTAIN

[Qemu-devel] [PULL 15/22] vhost-user: add multiple queue support

2015-09-24 Thread Michael S. Tsirkin
From: Changchun Ouyang This patch is initially based a patch from Nikolay Nikolaev. This patch adds vhost-user multiple queue support, by creating a nc and vhost_net pair for each queue. Qemu exits if find that the backend can't support the number of requested queues (by providing queues=# opti

[Qemu-devel] [PULL 13/22] vhost-user: add VHOST_USER_GET_QUEUE_NUM message

2015-09-24 Thread Michael S. Tsirkin
From: Yuanhan Liu This is for querying how many queues the backend supports if it has mq support(when VHOST_USER_PROTOCOL_F_MQ flag is set from the quried protocol features). vhost_net_get_max_queues() is the interface to export that value, and to tell if the backend supports # of queues user re

[Qemu-devel] [PATCH v4] docs: describe the QEMU build system structure / design

2015-09-24 Thread Daniel P. Berrange
Developers who are new to QEMU, or have a background familiarity with GNU autotools, can have trouble getting their head around the home-grown QEMU build system. This document attempts to explain the structure / design of the configure script and the various Makefile pieces that live across the sou

Re: [Qemu-devel] [PATCH RFC 0/8] arm: Steps towards EL2 support round 5

2015-09-24 Thread Edgar E. Iglesias
On Wed, Sep 23, 2015 at 10:11:19AM -0700, Peter Maydell wrote: > On 19 September 2015 at 07:15, Edgar E. Iglesias > wrote: > > From: "Edgar E. Iglesias" > > > > Hi, > > > > Another round of patches towards EL2 support. This one adds partial > > support for 2-stage MMU for AArch64. I've marked it

Re: [Qemu-devel] [PATCH] libseccomp: add cacheflush to whitelist

2015-09-24 Thread Andrew Jones
On Thu, Sep 24, 2015 at 11:31:19AM +0200, Eduardo Otubo wrote: > On Wed, Jul 01, 2015 at 09=12=33AM -0400, Andrew Jones wrote: > > cacheflush is an arm-specific syscall that qemu built for arm > > uses. Add it to the whitelist. > > > > Signed-off-by: Andrew Jones > > > > --- > > > > I'm not sur

Re: [Qemu-devel] [PATCH] libseccomp: add cacheflush to whitelist

2015-09-24 Thread Peter Maydell
On 24 September 2015 at 06:50, Andrew Jones wrote: > Short answer: The lowest priority is definitely correct. > > Long answer: > > I ran strace while installing a new guest, of 3.6 million syscalls, > only 5 were cacheflush. Of course the syscalls used (and their frequency) > is host-type, qemu ma

[Qemu-devel] [PATCH 1/1] migration: fix expected_downtime

2015-09-24 Thread Denis V. Lunev
From: Igor Redko To get this estimation we must divide pending_size by bandwidth according to description of expected-downtime ("qmp-commands.hx:3246"): "expected-downtime": only present while migration is active total amount in ms for downtime that was calculated on

Re: [Qemu-devel] [PATCH v5 04/46] qapi: Add tests for empty unions

2015-09-24 Thread Markus Armbruster
Eric Blake writes: > The documentation claims that alternates are useful for > allowing two types, although nothing enforces this. Meanwhile, > it is silent on whether empty unions are allowed. In practice, > the generated code will compile, in part because we have a > 'void *data' branch; but

<    1   2   3   4   >