[PATCH v3] drm/bochs: add drm_driver.release callback.

2020-02-11 Thread Gerd Hoffmann
Call bochs_unload via drm_driver.release to make sure we release stuff when it is safe to do so. Use drm_dev_{enter,exit,unplug} to avoid touching hardware after device removal. Tidy up here and there. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_drv.c | 6 +++--- drivers/gpu

[PATCH v3] drm/virtio: add drm_driver.release callback.

2020-02-11 Thread Gerd Hoffmann
Split virtio_gpu_deinit(), move the drm shutdown and release to virtio_gpu_release(). Drop vqs_ready variable, instead use drm_dev_{enter,exit,unplug} to avoid touching hardware after device removal. Tidy up here and there. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h

[PATCH v3] drm/cirrus: add drm_driver.release callback.

2020-02-11 Thread Gerd Hoffmann
Move final cleanups from cirrus_pci_remove() to the new callback. Add drm_atomic_helper_shutdown() call to cirrus_pci_remove(). Use drm_dev_{enter,exit,unplug} to avoid touching hardware after device removal. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/cirrus/cirrus.c | 43

[PATCH] drm/virtio: rework batching

2020-02-11 Thread Gerd Hoffmann
for userspace ioctls. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 6 ++--- drivers/gpu/drm/virtio/virtgpu_display.c | 2 ++ drivers/gpu/drm/virtio/virtgpu_ioctl.c | 4 +++ drivers/gpu/drm/virtio/virtgpu_kms.c | 3 +++ drivers/gpu/drm/virtio

[PATCH v4] drm/cirrus: add drm_driver.release callback.

2020-02-11 Thread Gerd Hoffmann
(). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/cirrus/cirrus.c | 43 - 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/cirrus/cirrus.c b/drivers/gpu/drm/cirrus/cirrus.c index a91fb0d7282c..d2ff63ce8eaf 100644 --- a/drivers/gpu/drm

[PATCH 1/2] drm/virtio: fix virtio_gpu_execbuffer_ioctl locking

2020-02-11 Thread Gerd Hoffmann
Lockdep says we can't call vmemdup() while having objects reserved because it needs the mmap semaphore. So reorder the calls reserve the objects later. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 20 ++-- 1 file changed, 10 insertions(+), 10

[PATCH v4] drm/virtio: add drm_driver.release callback.

2020-02-11 Thread Gerd Hoffmann
Split virtio_gpu_deinit(), move the drm shutdown and release to virtio_gpu_release(). Drop vqs_ready variable, instead use drm_dev_{enter,exit,unplug} to avoid touching hardware after device removal. Tidy up here and there. v4: add changelog. v3: use drm_dev_*(). Signed-off-by: Gerd Hoffmann

[PATCH v4] drm/bochs: add drm_driver.release callback.

2020-02-11 Thread Gerd Hoffmann
-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_drv.c | 6 +++--- drivers/gpu/drm/bochs/bochs_hw.c | 24 +++- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_drv.c index 10460878414e

[PATCH v2] drm/bochs: add drm_driver.release callback.

2020-02-10 Thread Gerd Hoffmann
is not touched after bochs_pci_remove returns. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs.h | 1 + drivers/gpu/drm/bochs/bochs_drv.c | 6 +++--- drivers/gpu/drm/bochs/bochs_hw.c | 14 ++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm

[PATCH v2 2/2] drm/qxl: add drm_driver.release callback.

2020-02-10 Thread Gerd Hoffmann
Move final cleanups to qxl_drm_release() callback. Add drm_atomic_helper_shutdown() call to qxl_pci_remove(). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.c | 26 +++--- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/qxl

[PATCH v2 1/2] drm/qxl: reorder calls in qxl_device_fini().

2020-02-10 Thread Gerd Hoffmann
Reorder calls in qxl_device_fini(). Cleaning up gem & ttm might trigger qxl commands, so we should do that before releaseing command rings. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_kms.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu

[PATCH v2] drm/virtio: add drm_driver.release callback.

2020-02-10 Thread Gerd Hoffmann
Split virtio_gpu_deinit(), move the drm shutdown and release to virtio_gpu_release(). Also free vbufs in case we can't queue them. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 + drivers/gpu/drm/virtio/virtgpu_display.c | 1 - drivers/gpu/drm/virtio

[PATCH v2] drm/cirrus: add drm_driver.release callback.

2020-02-10 Thread Gerd Hoffmann
Move final cleanups from cirrus_pci_remove() to the new callback. Add drm_atomic_helper_shutdown() call to cirrus_pci_remove(). Set pointers to NULL after iounmap() and check them before using them to make sure we don't touch released hardware. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm

[PATCH] drm/virtio: fix error check

2020-02-14 Thread Gerd Hoffmann
The >= compare op must happen in cpu byte order, doing it in little endian fails on big endian machines like s390. Reported-by: Sebastian Mitterle Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_vq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driv

Re: bochs_hw_init fails to request framebuffer on EFI boot with plymouth visible

