nutanix / libvfio-user

framework for emulating devices in userspace
BSD 3-Clause "New" or "Revised" License
166 stars 51 forks source link

gpio-pci-idio-16 system crash #54

Closed yuvalk closed 3 years ago

yuvalk commented 4 years ago
[ 1418.366630] muser muser: muser_iommu_dma_map: DMA map vaddr=0x7f7cf7e00000 iova=0x0-0xa0000
[ 1418.366631] muser muser: find_file_for_vaddr: no file for vaddr=0x7f7cf7e00000
[ 1418.366632] muser muser: muser_iommu_dma_map: DMA map vaddr=0x7f7f0ca20000 iova=0xe0000-0x100000
[ 1418.366633] muser muser: find_file_for_vaddr: no file for vaddr=0x7f7f0ca20000
[ 1418.366633] muser muser: muser_iommu_dma_map: DMA map vaddr=0x7f7db7e00000 iova=0x100000000-0x200000000
[ 1418.366634] muser muser: find_file_for_vaddr: no file for vaddr=0x7f7db7e00000
[ 1418.366634] muser muser: muser_iommu_dma_map: DMA map vaddr=0x7f7f0ca00000 iova=0xfffc0000-0x100000000
[ 1418.366635] muser muser: find_file_for_vaddr: no file for vaddr=0x7f7f0ca00000
[ 1418.366635] muser muser: muser_iommu_dma_map: DMA map vaddr=0x7f7cf7f00000 iova=0x100000-0xc0000000
[ 1418.366636] muser muser: find_file_for_vaddr: no file for vaddr=0x7f7cf7f00000
[ 1418.366636] muser muser: muser_iommu_dma_map: DMA map vaddr=0x7f7f0c800000 iova=0xc0000-0xe0000
[ 1418.366637] muser muser: find_file_for_vaddr: no file for vaddr=0x7f7f0c800000
[ 1418.366639] muser muser: muser_ioctl: mdev=000000000d244be4, cmd=15211, arg=0x7FFC89670DE0
[ 1418.366763] muser muser: muser_ioctl: mdev=000000000d244be4, cmd=15212, arg=0x5563DFD02F90
[ 1418.366806] muser muser: muser_ioctl: mdev=000000000d244be4, cmd=15212, arg=0x5563DFD02FC0
[ 1418.366811] muser muser: muser_ioctl: mdev=000000000d244be4, cmd=15212, arg=0x5563DFD02FF0
[ 1418.366820] muser muser: muser_ioctl: mdev=000000000d244be4, cmd=15212, arg=0x5563DFD034E0
[ 1418.366826] muser muser: muser_ioctl: mdev=000000000d244be4, cmd=15212, arg=0x5563DFD03510
[ 1418.366831] muser muser: muser_ioctl: mdev=000000000d244be4, cmd=15212, arg=0x5563DFD03540
[ 1418.366836] muser muser: muser_ioctl: mdev=000000000d244be4, cmd=15212, arg=0x5563DFD03570
[ 1418.366840] muser muser: muser_ioctl: mdev=000000000d244be4, cmd=15213, arg=0x7FFC89670E80
[ 1418.366855] muser muser: muser_read: R 100@70000000000
[ 1418.366863] muser muser: libmuser_write: received data from libmuser
[ 1418.366866] BUG: unable to handle kernel paging request at 0000000001eed890
[ 1418.366867] PGD fe3f1f067 P4D fe3f1f067 PUD ffc7bd067 PMD fe3c9c067 PTE 8000000fe7ec7867
[ 1418.366870] Oops: 0001 [#1] SMP NOPTI
[ 1418.366871] CPU: 6 PID: 3638 Comm: gpio-pci-idio-1 Kdump: loaded Tainted: G           OE    --------- -  - 4.18.0-193.1.2.el8_2.x86_64 #1
[ 1418.366872] Hardware name: Dell Inc. OptiPlex 7070/0YNVJG, BIOS 1.0.1 04/19/2019
[ 1418.366875] RIP: 0010:hex_dump_to_buffer+0x99/0x490
[ 1418.366876] Code: ed 0f 84 d7 01 00 00 4d 85 e4 0f 84 05 01 00 00 c7 04 24 01 00 00 00 49 83 fd 01 0f 86 e0 02 00 00 48 8b 44 24 08 48 8d 55 01 <0f> b6 30 89 f0 c0 e8 04 83 e0 0f 0f b6 80 80 4e 68 a2 88 45 00 49
[ 1418.366876] RSP: 0018:ffffb856877a7d68 EFLAGS: 00010206
[ 1418.366877] RAX: 0000000001eed890 RBX: 0000000000000010 RCX: 0000000000000010
[ 1418.366878] RDX: ffffb856877a7de6 RSI: 0000000000000010 RDI: 0000000000000010
[ 1418.366878] RBP: ffffb856877a7de5 R08: 0000000000000021 R09: 0000000000000083
[ 1418.366879] R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000010
[ 1418.366879] R13: 0000000000000083 R14: 0000000001eed890 R15: 00000000000000f0
[ 1418.366880] FS:  00007f0cc1f39740(0000) GS:ffff93207c380000(0000) knlGS:0000000000000000
[ 1418.366881] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1418.366881] CR2: 0000000001eed890 CR3: 0000000fdf6e6003 CR4: 00000000003626e0
[ 1418.366882] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 1418.366882] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 1418.366883] Call Trace:
[ 1418.366886]  print_hex_dump+0x9a/0x100
[ 1418.366888]  ? _copy_from_user+0x30/0x60
[ 1418.366890]  ? libmuser_unl_ioctl+0xeb/0x610 [muser]
[ 1418.366892]  ? _cond_resched+0x15/0x30
[ 1418.366894]  ? __inode_security_revalidate+0x4c/0x60
[ 1418.366895]  libmuser_write+0xe5/0x1c8 [muser]
[ 1418.366897]  vfs_write+0xa5/0x1a0
[ 1418.366898]  ksys_write+0x4f/0xb0
[ 1418.366900]  do_syscall_64+0x5b/0x1a0
[ 1418.366901]  entry_SYSCALL_64_after_hwframe+0x65/0xca
[ 1418.366902] RIP: 0033:0x7f0cc184db28
[ 1418.366903] Code: 89 02 48 c7 c0 ff ff ff ff eb b3 0f 1f 80 00 00 00 00 f3 0f 1e fa 48 8d 05 35 4b 2d 00 8b 00 85 c0 75 17 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 58 c3 0f 1f 80 00 00 00 00 41 54 49 89 d4 55
[ 1418.366904] RSP: 002b:00007fff73082e68 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
[ 1418.366904] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f0cc184db28
[ 1418.366905] RDX: 0000000000000100 RSI: 0000000001eed890 RDI: 0000000000000003
[ 1418.366905] RBP: 00007fff73082ea0 R08: 00000000000000f8 R09: 0000000000000000
[ 1418.366906] R10: 0000000000000004 R11: 0000000000000246 R12: 0000000000400770
[ 1418.366906] R13: 00007fff730836c0 R14: 0000000000000000 R15: 0000000000000000

when trying to start the vm with parameters as seen on readme.MD

tmakatos commented 4 years ago

I'll take a look. In the mean time, we're working with the QEMU community on impelementing a new device offloading protocol that allows MUSER to work without a kernel module. You can use it to get around this problem until it gets fixed, more details here: https://www.mail-archive.com/qemu-devel@nongnu.org/msg692251.html

swapnili commented 4 years ago

I do not see this panic on my setup with following config, Debian9 with vanilla kernel=5.4.0-rc8+ QEMU emulator version 2.8.1(Debian 1:2.8+dfsg-6+deb9u9)

yuvalk commented 4 years ago

mine is RHEL8.2 kernel 4.18.0-193.1.2.el8_2.x86_64 QEMU emulator version 4.1.0 (qemu-kvm-4.1.0-23.module+el8.1.1+5467+ba2d821b)

tmakatos commented 3 years ago

We've switched to vfio-user and have dropped muser.ko.