[PATCH] tools/virtio: Fix build

2019-10-13 Thread Jan Kiszka
From: Jan Kiszka Various changes in the recent kernel versions broke the build due to missing function and header stubs. Signed-off-by: Jan Kiszka --- tools/virtio/crypto/hash.h | 0 tools/virtio/linux/dma-mapping.h | 2 ++ tools/virtio/linux/kernel.h | 2 ++ 3 files changed, 4

Re: [PATCH] tools/virtio: Fix build

2019-10-13 Thread Michael S. Tsirkin
On Sun, Oct 13, 2019 at 03:29:34PM +0200, Jan Kiszka wrote: > On 13.10.19 14:20, Michael S. Tsirkin wrote: > > On Sun, Oct 13, 2019 at 02:01:03PM +0200, Jan Kiszka wrote: > >> On 13.10.19 13:52, Michael S. Tsirkin wrote: > >>> On Sun, Oct 13, 2019 at 11:03:30AM +0200, Jan Kiszka wrote: >

[PATCH RFC v3 1/4] vhost: option to fetch descriptors through an independent struct

2019-10-13 Thread Michael S. Tsirkin
The idea is to support multiple ring formats by converting to a format-independent array of descriptors. This costs extra cycles, but we gain in ability to fetch a batch of descriptors in one go, which is good for code cache locality. When used, this causes a minor performance degradation, it's

[PATCH RFC v3 3/4] vhost: batching fetches

2019-10-13 Thread Michael S. Tsirkin
With this patch applied, new and old code perform identically. Lots of extra optimizations are now possible, e.g. we can fetch multiple heads with copy_from/to_user now. We can get rid of maintaining the log array. Etc etc. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/test.c | 2 +-

[PATCH RFC v3 0/4] vhost: ring format independence

2019-10-13 Thread Michael S. Tsirkin
This adds infrastructure required for supporting multiple ring formats. The idea is as follows: we convert descriptors to an independent format first, and process that converting to iov later. The point is that we have a tight loop that fetches descriptors, which is good for cache utilization.

[PATCH RFC v3 2/4] vhost/test: add an option to test new code

2019-10-13 Thread Michael S. Tsirkin
Add a writeable module parameter that tests the new code. Note: no effort was made to ensure things work correctly if the parameter is changed while the device is open. Make sure to close the device before changing its value. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/test.c | 17

[PATCH RFC v3 4/4] vhost/net: add an option to test new code

2019-10-13 Thread Michael S. Tsirkin
Add a writeable module parameter that tests the new code. Note: no effort was made to ensure things work correctly if the parameter is changed while the device is open. Make sure to close the device before changing its value. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/net.c | 32

Re: [PATCH] tools/virtio: Fix build

2019-10-13 Thread Jan Kiszka
On 13.10.19 13:52, Michael S. Tsirkin wrote: > On Sun, Oct 13, 2019 at 11:03:30AM +0200, Jan Kiszka wrote: >> From: Jan Kiszka >> >> Various changes in the recent kernel versions broke the build due to >> missing function and header stubs. >> >> Signed-off-by: Jan Kiszka > > Thanks! > I think

Re: [PATCH] tools/virtio: Fix build

2019-10-13 Thread Michael S. Tsirkin
On Sun, Oct 13, 2019 at 02:01:03PM +0200, Jan Kiszka wrote: > On 13.10.19 13:52, Michael S. Tsirkin wrote: > > On Sun, Oct 13, 2019 at 11:03:30AM +0200, Jan Kiszka wrote: > >> From: Jan Kiszka > >> > >> Various changes in the recent kernel versions broke the build due to > >> missing function and

[PATCH RFC v4 0/5] vhost: ring format independence

2019-10-13 Thread Michael S. Tsirkin
This adds infrastructure required for supporting multiple ring formats. The idea is as follows: we convert descriptors to an independent format first, and process that converting to iov later. The point is that we have a tight loop that fetches descriptors, which is good for cache utilization.

[PATCH RFC v4 1/5] vhost: option to fetch descriptors through an independent struct

2019-10-13 Thread Michael S. Tsirkin
The idea is to support multiple ring formats by converting to a format-independent array of descriptors. This costs extra cycles, but we gain in ability to fetch a batch of descriptors in one go, which is good for code cache locality. When used, this causes a minor performance degradation, it's

