[Qemu-devel] [PULL] tap: vhost busy polling support

2016-07-06 Thread Jason Wang
This patch add the capability of basic vhost net busy polling which is supported by recent kernel. User could configure the maximum number of us that could be spent on busy polling through a new property of tap "poll-us". Cc: Greg Kurz Reviewed-by: Michael S. Tsirkin Signed-off-by: Jason Wang -

[Qemu-devel] [PULL] Net patches

2016-07-06 Thread Jason Wang
The following changes since commit 91d35509903464c7f4b9ed56be223d7370d3597c: Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20160706' into staging (2016-07-06 17:32:09 +0100) are available in the git repository at: https://github.com/jasowang/qemu.git tags/net-pull-re

Re: [Qemu-devel] [PATCH v3 2/7] ppc: move smp_threads sanity checks to spapr

2016-07-06 Thread Greg Kurz
On Thu, 7 Jul 2016 11:12:42 +1000 David Gibson wrote: > On Wed, Jul 06, 2016 at 02:13:30PM +0200, Greg Kurz wrote: > > Only POWER5 and newer PowerPC cpus from IBM have SMT capabilities. > > Since they are only supported by pseries, let's move the checks to > > ppc_spapr_init(). > > > > Signed-of

Re: [Qemu-devel] [Qemu-block] [PATCH v3 04/32] blockdev: Move bochs probe into separate file

2016-07-06 Thread Markus Armbruster
John Snow writes: > On 07/06/2016 04:24 AM, Kevin Wolf wrote: >> Am 05.07.2016 um 22:50 hat John Snow geschrieben: >>> >>> >>> On 07/05/2016 11:49 AM, Daniel P. Berrange wrote: On Tue, Jul 05, 2016 at 11:24:04AM -0400, Colin Lord wrote: > This puts the bochs probe function into its own s

[Qemu-devel] [PATCH v3 2/2] vhost-user: Attempt to fix a race with set_mem_table.

2016-07-06 Thread Prerna Saxena
From: Prerna Saxena The set_mem_table command currently does not seek a reply. Hence, there is no easy way for a remote application to notify to QEMU when it finished setting up memory, or if there were errors doing so. As an example: (1) Qemu sends a SET_MEM_TABLE to the backend (eg, a vhost-us

[Qemu-devel] [PATCH v3 1/2] vhost-user: Introduce a new protocol feature REPLY_ACK.

2016-07-06 Thread Prerna Saxena
From: Prerna Saxena This introduces the VHOST_USER_PROTOCOL_F_REPLY_ACK. If negotiated, client applications should send a u64 payload in response to any message that contains the "need_response" bit set on the message flags. Setting the payload to "zero" indicates the command finished successful

[Qemu-devel] [PATCH v3 0/2] vhost-user: Extend protocol to receive replies on any command.

2016-07-06 Thread Prerna Saxena
From: Prerna Saxena The current vhost-user protocol requires the client to send responses to only a few commands. For the remaining commands, it is impossible for QEMU to know the status of the requested operation -- ie, did it succeed? If so, by what time? This is inconvenient, and can also lea

Re: [Qemu-devel] [PATCH] linux-user: Correct type for LOOP_GET_STATUS{, 64} ioctls

2016-07-06 Thread Chanho Park
Hi Peter, On Wednesday, July 6, 2016, Peter Maydell wrote: > The LOOP_GET_STATUS and LOOP_GET_STATUS64 ioctls were incorrectly > defined as IOC_W rather than IOC_R, which meant we weren't > correctly copying the information back from the kernel to the guest. > The loop_info64 structure definitio

[Qemu-devel] [PATCH 2/2 V5] hmp: show all of snapshot info on every block dev in output of 'info snapshots'

2016-07-06 Thread Lin Ma
Currently, the output of 'info snapshots' shows fully available snapshots. It's opaque, hides some snapshot information to users. It's not convenient if users want to know more about all of snapshot information on every block device via monitor. Follow Kevin's and Max's proposals, The patch makes

[Qemu-devel] [PATCH 0/2 V5] Show all of snapshot info on every block dev

2016-07-06 Thread Lin Ma
V5: Minor changes. V4: Use QTAILQ_FOREACH_SAFE instead of QTAILQ_FOREACH while freeing snapshot lists. V3: Fix leaking the entries in image_list and the entries in their ImageEntry.snapshots lists V2: Split it to 2 patches. Lin Ma (2): hmp: use snapshot name to determine whether a snapsh

[Qemu-devel] [PATCH 1/2 V5] hmp: use snapshot name to determine whether a snapshot is 'fully available'

2016-07-06 Thread Lin Ma
Currently qemu uses snapshot id to determine whether a snapshot is fully available, It causes incorrect output in some scenario. For instance: (qemu) info block drive_image1 (#block113): /opt/vms/SLES12-SP1-JeOS-x86_64-GM/disk0.qcow2 (qcow2) Cache mode: writeback drive_image2 (#block349

Re: [Qemu-devel] [PATCH] main-loop: check return value before using

2016-07-06 Thread Fam Zheng
On Thu, 07/07 11:18, Cao jin wrote: > > > On 07/07/2016 08:31 AM, Fam Zheng wrote: > > On Wed, 07/06 15:46, Cao jin wrote: > > > > > > > Yes, but in this patch I think the blank line changes are 1) more of > > personal > > taste, 2) completely unrelated (neither lines nor semantics) to the >

