[PATCH 2/2] rpmsg: DMA map sgs passed to virtio

2016-12-07 Thread Wendy Liang
From: "Edgar E. Iglesias" As rpmsg uses dma_alloc_coherent() to allocate memory to shared with the remote. Virtio ring requires the shared buffers to be passed as sg struct. As the memory has already been mapped, and we cannot convert the virtual address got from

[PATCH 1/2] virtio_ring: Do not call dma_map_page if sg is already mapped.

2016-12-07 Thread Wendy Liang
If sg is already dma mapped, do not call dma_map_page() in vring_map_one_sg(). In case of rpmsg, rpmsg uses dma_alloc_coherent() to allocate memory to share with the remote. There is no pages setup in dma_alloc_coherent(). In this case, we cannot convert the virtual address back to the physical

[PATCH 0/2] Virtio ring works with DMA coherent memory

2016-12-07 Thread Wendy Liang
RPMsg uses dma_alloc_coherent() to allocate memory to shared with the remote. In this case, as there is no pages setup in the dma_alloc_coherent(), we cannot get the physical address back from the virtual address, and thus, we can set the sg_dma_addr to store the DMA address and mark it already

RE: [RFC LINUX PATCH 0/2] Virtio ring works with DMA coherent memory

2016-12-07 Thread Jiaying Liang
Thanks Jason, I will resend it as a formal patch. Wendy > -Original Message- > From: Jason Wang [mailto:jasow...@redhat.com] > Sent: Wednesday, December 07, 2016 7:18 PM > To: Jiaying Liang; o...@wizery.com; bjorn.anders...@linaro.org; linux- > remotep...@vger.kernel.org;

Re: [PATCH] linux/types.h: enable endian checks for all sparse builds

2016-12-07 Thread Michael S. Tsirkin
On Thu, Dec 08, 2016 at 05:21:47AM +, Bart Van Assche wrote: > On 12/07/16 18:29, Michael S. Tsirkin wrote: > > By now, linux is mostly endian-clean. Enabling endian-ness > > checks for everyone produces about 200 new sparse warnings for me - > > less than 10% over the 2000 sparse warnings

[PATCH v6 2/2] crypto: add virtio-crypto driver

2016-12-07 Thread Gonglei
This patch introduces virtio-crypto driver for Linux Kernel. The virtio crypto device is a virtual cryptography device as well as a kind of virtual hardware accelerator for virtual machines. The encryption anddecryption requests are placed in the data queue and are ultimately handled by

[PATCH v6 1/2] sparc: fix a building error reported by kbuild

2016-12-07 Thread Gonglei
>> arch/sparc/include/asm/topology_64.h:44:44: error: implicit declaration of function 'cpu_data' [-Werror=implicit-function-declaration] #define topology_physical_package_id(cpu) (cpu_data(cpu).proc_id) ^ Let's include cpudata.h in topology_64.h.

[PATCH v6 0/2] virtio-crypto: add Linux driver

2016-12-07 Thread Gonglei
v6: - add patch 1/2 to make sparc architecture happy. [Sam] - close created sessions previousely when rekeying. - convert the priority of virtio crypto algs from 4001 to 501 which is enough. v5: - add comments for algs_lock and table_lock. [Stefan] - use kzfree instead of kfree for key

Re: [RFC LINUX PATCH 0/2] Virtio ring works with DMA coherent memory

2016-12-07 Thread Jason Wang
On 2016年12月07日 02:21, Wendy Liang wrote: RPMsg uses dma_alloc_coherent() to allocate memory to shared with the remote. In this case, as there is no pages setup in the dma_alloc_coherent(), we cannot get the physical address back from the virtual address, and thus, we can set the sg_dma_addr to

[PATCH] linux/types.h: enable endian checks for all sparse builds

2016-12-07 Thread Michael S. Tsirkin
By now, linux is mostly endian-clean. Enabling endian-ness checks for everyone produces about 200 new sparse warnings for me - less than 10% over the 2000 sparse warnings already there. Not a big deal, OTOH enabling this helps people notice they are introducing new bugs. So let's just drop

RE: [PATCH v5 1/1] crypto: add virtio-crypto driver