2020-01-12 Thread Gerd Hoffmann
On Fri, Jan 10, 2020 at 05:32:11PM +0100, Marek Marczykowski-Górecki wrote: > Hi, > > This is the context of "bochs_drm: failed bochs_hw_init() results in > panic". When I boot the system, if plymouth is visible, it crashes. But > if I press ESC to hide it, it boots fine. bochs_drm is build as

Re: bochs_drm: failed bochs_hw_init() results in panic

2020-01-12 Thread Gerd Hoffmann
> Now the messages looks like this: > > [ 29.800835] bochs-drm :00:02.0: remove_conflicting_pci_framebuffers: > bar 0: 0xc000 -> 0xc0ff > [ 29.800840] bochs-drm :00:02.0: remove_conflicting_pci_framebuffers: > bar 2: 0xc1087000 -> 0xc1087fff > [ 29.800842] checking generic

Re: bochs_hw_init fails to request framebuffer on EFI boot with plymouth visible

2020-01-15 Thread Gerd Hoffmann
Hi, > > No clue why, also doesn't reproduce here (standard fedora 31 5.4.7 > > kernel). I don't have an encrypted disk, so no passphrase prompt, > > maybe that makes a difference. > > Extra data point: it worked on 4.19.89. > > > How does /proc/iomem look after boot, specifically the

Re: bochs_hw_init fails to request framebuffer on EFI boot with plymouth visible

2020-01-15 Thread Gerd Hoffmann
On Wed, Jan 15, 2020 at 03:27:41PM +0100, Marek Marczykowski-Górecki wrote: > On Wed, Jan 15, 2020 at 03:13:53PM +0100, Gerd Hoffmann wrote: > > Hi, > > > > > > And "grep -A1 :00:02.0 /proc/iomem" ? > > > > > > c000-c0ff

Re: bochs_hw_init fails to request framebuffer on EFI boot with plymouth visible

2020-01-15 Thread Gerd Hoffmann
Hi, > > And "grep -A1 :00:02.0 /proc/iomem" ? > > c000-c0ff : :00:02.0 > c100-c103 : :00:04.0 So no reservation left. Whatever blocked the pci bar resource (efifb probably) is gone now. So the interesting question is why that reservation sticked long enough

Re: bochs_hw_init fails to request framebuffer on EFI boot with plymouth visible

2020-01-20 Thread Gerd Hoffmann
On Fri, Jan 17, 2020 at 04:22:11PM +0100, Marek Marczykowski-Górecki wrote: > On Fri, Jan 17, 2020 at 01:58:25PM +0100, Gerd Hoffmann wrote: > > > Should switching to bochsdrmfb be deferred until efifb gets properly > > > destroyed? How? > > > > Should be in d

Re: bochs_hw_init fails to request framebuffer on EFI boot with plymouth visible

2020-01-17 Thread Gerd Hoffmann
> Should switching to bochsdrmfb be deferred until efifb gets properly > destroyed? How? Should be in do_remove_conflicting_framebuffers, everyone might run into this. So lets try wait for all (other) references went away: diff --git a/drivers/video/fbdev/core/fbmem.c

[PATCH] drm/virtio: add missing virtio_gpu_array_lock_resv call

2020-01-10 Thread Gerd Hoffmann
When submitting a fenced command we must lock the object reservations because virtio_gpu_queue_fenced_ctrl_buffer() unlocks after adding the fence. Reported-by: Jann Horn Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_plane.c | 1 + 1 file changed, 1 insertion(+) diff --git

Re: bochs_drm: failed bochs_hw_init() results in panic

2020-01-09 Thread Gerd Hoffmann
On Fri, Jan 10, 2020 at 02:33:28AM +0100, Marek Marczykowski-Górecki wrote: > Hi, > > It looks like bochs_kms_fini() don't like being called if > bochs_kms_init() wasn't. Regardless of the reason for the > bochs_hw_init() failure (that's another story), it shouldn't cause a > panic. Any idea how

Re: [PATCH 59/59] drm/bochs: Remove explicit drm_connector_register

2020-04-21 Thread Gerd Hoffmann
On Wed, Apr 15, 2020 at 09:40:34AM +0200, Daniel Vetter wrote: > This is leftovers from the old drm_driver->load callback > upside-down issues. It doesn't do anything for not-hotplugged > connectors since drm_dev_register takes care of that. > > Signed-off-by: Daniel Vetter &

Re: [PATCH 37/59] drm/cirrus: Move to drm/tiny

2020-04-21 Thread Gerd Hoffmann
On Wed, Apr 15, 2020 at 09:40:12AM +0200, Daniel Vetter wrote: > Because it is. Indeed. Acked-by: Gerd Hoffmann take care, Gerd ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mail

Re: [PATCH 1/1] drm/qxl: add mutex_lock/mutex_unlock to ensure the order in which resources are released.

2020-04-21 Thread Gerd Hoffmann
On Sat, Apr 18, 2020 at 02:39:17PM +0800, Caicai wrote: > When a qxl resource is released, the list that needs to be released is > fetched from the linked list ring and cleared. When you empty the list, > instead of trying to determine whether the ttm buffer object for each > qxl in the list is

[PATCH v3] drm/bochs: downgrade pci_request_region failure from error to warning

2020-03-13 Thread Gerd Hoffmann
this issue. Reported-by: Marek Marczykowski-Górecki Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_hw.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c index 952199cc0462..dce4672e3fc8

Re: [PATCH v3] drm/bochs: downgrade pci_request_region failure from error to warning

2020-03-13 Thread Gerd Hoffmann
Hi, > > + if (pci_request_region(pdev, 0, "bochs-drm") != 0) > > + DRM_WARN("Cannot request framebuffer, boot fb still active?\n"); > So you could use drm_WARN() which is what is preferred these days. Nope, this isn't yet in -fixes. cheers, Gerd

Re: [PATCH 30/44] drm/qxl: Use devm_drm_dev_alloc

2020-04-06 Thread Gerd Hoffmann
On Fri, Apr 03, 2020 at 03:58:14PM +0200, Daniel Vetter wrote: > Also need to remove the drm_dev_put from the remove hook. > > Signed-off-by: Daniel Vetter > Cc: Dave Airlie > Cc: Gerd Hoffmann > Cc: virtualization@lists.linux-foundation.org > Cc: spice-de...@lists.f

Re: [PATCH 31/44] drm/qxl: Don't use drm_device->dev_private

2020-04-06 Thread Gerd Hoffmann
On Fri, Apr 03, 2020 at 03:58:15PM +0200, Daniel Vetter wrote: > Upcasting using a container_of macro is more typesafe, faster and > easier for the compiler to optimize. > > Signed-off-by: Daniel Vetter > Cc: Dave Airlie > Cc: Gerd Hoffmann > Cc: virtualization@lists.linu

Re: upstream boot error: KASAN: slab-out-of-bounds Write in virtio_gpu_object_create

2020-04-06 Thread Gerd Hoffmann
On Mon, Apr 06, 2020 at 09:07:44AM +0200, Dmitry Vyukov wrote: > On Mon, Apr 6, 2020 at 8:46 AM syzbot > wrote: > > > > Hello, > > > > syzbot found the following crash on: > > > > HEAD commit:ffc1c20c Merge tag 'for-5.7/dm-changes' of git://git.kerne.. > > git tree: upstream > > console

Re: [PATCH Resend] drm/qxl: Use correct notify port address when creating cursor ring

2020-03-31 Thread Gerd Hoffmann
On Tue, Mar 31, 2020 at 02:18:08PM +0800, Huacai Chen wrote: > The command ring and cursor ring use different notify port addresses > definition: QXL_IO_NOTIFY_CMD and QXL_IO_NOTIFY_CURSOR. However, in > qxl_device_init() we use QXL_IO_NOTIFY_CMD to create both command ring > and cursor ring. This

Re: arm64 kernel crash in bochs_get_edid_block() with QEMU '-device VGA'

2020-03-25 Thread Gerd Hoffmann
On Sat, Feb 15, 2020 at 01:11:45PM +0100, Juerg Haefliger wrote: > The QEMU default edid=off results in a kernel crash [1] on arm64 due > to commit [2]. To reproduce: Should be fixed in qemu 5.0-rc0 cheers, Gerd ___ Virtualization mailing list

Re: upstream boot error: KASAN: slab-out-of-bounds Write in virtio_gpu_object_create

2020-04-06 Thread Gerd Hoffmann
Hi, > > > +drivers/gpu/drm/virtio/virtgpu_object.c maintainers > > > Now we have both mainline and linux-next boot broken (linux-next is > > > broken for the past 40 days). > > > No testing of new code happens. > > > > > > > virtio_gpu_object_shmem_init > > > >

Re: [PATCH Resend] drm/qxl: Use correct notify port address when creating cursor ring

2020-04-24 Thread Gerd Hoffmann
On Fri, Apr 24, 2020 at 05:57:37PM +0800, Huacai Chen wrote: > Hi, Gerd > > On Tue, Mar 31, 2020 at 10:53 PM Gerd Hoffmann wrote: > > > > On Tue, Mar 31, 2020 at 02:18:08PM +0800, Huacai Chen wrote: > > > The command ring and cursor ring use different notify p

Re: [PATCH v1] drm/bochs: fix an issue of ioremap() leak

2020-04-23 Thread Gerd Hoffmann
Hi, > I am a newbie, andy gave me some directions to submit the patch, eg: check > ioremap leak. At this time, I found that the bochs driver may have similar > problems, so I submitted this patch, then, Andy said the best is to switch > this driver to use pcim _ * () functions and drop tons of

Re: [PATCH] drm/qxl: lost qxl_bo_kunmap_atomic_page in qxl_image_init_helper()

2020-04-28 Thread Gerd Hoffmann
On Mon, Apr 27, 2020 at 10:55:27AM +0300, Vasily Averin wrote: > Signed-off-by: Vasily Averin > --- > drivers/gpu/drm/qxl/qxl_image.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/qxl/qxl_image.c b/drivers/gpu/drm/qxl/qxl_image.c > index 43688ecdd8a0..7270da62fc29

Re: [PATCH 2/2] drm/qxl: qxl_release leak in qxl_hw_surface_alloc()

2020-04-28 Thread Gerd Hoffmann
On Mon, Apr 27, 2020 at 08:32:51AM +0300, Vasily Averin wrote: > Cc: sta...@vger.kernel.org > Fixes: 8002db6336dd ("qxl: convert qxl driver to proper use for reservations") > Signed-off-by: Vasily Averin Both patches pushed to drm-misc-fixes. thanks, Gerd

Re: [PATCH 1/1] drm/qxl: add mutex_lock/mutex_unlock to ensure the order in which resources are rele

2020-04-29 Thread Gerd Hoffmann
Hi, > > The only way I see for this to happen is that the guest is preempted > > between qxl_push_{cursor,command}_ring_release() and > > qxl_release_fence_buffer_objects() calls. The host can complete the qxl > > command then, signal the guest, and the IRQ handler calls > >

Re: [PATCH 0/1] Add uvirtio for testing

2020-04-30 Thread Gerd Hoffmann
On Wed, Apr 29, 2020 at 08:59:18PM -0700, lepton wrote: > On Wed, Apr 29, 2020 at 4:58 AM Gerd Hoffmann wrote: > > > > > 3) Need to be verbose on how the vring processing work in the commit log > > > of > > > patch 1 > > > > Ecven b

Re: [PATCH 0/1] Add uvirtio for testing

2020-04-29 Thread Gerd Hoffmann
> 3) Need to be verbose on how the vring processing work in the commit log of > patch 1 Ecven better a file documenting the interface somewhere in Documentation/ take care, Gerd ___ Virtualization mailing list

Re: [PATCH] drm/qxl: qxl_release use after free

2020-04-29 Thread Gerd Hoffmann
t; > It can lead to crashes in qxl driver or trigger memory corruption > in some kmalloc-192 slab object > > Gerd Hoffmann proposes to swap the qxl_release_fence_buffer_objects() + > qxl_push_{cursor,command}_ring_release() calls to close that race window. > > cc: sta...@vger

Re: [PATCH v3 1/4] dma-buf: add support for virtio exported objects

2020-05-14 Thread Gerd Hoffmann
Hi, > - for the runtime upcasting the usual approach is to check the ->ops > pointer. Which means that would need to be the same for all virtio > dma_bufs, which might get a bit awkward. But I'd really prefer we not > add allocator specific stuff like this to dma-buf. This is exactly the

Re: [PATCH v5 25/38] drm: virtio: fix common struct sg_table related issues

2020-05-15 Thread Gerd Hoffmann
ssible. This, almost always, hides references to the > nents and orig_nents entries, making the code robust, easier to follow > and copy/paste safe. Looks all sane. Acked-by: Gerd Hoffmann take care, Gerd ___ Virtualization mailing list Virtualization@li

Re: [PATCH] drm/virtio: fix OOB in virtio_gpu_object_create

2020-03-19 Thread Gerd Hoffmann
which has 2 more members. > > So fix that by using correct type in virtio_gpu_create_object. > > Signed-off-by: Jiri Slaby > Fixes: f651c8b05542 ("drm/virtio: factor out the sg_table from > virtio_gpu_object") > Cc: Gurchetan Singh > Cc: Gerd Hoffmann Tha

Re: [PATCH v3] drm/bochs: downgrade pci_request_region failure from error to warning

2020-03-18 Thread Gerd Hoffmann
On Tue, Mar 17, 2020 at 05:49:41PM +0100, Daniel Vetter wrote: > On Fri, Mar 13, 2020 at 09:41:52AM +0100, Gerd Hoffmann wrote: > > Shutdown of firmware framebuffer has a bunch of problems. Because > > of this the framebuffer region might still be rese

Re: [PATCH v3 0/4] Support virtio cross-device resources

2020-03-20 Thread Gerd Hoffmann
On Wed, Mar 11, 2020 at 08:20:00PM +0900, David Stevens wrote: > This patchset implements the current proposal for virtio cross-device > resource sharing [1], with minor changes based on recent comments. It > is expected that this will be used to import virtio resources into the > virtio-video

[PATCH] drm/virtio: drop quirks handling

2020-09-08 Thread Gerd Hoffmann
. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_object.c | 19 ++- drivers/gpu/drm/virtio/virtgpu_vq.c | 16 ++-- 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c b/drivers/gpu/drm/virtio

[PATCH 2/3] drm/virtio: return virtio_gpu_queue errors

2020-09-08 Thread Gerd Hoffmann
In case queuing virtio commands fails (can happen when the device got unplugged) pass up the error. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_vq.c | 36 +++-- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/virtio

[PATCH 3/3] drm/virtio: add virtio_gpu_cmd_unref_resource error handling

2020-09-08 Thread Gerd Hoffmann
shutdown. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_vq.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c index b1884e6e242c..4d2325bf4aed 100644 --- a/drivers/gpu/drm/virtio

[PATCH 1/3] drm/virtio: use drmm_mode_config_init

