Commit 3daed63
VMCI: Use threaded irqs instead of tasklets
The vmci_dispatch_dgs() tasklet function calls vmci_read_data()
which uses wait_event() resulting in invalid sleep in an atomic
context (and therefore potentially in a deadlock).
Use threaded irqs to fix this issue and completely remove usage
of tasklets.
[ 20.264639] BUG: sleeping function called from invalid context at drivers/misc/vmw_vmci/vmci_guest.c:145
[ 20.264643] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 762, name: vmtoolsd
[ 20.264645] preempt_count: 101, expected: 0
[ 20.264646] RCU nest depth: 0, expected: 0
[ 20.264647] 1 lock held by vmtoolsd/762:
[ 20.264648] #0: ffff0000874ae440 (sk_lock-AF_VSOCK){+.+.}-{0:0}, at: vsock_connect+0x60/0x330 [vsock]
[ 20.264658] Preemption disabled at:
[ 20.264659] [<ffff80000151d7d8>] vmci_send_datagram+0x44/0xa0 [vmw_vmci]
[ 20.264665] CPU: 0 PID: 762 Comm: vmtoolsd Not tainted 5.19.0-0.rc8.20220727git39c3c396f813.60.fc37.aarch64 #1
[ 20.264667] Hardware name: VMware, Inc. VBSA/VBSA, BIOS VEFI 12/31/2020
[ 20.264668] Call trace:
[ 20.264669] dump_backtrace+0xc4/0x130
[ 20.264672] show_stack+0x24/0x80
[ 20.264673] dump_stack_lvl+0x88/0xb4
[ 20.264676] dump_stack+0x18/0x34
[ 20.264677] __might_resched+0x1a0/0x280
[ 20.264679] __might_sleep+0x58/0x90
[ 20.264681] vmci_read_data+0x74/0x120 [vmw_vmci]
[ 20.264683] vmci_dispatch_dgs+0x64/0x204 [vmw_vmci]
[ 20.264686] tasklet_action_common.constprop.0+0x13c/0x150
[ 20.264688] tasklet_action+0x40/0x50
[ 20.264689] __do_softirq+0x23c/0x6b4
[ 20.264690] __irq_exit_rcu+0x104/0x214
[ 20.264691] irq_exit_rcu+0x1c/0x50
[ 20.264693] el1_interrupt+0x38/0x6c
[ 20.264695] el1h_64_irq_handler+0x18/0x24
[ 20.264696] el1h_64_irq+0x68/0x6c
[ 20.264697] preempt_count_sub+0xa4/0xe0
[ 20.264698] _raw_spin_unlock_irqrestore+0x64/0xb0
[ 20.264701] vmci_send_datagram+0x7c/0xa0 [vmw_vmci]
[ 20.264703] vmci_datagram_dispatch+0x84/0x100 [vmw_vmci]
[ 20.264706] vmci_datagram_send+0x2c/0x40 [vmw_vmci]
[ 20.264709] vmci_transport_send_control_pkt+0xb8/0x120 [vmw_vsock_vmci_transport]
[ 20.264711] vmci_transport_connect+0x40/0x7c [vmw_vsock_vmci_transport]
[ 20.264713] vsock_connect+0x278/0x330 [vsock]
[ 20.264715] __sys_connect_file+0x8c/0xc0
[ 20.264718] __sys_connect+0x84/0xb4
[ 20.264720] __arm64_sys_connect+0x2c/0x3c
[ 20.264721] invoke_syscall+0x78/0x100
[ 20.264723] el0_svc_common.constprop.0+0x68/0x124
[ 20.264724] do_el0_svc+0x38/0x4c
[ 20.264725] el0_svc+0x60/0x180
[ 20.264726] el0t_64_sync_handler+0x11c/0x150
[ 20.264728] el0t_64_sync+0x190/0x194
Signed-off-by: Vishnu Dasa <[email protected]>
Suggested-by: Zack Rusin <[email protected]>
Reported-by: Nadav Amit <[email protected]>
Reported-by: Nathan Chancellor <[email protected]>
Tested-by: Nathan Chancellor <[email protected]>
Fixes: 463713e ("VMCI: dma dg: add support for DMA datagrams receive")
Cc: <[email protected]> # v5.18+
Cc: VMware PV-Drivers Reviewers <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Bryan Tan <[email protected]>
Reviewed-by: Bryan Tan <[email protected]>
Reviewed-by: Zack Rusin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent aaca766 commit 3daed63
1 file changed
+19
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
61 | 59 | | |
62 | 60 | | |
63 | 61 | | |
| |||
304 | 302 | | |
305 | 303 | | |
306 | 304 | | |
307 | | - | |
| 305 | + | |
308 | 306 | | |
309 | | - | |
310 | 307 | | |
311 | 308 | | |
312 | 309 | | |
| |||
465 | 462 | | |
466 | 463 | | |
467 | 464 | | |
468 | | - | |
| 465 | + | |
469 | 466 | | |
470 | | - | |
471 | | - | |
472 | 467 | | |
473 | 468 | | |
474 | 469 | | |
| |||
486 | 481 | | |
487 | 482 | | |
488 | 483 | | |
489 | | - | |
490 | | - | |
| 484 | + | |
| 485 | + | |
491 | 486 | | |
492 | 487 | | |
493 | 488 | | |
494 | 489 | | |
495 | | - | |
| 490 | + | |
496 | 491 | | |
497 | 492 | | |
498 | 493 | | |
| |||
502 | 497 | | |
503 | 498 | | |
504 | 499 | | |
505 | | - | |
| 500 | + | |
506 | 501 | | |
507 | 502 | | |
508 | 503 | | |
509 | 504 | | |
510 | | - | |
| 505 | + | |
511 | 506 | | |
512 | 507 | | |
513 | 508 | | |
| |||
536 | 531 | | |
537 | 532 | | |
538 | 533 | | |
539 | | - | |
| 534 | + | |
540 | 535 | | |
541 | 536 | | |
542 | 537 | | |
| |||
638 | 633 | | |
639 | 634 | | |
640 | 635 | | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | 636 | | |
646 | 637 | | |
647 | 638 | | |
| |||
808 | 799 | | |
809 | 800 | | |
810 | 801 | | |
811 | | - | |
812 | | - | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
813 | 805 | | |
814 | 806 | | |
815 | 807 | | |
| |||
823 | 815 | | |
824 | 816 | | |
825 | 817 | | |
826 | | - | |
827 | | - | |
828 | | - | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
829 | 821 | | |
830 | 822 | | |
831 | 823 | | |
832 | 824 | | |
833 | 825 | | |
834 | 826 | | |
835 | 827 | | |
836 | | - | |
837 | | - | |
838 | | - | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
839 | 833 | | |
840 | 834 | | |
841 | 835 | | |
| |||
871 | 865 | | |
872 | 866 | | |
873 | 867 | | |
874 | | - | |
875 | | - | |
876 | 868 | | |
877 | 869 | | |
878 | 870 | | |
| |||
943 | 935 | | |
944 | 936 | | |
945 | 937 | | |
946 | | - | |
947 | | - | |
948 | | - | |
949 | 938 | | |
950 | 939 | | |
951 | 940 | | |
| |||
0 commit comments