Re: [PATCH] vhost/vsock: fix vhost vsock cid hashing inconsistent

2019-01-10 Thread Jason Wang
On 2019/1/8 下午4:07, Zha Bin wrote: The vsock core only supports 32bit CID, but the Virtio-vsock spec define CID (dst_cid and src_cid) as u64 and the upper 32bits is reserved as zero. This inconsistency causes one bug in vhost vsock driver. The scenarios is: 0. A hash table

[PATCH net V3] vhost: log dirty page correctly

2019-01-10 Thread Jason Wang
Vhost dirty page logging API is designed to sync through GPA. But we try to log GIOVA when device IOTLB is enabled. This is wrong and may lead to missing data after migration. To solve this issue, when logging with device IOTLB enabled, we will: 1) reuse the device IOTLB translation result of

Re: [PATCH net V2] vhost: log dirty page correctly

2019-01-10 Thread Jason Wang
On 2019/1/10 下午10:07, Michael S. Tsirkin wrote: On Thu, Jan 10, 2019 at 08:37:17PM +0800, Jason Wang wrote: On 2019/1/9 下午10:25, Michael S. Tsirkin wrote: On Wed, Jan 09, 2019 at 03:29:47PM +0800, Jason Wang wrote: Vhost dirty page logging API is designed to sync through GPA. But we try to

Re: [PATCH 0/3] Fix virtio-blk issue with SWIOTLB

2019-01-10 Thread Jason Wang
On 2019/1/10 下午9:44, Joerg Roedel wrote: Hi, there is a problem with virtio-blk driven devices when virtio-ring uses SWIOTLB through the DMA-API. This happens for example in AMD-SEV enabled guests, where the guest RAM is mostly encrypted and all emulated DMA has to happen to/from the SWIOTLB

Re: [PATCH net V2] vhost: log dirty page correctly

2019-01-10 Thread Michael S. Tsirkin
On Thu, Jan 10, 2019 at 08:37:17PM +0800, Jason Wang wrote: > > On 2019/1/9 下午10:25, Michael S. Tsirkin wrote: > > On Wed, Jan 09, 2019 at 03:29:47PM +0800, Jason Wang wrote: > > > Vhost dirty page logging API is designed to sync through GPA. But we > > > try to log GIOVA when device IOTLB is

[PATCH 2/3] virtio: Introduce virtio_max_dma_size()

2019-01-10 Thread Joerg Roedel
From: Joerg Roedel This function returns the maximum segment size for a single dma transaction of a virtio device. The possible limit comes from the SWIOTLB implementation in the Linux kernel, that has an upper limit of (currently) 256kb of contiguous memory it can map. The functions return the

[PATCH 1/3] swiotlb: Export maximum allocation size

2019-01-10 Thread Joerg Roedel
From: Joerg Roedel The SWIOTLB implementation has a maximum size it can allocate dma-handles for. This needs to be exported so that device drivers don't try to allocate larger chunks. This is especially important for block device drivers like virtio-blk, that might do DMA through SWIOTLB.

[PATCH 3/3] virtio-blk: Consider virtio_max_dma_size() for maximum segment size

2019-01-10 Thread Joerg Roedel
From: Joerg Roedel Segments can't be larger than the maximum DMA allocation size supported by virtio on the platform. Take that into account when setting the maximum segment size for a block device. Signed-off-by: Joerg Roedel --- drivers/block/virtio_blk.c | 10 ++ 1 file changed, 6

[PATCH 0/3] Fix virtio-blk issue with SWIOTLB

2019-01-10 Thread Joerg Roedel
Hi, there is a problem with virtio-blk driven devices when virtio-ring uses SWIOTLB through the DMA-API. This happens for example in AMD-SEV enabled guests, where the guest RAM is mostly encrypted and all emulated DMA has to happen to/from the SWIOTLB aperture. The problem is a limitation of the

Re: [PATCH net V2] vhost: log dirty page correctly

2019-01-10 Thread Jason Wang
On 2019/1/9 下午10:25, Michael S. Tsirkin wrote: On Wed, Jan 09, 2019 at 03:29:47PM +0800, Jason Wang wrote: Vhost dirty page logging API is designed to sync through GPA. But we try to log GIOVA when device IOTLB is enabled. This is wrong and may lead to missing data after migration. To solve

Re: [PATCH v3 14/15] drm/bochs: drop old fbdev emulation code

2019-01-10 Thread Noralf Trønnes
Den 10.01.2019 11.16, skrev Gerd Hoffmann: > Hi, > >>> - drm_fb_helper_set_suspend_unlocked(>fb.helper, 1); >> >> The generic fbdev emulation doesn't take care of suspend/resume. You >> could do this: >> drm_fb_helper_set_suspend_unlocked(drm_dev->fb_helper, 1); > > Additional to

[PATCH] drm/virtio: drop prime import/export callbacks

2019-01-10 Thread Gerd Hoffmann
Also set prime_handle_to_fd and prime_fd_to_handle to NULL, so drm will not advertive DRM_PRIME_CAP_{IMPORT,EXPORT} to userspace. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 4 drivers/gpu/drm/virtio/virtgpu_drv.c | 4

Re: [PATCH v3 0/5] kvm "virtio pmem" device

2019-01-10 Thread Jan Kara
On Thu 10-01-19 12:26:17, Dave Chinner wrote: > On Wed, Jan 09, 2019 at 08:17:31PM +0530, Pankaj Gupta wrote: > > This patch series has implementation for "virtio pmem". > > "virtio pmem" is fake persistent memory(nvdimm) in guest > > which allows to bypass the guest page cache. This also > >

Re: [PATCH v3 14/15] drm/bochs: drop old fbdev emulation code

2019-01-10 Thread Gerd Hoffmann
Hi, > > - drm_fb_helper_set_suspend_unlocked(>fb.helper, 1); > > The generic fbdev emulation doesn't take care of suspend/resume. You > could do this: > drm_fb_helper_set_suspend_unlocked(drm_dev->fb_helper, 1); Additional to drm_mode_config_helper_suspend() I assume? Does the call order

[PATCH v3 11/15] drm/bochs: move ttm_bo_(un)reserve calls into bochs_bo_{pin, unpin}

2019-01-10 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_fbdev.c | 8 drivers/gpu/drm/bochs/bochs_kms.c | 14 +- drivers/gpu/drm/bochs/bochs_mm.c| 8 3 files changed, 9 insertions(+), 21 deletions(-) diff --git

[PATCH v3 12/15] drm/bochs: add basic prime support

2019-01-10 Thread Gerd Hoffmann
Just enough to make the generic framebuffer emulation happy. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs.h | 7 ++ drivers/gpu/drm/bochs/bochs_drv.c | 11 - drivers/gpu/drm/bochs/bochs_mm.c | 49

[PATCH v3 08/15] drm/bochs: atomic: set DRIVER_ATOMIC

2019-01-10 Thread Gerd Hoffmann
Conversion to atomic modesetting, final step. Set the DRIVER_ATOMIC flag. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v3 05/15] drm/bochs: atomic: switch planes to atomic, wire up helpers.

2019-01-10 Thread Gerd Hoffmann
Conversion to atomic modesetting, step three. Wire up atomic helpers. Switch planes to atomic. We are late to the party, the transitional helpers are gone, so this can't be splitted into smaller steps any more. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel

[PATCH v3 15/15] drm/bochs: move remaining fb bits to kms

2019-01-10 Thread Gerd Hoffmann
bochs_fbdev.c is almost empty now. Move the remaining framebuffer bits over to bochs_kms.c. Pure code motion. No functional change. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_fbdev.c | 29

[PATCH v3 04/15] drm/bochs: atomic: add mode_set_nofb callback.

2019-01-10 Thread Gerd Hoffmann
Conversion to atomic modesetting, step two. Add mode_set_nofb crtc helper callback. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_kms.c | 9 + 1 file changed, 9 insertions(+) diff --git

[PATCH v3 14/15] drm/bochs: drop old fbdev emulation code

2019-01-10 Thread Gerd Hoffmann
Not needed any more, bochs uses the generic emulation now. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs.h | 9 --- drivers/gpu/drm/bochs/bochs_drv.c | 6 -- drivers/gpu/drm/bochs/bochs_fbdev.c | 129

[PATCH v3 13/15] drm/bochs: switch to generic drm fbdev emulation

2019-01-10 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_drv.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_drv.c index 379111f5a0..1d86c0fb5f 100644 ---

[PATCH v3 09/15] drm/bochs: remove old bochs_crtc_* functions

2019-01-10 Thread Gerd Hoffmann
Remove the old, now unused crtc callbacks. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_kms.c | 81 --- 1 file changed, 81 deletions(-) diff --git

Re: [PATCH 1/3] swiotlb: Export maximum allocation size

2019-01-10 Thread Konrad Rzeszutek Wilk
On Thu, Jan 10, 2019 at 02:44:31PM +0100, Joerg Roedel wrote: > From: Joerg Roedel > > The SWIOTLB implementation has a maximum size it can > allocate dma-handles for. This needs to be exported so that > device drivers don't try to allocate larger chunks. > > This is especially important for

[PATCH v3 10/15] drm/bochs: drop unused gpu_addr arg from bochs_bo_pin()

2019-01-10 Thread Gerd Hoffmann
It's always NULL, so just remove it. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs.h | 2 +- drivers/gpu/drm/bochs/bochs_fbdev.c | 2 +- drivers/gpu/drm/bochs/bochs_kms.c | 2 +-