2020-09-08 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 2 +- drivers/gpu/drm/virtio/virtgpu_display.c | 11 +++ drivers/gpu/drm/virtio/virtgpu_kms.c | 6 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h

[PATCH 3/3] drm/qxl: handle shadow in primary destroy

2020-09-08 Thread Gerd Hoffmann
qxl_primary_atomic_disable must check whenever the framebuffer bo has a shadow surface and in case it has check the shadow primary status. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_display.c

[PATCH 2/3] drm/qxl: release shadow on shutdown

2020-09-08 Thread Gerd Hoffmann
In case we have a shadow surface on shutdown release it so it doesn't leak. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 4be04eaf7f37

[PATCH 1/3] drm/qxl: use drmm_mode_config_init

2020-09-08 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index fa79688013b7..4be04eaf7f37 100644 --- a/drivers/gpu/drm/qxl/qxl_display.c +++ b

Re: [PATCH] drm/virtio: drop quirks handling

2020-09-08 Thread Gerd Hoffmann
On Tue, Sep 08, 2020 at 10:57:21AM +0200, Daniel Vetter wrote: > On Tue, Sep 08, 2020 at 08:47:41AM +0200, Gerd Hoffmann wrote: > > These days dma ops can be overridden per device, and the virtio core > > "can be overridden" or "are"? Didn't happen yet, so scra

[PATCH v3 2/2] drm/virtio: set max_segment

2020-09-07 Thread Gerd Hoffmann
When initializing call virtio_max_dma_size() to figure the scatter list limit. Needed to make virtio-gpu work properly with SEV. v2: place max_segment in drm driver not gem object. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_kms.c | 1 + 1 file changed, 1 insertion

Re: [PATCH v2] drm/virtio: Use UUID API for importing the UUID

2020-10-14 Thread Gerd Hoffmann
On Tue, Oct 13, 2020 at 04:27:14PM +0300, Andy Shevchenko wrote: > There is import_uuid() function which imports u8 array to the uuid_t. > Use it instead of open coding variant. > > This allows to hide the uuid_t internals. > > Reviewed-by: David Stevens > Signed-off-by: Andy Shevchenko

Re: [PATCH v1] drm/virtio: Use UUID API for importing the UUID

2020-10-13 Thread Gerd Hoffmann
On Mon, Oct 12, 2020 at 08:18:26PM +0300, Andy Shevchenko wrote: > There is import_uuid() function which imports u8 array to the uuid_t. > Use it instead of open coding variant. > > This allows to hide the uuid_t internals. Doesn't apply to drm-misc-next, please rebase. thanks, Gerd

[PATCH 2/2] drm/virtio: set max_segment

2020-08-18 Thread Gerd Hoffmann
When initializing gem objects call virtio_max_dma_size() to figure the scatter list limit. Needed to make virtio-gpu work properly with SEV. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_object.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/virtio

[PATCH v2 2/2] drm/virtio: set max_segment

2020-08-18 Thread Gerd Hoffmann
When initializing call virtio_max_dma_size() to figure the scatter list limit. Needed to make virtio-gpu work properly with SEV. v2: place max_segment in drm driver not gem object. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_kms.c | 1 + 1 file changed, 1 insertion

Re: [PATCH] drm/qxl: Fix build errors

2020-08-17 Thread Gerd Hoffmann
Hi, > I guess things are never quite so easy :-). It looks like Daniel's > patch is in drm-misc-fixes and Sidong's patch is in drm-misc-next. On > their own they're fine, but once they are merged in drm-tip the build > error shows up. Ah, ok. I've already wondered how that got past my build

Re: [PATCH v6 0/3] Support virtio cross-device resources

2020-08-18 Thread Gerd Hoffmann
On Tue, Aug 18, 2020 at 10:37:41AM +0900, David Stevens wrote: > This patchset implements the current proposal for virtio cross-device > resource sharing [1]. It will be used to import virtio resources into > the virtio-video driver currently under discussion [2]. The patch > under consideration

[PATCH 2/2] drm/virtio: drop virtio_gpu_output->enabled

2020-08-18 Thread Gerd Hoffmann
Not needed, already tracked by drm_crtc_state->active. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 - drivers/gpu/drm/virtio/virtgpu_display.c | 4 drivers/gpu/drm/virtio/virtgpu_plane.c | 2 +- 3 files changed, 1 insertion(+), 6 deletions(-) diff --

[PATCH 1/2] drm/virtio: fix unblank

2020-08-18 Thread Gerd Hoffmann
ds_modeset() (Daniel). Cc: 1882...@bugs.launchpad.net Fixes: 3954ff10e06e ("drm/virtio: skip set_scanout if framebuffer didn't change") Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 + drivers/gpu/drm/virtio/virtgpu_display.c | 11 +++ dr

Re: [PATCH v3 30/38] virtio_input: convert to LE accessors

2020-08-18 Thread Gerd Hoffmann
On Wed, Aug 05, 2020 at 09:44:36AM -0400, Michael S. Tsirkin wrote: > Virtio input is modern-only. Use LE accessors for config space. > > Signed-off-by: Michael S. Tsirkin Reviewed-by: Gerd Hoffmann ___ Virtualization mailing list Virtu

