CISTI'2019 - Doctoral Symposium | Coimbra, Portugal

2019-01-18 Thread Maria Lemos
* Published in IEEE Xplore and indexed by ISI, Scopus, etc. --- Doctoral Symposium of CISTI'2019 - 14th Iberian Conference on Information Systems and Technologies

Re: [PATCH v3 23/23] drm/qxl: add overflow checks to qxl_mode_dumb_create()

2019-01-18 Thread Ville Syrjälä
On Fri, Jan 18, 2019 at 04:49:44PM +0100, Daniel Vetter wrote: > On Fri, Jan 18, 2019 at 01:20:20PM +0100, Gerd Hoffmann wrote: > > Signed-off-by: Gerd Hoffmann > > We already do all reasonable overflow checks in drm_mode_create_dumb(). If > you don't trust them I think would be better time

Re: [PATCH v3 23/23] drm/qxl: add overflow checks to qxl_mode_dumb_create()

2019-01-18 Thread Daniel Vetter
On Fri, Jan 18, 2019 at 5:32 PM Ville Syrjälä wrote: > > On Fri, Jan 18, 2019 at 04:49:44PM +0100, Daniel Vetter wrote: > > On Fri, Jan 18, 2019 at 01:20:20PM +0100, Gerd Hoffmann wrote: > > > Signed-off-by: Gerd Hoffmann > > > > We already do all reasonable overflow checks in

Re: [PATCH v7 0/7] Add virtio-iommu driver

2019-01-18 Thread Michael S. Tsirkin
On Tue, Jan 15, 2019 at 12:19:52PM +, Jean-Philippe Brucker wrote: > Implement the virtio-iommu driver, following specification v0.9 [1]. > > This is a simple rebase onto Linux v5.0-rc2. We now use the > dev_iommu_fwspec_get() helper introduced in v5.0 instead of accessing >

Re: [PATCH v3 23/23] drm/qxl: add overflow checks to qxl_mode_dumb_create()

2019-01-18 Thread Daniel Vetter
On Fri, Jan 18, 2019 at 01:20:20PM +0100, Gerd Hoffmann wrote: > Signed-off-by: Gerd Hoffmann We already do all reasonable overflow checks in drm_mode_create_dumb(). If you don't trust them I think would be better time spent typing an igt to test this than adding redundant check in all drivers.

Re: [PATCH v2] virtio_net: bulk free tx skbs

2019-01-18 Thread Jason Wang
On 2019/1/18 下午12:20, Michael S. Tsirkin wrote: Use napi_consume_skb() to get bulk free. Note that napi_consume_skb is safe to call in a non-napi context as long as the napi_budget flag is correct. Signed-off-by: Michael S. Tsirkin --- Changes from v1: rebase on master. lightly

[PATCH v3 18/23] drm/qxl: remove dead qxl fbdev emulation code

2019-01-18 Thread Gerd Hoffmann
Lovely diffstat, thanks to the new generic fbdev emulation. drm/qxl/Makefile |2 drm/qxl/qxl_draw.c | 232 drm/qxl/qxl_drv.h | 21 --- drm/qxl/qxl_fb.c | 300 - Signed-off-by: Gerd Hoffmann

[PATCH v3 12/23] drm/qxl: track primary bo

2019-01-18 Thread Gerd Hoffmann
Track which bo is used as primary surface. With that in place we don't need the primary_created flag any more, we can just check the primary bo pointer instead. Also verify we don't already have a primary surface in qxl_io_create_primary(). Signed-off-by: Gerd Hoffmann ---

[PATCH v3 23/23] drm/qxl: add overflow checks to qxl_mode_dumb_create()

2019-01-18 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_dumb.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_dumb.c b/drivers/gpu/drm/qxl/qxl_dumb.c index 272d19b677..bed6d06ee4 100644 --- a/drivers/gpu/drm/qxl/qxl_dumb.c +++

[PATCH v3 17/23] drm/qxl: use generic fbdev emulation

2019-01-18 Thread Gerd Hoffmann
Switch qxl over to the new generic fbdev emulation. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 7 --- drivers/gpu/drm/qxl/qxl_drv.c | 2 ++ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c

[PATCH v3 02/23] drm/qxl: drop unused qxl_fb_virtual_address

2019-01-18 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers/gpu/drm/qxl/qxl_drv.h index 38c5a8b1df..7eabf4a9ed 100644 --- a/drivers/gpu/drm/qxl/qxl_drv.h +++ b/drivers/gpu/drm/qxl/qxl_drv.h @@

[PATCH v3 07/23] drm/qxl: allow both PRIV and VRAM placement for QXL_GEM_DOMAIN_SURFACE

2019-01-18 Thread Gerd Hoffmann
qxl surfaces (used for framebuffers and gem objects) can live in both VRAM and PRIV ttm domains. Update placement setup to include both. Put PRIV first in the list so it is preferred, so VRAM will have more room for objects which must be allocated there. Signed-off-by: Gerd Hoffmann ---

[PATCH v3 01/23] drm/qxl: drop ttm_mem_reg arg from qxl_hw_surface_alloc()

2019-01-18 Thread Gerd Hoffmann
Not used, is always NULL. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h| 3 +-- drivers/gpu/drm/qxl/qxl_cmd.c| 14 ++ drivers/gpu/drm/qxl/qxl_object.c | 2 +- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_drv.h

[PATCH v3 08/23] drm/qxl: use QXL_GEM_DOMAIN_SURFACE for shadow bo.

2019-01-18 Thread Gerd Hoffmann
The shadow bo is used as qxl surface, so allocate it as QXL_GEM_DOMAIN_SURFACE. Should usually be allocated in PRIV ttm domain then, so this reduces VRAM memory pressure. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH v3 21/23] drm/qxl: add qxl_add_mode helper function

2019-01-18 Thread Gerd Hoffmann
Add a helper function to add custom video modes to a connector. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 84 +++ 1 file changed, 49 insertions(+), 35 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c

[PATCH v3 16/23] drm/qxl: implement prime kmap/kunmap

2019-01-18 Thread Gerd Hoffmann
Generic fbdev emulation needs this. Also: We must keep track of the number of mappings now, so we don't unmap early in case two users want a kmap of the same bo. Add a sanity check to destroy callback to make sure kmap/kunmap is balanced. Signed-off-by: Gerd Hoffmann ---

[PATCH v3 20/23] drm/qxl: add mode/framebuffer check functions

2019-01-18 Thread Gerd Hoffmann
Add a helper functions to check video modes. Also add a helper to check framebuffer buffer objects, using the former for consistency. That way we should not fail in qxl_primary_atomic_check() because video modes which are too big will not be added to the mode list in the first place.

[PATCH v3 22/23] drm/qxl: use kernel mode db

2019-01-18 Thread Gerd Hoffmann
Add all standard modes from the kernel's video mode data base. Keep a few non-standard modes in the qxl mode list. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 27 +++ 1 file changed, 7 insertions(+), 20 deletions(-) diff --git

[PATCH v3 14/23] drm/qxl: cover all crtcs in shadow bo.

2019-01-18 Thread Gerd Hoffmann
The qxl device supports only a single active framebuffer ("primary surface" in spice terminology). In multihead configurations are handled by defining rectangles within the primary surface for each head/crtc. Userspace which uses the qxl ioctl interface (xorg qxl driver) is aware of this

[PATCH v3 19/23] drm/qxl: implement qxl_gem_prime_(un)pin

2019-01-18 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_prime.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_prime.c b/drivers/gpu/drm/qxl/qxl_prime.c index 708378844c..22e1faf047 100644 --- a/drivers/gpu/drm/qxl/qxl_prime.c +++

[PATCH v3 15/23] drm/qxl: use qxl_num_crtc directly

2019-01-18 Thread Gerd Hoffmann
qdev->monitors_config->max_allowed is effectively set by the qxl.num_heads module parameter, stored in the qxl_num_crtc variable. Lets get rid of the indirection and use the variable qxl_num_crtc directly. The kernel doesn't need to dereference pointers each time it needs the value, and when

[PATCH v3 13/23] drm/qxl: use shadow bo directly

2019-01-18 Thread Gerd Hoffmann
Pass the shadow bo to qxl_io_create_primary() instead of expecting qxl_io_create_primary to check bo->shadow. Set is_primary flag on the shadow bo. Move the is_primary tracking into qxl_io_create_primary() and qxl_io_destroy_primary() functions. That simplifies primary surface tracking and the

[PATCH v3 10/23] drm/qxl: move qxl_primary_apply_cursor to correct place

2019-01-18 Thread Gerd Hoffmann
The cursor must be set again after creating the primary surface. Also drop the error message. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c

[PATCH v3 11/23] drm/qxl: drop unused offset parameter from qxl_io_create_primary()

2019-01-18 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h | 1 - drivers/gpu/drm/qxl/qxl_cmd.c | 7 +++ drivers/gpu/drm/qxl/qxl_display.c | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers/gpu/drm/qxl/qxl_drv.h index

[PATCH v3 06/23] drm/qxl: use separate offset spaces for the two slots / ttm memory types.

2019-01-18 Thread Gerd Hoffmann
Without that ttm offsets are not unique, they can refer to objects in both VRAM and PRIV memory (aka main and surfaces slot). One of those "why things didn't blow up without this" moments. Probably offset conflicts are rare enough by pure luck. Signed-off-by: Gerd Hoffmann ---

[PATCH v3 03/23] drm/qxl: simplify slot management

2019-01-18 Thread Gerd Hoffmann
Drop pointless indirection, remove the mem_slots array and index variables, drop dynamic allocation. Store memslots in qxl_device instead. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h | 15 + drivers/gpu/drm/qxl/qxl_kms.c | 72

[PATCH v3 09/23] drm/qxl: use QXL_GEM_DOMAIN_SURFACE for dumb gem objects

2019-01-18 Thread Gerd Hoffmann
dumb buffers are used as qxl surfaces, so allocate them as QXL_GEM_DOMAIN_SURFACE. Should usually be allocated in PRIV ttm domain then, so this reduces VRAM memory pressure. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_dumb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH v3 05/23] drm/qxl: drop unused fields from struct qxl_device