Re: [PATCH 0/3] Fix virtio-blk issue with SWIOTLB

2019-01-10 Thread Joerg Roedel
Hi Christoph, On Thu, Jan 10, 2019 at 02:59:52PM +0100, Christoph Hellwig wrote: > On Thu, Jan 10, 2019 at 02:44:30PM +0100, Joerg Roedel wrote: > > The problem is a limitation of the SWIOTLB implementation, > > which does not support allocations larger than 256kb. When > > the virtio-blk driver

Re: [PATCH 0/3] Fix virtio-blk issue with SWIOTLB

2019-01-10 Thread Christoph Hellwig
On Thu, Jan 10, 2019 at 02:44:30PM +0100, Joerg Roedel wrote: > Hi, > > there is a problem with virtio-blk driven devices when > virtio-ring uses SWIOTLB through the DMA-API. This happens > for example in AMD-SEV enabled guests, where the guest RAM > is mostly encrypted and all emulated DMA has

Re: [PATCH RFC 1/4] include/linux/compiler*.h: fix OPTIMIZER_HIDE_VAR

2019-01-10 Thread Dan Carpenter
On Wed, Jan 09, 2019 at 09:36:41PM -0500, Michael S. Tsirkin wrote: > On Wed, Jan 09, 2019 at 11:35:52AM +0100, Miguel Ojeda wrote: > > On Tue, Jan 8, 2019 at 6:44 PM Nick Desaulniers > > wrote: > > > > > > Also for more context, see: > > > commit 7829fb09a2b4 ("lib: make memzero_explicit more

Re: [PATCH v3 14/15] drm/bochs: drop old fbdev emulation code

2019-01-10 Thread Noralf Trønnes
Den 10.01.2019 09.28, skrev Gerd Hoffmann: > Not needed any more, bochs uses the generic emulation now. > > Signed-off-by: Gerd Hoffmann > Reviewed-by: Oleksandr Andrushchenko > Acked-by: Daniel Vetter > --- > drivers/gpu/drm/bochs/bochs.h | 9 --- >

[PATCH v3 02/15] drm/bochs: split bochs_hw_setmode

2019-01-10 Thread Gerd Hoffmann
Create a separate bochs_hw_setformat function to configure the framebuffer format (actually just the byteorder). Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs.h | 5 +++-- drivers/gpu/drm/bochs/bochs_hw.c | 19

[PATCH v3 06/15] drm/bochs: atomic: use atomic set_config helper

2019-01-10 Thread Gerd Hoffmann
Conversion to atomic modesetting, step four. Use atomic set_config helper for crtc. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v3 01/15] drm/bochs: encoder cleanup

2019-01-10 Thread Gerd Hoffmann
Most unused callbacks can be NULL pointers these days. Drop a bunch of empty encoder callbacks. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_kms.c | 26 -- 1 file changed, 26 deletions(-)

[PATCH v3 03/15] drm/bochs: atomic: add atomic_flush+atomic_enable callbacks.

2019-01-10 Thread Gerd Hoffmann
Conversion to atomic modesetting, step one. Add atomic crtc helper callbacks. Signed-off-by: Gerd Hoffmann Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_kms.c | 25 + 1 file changed, 25 insertions(+) diff --git a/drivers/gpu/drm/bochs/bochs_kms.c

[PATCH v3 07/15] drm/bochs: atomic: use atomic page_flip helper

2019-01-10 Thread Gerd Hoffmann
Conversion to atomic modesetting, step five. Use atomic page_flip helper for crtc. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Acked-by: Daniel Vetter --- drivers/gpu/drm/bochs/bochs_kms.c | 23 +-- 1 file changed, 1 insertion(+), 22 deletions(-)

[PATCH] drm/qxl: drop prime import/export callbacks

2019-01-10 Thread Gerd Hoffmann
Also set prime_handle_to_fd and prime_fd_to_handle to NULL, so drm will not advertive DRM_PRIME_CAP_{IMPORT,EXPORT} to userspace. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.c | 4 drivers/gpu/drm/qxl/qxl_prime.c | 14 -- 2 files changed, 18 deletions(-)

Re: [PATCH] virtio:linux:kernel:NULL check after kmalloc is needed

2019-01-10 Thread Vincent Stehle
Hi, On Wed, Jan 09, 2019 at 09:30:37AM -0500, Michael S. Tsirkin wrote: > On Tue, Jan 08, 2019 at 01:40:33PM +0800, Yi Wang wrote: > > From: "huang.zijiang" > > > > NULL check is needed because kmalloc maybe return NULL. > > > > Signed-off-by: huang.zijiang > > Can't hurt I will queue it. > > >