2016-12-07 Thread Gonglei (Arei)
Hi Sam, > > Subject: Re: [PATCH v5 1/1] crypto: add virtio-crypto driver > > On Mon, Dec 05, 2016 at 03:12:52AM +, Gonglei (Arei) wrote: > > I don't think the root cause of those warnings are introduced by > > virtio-crypto > driver. > > > > What's your opinion? Sam and David? > > Root

RE: [PATCH v5 1/1] crypto: add virtio-crypto driver

2016-12-07 Thread Gonglei (Arei)
> > Subject: Re: [PATCH v5 1/1] crypto: add virtio-crypto driver > > On Tue, Dec 06, 2016 at 09:01:49AM +, Gonglei (Arei) wrote: > > > > Would you please review and/or ack the virtio_crypto_algs.c? > > It is the realization of specified algs based on Linux Crypto Framework. > > I have no

Re: [PATCH v5 1/1] crypto: add virtio-crypto driver

2016-12-07 Thread Sam Ravnborg
On Mon, Dec 05, 2016 at 03:12:52AM +, Gonglei (Arei) wrote: > I don't think the root cause of those warnings are introduced by > virtio-crypto driver. > > What's your opinion? Sam and David? Root cause here is that arch/sparc/include/asm/topology_64.h references cpu_data without including

Re: [Qemu-devel] [PATCH kernel v5 0/5] Extend virtio-balloon for fast (de)inflating & fast live migration

2016-12-07 Thread Andrea Arcangeli
On Wed, Dec 07, 2016 at 11:54:34AM -0800, Dave Hansen wrote: > We're talking about a bunch of different stuff which is all being > conflated. There are 3 issues here that I can see. I'll attempt to > summarize what I think is going on: > > 1. Current patches do a hypercall for each order in the

Re: [Qemu-devel] [PATCH kernel v5 0/5] Extend virtio-balloon for fast (de)inflating & fast live migration

2016-12-07 Thread Dave Hansen
We're talking about a bunch of different stuff which is all being conflated. There are 3 issues here that I can see. I'll attempt to summarize what I think is going on: 1. Current patches do a hypercall for each order in the allocator. This is inefficient, but independent from the underlying

Re: [Qemu-devel] [PATCH kernel v5 0/5] Extend virtio-balloon for fast (de)inflating & fast live migration

2016-12-07 Thread Andrea Arcangeli
On Wed, Dec 07, 2016 at 10:44:31AM -0800, Dave Hansen wrote: > On 12/07/2016 10:38 AM, Andrea Arcangeli wrote: > >> > and leaves room for the bitmap size to be encoded as well, if we decide > >> > we need a bitmap in the future. > > How would a bitmap ever be useful with very large page-order? >

Re: [Qemu-devel] [PATCH kernel v5 0/5] Extend virtio-balloon for fast (de)inflating & fast live migration

2016-12-07 Thread Andrea Arcangeli
Hello, On Wed, Dec 07, 2016 at 08:57:01AM -0800, Dave Hansen wrote: > It is more space-efficient. We're fitting the order into 6 bits, which > would allows the full 2^64 address space to be represented in one entry, Very large order is the same as very large len, 6 bits of order or 8 bytes of

[PATCH v2 4/4] vsock: cancel packets when failing to connect

2016-12-07 Thread Peng Tao
Otherwise we'll leave the packets queued until releasing vsock device. E.g., if guest is slow to start up, resulting ETIMEDOUT on connect, guest will get the connect requests from failed host sockets. Reviewed-by: Stefan Hajnoczi Signed-off-by: Peng Tao

[PATCH v2 3/4] vsock: add pkt cancel capability

2016-12-07 Thread Peng Tao
Signed-off-by: Peng Tao --- net/vmw_vsock/virtio_transport.c | 42 1 file changed, 42 insertions(+) diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index 936d7ee..a5f3833 100644 ---

[PATCH v2 2/4] vhost-vsock: add pkt cancel capability

2016-12-07 Thread Peng Tao
To allow canceling all packets of a connection. Signed-off-by: Peng Tao --- drivers/vhost/vsock.c| 41 + include/linux/virtio_vsock.h | 3 +++ 2 files changed, 44 insertions(+) diff --git a/drivers/vhost/vsock.c