2019-01-18 Thread Gerd Hoffmann
slot_id_bits and slot_gen_bits can be read directly from qxlrom instead. va_slot_mask is never used anywhere. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h | 3 --- drivers/gpu/drm/qxl/qxl_kms.c | 10 ++ 2 files changed, 2 insertions(+), 11 deletions(-) diff --git

[PATCH v3 04/23] drm/qxl: change the way slot is detected

2019-01-18 Thread Gerd Hoffmann
From: Frediano Ziglio Instead of relaying on surface type use the actual placement. This allow to have different placement for a single type of surface. Signed-off-by: Frediano Ziglio [ kraxel: rebased, adapted to upstream changes ] Signed-off-by: Gerd Hoffmann ---

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

2019-01-18 Thread Michael S. Tsirkin
On Wed, Jan 16, 2019 at 04:54:42PM +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 this issue, when logging with device IOTLB

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

2019-01-18 Thread David Miller
From: Jason Wang Date: Wed, 16 Jan 2019 16:54:42 +0800 > 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

Re: [PATCH net 5/7] virtio_net: Don't process redirected XDP frames when XDP is disabled

2019-01-18 Thread Toshiaki Makita
On 2019/01/18 12:52, Jason Wang wrote: > On 2019/1/18 上午9:56, Toshiaki Makita wrote: >> On 2019/01/17 22:05, Jason Wang wrote: >>> On 2019/1/17 下午8:53, Jason Wang wrote: On 2019/1/17 下午7:20, Toshiaki Makita wrote: > Commit 8dcc5b0ab0ec ("virtio_net: fix ndo_xdp_xmit crash towards >

[PATCH v2] virtio_net: bulk free tx skbs

2019-01-18 Thread Michael S. Tsirkin
Use napi_consume_skb() to get bulk free. Note that napi_consume_skb is safe to call in a non-napi context as long as the napi_budget flag is correct. Signed-off-by: Michael S. Tsirkin --- Changes from v1: rebase on master. lightly tested on developer's box. drivers/net/virtio_net.c

Re: [PATCH net 5/7] virtio_net: Don't process redirected XDP frames when XDP is disabled

2019-01-18 Thread Jason Wang
On 2019/1/18 上午9:56, Toshiaki Makita wrote: On 2019/01/17 22:05, Jason Wang wrote: On 2019/1/17 下午8:53, Jason Wang wrote: On 2019/1/17 下午7:20, Toshiaki Makita wrote: Commit 8dcc5b0ab0ec ("virtio_net: fix ndo_xdp_xmit crash towards dev not ready for XDP") tried to avoid access to unexpected

Re: [PATCH net 2/7] virtio_net: Don't call free_old_xmit_skbs for xdp_frames

2019-01-18 Thread Jason Wang
On 2019/1/18 上午9:44, Toshiaki Makita wrote: On 2019/01/17 21:39, Jason Wang wrote: On 2019/1/17 下午7:20, Toshiaki Makita wrote: When napi_tx is enabled, virtnet_poll_cleantx() called free_old_xmit_skbs() even for xdp send queue. This is bogus since the queue has xdp_frames, not sk_buffs, thus

Re: [PATCH net 0/7] virtio_net: Fix problems around XDP tx and napi_tx

2019-01-18 Thread Toshiaki Makita
On 2019/01/17 23:55, Michael S. Tsirkin wrote: > On Thu, Jan 17, 2019 at 08:20:38PM +0900, Toshiaki Makita wrote: >> While I'm looking into how to account standard tx counters on XDP tx >> processing, I found several bugs around XDP tx and napi_tx. >> >> Patch1: Fix oops on error path. Patch2

Re: [PATCH net 5/7] virtio_net: Don't process redirected XDP frames when XDP is disabled

2019-01-18 Thread Toshiaki Makita
On 2019/01/17 22:05, Jason Wang wrote: > On 2019/1/17 下午8:53, Jason Wang wrote: >> On 2019/1/17 下午7:20, Toshiaki Makita wrote: >>> Commit 8dcc5b0ab0ec ("virtio_net: fix ndo_xdp_xmit crash towards dev not >>> ready for XDP") tried to avoid access to unexpected sq while XDP is >>> disabled, but was

Re: [PATCH net 2/7] virtio_net: Don't call free_old_xmit_skbs for xdp_frames

2019-01-18 Thread Toshiaki Makita
On 2019/01/17 21:39, Jason Wang wrote: > On 2019/1/17 下午7:20, Toshiaki Makita wrote: >> When napi_tx is enabled, virtnet_poll_cleantx() called >> free_old_xmit_skbs() even for xdp send queue. >> This is bogus since the queue has xdp_frames, not sk_buffs, thus mangled >> device tx bytes counters

[PATCH] drm: Split out drm_probe_helper.h

2019-01-18 Thread Daniel Vetter
Having the probe helper stuff (which pretty much everyone needs) in the drm_crtc_helper.h file (which atomic drivers should never need) is confusing. Split them out. To make sure I actually achieved the goal here I went through all drivers. And indeed, all atomic drivers are now free of