Re: [PATCH 1/2] drm/virtio: fix unblank

2020-08-28 Thread Gerd Hoffmann
On Mon, Aug 24, 2020 at 09:24:40AM +0200, Jiri Slaby wrote: > On 18. 08. 20, 9:25, Gerd Hoffmann wrote: > > When going through a disable/enable cycle without changing the > > framebuffer the optimization added by commit 3954ff10e06e ("drm/virtio: > > skip set_scanout if

Re: [PATCH 2/2] drm/virtio: Remove open-coded commit-tail function

2020-08-19 Thread Gerd Hoffmann
On Wed, Aug 19, 2020 at 02:43:28PM +0200, Jiri Slaby wrote: > On 09. 07. 20, 14:33, Daniel Vetter wrote: > > Exactly matches the one in the helpers. > > It's not that exact. The order of modeset_enables and planes is > different. And this causes a regression -- no fb in qemu. Does

Re: [PATCH 2/2] drm/virtio: Remove open-coded commit-tail function

2020-08-21 Thread Gerd Hoffmann
On Thu, Aug 20, 2020 at 08:32:51AM +0200, Jiri Slaby wrote: > On 19. 08. 20, 15:24, Gerd Hoffmann wrote: > > On Wed, Aug 19, 2020 at 02:43:28PM +0200, Jiri Slaby wrote: > >> On 09. 07. 20, 14:33, Daniel Vetter wrote: > >>> Exactly matches the one in the helpers.

Re: [PATCH][next] drm/virtio: Use struct_size() helper in kmalloc()

2020-08-17 Thread Gerd Hoffmann
On Wed, Jun 17, 2020 at 04:57:07PM -0500, Gustavo A. R. Silva wrote: > Make use of the struct_size() helper instead of an open-coded version > in order to avoid any potential type mistakes. > > This code was detected with the help of Coccinelle and, audited and > fixed manually. > >

Re: [PATCH] drm/virtio: fix unblank

2020-08-17 Thread Gerd Hoffmann
Hi, > > --- a/drivers/gpu/drm/virtio/virtgpu_display.c > > +++ b/drivers/gpu/drm/virtio/virtgpu_display.c > > @@ -100,6 +100,7 @@ static void virtio_gpu_crtc_atomic_enable(struct > > drm_crtc *crtc, > > struct virtio_gpu_output *output = drm_crtc_to_virtio_gpu_output(crtc); > > > >

Re: [PATCH] drm/virtgpu: remove redundant assignments to width and height

2020-08-17 Thread Gerd Hoffmann
On Wed, Jul 01, 2020 at 02:41:54PM +0100, Colin King wrote: > From: Colin Ian King > > Variables width and height are being assigned values that are never > read. The assignments are redundant and can be removed. > > Addresses-Coverity: ("Unused value") > Signed-off-by: Colin Ian King Pused

Re: [PATCH] drm/virtio: fix unblank

2020-08-17 Thread Gerd Hoffmann
On Mon, Aug 17, 2020 at 11:03:42AM +0200, Gerd Hoffmann wrote: > Hi, > > > > --- a/drivers/gpu/drm/virtio/virtgpu_display.c > > > +++ b/drivers/gpu/drm/virtio/virtgpu_display.c > > > @@ -100,6 +100,7 @@ static void virtio_gpu_crtc_atomic_enable(struct >

Re: [virtio-dev] Re: [PATCH v5 0/3] Support virtio cross-device resources

2020-08-17 Thread Gerd Hoffmann
On Tue, Jun 23, 2020 at 10:31:28AM +0900, David Stevens wrote: > Unless there are any remaining objections to these patches, what are > the next steps towards getting these merged? Sorry, I'm not familiar > with the workflow for contributing patches to Linux. Sorry, just have been busy and not

Re: [virtio-dev] Re: [PATCH v5 0/3] Support virtio cross-device resources

2020-08-17 Thread Gerd Hoffmann
On Mon, Aug 17, 2020 at 12:50:08PM +0200, Gerd Hoffmann wrote: > On Tue, Jun 23, 2020 at 10:31:28AM +0900, David Stevens wrote: > > Unless there are any remaining objections to these patches, what are > > the next steps towards getting these merged? Sorry, I'm not familiar > &

Re: [PATCH] drm/qxl: Replace deprecated function in qxl_display

2020-08-17 Thread Gerd Hoffmann
On Sun, May 24, 2020 at 11:26:23AM +0900, Sidong Yang wrote: > Hi, Dave. > > This is resended e-mail for your advice. > > I'm a newbie interested in linux kernel and qxl module. > Please check this patch and give me advice for me. > Also I'll be glad if there is any task that you bothered. >

Re: [PATCH -next] drm/qxl: simplify the return expression of qxl_plane_prepare_fb()

2020-09-29 Thread Gerd Hoffmann
On Mon, Sep 21, 2020 at 09:10:22PM +0800, Qinglang Miao wrote: > Simplify the return expression. Pushed to drm-misc-next. thanks, Gerd ___ Virtualization mailing list Virtualization@lists.linux-foundation.org

[PATCH v2 2/4] drm/qxl: release shadow on shutdown

2020-09-29 Thread Gerd Hoffmann
In case we have a shadow surface on shutdown release it so it doesn't leak. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 5bef8f121e54

[PATCH v2 4/4] drm/qxl: use qxl pin function

2020-09-29 Thread Gerd Hoffmann
Otherwise ttm throws a WARN because we try to pin without a reservation. Fixes: 9d36d4320462 ("drm/qxl: switch over to the new pin interface") Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drive

[PATCH v2 1/4] drm/qxl: use drmm_mode_config_init

2020-09-29 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter --- drivers/gpu/drm/qxl/qxl_display.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 65de1f69af58..5bef8f121e54 100644 --- a/drivers/gpu

[PATCH v2 3/4] drm/qxl: handle shadow in primary destroy

2020-09-29 Thread Gerd Hoffmann
qxl_primary_atomic_disable must check whenever the framebuffer bo has a shadow surface and in case it has check the shadow primary status. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_display.c

Re: [PATCH v3 0/6] Add virtio-iommu built-in topology

2020-09-24 Thread Gerd Hoffmann
On Thu, Sep 24, 2020 at 12:02:55PM +0200, Joerg Roedel wrote: > On Thu, Sep 24, 2020 at 05:38:13AM -0400, Michael S. Tsirkin wrote: > > On Thu, Sep 24, 2020 at 11:21:29AM +0200, Joerg Roedel wrote: > > > On Thu, Sep 24, 2020 at 05:00:35AM -0400, Michael S. Tsirkin wrote: > > > > OK so this looks

Re: [virtio-dev] Re: [PATCH v3 0/6] Add virtio-iommu built-in topology

2020-09-25 Thread Gerd Hoffmann
Hi, > Many power platforms are OF based, thus without ACPI or DT support. pseries has lots of stuff below /proc/device-tree. Dunno whenever that is the same kind of device tree we have on arm ... take care, Gerd ___ Virtualization mailing list

Re: [PATCH v4 0/3] Support virtio cross-device resources

2020-05-28 Thread Gerd Hoffmann
On Tue, May 26, 2020 at 07:58:08PM +0900, David Stevens wrote: > This patchset implements the current proposal for virtio cross-device > resource sharing [1]. It will be used to import virtio resources into > the virtio-video driver currently under discussion [2]. The patch > under consideration

Re: Potential Memory Leak Bugs in drivers/gpu/drm/virtio/virtgpu_vq.c (Linux 5.6).

2020-05-28 Thread Gerd Hoffmann
On Thu, May 28, 2020 at 03:57:05PM +0800, Dongyang Zhan wrote: > Hi, > My name is Dongyang Zhan, I am a security researcher. > Currently, I found two possible memory bugs in > drivers/gpu/drm/virtio/virtgpu_vq.c (Linux 5.6). > I hope you can help me to confirm them. Thank you. Sorry. Not

Re: [PATCH v2 11/24] virtio_input: correct tags for config space fields

2020-08-04 Thread Gerd Hoffmann
+ __le32 res; > }; > > struct virtio_input_devids { > - __u16 bustype; > - __u16 vendor; > - __u16 product; > - __u16 version; > + __le16 bustype; > + __le16 vendor; > + __le16 pro

Re: [PATCH] drm/virtio: fix memory leak in virtio_gpu_cleanup_object()

2020-08-07 Thread Gerd Hoffmann
On Wed, Jul 22, 2020 at 01:18:51PM +0800, Xin He wrote: > Before setting shmem->pages to NULL, kfree() should > be called. > sg_free_table(shmem->pages); > + kfree(shmem->pages); > shmem->pages = NULL; Pushed to drm-misc-fixes.

[PATCH] drm/virtio: fix unblank

2020-08-07 Thread Gerd Hoffmann
.net Fixes: 3954ff10e06e ("drm/virtio: skip set_scanout if framebuffer didn't change") Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 + drivers/gpu/drm/virtio/virtgpu_display.c | 1 + drivers/gpu/drm/virtio/virtgpu_plane.c | 4 +++- 3 files changed, 5 inser

[PATCH v2] drm/qxl: don't take vga ports on rev5+

2020-08-07 Thread Gerd Hoffmann
qemu 5.0 introduces a new qxl hardware revision 5. Unlike revision 4 (and below) the device doesn't switch back into vga compatibility mode when someone touches the vga ports. So we don't have to reserve the vga ports any more to avoid that happening. Signed-off-by: Gerd Hoffmann --- drivers

Re: [PATCH v3 10/38] virtio_gpu: correct tags for config space fields

2020-08-07 Thread Gerd Hoffmann
On Wed, Aug 05, 2020 at 09:43:42AM -0400, Michael S. Tsirkin wrote: > Since gpu is a modern-only device, > tag config space fields as having little endian-ness. > > Signed-off-by: Michael S. Tsirkin > Reviewed-by: Cornelia Huck Reviewed-by

Re: [PATCH v3 34/38] drm/virtio: convert to LE accessors

2020-08-07 Thread Gerd Hoffmann
On Wed, Aug 05, 2020 at 09:44:48AM -0400, Michael S. Tsirkin wrote: > Virtgpu is modern-only. Use LE accessors for config space. > > Signed-off-by: Michael S. Tsirkin Reviewed-by: Gerd Hoffmann ___ Virtualization mailing list Virtu

Re: [PATCH v3] drm/virtio: fix missing dma_fence_put() in virtio_gpu_execbuffer_ioctl()

2020-08-07 Thread Gerd Hoffmann
On Tue, Jul 21, 2020 at 06:16:47PM +0800, Xin He wrote: > From: Qi Liu > > We should put the reference count of the fence after calling > virtio_gpu_cmd_submit(). So add the missing dma_fence_put(). > virtio_gpu_cmd_submit(vgdev, buf, exbuf->size, >

Re: [PATCH 2/2] drm/virtio: Remove open-coded commit-tail function

2020-07-09 Thread Gerd Hoffmann
On Thu, Jul 09, 2020 at 02:33:39PM +0200, Daniel Vetter wrote: > Exactly matches the one in the helpers. > > This avoids me having to roll out dma-fence critical section > annotations to this copy. > > Signed-off-by: Daniel Vetter > Cc: David Airlie > Cc: Gerd Hoffma

[PATCH] drm/virtio: fix unblank

2020-06-12 Thread Gerd Hoffmann
uffer didn't change") Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 + drivers/gpu/drm/virtio/virtgpu_display.c | 1 + drivers/gpu/drm/virtio/virtgpu_plane.c | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/virtio/virtgp

Re: [PATCH v2 04/20] drm/bochs: Remove references to struct drm_device.pdev

2020-12-02 Thread Gerd Hoffmann
On Tue, Dec 01, 2020 at 11:35:26AM +0100, Thomas Zimmermann wrote: > Using struct drm_device.pdev is deprecated. Convert bochs to struct > drm_device.dev. No functional changes. > > Signed-off-by: Thomas Zimmermann > Acked-by: Sam Ravnborg > Cc: Gerd Hoffmann Acked

Re: [PATCH v2 05/20] drm/cirrus: Remove references to struct drm_device.pdev

2020-12-02 Thread Gerd Hoffmann
On Tue, Dec 01, 2020 at 11:35:27AM +0100, Thomas Zimmermann wrote: > Using struct drm_device.pdev is deprecated. Convert cirrus to struct > drm_device.dev. No functional changes. > > Signed-off-by: Thomas Zimmermann > Acked-by: Sam Ravnborg > Cc: Gerd Hoffmann Acked

Re: [PATCH v2 14/20] drm/qxl: Remove references to struct drm_device.pdev

2020-12-02 Thread Gerd Hoffmann
On Tue, Dec 01, 2020 at 11:35:36AM +0100, Thomas Zimmermann wrote: > Using struct drm_device.pdev is deprecated. Convert qxl to struct > drm_device.dev. No functional changes. > > Signed-off-by: Thomas Zimmermann > Acked-by: Sam Ravnborg > Cc: Gerd Hoffmann Acked

Re: [PATCH v2 18/20] drm/virtgpu: Remove references to struct drm_device.pdev

2020-12-02 Thread Gerd Hoffmann
On Tue, Dec 01, 2020 at 11:35:40AM +0100, Thomas Zimmermann wrote: > Using struct drm_device.pdev is deprecated. Convert virtgpu to struct > drm_device.dev. No functional changes. > > Signed-off-by: Thomas Zimmermann > Acked-by: Sam Ravnborg > Cc: Gerd Hoffmann Acked

Re: [PATCH] drivers: gpu: drm: virtio: fix dependency of DRM_VIRTIO_GPU on VIRTIO

2020-12-22 Thread Gerd Hoffmann
On Fri, Dec 04, 2020 at 02:12:21PM +0100, Enrico Weigelt, metux IT consult wrote: > VIRTIO itself has no dependencies and therefore can easily be just > select'ed, instead of depending on it. The current depends on causes > any others trying to select VIRTIO to fail like this: > >

Re: [PATCH -next] drm/virtio: Make virtgpu_dmabuf_ops with static keyword

2020-11-15 Thread Gerd Hoffmann
On Sat, Nov 14, 2020 at 03:16:13PM +0800, Zou Wei wrote: > Fix the following sparse warning: > > ./virtgpu_prime.c:46:33: warning: symbol 'virtgpu_dmabuf_ops' was not > declared. Should it be static? Pushed to drm-misc-next. thanks, Gerd ___

Re: [PATCH 3/3] drm/qxl: Remove fbcon acceleration leftovers

2020-10-29 Thread Gerd Hoffmann
On Thu, Oct 29, 2020 at 11:14:28AM +0100, Daniel Vetter wrote: > These are leftovers from 13aff184ed9f ("drm/qxl: remove dead qxl fbdev > emulation code"). Acked-by: Gerd Hoffmann ___ Virtualization mailing list Virtualiza

<    5   6   7   8   9   10   11   12   >