[PATCH v2 1/4] vsock: track pkt owner vsock

2016-12-07 Thread Peng Tao
So that we can cancel a queued pkt later if necessary. Signed-off-by: Peng Tao --- include/linux/virtio_vsock.h| 2 ++ net/vmw_vsock/virtio_transport_common.c | 7 +++ 2 files changed, 9 insertions(+) diff --git a/include/linux/virtio_vsock.h

[PATCH v2 0/4] vsock: cancel connect packets when failing to connect

2016-12-07 Thread Peng Tao
Currently, if a connect call fails on a signal or timeout (e.g., guest is still in the process of starting up), we'll just return to caller and leave the connect packet queued and they are sent even though the connection is considered a failure, which can confuse applications with unwanted false

[PATCH 4/4] vsock: cancel packets when failing to connect

2016-12-07 Thread Peng Tao
Otherwise we'll leave the packets queued until releasing vsock device. E.g., if guest is slow to start up, resulting ETIMEDOUT on connect, guest will get the connect requests from failed host sockets. Signed-off-by: Peng Tao --- include/linux/virtio_vsock.h| 7

Re: [PATCH 3/4] vsock: add pkt cancel capability

2016-12-07 Thread Peng Tao
On Wed, Dec 7, 2016 at 9:22 PM, Stefan Hajnoczi wrote: > On Wed, Dec 07, 2016 at 06:00:20PM +0800, Peng Tao wrote: >> Signed-off-by: Peng Tao >> --- >> net/vmw_vsock/virtio_transport.c | 36 >> 1 file changed, 36

[PATCH 3/4] vsock: add pkt cancel capability

2016-12-07 Thread Peng Tao
Signed-off-by: Peng Tao --- net/vmw_vsock/virtio_transport.c | 36 1 file changed, 36 insertions(+) diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index 936d7ee..f88b6ed 100644 ---

[PATCH 2/4] vhost-vsock: add pkt cancel capability

2016-12-07 Thread Peng Tao
To allow canceling all packets of a connection. Signed-off-by: Peng Tao --- drivers/vhost/vsock.c| 29 + include/linux/virtio_vsock.h | 3 +++ 2 files changed, 32 insertions(+) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c

[PATCH 1/4] vsock: track pkt owner vsock

2016-12-07 Thread Peng Tao
So that we can cancel a queued pkt later if necessary. Signed-off-by: Peng Tao --- include/linux/virtio_vsock.h| 2 ++ net/vmw_vsock/virtio_transport_common.c | 7 +++ 2 files changed, 9 insertions(+) diff --git a/include/linux/virtio_vsock.h

[PATCH 0/4] vsock: cancel connect packets when failing to connect

2016-12-07 Thread Peng Tao
Currently, if a connect call fails on a signal or timeout (e.g., guest is still in the process of starting up), we'll just return to caller and leave the connect packet queued and they are sent even though the connection is considered a failure, which can confuse applications with unwanted false

[PATCH 2/2] vhost: remove unnecessary smp_mb from vhost_work_queue

2016-12-07 Thread Peng Tao
test_and_set_bit() already implies a memory barrier. Signed-off-by: Peng Tao --- drivers/vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index c6f2d89..2663543 100644 --- a/drivers/vhost/vhost.c

Oops with CONFIG_VMAP_STCK and bond device + virtio-net

2016-12-07 Thread Laura Abbott
Hi, Fedora got a bug report https://bugzilla.redhat.com/show_bug.cgi?id=1401612 In qemu with two virtio-net interfaces: $ ip l ... 5: ens14: mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 52:54:00:e9:64:41 brd ff:ff:ff:ff:ff:ff 6: ens15:

[PATCH] vhost-vsock: fix orphan connection reset

2016-12-07 Thread Peng Tao
local_addr.svm_cid is host cid. We should check guest cid instead, which is remote_addr.svm_cid. Cc: Stefan Hajnoczi Cc: sta...@vger.kernel.org #4.8+ Signed-off-by: Peng Tao --- drivers/vhost/vsock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH 1/2] vhost-vsock: remove unused vq variable

2016-12-07 Thread Peng Tao
Signed-off-by: Peng Tao --- drivers/vhost/vsock.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index 0c23b55..3e01d58 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -195,7 +195,6 @@ static int

