Re: [Qemu-devel] virtio_tswaps() vs virtio_ld/st_p()

2015-01-19 Thread Greg Kurz
On Mon, 19 Jan 2015 11:45:39 + Peter Maydell peter.mayd...@linaro.org wrote: On 19 January 2015 at 11:35, Stefan Hajnoczi stefa...@gmail.com wrote: What is the difference between the virtio_tswaps() and virtio_ld/st_p() families of functions? virtio_ld/st*_p() perform a load or store

Re: [Qemu-devel] [PATCH 1/2] dataplane: move vring_more_avail() into vring.c

2015-01-21 Thread Greg Kurz
-off-by: Stefan Hajnoczi stefa...@redhat.com --- Yes, this function should definitely be declared in more appropriate scope. And BTW I remember Cornelia had the same concern in the virtio-1 serie. :) Reviewed-by: Greg Kurz gk...@linux.vnet.ibm.com hw/virtio/dataplane/vring.c | 6

[Qemu-devel] [PATCH 0/2] vhost: support for cross endian

2015-02-20 Thread Greg Kurz
cross endian Greg Kurz (1): vhost: add VHOST_VRING_F_LEGACY_BIG_ENDIAN flag hw/net/vhost_net.c | 19 --- hw/virtio/vhost.c | 10 +- include/hw/virtio/vhost.h |1 + linux-headers/linux/vhost.h |2 ++ 4 files changed, 12 insertions

[Qemu-devel] [PATCH 1/2] vhost: add VHOST_VRING_F_LEGACY_BIG_ENDIAN flag

2015-02-20 Thread Greg Kurz
. Cc: Cédric Le Goater c...@fr.ibm.com Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- hw/virtio/vhost.c | 10 +- include/hw/virtio/vhost.h |1 + linux-headers/linux/vhost.h |2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost.c

[Qemu-devel] [PATCH 2/2] vhost_net: re-enable when cross endian

2015-02-20 Thread Greg Kurz
From: Cédric Le Goater c...@fr.ibm.com revert 371df9f5e0f1 vhost-net: disable when cross-endian Signed-off-by: Cédric Le Goater c...@fr.ibm.com Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- hw/net/vhost_net.c | 19 --- 1 file changed, 19 deletions(-) diff --git a/hw

Re: [Qemu-devel] [PATCH] include/qom/cpu.h: Add missing documentation for some CPUClass methods

2015-01-05 Thread Greg Kurz
Maydell peter.mayd...@linaro.org --- Thanks for this accurate description of virtio_is_big_endian. Acked-by: Greg Kurz gk...@linux.vnet.ibm.com More informative phrasings for the elf note callbacks welcome... include/qom/cpu.h | 12 1 file changed, 12 insertions(+) diff

Re: [Qemu-devel] [PATCH] kvm: fix ioeventfd endianness on bi-endian architectures

2015-03-17 Thread Greg Kurz
On Sun, 15 Mar 2015 10:14:18 +0100 Paolo Bonzini pbonz...@redhat.com wrote: On 13/03/2015 22:30, Patchew Tool wrote: This series passed Patchew automatic testing, but there are some warnings. Find the log fragments below, or open the following URL to see the full log:

Re: [Qemu-devel] [PATCH] virtio-pci: fix host notifiers on bi-endian architectures

2015-03-11 Thread Greg Kurz
On Wed, 11 Mar 2015 21:06:05 +0100 Michael S. Tsirkin m...@redhat.com wrote: On Wed, Mar 11, 2015 at 07:04:38PM +0100, Greg Kurz wrote: vhost is seriously broken with ppc64le guests, even in the supposedly supported case where the host is ppc64le and we don't need cross-endian support

[Qemu-devel] [PATCH] virtio-pci: fix host notifiers on bi-endian architectures

2015-03-11 Thread Greg Kurz
...@fr.ibm.com Suggested-by: Michael Roth mdr...@linux.vnet.ibm.com Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- I guess it is also a fix for virtio-1 but I didn't check. hw/virtio/virtio-pci.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hw/virtio

Re: [Qemu-devel] [Qemu-ppc] [PATCH] virtio-pci: fix host notifiers on bi-endian architectures

2015-03-11 Thread Greg Kurz
On Thu, 12 Mar 2015 09:18:38 +1100 Benjamin Herrenschmidt b...@kernel.crashing.org wrote: On Wed, 2015-03-11 at 23:03 +0100, Greg Kurz wrote: /* The host notifier will be swapped in adjust_endianness() according to the * target default endianness. We need to negate this swap if the device

[Qemu-devel] [PATCH] kvm: fix ioeventfd endianness on bi-endian architectures

2015-03-13 Thread Greg Kurz
KVM expects host endian values. Hosts that don't use the default endianness need to negate the swap performed in adjust_endianness(). Suggested-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- kvm-all.c | 24 ++-- 1 file changed

[Qemu-devel] [PATCH 1/2] memory: make adjust_endianness() generic

2015-03-13 Thread Greg Kurz
This patch just moves the decision to swap up to the callers. It changes no functionnality and will allow a subsequent patch to perform host endianness based swapping. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- memory.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions

[Qemu-devel] [PATCH 2/2] memory: fix the eventfd data endianness according to the host

2015-03-13 Thread Greg Kurz
of TARGET_WORDS_BIGENDIAN). It doesn't change functionnality for fixed endian architectures (i.e. doesn't break x86). Reported-by: Cédric Le Goater c...@fr.ibm.com Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- memory.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff

Re: [Qemu-devel] [PATCH] virtio-pci: fix host notifiers on bi-endian architectures

2015-03-13 Thread Greg Kurz
On Thu, 12 Mar 2015 17:25:15 +0100 Paolo Bonzini pbonz...@redhat.com wrote: On 12/03/2015 08:08, Michael S. Tsirkin wrote: But common header format is simple, it's always LE. It does not depend on target. To me this looks like a bug in memory_region_add_eventfd, it should do the right

Re: [Qemu-devel] [PATCH 2/2] memory: fix the eventfd data endianness according to the host

2015-03-13 Thread Greg Kurz
On Fri, 13 Mar 2015 12:06:06 +0100 Paolo Bonzini pbonz...@redhat.com wrote: On 13/03/2015 09:11, Greg Kurz wrote: The data argument is a host entity. It is not related to the target endianness. Let's introduce a HOST_WORDS_BIGENDIAN based helper for that. This patch fixes ioeventfd

[Qemu-devel] [PATCH] vhost: fix typo in vq_index description

2015-03-26 Thread Greg Kurz
Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- include/hw/virtio/vhost.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h index 71ef18f..88e1e56 100644 --- a/include/hw/virtio/vhost.h +++ b/include/hw/virtio

Re: [Qemu-devel] [PATCH RFC v6 06/20] virtio: endianness checks for virtio 1.0 devices

2015-01-23 Thread Greg Kurz
On Thu, 22 Jan 2015 12:54:09 +1100 David Gibson da...@gibson.dropbear.id.au wrote: On Thu, Dec 11, 2014 at 02:25:08PM +0100, Cornelia Huck wrote: Add code that checks for the VERSION_1 feature bit in order to make decisions about the device's endianness. This allows us to support

Re: [Qemu-devel] [PULL 16/19] kvm: fix ioeventfd endianness on bi-endian architectures

2015-03-23 Thread Greg Kurz
On Wed, 18 Mar 2015 12:25:03 +0100 Paolo Bonzini pbonz...@redhat.com wrote: From: Greg Kurz gk...@linux.vnet.ibm.com KVM expects host endian values. Hosts that don't use the default endianness need to negate the swap performed in adjust_endianness(). Suggested-by: Paolo Bonzini pbonz

[Qemu-devel] [PATCH RFC 0/7] vhost: cross-endian support (vhost-net only)

2015-05-06 Thread Greg Kurz
endian Greg Kurz (6): virtio: relax feature check linux-headers: sync vhost.h virtio: introduce virtio_legacy_is_cross_endian() vhost: set vring endianness for legacy virtio tap: add VNET_LE/VNET_BE operations vhost-net: tell tap backend about the vnet endianness

[Qemu-devel] [PATCH RFC 5/7] tap: add VNET_LE/VNET_BE operations

2015-05-06 Thread Greg Kurz
The linux tap and macvtap backends can be told to parse vnet headers according to little or big endian. This is done through the TUNSETVNETLE and TUNSETVNETBE ioctls. This patch brings all the plumbing for QEMU to use these APIs. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- include/net

[Qemu-devel] [PATCH RFC 1/7] virtio: relax feature check

2015-05-06 Thread Greg Kurz
VIRTIO_F_VERSION_1, even if they are still not implemented. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- include/hw/virtio/virtio.h |1 - 1 file changed, 1 deletion(-) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index d95f8b6..6ef70f1 100644 --- a/include/hw

[Qemu-devel] [PATCH RFC 6/7] vhost-net: tell tap backend about the vnet endianness

2015-05-06 Thread Greg Kurz
The default behaviour for TAP/MACVTAP is to consider vnet as native endian. This patch handles the cases when this is not true: - virtio 1.0: always little-endian - legacy cross-endian Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- hw/net/vhost_net.c | 33

[Qemu-devel] [PATCH RFC 2/7] linux-headers: sync vhost.h

2015-05-06 Thread Greg Kurz
This patch brings the cross-endian vhost API to QEMU. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- linux-headers/linux/vhost.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/linux-headers/linux/vhost.h b/linux-headers/linux/vhost.h index c656f61..ead86db 100644

[Qemu-devel] [PATCH RFC 7/7] vhost_net: re-enable when cross endian

2015-05-06 Thread Greg Kurz
From: Cédric Le Goater c...@fr.ibm.com Cross-endianness is now checked by the core vhost code. revert 371df9f5e0f1 vhost-net: disable when cross-endian Signed-off-by: Cédric Le Goater c...@fr.ibm.com [ added commit message, Greg Kurz gk...@linux.vnet.ibm.com ] Signed-off-by: Greg Kurz gk

[Qemu-devel] [PATCH RFC 4/7] vhost: set vring endianness for legacy virtio

2015-05-06 Thread Greg Kurz
Legacy virtio is native endian: if the guest and host endianness differ, we have to tell vhost so it can swap bytes where appropriate. This is done through a vhost ring ioctl. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- hw/virtio/vhost.c | 50

[Qemu-devel] [PATCH RFC 3/7] virtio: introduce virtio_legacy_is_cross_endian()

2015-05-06 Thread Greg Kurz
This helper will be used by vhost and tap to detect cross-endianness in the legacy virtio case. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- include/hw/virtio/virtio-access.h | 13 + 1 file changed, 13 insertions(+) diff --git a/include/hw/virtio/virtio-access.h b

[Qemu-devel] [PATCH] spapr: ensure we have at least one XICS server

2015-05-13 Thread Greg Kurz
threads on PPC with KVM ... which is a lot more explicit than the XICS errors. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- hw/ppc/spapr.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 35dca77..92916df 100644 --- a/hw/ppc

Re: [Qemu-devel] [PATCH RFC 1/7] virtio: relax feature check

2015-05-12 Thread Greg Kurz
On Tue, 12 May 2015 15:14:53 +0200 Cornelia Huck cornelia.h...@de.ibm.com wrote: On Wed, 06 May 2015 14:07:37 +0200 Greg Kurz gk...@linux.vnet.ibm.com wrote: Unlike with add and clear, there is no valid reason to abort when checking for a feature. It makes more sense to return false (i.e

Re: [Qemu-devel] [virtio] qemu vs vhost virtqueue consumer

2015-04-07 Thread Greg Kurz
On Tue, 7 Apr 2015 11:10:07 +0300 Catalin Vasile catalinvasil...@gmail.com wrote: I am using the virtio-net vhost-net model to make another virtio/vhost solution. I can't seem to find how does one make a virtqueue to only be consumed by vhost when adding notifiers to vhost.

[Qemu-devel] [PATCH v2 2/3] linux-headers: sync vhost.h

2015-04-02 Thread Greg Kurz
This patch brings the cross-endian vhost API to QEMU. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- linux-headers/linux/vhost.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/linux-headers/linux/vhost.h b/linux-headers/linux/vhost.h index c656f61..e040bcb 100644

[Qemu-devel] [PATCH v2 3/3] vhost: set vring endianness for legacy virtio

2015-04-02 Thread Greg Kurz
is detected. Of course, virtio 1.0 doesn't need this and will never ack the feature back to vhost. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- hw/virtio/vhost.c | 46 +++-- include/hw/virtio/vhost.h |1 + 2 files changed, 37 insertions

[Qemu-devel] [PATCH v2 1/3] vhost: move cross-endian check to vhost core

2015-04-02 Thread Greg Kurz
The cross-endian support isn't really a vhost_net affair: it affects any vhost device. This patch moves the checking to the vhost core code. While, we're here, let's give a meaningful name to the helper. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- hw/net/vhost_net.c | 19

[Qemu-devel] [PATCH v2 0/3] vhost: set vring endianness for legacy virtio

2015-04-02 Thread Greg Kurz
friendly, and have thus been generated against MST's virtio-1.0 branch: https://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git Please note that some more work is needed though to have vhost_net working. It will me covered in another patchset. --- Greg Kurz (3): vhost: move cross-endian

Re: [Qemu-devel] [PATCH] dataplane: endian fix in host notification

2015-06-25 Thread Greg Kurz
On Thu, 25 Jun 2015 18:41:31 +0200 Cornelia Huck cornelia.h...@de.ibm.com wrote: On Thu, 25 Jun 2015 18:34:47 +0200 Cornelia Huck cornelia.h...@de.ibm.com wrote: On Thu, 25 Jun 2015 17:26:21 +0200 Greg Kurz gk...@linux.vnet.ibm.com wrote: This field comes either LE with virtio 1.0

[Qemu-devel] [PATCH 0/2] dataplane: cross-endian fixes

2015-06-26 Thread Greg Kurz
/ with some minor changes in the commit message. This series was tested with ppc64 and ppc64le hosts. No regression was observed on x86_64. --- Greg Kurz (2): dataplane: drop copy_in_vring_desc() dataplane: fix cross-endian issues hw/virtio/dataplane/vring.c | 20 ++-- 1

[Qemu-devel] [PATCH 2/2] dataplane: fix cross-endian issues

2015-06-26 Thread Greg Kurz
Accesses to vring_avail_event and vring_used_event must honor the queue endianness. This patch allows cross-endian setups to use dataplane (tested with ppc64 on ppc64le, and vice-versa). Suggested-by: Cornelia Huck cornelia.h...@de.ibm.com Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com

[Qemu-devel] [PATCH 1/2] dataplane: drop copy_in_vring_desc()

2015-06-26 Thread Greg Kurz
descriptor addr 0x18e2517e len 268435456 A solution could be to revert f5a5628cf0b6, but dropping copy_in_vring_desc() is equivalent and result in a smaller patch. This patch allows SLOF to boot the OS. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- hw/virtio/dataplane/vring.c

[Qemu-devel] [PATCH] dataplane: drop copy_in_vring_desc()

2015-06-25 Thread Greg Kurz
268435456 A solution could be to revert f5a5628cf0b6, but dropping copy_in_vring_desc() is equivalent and gives a smaller patch. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- hw/virtio/dataplane/vring.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/hw

[Qemu-devel] [PATCH] dataplane: endian fix in host notification

2015-06-25 Thread Greg Kurz
This field comes either LE with virtio 1.0, either guest endian with legacy. It must only be accessed with an accessor that knows about the appropriate endianness. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- hw/virtio/dataplane/vring.c |2 +- 1 file changed, 1 insertion(+), 1

Re: [Qemu-devel] [PATCH] dataplane: endian fix in host notification

2015-06-25 Thread Greg Kurz
On Thu, 25 Jun 2015 18:34:47 +0200 Cornelia Huck cornelia.h...@de.ibm.com wrote: On Thu, 25 Jun 2015 17:26:21 +0200 Greg Kurz gk...@linux.vnet.ibm.com wrote: This field comes either LE with virtio 1.0, either guest endian with legacy. It must only be accessed with an accessor that knows

[Qemu-devel] [PATCH v2] vhost_net: fix misuse of assert()

2015-06-19 Thread Greg Kurz
(). This is a readability enhancement. The patch does not fix any bug. Suggested-by: Thomas Huth th...@redhat.com Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- hw/net/vhost_net.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) v2: rewrote commit log diff --git a/hw/net/vhost_net.c b/hw

Re: [Qemu-devel] [PATCH 5/6] vhost-net: tell tap backend about the vnet endianness

2015-06-19 Thread Greg Kurz
On Fri, 19 Jun 2015 11:16:35 +0200 Thomas Huth th...@redhat.com wrote: Hi, On Wed, 17 Jun 2015 15:23:49 +0200 Greg Kurz gk...@linux.vnet.ibm.com wrote: The default behaviour for TAP/MACVTAP is to consider vnet as native endian. This patch handles the cases when this is not true

[Qemu-devel] [PATCH] vhost_net: fix misuse of assert()

2015-06-19 Thread Greg Kurz
In case NDEBUG is defined, assert() expands to nothing and vhost_net_set_vnet_endian() doesn't get called... Suggested-by: Thomas Huth th...@redhat.com Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- hw/net/vhost_net.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Michael

Re: [Qemu-devel] [PATCH] tap: fix non-linux build

2015-06-19 Thread Greg Kurz
using_vnet_hdr) { } I couldn't setup a build environment on a non-linux platform (tried AIX but I miss to many packages), so I won't give a Tested-by... patch is trivial though so: Reviewed-by: Greg Kurz gk...@linux.vnet.ibm.com

Re: [Qemu-devel] [PATCH] vhost_net: fix misuse of assert()

2015-06-19 Thread Greg Kurz
...@redhat.com writes: On Fri, Jun 19, 2015 at 11:13:40AM +0100, Peter Maydell wrote: On 19 June 2015 at 11:07, Michael S. Tsirkin m...@redhat.com wrote: On Fri, Jun 19, 2015 at 12:00:53PM +0200, Greg Kurz wrote: In case NDEBUG is defined, assert() expands to nothing

Re: [Qemu-devel] [PATCH] dataplane: drop copy_in_vring_desc()

2015-06-26 Thread Greg Kurz
On Fri, 26 Jun 2015 11:00:45 +0100 Stefan Hajnoczi stefa...@gmail.com wrote: On Thu, Jun 25, 2015 at 05:26:09PM +0200, Greg Kurz wrote: During early virtio 1.0 devel, there were several proposals about how to deal endianness of the vring descriptor fields: - convert the decriptor to host

Re: [Qemu-devel] [PATCH 1/2] dataplane: drop copy_in_vring_desc()

2015-06-26 Thread Greg Kurz
On Fri, 26 Jun 2015 18:28:42 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Fri, Jun 26, 2015 at 02:18:38PM +0200, Greg Kurz wrote: On Fri, 26 Jun 2015 12:28:45 +0200 Cornelia Huck cornelia.h...@de.ibm.com wrote: On Fri, 26 Jun 2015 09:32:21 +0200 Greg Kurz gk

[Qemu-devel] [PATCH v2 2/2] spapr_iommu: translate sPAPRTCEAccess to IOMMUAccessFlags

2015-06-16 Thread Greg Kurz
The fact that these enums have matching values is pure coincidence. We actually need to translate from the PAPR definition to the QEMU one. This patch doesn't fix any bug, it is only code cleanup. Suggested-by: Alexey Kardashevskiy a...@ozlabs.ru Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com

[Qemu-devel] [PATCH v2 1/2] spapr_iommu: drop erroneous check in h_put_tce_indirect()

2015-06-16 Thread Greg Kurz
a...@ozlabs.ru Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- hw/ppc/spapr_iommu.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c index 8cd9dba9ac4d..ddd0ea5cd4dd 100644 --- a/hw/ppc/spapr_iommu.c +++ b/hw/ppc/spapr_iommu.c

[Qemu-devel] [PATCH v2 0/2] spapr_iommu: TCE permission bits fixes

2015-06-16 Thread Greg Kurz
This series fixes some minor nits in the sPAPR IOMMU code. It supercedes my previous post: spapr_iommu: drop erroneous check in h_put_tce_indirect() and useless enum --- Greg Kurz (2): spapr_iommu: drop erroneous check in h_put_tce_indirect() spapr_iommu: translate sPAPRTCEAccess

Re: [Qemu-devel] [PATCH] spapr_iommu: drop erroneous check in h_put_tce_indirect() and useless enum

2015-06-16 Thread Greg Kurz
On Tue, 16 Jun 2015 12:09:33 +0200 Greg Kurz gk...@linux.vnet.ibm.com wrote: The tce_list variable is not a TCE but the address to a TCE: we shouldn't clear permission bits as we do now. And this is dead code anyway since we check tce_list is 4K aligned a few lines above. While we're here

Re: [Qemu-devel] [PATCH v2 1/2] spapr_iommu: drop erroneous check in h_put_tce_indirect()

2015-06-16 Thread Greg Kurz
On Tue, 16 Jun 2015 18:26:47 +0200 Greg Kurz gk...@linux.vnet.ibm.com wrote: The tce_list variable is not a TCE but the address to a TCE: we shouldn't clear permission bits as we do now. And this is dead code anyway since we check tce_list is 4K aligned a few lines above. This patch doesn't

[Qemu-devel] [PATCH 2/6] virtio: introduce virtio_legacy_is_cross_endian()

2015-06-17 Thread Greg Kurz
This helper will be used by vhost and tap to detect cross-endianness in the legacy virtio case. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- include/hw/virtio/virtio-access.h | 13 + 1 file changed, 13 insertions(+) diff --git a/include/hw/virtio/virtio-access.h b

[Qemu-devel] [PATCH 3/6] vhost: set vring endianness for legacy virtio

2015-06-17 Thread Greg Kurz
Legacy virtio is native endian: if the guest and host endianness differ, we have to tell vhost so it can swap bytes where appropriate. This is done through a vhost ring ioctl. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- hw/virtio/vhost.c | 50

[Qemu-devel] [PATCH 1/6] linux-headers: sync vhost.h

2015-06-17 Thread Greg Kurz
This patch brings the cross-endian vhost API to QEMU. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- linux-headers/linux/vhost.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/linux-headers/linux/vhost.h b/linux-headers/linux/vhost.h index c656f61cfc75..ead86db91a08

[Qemu-devel] [PATCH 6/6] vhost_net: re-enable when cross endian

2015-06-17 Thread Greg Kurz
From: Cédric Le Goater c...@fr.ibm.com Cross-endianness is now checked by the core vhost code. revert 371df9f5e0f1 vhost-net: disable when cross-endian Signed-off-by: Cédric Le Goater c...@fr.ibm.com [ added commit message, Greg Kurz gk...@linux.vnet.ibm.com ] Signed-off-by: Greg Kurz gk

[Qemu-devel] [PATCH 0/6] vhost: cross-endian support

2015-06-17 Thread Greg Kurz
/kernel/git/mst/vhost.git Please review. --- Cédric Le Goater (1): vhost_net: re-enable when cross endian Greg Kurz (5): linux-headers: sync vhost.h virtio: introduce virtio_legacy_is_cross_endian() vhost: set vring endianness for legacy virtio tap: add VNET_LE

[Qemu-devel] [PATCH 4/6] tap: add VNET_LE/VNET_BE operations

2015-06-17 Thread Greg Kurz
The linux tap and macvtap backends can be told to parse vnet headers according to little or big endian. This is done through the TUNSETVNETLE and TUNSETVNETBE ioctls. This patch brings all the plumbing for QEMU to use these APIs. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- include/net

[Qemu-devel] [PATCH 5/6] vhost-net: tell tap backend about the vnet endianness

2015-06-17 Thread Greg Kurz
The default behaviour for TAP/MACVTAP is to consider vnet as native endian. This patch handles the cases when this is not true: - virtio 1.0: always little-endian - legacy cross-endian Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- hw/net/vhost_net.c | 33

[Qemu-devel] [PATCH] spapr_iommu: fix erroneous sanity check in h_put_tce_indirect()

2015-06-15 Thread Greg Kurz
the other reserved bits should error out with H_PARAMETER. This patch simply drops the offending check. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- hw/ppc/spapr_iommu.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c index

Re: [Qemu-devel] [Qemu-ppc] [PATCH] spapr_iommu: fix erroneous sanity check in h_put_tce_indirect()

2015-06-16 Thread Greg Kurz
On Tue, 16 Jun 2015 18:53:51 +1000 Alexey Kardashevskiy a...@ozlabs.ru wrote: On 06/16/2015 03:28 AM, Greg Kurz wrote: According to PAPR+ 3.2.2.2, the TCE is implemented as follows: bits 0-51: real page number bits 52-61: reserved for future use bits 62-63: page protection

[Qemu-devel] [PATCH] spapr_iommu: drop erroneous check in h_put_tce_indirect() and useless enum

2015-06-16 Thread Greg Kurz
. This patch doesn't fix any bug, it is only code cleanup. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- hw/ppc/spapr_iommu.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c index 8cd9dba9ac4d..2ae8684ca5bc 100644 --- a/hw

Re: [Qemu-devel] [PATCH 1/2] dataplane: drop copy_in_vring_desc()

2015-06-28 Thread Greg Kurz
On Sun, 28 Jun 2015 15:03:20 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Fri, Jun 26, 2015 at 07:05:07PM +0200, Greg Kurz wrote: On Fri, 26 Jun 2015 18:28:42 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Fri, Jun 26, 2015 at 02:18:38PM +0200, Greg Kurz wrote: On Fri, 26

[Qemu-devel] [PATCH] spapr_vty: lookup should only return valid VTY objects

2015-06-30 Thread Greg Kurz
the RTAS call display-character. Signed-off-by: Greg Kurz gk...@linux.vnet.ibm.com --- hw/char/spapr_vty.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/char/spapr_vty.c b/hw/char/spapr_vty.c index 4e464bd15a54..7eeacde31d27 100644 --- a/hw/char/spapr_vty.c +++ b/hw/char

Re: [Qemu-devel] [PATCH] spapr_vty: lookup should only return valid VTY objects

2015-06-30 Thread Greg Kurz
On Tue, 30 Jun 2015 14:04:31 +0200 Greg Kurz gk...@linux.vnet.ibm.com wrote: If a guest passes the reg property of a valid VIO object that is not a VTY to either H_GET_TERM_CHAR or H_PUT_TERM_CHAR, QEMU hits a dynamic cast assertion and aborts. PAPR+ says Hypervisor checks the termno

Re: [Qemu-devel] [PATCH 4/6] virtio-pci: use wildcard mmio eventfd for 1.0 notification cap

2015-08-24 Thread Greg Kurz
On Fri, 21 Aug 2015 17:05:48 +0800 Jason Wang jasow...@redhat.com wrote: We use data match eventfd for 1.0 notification currently. This could be slow since software decoding is needed for mmio exit. To speed this up, we can switch to use wild card mmio eventfd for 1.0 notification since we

Re: [Qemu-devel] [PATCH 5/6] virtio-pci: introduce pio notification capability for modern device

2015-08-24 Thread Greg Kurz
On Fri, 21 Aug 2015 17:05:49 +0800 Jason Wang jasow...@redhat.com wrote: We used to use mmio for notification. This could be slow on some arch (e.g on x86 without EPT). So this patch introduces pio bar and a pio notification cap for modern device. This ability is enabled through property

Re: [Qemu-devel] [PATCH 5/6] virtio-pci: introduce pio notification capability for modern device

2015-08-24 Thread Greg Kurz
On Mon, 24 Aug 2015 16:52:45 +0200 Greg Kurz gk...@linux.vnet.ibm.com wrote: On Fri, 21 Aug 2015 17:05:49 +0800 Jason Wang jasow...@redhat.com wrote: We used to use mmio for notification. This could be slow on some arch (e.g on x86 without EPT). So this patch introduces pio bar and a pio

Re: [Qemu-devel] [PATCH 1/2] dataplane: drop copy_in_vring_desc()

2015-06-29 Thread Greg Kurz
On Sun, 28 Jun 2015 15:03:20 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Fri, Jun 26, 2015 at 07:05:07PM +0200, Greg Kurz wrote: On Fri, 26 Jun 2015 18:28:42 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Fri, Jun 26, 2015 at 02:18:38PM +0200, Greg Kurz wrote: On Fri, 26

Re: [Qemu-devel] [PATCH 1/2] dataplane: drop copy_in_vring_desc()

2015-06-26 Thread Greg Kurz
On Fri, 26 Jun 2015 12:28:45 +0200 Cornelia Huck cornelia.h...@de.ibm.com wrote: On Fri, 26 Jun 2015 09:32:21 +0200 Greg Kurz gk...@linux.vnet.ibm.com wrote: During early virtio 1.0 devel, there were several proposals about how to deal with the endianness of the vring descriptor fields

Re: [Qemu-devel] [PATCH 5/5] virtio-net: unbreak any layout

2015-07-13 Thread Greg Kurz
On Mon, 13 Jul 2015 11:22:09 +0300 Michael S. Tsirkin m...@redhat.com wrote: On Mon, Jul 13, 2015 at 10:24:59AM +0300, Michael S. Tsirkin wrote: On Mon, Jul 13, 2015 at 01:46:51PM +0800, Jason Wang wrote: Commit 032a74a1c0fcdd5fd1c69e56126b4c857ee36611 (virtio-net: byteswap virtio-net

[Qemu-devel] [PATCH] virtio-9p: add savem handlers

2015-10-22 Thread Greg Kurz
device... This patch simply registers migration handlers for virtio-9p-device. Whether migration is possible or not still depends on the migration blocker. Signed-off-by: Greg Kurz <gk...@linux.vnet.ibm.com> --- Michael, Aneesh, This is the same patch minus the call to unregister_savevm() si

Re: [Qemu-devel] [PATCH] virtio-net: use the backend cross-endian capabilities

2015-11-09 Thread Greg Kurz
On Fri, 06 Nov 2015 18:45:04 +0100 Greg Kurz <gk...@linux.vnet.ibm.com> wrote: > When running a fully emulated device in cross-endian conditions, including > a virtio 1.0 device offered to a big endian guest, we need to fix the vnet > headers. This is currently handled by the virt

[Qemu-devel] [PATCH v2 1/2] virtio-net: use the backend cross-endian capabilities

2015-11-09 Thread Greg Kurz
also tries to configure net backends. This will be no more needed and will be addressed in a subsequent patch. Signed-off-by: Greg Kurz <gk...@linux.vnet.ibm.com> --- v2: - introduced virtio_net_needs_hdr_swap() to consolidate the logic in one place --- hw/net/virtio-net.c

[Qemu-devel] [PATCH 2/3] vhost: move virtio 1.0 check to cross-endian helper

2015-11-09 Thread Greg Kurz
Indeed vhost doesn't need to ask for vring endian fixing if the device is virtio 1.0, since it is already handled by the in-kernel vhost driver. This patch simply consolidates the logic into the existing helper. Signed-off-by: Greg Kurz <gk...@linux.vnet.ibm.com> --- hw/virtio/vhost.c

[Qemu-devel] [PATCH v2 2/2] Revert "vhost-net: tell tap backend about the vnet endianness"

2015-11-09 Thread Greg Kurz
This reverts commit 5be7d9f1b1452613b95c6ba70b8d7ad3d0797991. Cross-endian is now configured by the core virtio-net code. We simply fall back on full emulation if the net backend cannot support the requested endianness for vnet headers. Signed-off-by: Greg Kurz <gk...@linux.vnet.ibm.com>

[Qemu-devel] [PATCH v2 0/2] virtio-net/vhost-net: share cross-endian enablement

2015-11-09 Thread Greg Kurz
and full emulation can now benefit from it. Of course we keep the current hack to fall back on when the backend doesn't support cross-endian. --- Greg Kurz (2): virtio-net: use the backend cross-endian capabilities Revert "vhost-net: tell tap backend about the vnet endianness"

[Qemu-devel] [PATCH 1/3] virtio: move cross-endian helper to vhost

2015-11-09 Thread Greg Kurz
, where indeed non bi-endian targets don't have to deal with cross-endian issues. This patch moves the helper to vhost.c and gives it a more appropriate name. Signed-off-by: Greg Kurz <gk...@linux.vnet.ibm.com> --- hw/virtio/vhost.c | 17 +++-- include/hw/virtio/

[Qemu-devel] [PATCH 0/3] virtio: cross-endian helpers fixes

2015-11-09 Thread Greg Kurz
This series tries to rework cross-endian helpers for better clarity. It does not change behaviour, except perhaps patch 3/3 even if I could not measure any performance gain. --- Greg Kurz (3): virtio: move cross-endian helper to vhost vhost: move virtio 1.0 check to cross-endian

[Qemu-devel] [PATCH 3/3] virtio: optimize virtio_access_is_big_endian() for little-endian targets

2015-11-09 Thread Greg Kurz
it is clear it is optimized for fast paths. Signed-off-by: Greg Kurz <gk...@linux.vnet.ibm.com> --- include/hw/virtio/virtio-access.h | 43 - 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/include/hw/virtio/virtio-access.h b/include/hw/virtio/

Re: [Qemu-devel] [PATCH] virtio-9p: add savem handlers

2015-11-12 Thread Greg Kurz
On Thu, 22 Oct 2015 19:38:42 +0200 Greg Kurz <gk...@linux.vnet.ibm.com> wrote: > We don't support migration of mounted 9p shares. This is handled by a > migration blocker. > > One would expect, however, to be able to migrate if the share is unmounted. > Unfortunately

Re: [Qemu-devel] [PATCH] virtio-9p: add savem handlers

2015-11-12 Thread Greg Kurz
On Thu, 12 Nov 2015 13:50:20 +0100 Cornelia Huck <cornelia.h...@de.ibm.com> wrote: > On Thu, 12 Nov 2015 09:28:21 +0100 > Greg Kurz <gk...@linux.vnet.ibm.com> wrote: > > > On Thu, 22 Oct 2015 19:38:42 +0200 > > Greg Kurz <gk...@linux.vnet.ibm.com> wrote

Re: [Qemu-devel] [PATCH v2 1/2] virtio-net: use the backend cross-endian capabilities

2015-11-13 Thread Greg Kurz
On Thu, 12 Nov 2015 18:52:55 +0100 Cornelia Huck <cornelia.h...@de.ibm.com> wrote: > On Mon, 09 Nov 2015 18:41:33 +0100 > Greg Kurz <gk...@linux.vnet.ibm.com> wrote: > > > When running a fully emulated device in cross-endian conditions, including > > a virtio 1

Re: [Qemu-devel] [PATCH 1/3] virtio: move cross-endian helper to vhost

2015-11-13 Thread Greg Kurz
On Thu, 12 Nov 2015 19:00:54 +0100 Cornelia Huck <cornelia.h...@de.ibm.com> wrote: > On Mon, 09 Nov 2015 18:58:16 +0100 > Greg Kurz <gk...@linux.vnet.ibm.com> wrote: > > > If target is bi-endian (ppc64, arm), the virtio_legacy_is_cross_endian() > > indeed return

Re: [Qemu-devel] [PATCH 3/3] virtio: optimize virtio_access_is_big_endian() for little-endian targets

2015-11-13 Thread Greg Kurz
On Thu, 12 Nov 2015 19:08:59 +0100 Cornelia Huck <cornelia.h...@de.ibm.com> wrote: > On Mon, 09 Nov 2015 18:58:34 +0100 > Greg Kurz <gk...@linux.vnet.ibm.com> wrote: > > > When adding cross-endian support, we introduced the TARGET_IS_BIENDIAN macro > > an

Re: [Qemu-devel] [PATCH v2 1/2] virtio-net: use the backend cross-endian capabilities

2015-11-13 Thread Greg Kurz
On Fri, 13 Nov 2015 15:46:06 +0100 Cornelia Huck <cornelia.h...@de.ibm.com> wrote: > On Fri, 13 Nov 2015 09:26:26 +0100 > Greg Kurz <gk...@linux.vnet.ibm.com> wrote: > > > On Thu, 12 Nov 2015 18:52:55 +0100 > > Cornelia Huck <cornelia.h...@de.ibm.com> wrot

Re: [Qemu-devel] [PATCH 3/3] virtio: optimize virtio_access_is_big_endian() for little-endian targets

2015-11-13 Thread Greg Kurz
On Fri, 13 Nov 2015 15:42:53 +0100 Cornelia Huck <cornelia.h...@de.ibm.com> wrote: > On Fri, 13 Nov 2015 10:28:31 +0100 > Greg Kurz <gk...@linux.vnet.ibm.com> wrote: > > > On Thu, 12 Nov 2015 19:08:59 +0100 > > Cornelia Huck <cornelia.h...@de.ibm.com> wrot

Re: [Qemu-devel] [PATCH] virtio-9p: add savem handlers

2015-11-12 Thread Greg Kurz
On Thu, 12 Nov 2015 15:39:02 +0100 Cornelia Huck <cornelia.h...@de.ibm.com> wrote: > On Thu, 12 Nov 2015 15:25:33 +0100 > Greg Kurz <gk...@linux.vnet.ibm.com> wrote: > > > On Thu, 12 Nov 2015 13:50:20 +0100 > > Cornelia Huck <cornelia.h...@de.ibm.com> wrot

Re: [Qemu-devel] [PATCH 01/11] snapshot: create helper to test that block drivers supports snapshots

2015-11-04 Thread Greg Kurz
does not > support snapshots.\n", > - bdrv_get_device_name(bs)); > -return; > -} > +if (!bdrv_all_can_snapshot()) { > +monitor_printf(mon, "Device '%s' is writable but does not " > + "support snapshots.\n", bdrv_get_device_name(bs)); > +return; > } > > bs = find_vmstate_bs(); Reviewed-by: Greg Kurz <gk...@linux.vnet.ibm.com>

Re: [Qemu-devel] [PATCH 02/11] snapshot: return error code from bdrv_snapshot_delete_by_id_or_name

2015-11-04 Thread Greg Kurz
On Wed, 4 Nov 2015 20:19:33 +0300 "Denis V. Lunev" wrote: > this will make code better in the next patch > This changelog is not very useful. IMHO this calls for squashing this patch into the next one: then we clearly see how the return value is used and why the code is

Re: [Qemu-devel] [PATCH 04/11] snapshot: create bdrv_all_goto_snapshot helper

2015-11-05 Thread Greg Kurz
..@redhat.com> > CC: Stefan Hajnoczi <stefa...@redhat.com> > CC: Kevin Wolf <kw...@redhat.com> > --- Reviewed-by: Greg Kurz <gk...@linux.vnet.ibm.com> > block/snapshot.c | 20 > include/block/snapshot.h | 1 + > migration/save

Re: [Qemu-devel] [PATCH V3] hw/virtio: Add PCIe capability to virtio devices

2015-11-02 Thread Greg Kurz
On Thu, 29 Oct 2015 13:56:28 +0200 Marcel Apfelbaum wrote: > The virtio devices are converted to PCI-Express > if they are plugged into a PCI-Express bus and > the 'modern' protocol is enabled. > > Devices plugged directly into the Root Complex as > Integrated Endpoints

[Qemu-devel] [PATCH] Revert "vhost-net: tell tap backend about the vnet endianness"

2015-11-06 Thread Greg Kurz
This reverts commit 5be7d9f1b1452613b95c6ba70b8d7ad3d0797991. Cross-endian is now configured by the core virtio-net code. We simply fall back on full emulation if the net backend cannot support the requested endianness for vnet headers. Signed-off-by: Greg Kurz <gk...@linux.vnet.ibm.com> -

[Qemu-devel] [PATCH] virtio-net: use the backend cross-endian capabilities

2015-11-06 Thread Greg Kurz
more needed and will be addressed in a subsequent patch. Signed-off-by: Greg Kurz <gk...@linux.vnet.ibm.com> --- hw/net/virtio-net.c| 35 +-- include/hw/virtio/virtio-net.h |1 + 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/hw/net/virtio-net.

Re: [Qemu-devel] [PATCH] net: don't set native endianness

2015-10-14 Thread Greg Kurz
On Wed, 14 Oct 2015 17:02:28 +0300 "Michael S. Tsirkin" <m...@redhat.com> wrote: > On Wed, Oct 14, 2015 at 03:54:32PM +0200, Greg Kurz wrote: > > On Wed, 14 Oct 2015 12:26:58 +0300 > > "Michael S. Tsirkin" <m...@redhat.com> wrote: > >

Re: [Qemu-devel] [PATCH v2 2/5] qdev: add the HotUnpluggable handler

2015-10-15 Thread Greg Kurz
On Thu, 15 Oct 2015 17:14:36 +0200 Cornelia Huck <cornelia.h...@de.ibm.com> wrote: > On Mon, 12 Oct 2015 11:00:13 +0200 > Greg Kurz <gk...@linux.vnet.ibm.com> wrote: > > > This handler allows to ask a device instance if it can be hot-unplugged. It > > is to be de

[Qemu-devel] [PATCH v3 5/5] virtio-9p: add savem handlers

2015-10-20 Thread Greg Kurz
device... This patch simply registers migration handlers for virtio-9p-device. Whether migration is possible or not still depends on the migration blocker. Signed-off-by: Greg Kurz <gk...@linux.vnet.ibm.com> --- hw/9pfs/virtio-9p-device.c | 12 1 file changed, 12 insertions(+)

[Qemu-devel] [PATCH v3 4/5] virtio-9p: add unrealize handler

2015-10-20 Thread Greg Kurz
to be reached if the 9p share is mounted in the guest. No need to bother about in-flight I/O requests in this case. This patch fixes a QEMU crash on the source node if the user device_add a virtio-9p device and then migrate. Signed-off-by: Greg Kurz <gk...@linux.vnet.ibm.com> --- hw/9pfs/virtio-9p-

[Qemu-devel] [PATCH v3 2/5] qdev: add the @unplug_is_blocked handler

2015-10-20 Thread Greg Kurz
This handler allows to ask a device instance if it can be hot-unplugged. It is to be defined in device classes where hot-unpluggability depends on the device state (for example, virtio-9p devices cannot be unplugged if the 9p share is mounted in the guest). Signed-off-by: Greg Kurz <

[Qemu-devel] [PATCH v3 0/5] virtio-9p: hotplug and migration support

2015-10-20 Thread Greg Kurz
ble to @unplug_is_blocked (patches 2/5 and 3/5) v1->v2: - introduced unplug blocker (patches 2/5 and 3/5) - moved fixes to separate patches (see individual changelogs) --- Greg Kurz (5): virtio-9p-coth: fix init function qdev: add the @unplug_is_blocked handler virtio-9p:

<    1   2   3   4   5   6   7   8   9   10   >