Re: [Qemu-devel] [PATCH v2 2/3] Add KVM_CAP_PPC_HTM to linux/kvm.h

2016-07-06 Thread David Gibson
On Wed, Jul 06, 2016 at 03:35:22PM +1000, Sam Bobroff wrote: > Signed-off-by: Sam Bobroff We need to wait for this to be merged on the kernel side. > --- > linux-headers/linux/kvm.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h >

Re: [Qemu-devel] [PATCH v2 1/3] spapr: Disable ibm, pa-features HTM bit

2016-07-06 Thread David Gibson
On Wed, Jul 06, 2016 at 03:35:21PM +1000, Sam Bobroff wrote: > There are a few issues with our handling of the ibm,pa-features > HTM bit: > > - We don't support transactional memory in PR KVM, so don't tell > the OS that we do. > > - In full emulation we have a minimal implementation of HTM tha

Re: [Qemu-devel] [PATCH v2 3/3] spapr: Set ibm, pa-features HTM from KVM_CAP_PPC_HTM

2016-07-06 Thread David Gibson
On Wed, Jul 06, 2016 at 03:35:23PM +1000, Sam Bobroff wrote: > Advertise HTM support in ibm, pa-features if KVM indicates support when > queried via a new capability (KVM_CAP_PPC_HTM). > > If KVM returns false for the capability (which may indicate that the > host kernel doesn't support the capabi

Re: [Qemu-devel] [PATCH] main-loop: check return value before using

2016-07-06 Thread Cao jin
On 07/07/2016 08:31 AM, Fam Zheng wrote: On Wed, 07/06 15:46, Cao jin wrote: Yes, but in this patch I think the blank line changes are 1) more of personal taste, 2) completely unrelated (neither lines nor semantics) to the functional change. Fam Indeed, my personal taste. Generally speak

Re: [Qemu-devel] [RFC PATCH 1/1] OpenBIOS: Switch over to official OpenBIOS git repo

2016-07-06 Thread Jeff Cody
On Wed, Jul 06, 2016 at 04:19:24PM +0100, Mark Cave-Ayland wrote: > On 06/07/16 14:29, Jeff Cody wrote: > > > On Wed, Jul 06, 2016 at 08:26:57AM +0100, Mark Cave-Ayland wrote: > >> On 28/06/16 21:43, Mark Cave-Ayland wrote: > >> > >>> On 28/06/16 14:44, Stefan Hajnoczi wrote: > >>> > On Tue,

Re: [Qemu-devel] [RFC PATCH v0 2/5] cpu: Optionally use arch_id instead of cpu_index in cpu vmstate_register()

2016-07-06 Thread David Gibson
On Wed, Jul 06, 2016 at 01:55:25PM +0530, Bharata B Rao wrote: > On Wed, Jul 06, 2016 at 07:25:44AM +0200, Igor Mammedov wrote: > > On Tue, 5 Jul 2016 18:13:22 +0530 > > Bharata B Rao wrote: > > > > > On Tue, Jul 05, 2016 at 09:15:51AM +0200, Igor Mammedov wrote: > > > > On Tue, 5 Jul 2016 10:12

[Qemu-devel] [PATCH] m25p80: Fix QIOR/DIOR handling for Winbond

2016-07-06 Thread marcin.krzeminski
From: Marcin Krzeminski Winbond also support continuous read mode, but as an opposite for other flash type read mode clock cycles are included to dummy cycles number. This path add proper handling of read mode byte and update needed dummy cycles. QPI mode and dummy cycles configuration are not su

Re: [Qemu-devel] [PATCH v3 7/7] spapr: consolidate the logic of core cpu_dt_id

2016-07-06 Thread David Gibson
On Wed, Jul 06, 2016 at 02:14:59PM +0200, Greg Kurz wrote: > POWER5 and newer cpus from IBM have a specific numbering scheme for > DT ids. This is currently open coded in several places. > > This patch consolidates the logic in helpers. > > Suggested-by: Bharata B Rao > Signed-off-by: Greg Kurz

Re: [Qemu-devel] [PATCH v3 2/7] ppc: move smp_threads sanity checks to spapr

2016-07-06 Thread David Gibson
On Thu, Jul 07, 2016 at 11:57:32AM +1000, Benjamin Herrenschmidt wrote: > On Thu, 2016-07-07 at 11:12 +1000, David Gibson wrote: > > I'm not comfortable with this.  SMT may only be used for pseries at > > the moment, but the SMT possibilities are absolutely a constraint of > > the CPU itself, not t

Re: [Qemu-devel] [PATCH v3 5/7] ppc: each machine type to provide vcpu_dt_id

2016-07-06 Thread David Gibson
On Wed, Jul 06, 2016 at 02:14:36PM +0200, Greg Kurz wrote: > This patch switches machine types to provide device-tree cpu ids. > > We have three cases to handle: > > - pseries < 2.7 call ppc_cpu_init() and should compute the DT id as it is > currently done in the target code. > > - pseries 2.7

Re: [Qemu-devel] [PATCH v3 4/7] ppc: open code cpu creation for machine types

2016-07-06 Thread David Gibson
On Wed, Jul 06, 2016 at 02:14:25PM +0200, Greg Kurz wrote: > If we want to generate cpu_dt_id in the machine code, this must occur > before the cpu gets realized. We must open code the cpu creation to be > able to do this. > > This patch just does that. > > Signed-off-by: Greg Kurz > --- > v3: d

Re: [Qemu-devel] [Qemu-ppc] [PATCH v3 4/7] ppc: open code cpu creation for machine types

2016-07-06 Thread David Gibson
On Wed, Jul 06, 2016 at 06:06:16PM +0200, Greg Kurz wrote: > On Wed, 06 Jul 2016 14:14:25 +0200 > Greg Kurz wrote: > > > If we want to generate cpu_dt_id in the machine code, this must occur > > before the cpu gets realized. We must open code the cpu creation to be > > able to do this. > > > > T

Re: [Qemu-devel] [PATCH v3 2/7] ppc: move smp_threads sanity checks to spapr

2016-07-06 Thread Benjamin Herrenschmidt
On Thu, 2016-07-07 at 11:12 +1000, David Gibson wrote: > I'm not comfortable with this.  SMT may only be used for pseries at > the moment, but the SMT possibilities are absolutely a constraint of > the CPU itself, not the machine type.  It seems more logical to me to > check this in the CPU code.

Re: [Qemu-devel] [RFC PATCH v1 3/5] spapr: Implement CPUClass::get_migration_id() for PowerPC CPUs

2016-07-06 Thread David Gibson
On Wed, Jul 06, 2016 at 07:51:01PM +0530, Bharata B Rao wrote: > On Wed, Jul 06, 2016 at 02:01:14PM +0200, Igor Mammedov wrote: > > On Wed, 6 Jul 2016 14:29:19 +0530 > > Bharata B Rao wrote: > > > > > cpu_index is used as migration_id by default. For machine type > > > versions that set use-migr

Re: [Qemu-devel] [RFC PATCH v1 3/5] spapr: Implement CPUClass::get_migration_id() for PowerPC CPUs

2016-07-06 Thread David Gibson
On Wed, Jul 06, 2016 at 02:29:19PM +0530, Bharata B Rao wrote: > cpu_index is used as migration_id by default. For machine type versions > that set use-migration-id property, cpu_dt_it is returned. > > Signed-off-by: Bharata B Rao This seems ceonceptually wrong. The logic to determine the stabl

Re: [Qemu-devel] [PATCH v3 1/7] ppc: different creation paths for cpus in system and user mode

2016-07-06 Thread David Gibson
On Wed, Jul 06, 2016 at 02:13:14PM +0200, Greg Kurz wrote: > The machine code currently uses the same cpu_ppc_init() function to > create cpus as the user mode. This function also triggers the cpu > realization. > > It is okay for user mode but with system mode we may want to do other > things bet

Re: [Qemu-devel] [RFC PATCH v1 3/5] spapr: Implement CPUClass::get_migration_id() for PowerPC CPUs

2016-07-06 Thread David Gibson
On Wed, Jul 06, 2016 at 02:01:14PM +0200, Igor Mammedov wrote: > On Wed, 6 Jul 2016 14:29:19 +0530 > Bharata B Rao wrote: > > > cpu_index is used as migration_id by default. For machine type > > versions that set use-migration-id property, cpu_dt_it is returned. > > > > Signed-off-by: Bharata B

Re: [Qemu-devel] [PATCH v3 2/7] ppc: move smp_threads sanity checks to spapr

2016-07-06 Thread David Gibson
On Wed, Jul 06, 2016 at 02:13:30PM +0200, Greg Kurz wrote: > Only POWER5 and newer PowerPC cpus from IBM have SMT capabilities. > Since they are only supported by pseries, let's move the checks to > ppc_spapr_init(). > > Signed-off-by: Greg Kurz I'm not comfortable with this. SMT may only be us

Re: [Qemu-devel] [PATCH 0/2] convert device initialization functions

2016-07-06 Thread Wei, Jiangang
Ping again ... May I ask for some attention for these two patches? Thanks wei On Thu, 2016-06-30 at 03:36 +, Wei, Jiangang wrote: > Ping > These two patches seem to be forgotten ... > > On Tue, 2016-05-17 at 18:18 +0800, Wei Jiangang wrote: > > The first had been reviewed. > > The second had

[Qemu-devel] [PATCH v4 29/29] vhost: add vhost_net_set_backend()

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau Not all vhost-user backends support ops->vhost_net_set_backend(), it is a bit nicer to provide an assert/error than to crash trying to call it. Furthermore, it improves a bit the code by hiding vhost_ops details. Signed-off-by: Marc-André Lureau --- hw/net/vhost_net.c

[Qemu-devel] [PATCH v4 22/29] char: add and use tcp_chr_wait_connected

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau Add a chr_wait_connected for the tcp backend, and use it in the open_socket() function. Signed-off-by: Marc-André Lureau --- qemu-char.c | 63 ++--- 1 file changed, 44 insertions(+), 19 deletions(-) diff --git a/q

[Qemu-devel] [PATCH v4 23/29] vhost-user: wait until backend init is completed

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau The chardev waits for an initial connection before starting qemu, and vhost-user should wait for the backend negotiation to be completed before starting qemu too. vhost-user is started in the net_vhost_user_event callback, which is synchronously called after the socket is