Re: [Qemu-devel] [PATCH kernel v5 0/5] Extend virtio-balloon for fast (de)inflating & fast live migration

2016-12-07 Thread Dave Hansen
On 12/07/2016 10:38 AM, Andrea Arcangeli wrote: >> > and leaves room for the bitmap size to be encoded as well, if we decide >> > we need a bitmap in the future. > How would a bitmap ever be useful with very large page-order? Please, guys. Read the patches. *Please*. The current code doesn't

Re: automatic IRQ affinity for virtio

2016-12-07 Thread Christoph Hellwig
On Sun, Nov 27, 2016 at 05:37:04AM +0200, Michael S. Tsirkin wrote: > On Fri, Nov 25, 2016 at 08:25:38AM +0100, Christoph Hellwig wrote: > > Btw, what's the best way to get any response to this series? > > But this and the predecessor seem to have completly fallen on deaf > > ears. > > I'm sorry,

Re: [PATCH kernel v5 0/5] Extend virtio-balloon for fast (de)inflating & fast live migration

2016-12-07 Thread Dave Hansen
Removing silly virtio-dev@ list because it's bouncing mail... On 12/07/2016 08:21 AM, David Hildenbrand wrote: >> Li's current patches do that. Well, maybe not pfn/length, but they do >> take a pfn and page-order, which fits perfectly with the kernel's >> concept of high-order pages. > > So we

Re: [PATCH kernel v5 0/5] Extend virtio-balloon for fast (de)inflating & fast live migration

2016-12-07 Thread David Hildenbrand
I did something similar. Filled the balloon with 15GB for a 16GB idle guest, by using bitmap, the madvise count was reduced to 605. when using the PFNs, the madvise count was 3932160. It means there are quite a lot consecutive bits in the bitmap. I didn't test for a guest with heavy memory

Re: [PATCH kernel v5 0/5] Extend virtio-balloon for fast (de)inflating & fast live migration

2016-12-07 Thread Dave Hansen
On 12/07/2016 07:42 AM, David Hildenbrand wrote: > Am 07.12.2016 um 14:35 schrieb Li, Liang Z: >>> Am 30.11.2016 um 09:43 schrieb Liang Li: This patch set contains two parts of changes to the virtio-balloon. One is the change for speeding up the inflating & deflating process,

Re: [PATCH kernel v5 0/5] Extend virtio-balloon for fast (de)inflating & fast live migration

2016-12-07 Thread David Hildenbrand
Am 07.12.2016 um 14:35 schrieb Li, Liang Z: Am 30.11.2016 um 09:43 schrieb Liang Li: This patch set contains two parts of changes to the virtio-balloon. One is the change for speeding up the inflating & deflating process, the main idea of this optimization is to use bitmap to send the page

Re: [PATCH kernel v5 0/5] Extend virtio-balloon for fast (de)inflating & fast live migration

2016-12-07 Thread Dave Hansen
On 12/07/2016 05:35 AM, Li, Liang Z wrote: >> Am 30.11.2016 um 09:43 schrieb Liang Li: >> IOW in real examples, do we have really large consecutive areas or are all >> pages just completely distributed over our memory? > > The buddy system of Linux kernel memory management shows there should > be

Re: [PATCH 10/10] virtio: enable endian checks for sparse builds

2016-12-07 Thread Stefan Hajnoczi
On Tue, Dec 06, 2016 at 05:41:05PM +0200, Michael S. Tsirkin wrote: > __CHECK_ENDIAN__ isn't on by default presumably because > it triggers too many sparse warnings for correct code. > But virtio is now clean of these warnings, and > we want to keep it this way - enable this for > sparse builds. >

Re: [PATCH 08/10] vsock/virtio: mark an internal function static

2016-12-07 Thread Stefan Hajnoczi
On Tue, Dec 06, 2016 at 05:41:00PM +0200, Michael S. Tsirkin wrote: > virtio_transport_alloc_pkt is only used locally, make it static. > > Signed-off-by: Michael S. Tsirkin > --- > net/vmw_vsock/virtio_transport_common.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-)

Re: [PATCH 07/10] vsock/virtio: add a missing __le annotation

2016-12-07 Thread Stefan Hajnoczi
On Tue, Dec 06, 2016 at 05:40:57PM +0200, Michael S. Tsirkin wrote: > guest cid is read from config space, therefore it's in little endian > format and is treated as such, annotate it accordingly. > > Signed-off-by: Michael S. Tsirkin > --- > net/vmw_vsock/virtio_transport.c |

Re: [PATCH 09/10] vsock/virtio: fix src/dst cid format

2016-12-07 Thread Stefan Hajnoczi
On Tue, Dec 06, 2016 at 05:41:02PM +0200, Michael S. Tsirkin wrote: > These fields are 64 bit, using le32_to_cpu and friends > on these will not do the right thing. > Fix this up. > > Cc: sta...@vger.kernel.org > Signed-off-by: Michael S. Tsirkin > --- >

RE: [PATCH kernel v5 0/5] Extend virtio-balloon for fast (de)inflating & fast live migration

2016-12-07 Thread Li, Liang Z
> Am 30.11.2016 um 09:43 schrieb Liang Li: > > This patch set contains two parts of changes to the virtio-balloon. > > > > One is the change for speeding up the inflating & deflating process, > > the main idea of this optimization is to use bitmap to send the page > > information to host instead

Re: [PATCH 4/4] vsock: cancel packets when failing to connect

2016-12-07 Thread Stefan Hajnoczi
On Wed, Dec 07, 2016 at 06:00:21PM +0800, Peng Tao wrote: > Otherwise we'll leave the packets queued until releasing vsock device. > E.g., if guest is slow to start up, resulting ETIMEDOUT on connect, guest > will get the connect requests from failed host sockets. > > Signed-off-by: Peng Tao

Re: [PATCH 2/4] vhost-vsock: add pkt cancel capability

2016-12-07 Thread Stefan Hajnoczi
On Wed, Dec 07, 2016 at 06:00:19PM +0800, Peng Tao wrote: > To allow canceling all packets of a connection. > > Signed-off-by: Peng Tao > --- > drivers/vhost/vsock.c| 29 + > include/linux/virtio_vsock.h | 3 +++ > 2 files changed, 32

Re: [PATCH 10/10] virtio: enable endian checks for sparse builds

2016-12-07 Thread Michael S. Tsirkin
On Wed, Dec 07, 2016 at 07:25:51AM +0100, Johannes Berg wrote: > On Tue, 2016-12-06 at 17:41 +0200, Michael S. Tsirkin wrote: > > > It seems that there should be a better way to do it, > > but this works too. > > In some cases there might be: > > > --- a/drivers/s390/virtio/Makefile > > +++

Re: [PATCH 3/4] vsock: add pkt cancel capability

2016-12-07 Thread Stefan Hajnoczi
On Wed, Dec 07, 2016 at 06:00:20PM +0800, Peng Tao wrote: > Signed-off-by: Peng Tao > --- > net/vmw_vsock/virtio_transport.c | 36 > 1 file changed, 36 insertions(+) > > diff --git a/net/vmw_vsock/virtio_transport.c >

Re: [PATCH 2/2] vhost: remove unnecessary smp_mb from vhost_work_queue

2016-12-07 Thread Stefan Hajnoczi
On Wed, Dec 07, 2016 at 05:52:19PM +0800, Peng Tao wrote: > test_and_set_bit() already implies a memory barrier. > > Signed-off-by: Peng Tao > --- > drivers/vhost/vhost.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Stefan Hajnoczi

Re: [PATCH 1/2] vhost-vsock: remove unused vq variable

2016-12-07 Thread Stefan Hajnoczi
On Wed, Dec 07, 2016 at 05:52:18PM +0800, Peng Tao wrote: > Signed-off-by: Peng Tao > --- > drivers/vhost/vsock.c | 3 --- > 1 file changed, 3 deletions(-) Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP signature

Re: [PATCH v5 1/1] crypto: add virtio-crypto driver

2016-12-07 Thread Herbert Xu
On Tue, Dec 06, 2016 at 09:01:49AM +, Gonglei (Arei) wrote: > > Would you please review and/or ack the virtio_crypto_algs.c? > It is the realization of specified algs based on Linux Crypto Framework. I have no issues with it. If the virtio folks are happy with the interface with the host