[PATCH RFC v4 3/5] vhost: batching fetches

2019-10-13 Thread Michael S. Tsirkin
With this patch applied, new and old code perform identically. Lots of extra optimizations are now possible, e.g. we can fetch multiple heads with copy_from/to_user now. We can get rid of maintaining the log array. Etc etc. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/test.c | 2 +-

[PATCH RFC v4 2/5] vhost/test: add an option to test new code

2019-10-13 Thread Michael S. Tsirkin
Add a writeable module parameter that tests the new code. Note: no effort was made to ensure things work correctly if the parameter is changed while the device is open. Make sure to close the device before changing its value. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/test.c | 17

[PATCH RFC v4 5/5] vhost: last descriptor must have NEXT clear

2019-10-13 Thread Michael S. Tsirkin
fetch_buf already guarantees we exit on a descriptor without a NEXT flag. Add a BUG_ON statement to make sure we don't overflow the buffer in case of a bug. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/vhost.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/vhost/vhost.c

[PATCH RFC v4 4/5] vhost/net: add an option to test new code

2019-10-13 Thread Michael S. Tsirkin
Add a writeable module parameter that tests the new code. Note: no effort was made to ensure things work correctly if the parameter is changed while the device is open. Make sure to close the device before changing its value. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/net.c | 32

Re: [PATCH] tools/virtio: Fix build

2019-10-13 Thread Jan Kiszka
On 13.10.19 14:20, Michael S. Tsirkin wrote: > On Sun, Oct 13, 2019 at 02:01:03PM +0200, Jan Kiszka wrote: >> On 13.10.19 13:52, Michael S. Tsirkin wrote: >>> On Sun, Oct 13, 2019 at 11:03:30AM +0200, Jan Kiszka wrote: From: Jan Kiszka Various changes in the recent kernel versions

Re: [PATCH] tools/virtio: Fix build

2019-10-13 Thread Michael S. Tsirkin
On Sun, Oct 13, 2019 at 11:03:30AM +0200, Jan Kiszka wrote: > From: Jan Kiszka > > Various changes in the recent kernel versions broke the build due to > missing function and header stubs. > > Signed-off-by: Jan Kiszka Thanks! I think it's already fixes in the vhost tree. That tree also

Re: [PATCH 2/2] virtio_ring: Use DMA API if memory is encrypted

2019-10-13 Thread David Gibson
On Fri, Oct 11, 2019 at 06:25:19PM -0700, Ram Pai wrote: > From: Thiago Jung Bauermann > > Normally, virtio enables DMA API with VIRTIO_F_IOMMU_PLATFORM, which must > be set by both device and guest driver. However, as a hack, when DMA API > returns physical addresses, guest driver can use the

Re: [PATCH 1/2] dma-mapping: Add dma_addr_is_phys_addr()

2019-10-13 Thread David Gibson
On Fri, Oct 11, 2019 at 06:25:18PM -0700, Ram Pai wrote: > From: Thiago Jung Bauermann > > In order to safely use the DMA API, virtio needs to know whether DMA > addresses are in fact physical addresses and for that purpose, > dma_addr_is_phys_addr() is introduced. > > cc: Benjamin

Re: [PATCH RFC v1 2/2] vhost: batching fetches

2019-10-13 Thread Jason Wang
On 2019/10/13 上午4:36, Michael S. Tsirkin wrote: On Sat, Oct 12, 2019 at 03:30:52PM +0800, Jason Wang wrote: On 2019/10/11 下午9:46, Michael S. Tsirkin wrote: With this patch applied, new and old code perform identically. Lots of extra optimizations are now possible, e.g. we can fetch multiple

Re: [PATCH RFC v1 1/2] vhost: option to fetch descriptors through an independent struct

2019-10-13 Thread Jason Wang
On 2019/10/13 上午4:27, Michael S. Tsirkin wrote: On Sat, Oct 12, 2019 at 03:28:49PM +0800, Jason Wang wrote: On 2019/10/11 下午9:45, Michael S. Tsirkin wrote: The idea is to support multiple ring formats by converting to a format-independent array of descriptors. This costs extra cycles, but we