[Qemu-devel] [PATCH v4 19/29] vhost-net: vhost_migration_done is vhost-user specific

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau Either the callback is mandatory to implement, in which case an assert() is more appropriate, or it's not and we can't tell much whether the function should fail or not (given it's name, I guess it should silently success by default). Instead, make the implementation manda

[Qemu-devel] [PATCH v4 28/29] vhost-user: add error report in vhost_user_write()

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau Similar to vhost_user_read() error report, it is useful to have early error report. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-user.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-us

[Qemu-devel] [PATCH v4 16/29] vhost-user: keep vhost_net after a disconnection

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau Many code paths assume get_vhost_net() returns non-null. Keep VhostUserState.vhost_net after a successful vhost_net_init(), instead of freeing it in vhost_net_cleanup(). VhostUserState.vhost_net is thus freed before after being recreated or on final vhost_user_cleanup()

[Qemu-devel] [PATCH v4 27/29] tests: add a simple /vhost-user/multiqueue test

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau This test just checks that 2 virtio-net queues can be setup over vhost-user and waits for them to be started. Signed-off-by: Marc-André Lureau --- tests/Makefile.include | 2 +- tests/vhost-user-test.c | 108 +++- 2 files c

[Qemu-devel] [PATCH v4 12/29] qemu-char: fix qemu_chr_fe_set_msgfds() crash when disconnected

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau Calling qemu_chr_fe_set_msgfds() on unconnected socket leads to crash since s->ioc is NULL in this case. Return an error earlier instead. Signed-off-by: Marc-André Lureau --- qemu-char.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/qemu

[Qemu-devel] [PATCH v4 17/29] vhost-user: add get_vhost_net() assertions

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau Add a few assertions to be more explicit about the runtime behaviour after the previous patch: get_vhost_net() is non-null after net_vhost_user_init(). Signed-off-by: Marc-André Lureau --- hw/net/vhost_net.c | 1 + net/vhost-user.c | 2 ++ 2 files changed, 3 insertion

[Qemu-devel] [PATCH v4 25/29] tests: fix vhost-user-test leak

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau Spotted by valgrind. Signed-off-by: Marc-André Lureau --- tests/vhost-user-test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c index 421d432..a0b91ab 100644 --- a/tests/vhost-user-test.c +++ b/tests/vhost-user-tes

[Qemu-devel] [PATCH v4 26/29] tests: add /vhost-user/connect-fail test

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau Check early connection failure and resume. Signed-off-by: Marc-André Lureau --- tests/vhost-user-test.c | 38 ++ 1 file changed, 38 insertions(+) diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c index a0b91ab..6595243 1

[Qemu-devel] [PATCH v4 13/29] vhost-user: call set_msgfds unconditionally

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau It is fine to call set_msgfds() with 0 fd, and ensures any previous fd array is cleared. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-user.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c in

[Qemu-devel] [PATCH v4 11/29] vhost: use error_report() instead of fprintf(stderr, ...)

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau Let's use qemu proper error reporting API, this ensures the error is reported at the right place (stderr or monitor), with a conventional format. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost.c | 22 ++ 1 file changed, 10 insertions(+), 12 del

[Qemu-devel] [PATCH v4 21/29] char: add chr_wait_connected callback

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau A function to wait on the backend to be connected, to be used in the following patches. Signed-off-by: Marc-André Lureau --- include/sysemu/char.h | 8 qemu-char.c | 9 + 2 files changed, 17 insertions(+) diff --git a/include/sysemu/char.h b/

[Qemu-devel] [PATCH v4 24/29] tests: plug some leaks in virtio-net-test

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau Found thanks to valgrind. Signed-off-by: Marc-André Lureau --- tests/virtio-net-test.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/virtio-net-test.c b/tests/virtio-net-test.c index a34a939..361506f 100644 --- a/tests/virtio-net

[Qemu-devel] [PATCH v4 10/29] vhost: do not assert() on vhost_ops failure

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau Calling a vhost operation may fail, for example with disconnected vhost-user backend, but qemu shouldn't abort in this case. Report an error instead, except on error/cleanup code path. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost.c | 32 +---

[Qemu-devel] [PATCH v4 15/29] vhost-user: check vhost_user_{read, write}() return value

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau The vhost-user code is quite inconsistent with error handling. Instead of ignoring some return values of read/write and silently going on with invalid state (invalid read for example), break the code flow when the error happened. Signed-off-by: Marc-André Lureau --- hw/

[Qemu-devel] [PATCH v4 07/29] vhost: make vhost_dev_cleanup() idempotent

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau It is called on multiple code path, so make it safe to call several times (note: I don't remember a reproducer here, but a function called 'cleanup' should probably be idempotent in my book) Signed-off-by: Marc-André Lureau --- hw/virtio/vhost.c | 7 ++- 1 file chan

[Qemu-devel] [PATCH v4 20/29] vhost: add assert() to check runtime behaviour

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau All these functions must be called only after the backend is connected. They are called from virtio-net.c, after either virtio or link status change. The check for nc->peer->link_down should ensure vhost_net_{start,stop}() are always called between vhost_user_{start,stop}

[Qemu-devel] [PATCH v4 14/29] vhost-user: check qemu_chr_fe_set_msgfds() return value

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau Check qemu_chr_fe_set_msgfds() for errors, to make sure the message to be sent is correct. Signed-off-by: Marc-André Lureau --- hw/virtio/vhost-user.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c

[Qemu-devel] [PATCH v4 08/29] vhost-net: always call vhost_dev_cleanup() on failure

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau vhost_dev_init(), calling vhost backend initialization, should be cleaned up after failure too. Call vhost_dev_cleanup() in all failure cases. First, it needs to zero-alloc the struct to avoid the initial garbage. Signed-off-by: Marc-André Lureau --- hw/net/vhost_net.c

[Qemu-devel] [PATCH v4 06/29] vhost: fix cleanup on not fully initialized device

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau If vhost_dev_init() failed, caller may still call vhost_dev_cleanup() later. However, vhost_dev_cleanup() tries to remove the device from the list even if it wasn't yet added, which may lead to crashes. Similarly for the memory listener. Signed-off-by: Marc-André Lureau

[Qemu-devel] [PATCH v4 18/29] Revert "vhost-net: do not crash if backend is not present"

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau Now that get_vhost_net() returns non-null after a successful vhost_net_init(), we no longer need to check this case. This reverts commit ecd34898596c60f79886061618dd7e01001113ad. Signed-off-by: Marc-André Lureau --- hw/net/vhost_net.c | 7 +-- 1 file changed, 1 ins

[Qemu-devel] [PATCH v4 00/29] vhost-user reconnect fixes

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau Hi, Since 'vhost-user: simple reconnection support' was merged, it is possible to disconnect and reconnect a vhost-user backend. However, many code paths in qemu may trigger assert() when the backend is disconnected. Some assert() could simply be replaced by error_report

[Qemu-devel] [PATCH v4 04/29] vhost: make vhost_log_put() idempotent

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau Although not strictly required, it is nice to have vhost_log_put() safely callable multiple times. Clear dev->log* when calling vhost_log_put() to make the function idempotent. This also simplifies a bit the caller work. Signed-off-by: Marc-André Lureau --- hw/virtio/v

[Qemu-devel] [PATCH v4 05/29] vhost: assert the log was cleaned up

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau Make sure the log was released on cleanup, or it will leak (the alternative is to call vhost_log_put() unconditionally, but it may hide some dev state issues). Signed-off-by: Marc-André Lureau --- hw/virtio/vhost.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/

[Qemu-devel] [PATCH v4 09/29] vhost: fix calling vhost_dev_cleanup() after vhost_dev_init()

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau vhost_net_init() calls vhost_dev_init() and in case of failure, calls vhost_dev_cleanup() directly. However, the structure is already partially cleaned on error. Calling vhost_dev_cleanup() again will call vhost_virtqueue_cleanup() on already clean queues, and causing pote

[Qemu-devel] [PATCH v4 01/29] misc: indentation

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/net/vhost_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index 50f4dcd..3f1fecc 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -313,7 +313,7 @@ int vho

[Qemu-devel] [PATCH v4 03/29] vhost: don't assume opaque is a fd, use backend cleanup

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau vhost-dev opaque isn't necessarily an fd, it can be a chardev when using vhost-user. Goto fail, so vhost_backend_cleanup() is called to handle backend cleanup appropriately. vhost_set_backend_type() should never fail, use an assert(). Signed-off-by: Marc-André Lureau --

[Qemu-devel] [PATCH v4 02/29] vhost-user: minor simplification

2016-07-06 Thread marcandre . lureau
From: Marc-André Lureau Shorten the code and make it more clear by using the specialized function g_str_has_prefix(). Signed-off-by: Marc-André Lureau --- net/vhost-user.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/vhost-user.c b/net/vhost-user.c index 92f4cfd..1

Re: [Qemu-devel] [RFC v2 02/11] cpus: pass CPUState to run_on_cpu helpers

2016-07-06 Thread David Gibson
On Thu, Jul 07, 2016 at 12:14:54AM +0300, Sergey Fedorov wrote: > From: Alex Bennée > > CPUState is a fairly common pointer to pass to these helpers. This means > if you need other arguments for the async_run_on_cpu case you end up > having to do a g_malloc to stuff additional data into the routi

Re: [Qemu-devel] [RFC PATCH v1 1/5] cpu, target-ppc: Move cpu_vmstate_[un]register calls to cpu_common_[un]realize

2016-07-06 Thread David Gibson
On Wed, Jul 06, 2016 at 02:29:17PM +0530, Bharata B Rao wrote: > Move vmstate_register() call to cpu_common_realize(). > Introduce cpu_common_unrealize() and move vmstate_unregister() to it. > > Change those archs that implement their own CPU unrealize routine to > mandatorily call CPUClass::unrea

Re: [Qemu-devel] [RFC PATCH v1 2/5] cpu: Introduce CPUState::migration_id

2016-07-06 Thread David Gibson
On Wed, Jul 06, 2016 at 02:29:18PM +0530, Bharata B Rao wrote: > Add CPUState::migration_id and use that as instance_id in > vmstate_register() call. > > Introduce use-migration-id property that allows target machines to > optionally switch to using migration_id instead of cpu_index. > This will h

Re: [Qemu-devel] [PATCH] main-loop: check return value before using

2016-07-06 Thread Fam Zheng
On Wed, 07/06 15:46, Cao jin wrote: > > On 07/06/2016 02:46 PM, Fam Zheng wrote: > > On Wed, 07/06 11:03, Cao jin wrote: > > > pointer 'qemu_aio_context' should be checked first before it is used. > > > qemu_bh_new() will use it. > > > > > > Also add extra newlines to make code well separated and

Re: [Qemu-devel] [PATCH 1/1] KVM: PPC: Introduce KVM_CAP_PPC_HTM

2016-07-06 Thread David Gibson
On Wed, Jul 06, 2016 at 04:05:54PM +1000, Sam Bobroff wrote: > Introduce a new KVM capability, KVM_CAP_PPC_HTM, that can be queried to > determine if a PowerPC KVM guest should use HTM (Hardware Transactional > Memory). > > This will be used by QEMU to populate the pa-features bits in the > guest'

Re: [Qemu-devel] [PATCH v0] spapr: Error out when CPU hotplug is attempted on older pseries machines

2016-07-06 Thread David Gibson
On Wed, Jul 06, 2016 at 11:19:30PM +0530, Bharata B Rao wrote: > CPU hotplug and coldplug aren't supported prior to pseries-2.7. > query-hotpluggable-cpus and coldplug on older pseries machines are crashing > the QEMU. Fix this. > > - Let query_hotpluggable_cpus return NULL for pseries < 2.7 > - s

Re: [Qemu-devel] test-qga failures on Fedora 24

2016-07-06 Thread Michael Roth
Quoting John Snow (2016-07-06 17:41:32) > > > On 07/06/2016 06:20 PM, Michael Roth wrote: > > Quoting Marc-André Lureau (2016-07-06 16:40:52) > >> Hi > >> > >> - Original Message - > >>> I upgraded to Fedora 24 last Friday before the long (American) weekend. > >>> Probably a bad idea. > >

Re: [Qemu-devel] test-qga failures on Fedora 24

2016-07-06 Thread John Snow
On 07/06/2016 06:20 PM, Michael Roth wrote: > Quoting Marc-André Lureau (2016-07-06 16:40:52) >> Hi >> >> - Original Message - >>> I upgraded to Fedora 24 last Friday before the long (American) weekend. >>> Probably a bad idea. >>> >>> Regardless, test-qga has developed a new symptom on c

[Qemu-devel] [PATCH v10 08/10] target-avr: adding instruction translation

2016-07-06 Thread Michael Rolnik
Signed-off-by: Michael Rolnik --- target-avr/helper.c | 118 +- target-avr/helper.h |1 + target-avr/translate-inst.c | 2621 +++ target-avr/translate.c |2 +- target-avr/translate.h | 119 ++ 5 files changed, 2830 insert

[Qemu-devel] [PATCH v10 09/10] target-avr: updating translate.c to use instructions translation

2016-07-06 Thread Michael Rolnik
Signed-off-by: Michael Rolnik --- target-avr/Makefile.objs | 4 +- target-avr/translate.c | 142 --- 2 files changed, 64 insertions(+), 82 deletions(-) diff --git a/target-avr/Makefile.objs b/target-avr/Makefile.objs index 2a10104..9757721 100644 -

[Qemu-devel] [PATCH v10 10/10] target-avr: instruction decoder generator

2016-07-06 Thread Michael Rolnik
Signed-off-by: Michael Rolnik --- target-avr/cpugen/CMakeLists.txt | 38 +++ target-avr/cpugen/README.md| 17 ++ target-avr/cpugen/cpu/avr.yaml | 214 ++ target-avr/cpugen/src/CMakeLists.txt | 62 target-avr/cpugen/src/cpugen.cpp

[Qemu-devel] [PATCH v10 07/10] target-avr: adding instruction decoder

2016-07-06 Thread Michael Rolnik
Signed-off-by: Michael Rolnik --- target-avr/decode.c | 693 1 file changed, 693 insertions(+) create mode 100644 target-avr/decode.c diff --git a/target-avr/decode.c b/target-avr/decode.c new file mode 100644 index 000..44a5815 --- /dev/

[Qemu-devel] [PATCH v10 02/10] target-avr: adding AVR CPU features/flavors

2016-07-06 Thread Michael Rolnik
Signed-off-by: Michael Rolnik --- target-avr/cpu.c | 307 ++- target-avr/cpu.h | 49 target-avr/machine.c | 1 + 3 files changed, 356 insertions(+), 1 deletion(-) diff --git a/target-avr/cpu.c b/target-avr/cpu.c index 1fdc1e6..6

[Qemu-devel] [PATCH v10 04/10] target-avr: adding instructions encodings

2016-07-06 Thread Michael Rolnik
Signed-off-by: Michael Rolnik --- target-avr/translate-inst.h | 762 1 file changed, 762 insertions(+) create mode 100644 target-avr/translate-inst.h diff --git a/target-avr/translate-inst.h b/target-avr/translate-inst.h new file mode 100644 index 00

[Qemu-devel] [PATCH v10 06/10] target-avr: adding helpers for IN, OUT, SLEEP, WBR & unsupported instructions

2016-07-06 Thread Michael Rolnik
Signed-off-by: Michael Rolnik --- target-avr/helper.c | 222 +--- target-avr/helper.h | 6 ++ 2 files changed, 215 insertions(+), 13 deletions(-) diff --git a/target-avr/helper.c b/target-avr/helper.c index 060b2f0..1a324cb 100644 --- a/target-av

[Qemu-devel] [PATCH v10 01/10] target-avr: AVR cores support is added.

2016-07-06 Thread Michael Rolnik
1. basic CPU structure 2. registers 3. no instructions 4. saving sreg, rampD, rampX, rampY, rampD, eind in HW representation saving cpu features Signed-off-by: Michael Rolnik --- arch_init.c | 2 + configure | 5 + default-configs/av

[Qemu-devel] [PATCH v10 05/10] target-avr: adding AVR interrupt handling

2016-07-06 Thread Michael Rolnik
Signed-off-by: Michael Rolnik --- target-avr/helper.c | 59 - 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/target-avr/helper.c b/target-avr/helper.c index 3e23646..060b2f0 100644 --- a/target-avr/helper.c +++ b/target-avr/helper

[Qemu-devel] [PATCH v10 03/10] target-avr: adding a sample AVR board

2016-07-06 Thread Michael Rolnik
Signed-off-by: Michael Rolnik --- MAINTAINERS | 6 ++ hw/avr/Makefile.objs | 21 +++ hw/avr/sample-io.c | 175 +++ hw/avr/sample.c | 136 +++ 4 files changed, 338 insertions(+) create mode

[Qemu-devel] [PATCH v10 00/10] *** 8bit AVR cores ***

2016-07-06 Thread Michael Rolnik
This series of patches adds 8bit AVR cores to QEMU. All instruction, except BREAK/DES/SPM/SPMX, are implemented. Not fully tested yet. However I was able to execute simple code with functions. e.g fibonacci calculation. This series of patches include a non real, sample board. No fuses support yet

Re: [Qemu-devel] test-qga failures on Fedora 24

2016-07-06 Thread Michael Roth
Quoting Marc-André Lureau (2016-07-06 16:40:52) > Hi > > - Original Message - > > I upgraded to Fedora 24 last Friday before the long (American) weekend. > > Probably a bad idea. > > > > Regardless, test-qga has developed a new symptom on current development > > HEAD that I don't know wha

Re: [Qemu-devel] test-qga failures on Fedora 24

2016-07-06 Thread Marc-André Lureau
Hi - Original Message - > I upgraded to Fedora 24 last Friday before the long (American) weekend. > Probably a bad idea. > > Regardless, test-qga has developed a new symptom on current development > HEAD that I don't know what to make of: > > https://paste.fedoraproject.org/388356/146782

[Qemu-devel] [RFC v2 11/11] tcg: Make tb_flush() thread safe

2016-07-06 Thread Sergey Fedorov
From: Sergey Fedorov Use async_safe_run_on_cpu() to make tb_flush() thread safe. Signed-off-by: Sergey Fedorov Signed-off-by: Sergey Fedorov --- Changes in v2: - stale comment about unsafe tb_flush() removed --- translate-all.c | 13 - 1 file changed, 8 insertions(+), 5 deletion

[Qemu-devel] [RFC v2 07/11] linux-user: Rework exclusive operation mechanism

2016-07-06 Thread Sergey Fedorov
From: Sergey Fedorov A single variable 'pending_cpus' was used for both counting currently running CPUs and for signalling the pending exclusive operation request. To prepare for supporting operations which requires a quiescent state, like translation buffer flush, it is useful to keep a counter

[Qemu-devel] [RFC v2 02/11] cpus: pass CPUState to run_on_cpu helpers

2016-07-06 Thread Sergey Fedorov
From: Alex Bennée CPUState is a fairly common pointer to pass to these helpers. This means if you need other arguments for the async_run_on_cpu case you end up having to do a g_malloc to stuff additional data into the routine. For the current users this isn't a massive deal but for MTTCG this get

[Qemu-devel] [RFC v2 05/11] cpus: Rename flush_queued_work()

2016-07-06 Thread Sergey Fedorov
From: Sergey Fedorov To avoid possible confusion, rename flush_queued_work() to process_queued_cpu_work(). Signed-off-by: Sergey Fedorov Signed-off-by: Sergey Fedorov --- cpus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpus.c b/cpus.c index f80ed2aeefdd..51fd8c1

[Qemu-devel] [RFC v2 04/11] cpus: Wrap mutex used to protect CPU work

2016-07-06 Thread Sergey Fedorov
From: Sergey Fedorov This will be useful to enable CPU work on user mode emulation. Signed-off-by: Sergey Fedorov Signed-off-by: Sergey Fedorov --- cpus.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cpus.c b/cpus.c index 04687c85bcd4..f80ed2aeefdd 100644 --- a/cp

[Qemu-devel] [RFC v2 09/11] linux-user: Support CPU work queue

2016-07-06 Thread Sergey Fedorov
From: Sergey Fedorov Make CPU work core functions common between system and user-mode emulation. User-mode does not have BQL, so process_queued_cpu_work() is protected by 'exclusive_lock'. Signed-off-by: Sergey Fedorov Signed-off-by: Sergey Fedorov --- Changes in v2: - 'qemu_work_cond' defin

[Qemu-devel] [RFC v2 08/11] linux-user: Add qemu_cpu_is_self() and qemu_cpu_kick()

2016-07-06 Thread Sergey Fedorov
From: Sergey Fedorov Signed-off-by: Sergey Fedorov Signed-off-by: Sergey Fedorov --- linux-user/main.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/linux-user/main.c b/linux-user/main.c index 5ff0b20bad89..a8790ac63f68 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @

[Qemu-devel] [RFC v2 03/11] cpus: Move common code out of {async_, }run_on_cpu()

2016-07-06 Thread Sergey Fedorov
From: Sergey Fedorov Move the code common between run_on_cpu() and async_run_on_cpu() into a new function queue_work_on_cpu(). Signed-off-by: Sergey Fedorov Signed-off-by: Sergey Fedorov Reviewed-by: Alex Bennée --- cpus.c | 42 ++ 1 file changed, 18 i

[Qemu-devel] [RFC v2 06/11] linux-user: Use QemuMutex and QemuCond

2016-07-06 Thread Sergey Fedorov
From: Sergey Fedorov Convert pthread_mutex_t and pthread_cond_t to QemuMutex and QemuCond. This will allow to make some locks and conditional variables common between user and system mode emulation. Signed-off-by: Sergey Fedorov Signed-off-by: Sergey Fedorov --- linux-user/main.c | 53 +++

[Qemu-devel] [RFC v2 00/11] cpu-exec: Safe work in quiescent state

2016-07-06 Thread Sergey Fedorov
From: Sergey Fedorov Hi, This is a v2 of the RFC series [3] that was a follow-up for a discussion on the subject [1]. This is sill marked as FRC becuse it laks bsd-user support. Basically, this series suggests a way to perform some operations in quiescent state. The goal is to implement such a

[Qemu-devel] [RFC v2 01/11] atomic: introduce atomic_dec_fetch.

2016-07-06 Thread Sergey Fedorov
From: Alex Bennée Useful for counting down. Signed-off-by: Alex Bennée Signed-off-by: Sergey Fedorov --- include/qemu/atomic.h | 4 1 file changed, 4 insertions(+) diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h index 7a590969b59f..8ac9ca7f457a 100644 --- a/include/qemu/atomi

[Qemu-devel] [RFC v2 10/11] cpu-exec-common: Introduce async_safe_run_on_cpu()

2016-07-06 Thread Sergey Fedorov
From: Sergey Fedorov This patch is based on the ideas found in work of KONRAD Frederic [1], Alex Bennée [2], and Alvise Rigo [3]. This mechanism allows to perform an operation safely in a quiescent state. Quiescent state means: (1) no vCPU is running and (2) BQL in system-mode or 'exclusive_lock

[Qemu-devel] test-qga failures on Fedora 24

2016-07-06 Thread John Snow
I upgraded to Fedora 24 last Friday before the long (American) weekend. Probably a bad idea. Regardless, test-qga has developed a new symptom on current development HEAD that I don't know what to make of: https://paste.fedoraproject.org/388356/14678205/ Here's the meat of it: LINK tests/test

[Qemu-devel] [PATCH v2] target-i386: Use struct X86XSaveArea in fpu_helper.c

2016-07-06 Thread Richard Henderson
This avoids a double hand-full of magic numbers in the xsave and xrstor helper functions. Signed-off-by: Richard Henderson --- target-i386/cpu.c| 7 ++- target-i386/cpu.h| 10 + target-i386/fpu_helper.c | 108 ++- 3 files changed

Re: [Qemu-devel] [PATCH] qemu-sockets: use qapi_free_SocketAddress in cleanup

2016-07-06 Thread Eric Blake
On 07/06/2016 10:42 AM, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > Commit 74b6ce43e3 uses the wrong free API for a SocketAddress, that > may leak some linked data. > > Signed-off-by: Marc-André Lureau > --- > util/qemu-sockets.c | 2 +- > 1 file changed, 1 insertion(+), 1

[Qemu-devel] [PATCH v2 1/1] block/gluster: add support to choose libgfapi logfile

2016-07-06 Thread Prasanna Kumar Kalever
currently all the libgfapi logs defaults to '/dev/stderr' as it was hardcoded in a call to glfs logging api, in case if debug level is chosen to DEBUG/TRACE gfapi logs will be huge and fill/overflow the console view. this patch provides a commandline option to mention log file path which helps in

Re: [Qemu-devel] [PATCH v3 1/4] x86: Allow physical address bits to be set

2016-07-06 Thread Eduardo Habkost
On Tue, Jul 05, 2016 at 08:03:15PM +0100, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > Currently QEMU sets the x86 number of physical address bits to the > magic number 40. This is only correct on some small AMD systems; > Intel systems tend to have 36, 39, 46 bits, a

Re: [Qemu-devel] [PATCH v3 4/4] x86: Set physical address bits based on host

2016-07-06 Thread Eduardo Habkost
On Tue, Jul 05, 2016 at 08:03:18PM +0100, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > A special case based on the previous phys-bits property; if it's > the magic value 0 then use the hosts capabilities. > > We can also use the value we read from the host to check th

  1   2   3   4   >