Re: [PATCH v5 3/5] vduse: Support using userspace pages as bounce buffer

2022-08-19 Thread Mike Galbraith
Greetings,

On Wed, 2022-08-03 at 12:55 +0800, Xie Yongji wrote:
>
> diff --git a/drivers/vdpa/vdpa_user/iova_domain.h 
> b/drivers/vdpa/vdpa_user/iova_domain.h
> index 2722d9b8e21a..4e0e50e7ac15 100644
> --- a/drivers/vdpa/vdpa_user/iova_domain.h
> +++ b/drivers/vdpa/vdpa_user/iova_domain.h
> @@ -14,6 +14,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
   

Erm, that should be spinlock.h.

#ifndef __LINUX_RWLOCK_H
#define __LINUX_RWLOCK_H

#ifndef __LINUX_SPINLOCK_H
# error "please don't include this file directly"
#endif

This belated comment inspired by PREEMPT_RT build meeting the above :)

-Mike
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [bisected] Re: drm, qxl: post 5.11 merge warning+explosion

2020-12-17 Thread Mike Galbraith
On Thu, 2020-12-17 at 17:38 +0100, Christian König wrote:
>
> Mike can you test the attached patch?

Yup, one-liner made it all better. That was quick like bunny.

-Mike

___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization


Re: [bisected] Re: drm, qxl: post 5.11 merge warning+explosion

2020-12-17 Thread Mike Galbraith
On Thu, 2020-12-17 at 17:24 +0100, Christian König wrote:
> Hi Mike,
>
> what exactly is the warning from qxl you are seeing?

