Bug 254017

Summary: [POWERPC] Kernel page fault with the following non-sleepable locks held while copying files
Product: Base System Reporter: Leonardo Bianconi <leonardo.bianconi>
Component: kernAssignee: freebsd-ppc (Nobody) <ppc>
Status: New ---    
Severity: Affects Some People CC: alfredo
Priority: --- Keywords: panic
Version: CURRENT   
Hardware: powerpc   
OS: Any   

Description Leonardo Bianconi 2021-03-04 17:56:24 UTC
I faced a kernel panic while transferring large files in parallel through the network in a PowerPC BE virtual machine.

My network was configured with virtio legacy.

Command executed: scp <user>@<source machine ip>:<file> ./ & scp <user>@<source machine ip>:<file> ./copy2/

Error output:
Kernel page fault with the following non-sleepable locks held:
exclusive sleep mutex vtnet0-tx0 (vtnet0-tx0) r = 0 (0x44d0100) locked @ /usr/src/sys/dev/virtio/network/if_vtnet.c:2760
stack backtrace:
#0 0xc0000000008098dc at witness_debugger+0xa4
#1 0xc00000000080af34 at witness_warn+0x498
#2 0xc000000000bb26b8 at trap_pfault+0x274
#3 0xc000000000bb12bc at trap+0x140
#4 0xc000000000ba5438 at powerpc_interrupt+0x1cc

fatal kernel trap:

   exception       = 0x300 (data storage interrupt)
   virtual address = 0xdeadc0dedeadc0de
   dsisr           = 0x40000000
   srr0            = 0xc000000000b50e10 (0xb50e10)
   srr1            = 0x8000000000009032
   current msr     = 0x8000000000009032
   lr              = 0xc00000000083c0ec (0x83c0ec)
   frame           = 0xc0080000016d2190
   curthread       = 0xc008000003890b80
          pid = 0, comm = vtnet0 txq 0

panic: data storage interrupt trap
cpuid = 3
time = 1614688096
KDB: stack backtrace:
0xc0080000016d1cf0: at kdb_backtrace+0x60
0xc0080000016d1e00: at vpanic+0x1e0
0xc0080000016d1eb0: at panic+0x40
0xc0080000016d1ee0: at trap_pfault+0x300
0xc0080000016d1f90: at trap+0x140
0xc0080000016d20d0: at powerpc_interrupt+0x1cc
0xc0080000016d2160: kernel DSI read trap @ 0xdeadc0dedeadc0de by memcpy+0x58: srr1=0x8000000000009032
            r1=0xc0080000016d2410 cr=0x44000c80 xer=0x20040000 ctr=0x3c r2=0xc000000001383000 sr=0x40000000 frame=0xc0080000016d2190
0xc0080000016d2410: at m_pullup+0x250
0xc0080000016d24b0: at ether_vlanencap_proto+0x11c
0xc0080000016d24f0: at vtnet_txq_encap+0xb8
0xc0080000016d25d0: at vtnet_txq_mq_start_locked+0x16c
0xc0080000016d2690: at vtnet_txq_tq_deferred+0x6c
0xc0080000016d26d0: at taskqueue_run_locked+0xfc
0xc0080000016d27d0: at taskqueue_thread_loop+0xd4
0xc0080000016d2820: at fork_exit+0xc4
0xc0080000016d28c0: at fork_trampoline+0x18
0xc0080000016d28f0: at -0x4
KDB: enter: panic
[ thread pid 0 tid 100147 ]