[1.815561] WARNING: CPU: 7 PID: 355 at drivers/gpu/drm/ttm/ttm_pool.c:365 
ttm_pool_alloc+0x41b/0x540 [ttm]
[1.815561] Modules linked in: ext4(E) crc16(E) mbcache(E) jbd2(E) 
ata_generic(E) ata_piix(E) virtio_console(E) virtio_rng(E) virtio_blk(E) qxl(E) 
drm_ttm_helper(E) ttm(E) drm_kms_helper(E) syscopyarea(E) sysfillrect(E) 
sysimgblt(E) ahci(E) fb_sys_fops(E) cec(E) libahci(E) uhci_hcd(E) ehci_pci(E) 
rc_core(E) ehci_hcd(E) crc32c_intel(E) serio_raw(E) virtio_pci(E) 
virtio_ring(E) 8139cp(E) virtio(E) libata(E) drm(E) usbcore(E) mii(E) sg(E) 
dm_multipath(E) dm_mod(E) scsi_dh_rdac(E) scsi_dh_emc(E) scsi_dh_alua(E) 
scsi_mod(E) autofs4(E)
[1.815589] CPU: 7 PID: 355 Comm: kworker/7:2 Tainted: GE 
5.10.0.g489e9fe-master #26
[1.815590] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 
rel-1.12.0-59-gc9ba527-rebuilt.opensuse.org 04/01/2014
[1.815614] Workqueue: events drm_fb_helper_dirty_work [drm_kms_helper]
[1.815621] RIP: 0010:ttm_pool_alloc+0x41b/0x540 [ttm]
[1.815623] Code: fc ff ff 89 ea 48 8d 04 d5 00 00 00 00 48 29 d0 48 8d 3c 
c5 00 1c 40 a0 e9 d7 fc ff ff 85 c0 0f 89 2f fc ff ff e9 28 fc ff ff <0f> 0b e9 
35 fc ff ff 89 e9 49 8b 7d 00 b8 00 10 00 00 48 d3 e0 45
[1.815623] RSP: 0018:888105d3b818 EFLAGS: 00010246
[1.815625] RAX:  RBX: 888106978800 RCX: 
[1.815626] RDX: 888105d3bc68 RSI: 0001 RDI: 888106238820
[1.815626] RBP: 888106238758 R08: c9296000 R09: 816b
[1.815627] R10: 0001 R11: c9296000 R12: 
[1.815628] R13: 888106238820 R14:  R15: 888106978800
[1.815628] FS:  () GS:888237dc() 
knlGS:
[1.815632] CS:  0010 DS:  ES:  CR0: 80050033
[1.815633] CR2: 7eff52a0d5b8 CR3: 02010003 CR4: 001706e0
[1.815633] Call Trace:
[1.815644]  ttm_tt_populate+0xb1/0xc0 [ttm]
[1.815647]  ttm_bo_move_memcpy+0x4a5/0x500 [ttm]
[1.815652]  qxl_bo_move+0x230/0x2f0 [qxl]
[1.815655]  ttm_bo_handle_move_mem+0x79/0x140 [ttm]
[1.815657]  ttm_bo_evict+0x124/0x250 [ttm]
[1.815693]  ? drm_mm_insert_node_in_range+0x55c/0x580 [drm]
[1.815696]  ttm_mem_evict_first+0x110/0x3d0 [ttm]
[1.815698]  ttm_bo_mem_space+0x261/0x270 [ttm]
[1.815702]  ? qxl_ttm_debugfs_init+0xb0/0xb0 [qxl]
[1.815705]  ttm_bo_validate+0x117/0x150 [ttm]
[1.815756]  ttm_bo_init_reserved+0x2c8/0x3c0 [ttm]
[1.815772]  qxl_bo_create+0x134/0x1d0 [qxl]
[1.815775]  ? qxl_ttm_debugfs_init+0xb0/0xb0 [qxl]
[1.815791]  qxl_alloc_bo_reserved+0x2c/0x90 [qxl]
[1.815794]  qxl_image_alloc_objects+0xa3/0x120 [qxl]
[1.815797]  qxl_draw_dirty_fb+0x155/0x450 [qxl]
[1.815815]  ? _cond_resched+0x15/0x40
[1.815819]  ? ww_mutex_lock_interruptible+0x12/0x60
[1.815822]  qxl_framebuffer_surface_dirty+0x14f/0x1a0 [qxl]
[1.815841]  drm_fb_helper_dirty_work+0x11d/0x180 [drm_kms_helper]
[1.815853]  process_one_work+0x1f5/0x3c0
[1.815866]  ? process_one_work+0x3c0/0x3c0
[1.815867]  worker_thread+0x2d/0x3d0
[1.815868]  ? process_one_work+0x3c0/0x3c0
[1.815872]  kthread+0x117/0x130
[1.815876]  ? kthread_park+0x90/0x90
[1.815880]  ret_from_fork+0x1f/0x30
[1.815886] ---[ end trace 51e464c1e89a1728 ]---
[1.815894] BUG: kernel NULL pointer dereference, address: 0230
[1.815895] #PF: supervisor read access in kernel mode
[1.815895] #PF: error_code(0x) - not-present page
[1.815896] PGD 0 P4D 0
[1.815898] Oops:  [#1] SMP NOPTI
[1.815900] CPU: 7 PID: 355 Comm: kworker/7:2 Tainted: GW   E 
5.10.0.g489e9fe-master #26
[1.815901] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 
rel-1.12.0-59-gc9ba527-rebuilt.opensuse.org 04/01/2014
[1.815916] Workqueue: events drm_fb_helper_dirty_work [drm_kms_helper]
[1.815921] RIP: 0010:dma_map_page_attrs+0xf/0x1c0
[1.815922] Code: 1f 17 5b 01 48 85 c0 75 e3 31 c0 c3 66 66 2e 0f 1f 84 00 
00 00 00 00 0f 1f 40 00 0f 1f 44 00 00 41 55 41 54 55 53 48 83 ec 08 <48> 8b 87 
30 02 00 00 48 85 c0 48 0f 44 05 e7 16 5b 01 41 83 f8 02
[1.815923] RSP: 0018:888105d3b7e8 EFLAGS: 00010296
[1.815924] RAX: 1000 RBX: 0001 RCX: 1000
[1.815924] RDX:  RSI: ea0004171e40 RDI: 
[1.815925] RBP:  R08:  R09: 
[1.815925] R10: ea0004171e40 R11: c9296000 R12: 0001
[1.815926] R13: 888106238820 R14: 888105d07100 R15: 888106978800
[1.815926] FS:  () GS:888237dc() 
knlGS:
[1.815928] CS:  0010 DS:  ES:  CR0: 80050033
[

[bisected] Re: drm, qxl: post 5.11 merge warning+explosion

2020-12-17 Thread Mike Galbraith
ee5d2a8e549e90325fcc31825269f89647cd6fac is the first bad commit
commit ee5d2a8e549e90325fcc31825269f89647cd6fac
Author: Christian König 
Date:   Sat Oct 24 13:10:28 2020 +0200

drm/ttm: wire up the new pool as default one v2

Provide the necessary parameters by all drivers and use the new pool alloc
when no driver specific function is provided.

v2: fix the GEM VRAM helpers

Signed-off-by: Christian König 
Reviewed-by: Dave Airlie 
Reviewed-by: Madhav Chauhan 
Tested-by: Huang Rui 
Link: https://patchwork.freedesktop.org/patch/397081/?series=83051=1

 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c |  4 ++--
 drivers/gpu/drm/drm_gem_vram_helper.c   |  4 ++--
 drivers/gpu/drm/nouveau/nouveau_ttm.c   | 14 +-
 drivers/gpu/drm/qxl/qxl_ttm.c   |  5 ++---
 drivers/gpu/drm/radeon/radeon_ttm.c |  4 ++--
 drivers/gpu/drm/ttm/ttm_bo.c|  8 ++--
 drivers/gpu/drm/ttm/ttm_memory.c|  2 +-
 drivers/gpu/drm/ttm/ttm_tt.c|  5 ++---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c |  5 +++--
 include/drm/ttm/ttm_bo_driver.h | 11 +++
 10 files changed, 36 insertions(+), 26 deletions(-)

git bisect start 'drivers/gpu/drm/qxl'
# good: [2c85ebc57b3e1817b6ce1a6b703928e113a90442] Linux 5.10
git bisect good 2c85ebc57b3e1817b6ce1a6b703928e113a90442
# bad: [accefff5b547a9a1d959c7e76ad539bf2480e78b] Merge tag 
'arm-soc-omap-genpd-5.11' of 
git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
git bisect bad accefff5b547a9a1d959c7e76ad539bf2480e78b
# bad: [d635a69dd4981cc51f90293f5f64268620ed1565] Merge tag 'net-next-5.11' of 
git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next
git bisect bad d635a69dd4981cc51f90293f5f64268620ed1565
# bad: [0ca2ce81eb8ee30f3ba8ac7967fef9cfbb44dbdb] Merge tag 'arm64-upstream' of 
git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
git bisect bad 0ca2ce81eb8ee30f3ba8ac7967fef9cfbb44dbdb
# bad: [f8aab60422c371425365d386dfd51e0c6c5b1041] drm/amdgpu: Initialise 
drm_gem_object_funcs for imported BOs
git bisect bad f8aab60422c371425365d386dfd51e0c6c5b1041
# bad: [c0f98d2f8b076bf3e3183aa547395f919c943a14] Merge tag 
'drm-misc-next-2020-11-05' of git://anongit.freedesktop.org/drm/drm-misc into 
drm-next
git bisect bad c0f98d2f8b076bf3e3183aa547395f919c943a14
# good: [6a6e5988a2657cd0c91f6f1a3e7d194599248b6d] drm/ttm: replace last 
move_notify with delete_mem_notify
git bisect good 6a6e5988a2657cd0c91f6f1a3e7d194599248b6d
# good: [f566fdcd6cc49a9d5b5d782f56e3e7cb243f01b8] drm/i915: Force VT'd 
workarounds when running as a guest OS
git bisect good f566fdcd6cc49a9d5b5d782f56e3e7cb243f01b8
# good: [e76ab2cf21c38331155ea613cdf18582f011c30f] drm/i915: Remove 
per-platform IIR HPD masking
git bisect good e76ab2cf21c38331155ea613cdf18582f011c30f
# bad: [268af50f38b1f2199a2e85e38073d7a25c20190c] drm/panfrost: Support 
cache-coherent integrations
git bisect bad 268af50f38b1f2199a2e85e38073d7a25c20190c
# good: [e000650375b65ff77c5ee852b5086f58c741179e] fbdev/atafb: Remove unused 
extern variables
git bisect good e000650375b65ff77c5ee852b5086f58c741179e
# bad: [461619f5c3242aaee9ec3f0b7072719bd86ea207] drm/nouveau: switch to new 
allocator
git bisect bad 461619f5c3242aaee9ec3f0b7072719bd86ea207
# good: [d099fc8f540add80f725014fdd4f7f49f3c58911] drm/ttm: new TT backend 
allocation pool v3
git bisect good d099fc8f540add80f725014fdd4f7f49f3c58911
# bad: [e93b2da9799e5cb97760969f3e1f02a5bdac29fe] drm/amdgpu: switch to new 
allocator v2
git bisect bad e93b2da9799e5cb97760969f3e1f02a5bdac29fe
# bad: [ee5d2a8e549e90325fcc31825269f89647cd6fac] drm/ttm: wire up the new pool 
as default one v2
git bisect bad ee5d2a8e549e90325fcc31825269f89647cd6fac
# first bad commit: [ee5d2a8e549e90325fcc31825269f89647cd6fac] drm/ttm: wire up 
the new pool as default one v2

___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization


Re: drm, qxl: post 5.11 merge warning+explosion

2020-12-16 Thread Mike Galbraith


On Wed, 2020-12-16 at 03:41 +0100, Mike Galbraith wrote:
> Little kvm works fine with nomodeset, so will be busy for a while
> bisecting two other problems that popped up here this cycle. (hohum)
>
> [1.815561] WARNING: CPU: 7 PID: 355 at drivers/gpu/drm/ttm/ttm_pool.c:365 
> ttm_pool_alloc+0x41b/0x540 [ttm]
> [1.815561] Modules linked in: ext4(E) crc16(E) mbcache(E) jbd2(E) 
> ata_generic(E) ata_piix(E) virtio_console(E) virtio_rng(E) virtio_blk(E) 
> qxl(E) drm_ttm_helper(E) ttm(E) drm_kms_helper(E) syscopyarea(E) 
> sysfillrect(E) sysimgblt(E) ahci(E) fb_sys_fops(E) cec(E) libahci(E) 
> uhci_hcd(E) ehci_pci(E) rc_core(E) ehci_hcd(E) crc32c_intel(E) serio_raw(E) 
> virtio_pci(E) virtio_ring(E) 8139cp(E) virtio(E) libata(E) drm(E) usbcore(E) 
> mii(E) sg(E) dm_multipath(E) dm_mod(E) scsi_dh_rdac(E) scsi_dh_emc(E) 
> scsi_dh_alua(E) scsi_mod(E) autofs4(E)
> [1.815589] CPU: 7 PID: 355 Comm: kworker/7:2 Tainted: GE 
> 5.10.0.g489e9fe-master #26
> [1.815590] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 
> rel-1.12.0-59-gc9ba527-rebuilt.opensuse.org 04/01/2014
> [1.815614] Workqueue: events drm_fb_helper_dirty_work [drm_kms_helper]
> [1.815621] RIP: 0010:ttm_pool_alloc+0x41b/0x540 [ttm]
> [1.815623] Code: fc ff ff 89 ea 48 8d 04 d5 00 00 00 00 48 29 d0 48 8d 3c 
> c5 00 1c 40 a0 e9 d7 fc ff ff 85 c0 0f 89 2f fc ff ff e9 28 fc ff ff <0f> 0b 
> e9 35 fc ff ff 89 e9 49 8b 7d 00 b8 00 10 00 00 48 d3 e0 45
> [1.815623] RSP: 0018:888105d3b818 EFLAGS: 00010246
> [1.815625] RAX:  RBX: 888106978800 RCX: 
> 
> [1.815626] RDX: 888105d3bc68 RSI: 0001 RDI: 
> 888106238820
> [1.815626] RBP: 888106238758 R08: c9296000 R09: 
> 816b
> [1.815627] R10: 0001 R11: c9296000 R12: 
> 
> [1.815628] R13: 888106238820 R14:  R15: 
> 888106978800
> [1.815628] FS:  () GS:888237dc() 
> knlGS:
> [1.815632] CS:  0010 DS:  ES:  CR0: 80050033
> [1.815633] CR2: 7eff52a0d5b8 CR3: 02010003 CR4: 
> 001706e0
> [1.815633] Call Trace:
> [1.815644]  ttm_tt_populate+0xb1/0xc0 [ttm]
> [1.815647]  ttm_bo_move_memcpy+0x4a5/0x500 [ttm]
> [1.815652]  qxl_bo_move+0x230/0x2f0 [qxl]
> [1.815655]  ttm_bo_handle_move_mem+0x79/0x140 [ttm]
> [1.815657]  ttm_bo_evict+0x124/0x250 [ttm]
> [1.815693]  ? drm_mm_insert_node_in_range+0x55c/0x580 [drm]
> [1.815696]  ttm_mem_evict_first+0x110/0x3d0 [ttm]
> [1.815698]  ttm_bo_mem_space+0x261/0x270 [ttm]
> [1.815702]  ? qxl_ttm_debugfs_init+0xb0/0xb0 [qxl]
> [1.815705]  ttm_bo_validate+0x117/0x150 [ttm]
> [1.815756]  ttm_bo_init_reserved+0x2c8/0x3c0 [ttm]
> [1.815772]  qxl_bo_create+0x134/0x1d0 [qxl]
> [1.815775]  ? qxl_ttm_debugfs_init+0xb0/0xb0 [qxl]
> [1.815791]  qxl_alloc_bo_reserved+0x2c/0x90 [qxl]
> [1.815794]  qxl_image_alloc_objects+0xa3/0x120 [qxl]
> [1.815797]  qxl_draw_dirty_fb+0x155/0x450 [qxl]
> [1.815815]  ? _cond_resched+0x15/0x40
> [1.815819]  ? ww_mutex_lock_interruptible+0x12/0x60
> [1.815822]  qxl_framebuffer_surface_dirty+0x14f/0x1a0 [qxl]
> [1.815841]  drm_fb_helper_dirty_work+0x11d/0x180 [drm_kms_helper]
> [1.815853]  process_one_work+0x1f5/0x3c0
> [1.815866]  ? process_one_work+0x3c0/0x3c0
> [1.815867]  worker_thread+0x2d/0x3d0
> [1.815868]  ? process_one_work+0x3c0/0x3c0
> [1.815872]  kthread+0x117/0x130
> [1.815876]  ? kthread_park+0x90/0x90
> [1.815880]  ret_from_fork+0x1f/0x30
> [1.815886] ---[ end trace 51e464c1e89a1728 ]---
> [1.815894] BUG: kernel NULL pointer dereference, address: 0230
> [1.815895] #PF: supervisor read access in kernel mode
> [1.815895] #PF: error_code(0x) - not-present page
> [1.815896] PGD 0 P4D 0
> [1.815898] Oops:  [#1] SMP NOPTI
> [1.815900] CPU: 7 PID: 355 Comm: kworker/7:2 Tainted: GW   E 
> 5.10.0.g489e9fe-master #26
> [1.815901] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 
> rel-1.12.0-59-gc9ba527-rebuilt.opensuse.org 04/01/2014
> [1.815916] Workqueue: events drm_fb_helper_dirty_work [drm_kms_helper]
> [1.815921] RIP: 0010:dma_map_page_attrs+0xf/0x1c0
> [1.815922] Code: 1f 17 5b 01 48 85 c0 75 e3 31 c0 c3 66 66 2e 0f 1f 84 00 
> 00 00 00 00 0f 1f 40 00 0f 1f 44 00 00 41 55 41 54 55 53 48 83 ec 08 <48> 8b 
> 87 30 02 00 00 48 85 c0 48 0f 44 05 e7 16 5b 01 41 83 f8 02
> [1.815923] RSP: 0018:888105d3b7e8 EFLAGS: 00010296
> [1.815924] RAX: 1000 RBX: 0001 

Re: v4.14.21+: ATOMIC_SLEEP splat bisected to 9428088c90b6 ("drm/qxl: reapply cursor after resetting primary")

2018-06-17 Thread Mike Galbraith
On Mon, 2018-06-18 at 12:33 +1000, Dave Airlie wrote:
> On 17 June 2018 at 21:02, Greg KH  wrote:
> > On Sun, Jun 17, 2018 at 12:38:06PM +0200, Mike Galbraith wrote:
> >> On Sun, 2018-06-17 at 11:36 +0200, Greg KH wrote:
> >> >
> >> > And if you revert that patch, does everything work again?
> >>
> >> Yes.
> >
> > Great, Dave, care to revert this in 4.18 so I can queue up that revert
> > in older kernels as well?
> >
> > thanks,
> >
> > greg k-h
> 
> Hi MIke,
> 
> Does
> https://patchwork.freedesktop.org/patch/229980/
> 
> fix it?

Yup.

-Mike
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization


Re: v4.14.21+: ATOMIC_SLEEP splat bisected to 9428088c90b6 ("drm/qxl: reapply cursor after resetting primary")

2018-06-17 Thread Mike Galbraith
On Sun, 2018-06-17 at 11:36 +0200, Greg KH wrote:
> 
> And if you revert that patch, does everything work again?

Yes.

-Mike
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization


Re: [PATCH] virtio_console: fix uninitialized variable use

2017-04-24 Thread Mike Galbraith
On Wed, 2017-03-29 at 23:27 +0300, Michael S. Tsirkin wrote:

> Hi Mike
>   if you like, pls send me your Signed-off-by and I'll
>   change the patch to make you an author.

Nah, it's perfect as it is.  While I was pretty darn sure it was
generic, I intentionally posted it as diagnostic info.

>   More importantly, pls let me know whether this helps
>   resolve the issues about hybernation for you!

Well, it prevents kaboom with VIRTIO_CONSOLE_F_MULTIPORT turned off,
but no, it does nada wrt the warnings.

-Mike
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization


Re: [PATCH v12 09/11] pvqspinlock, x86: Add para-virtualization support

2014-10-27 Thread Mike Galbraith
On Sat, 2014-10-25 at 00:04 +0200, Peter Zijlstra wrote: 
 On Fri, Oct 24, 2014 at 04:53:27PM -0400, Waiman Long wrote:
  The additional register pressure may just cause a few more register moves
  which should be negligible in the overall performance . The additional
  icache pressure, however, may have some impact on performance. I was trying
  to balance the performance of the pv and non-pv versions so that we won't
  penalize the pv code too much for a bit more performance in the non-pv code.
  Doing it your way will add a lot of function call and register
  saving/restoring to the pv code.
 
 If people care about performance they should not be using virt crap :-)

I tried some benching recently.. where did they hide the fastpaths? :)

-Mike

___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization