======================================
| [ 28.045932][ T232] Cannot link a netdevsim to itself
| [ 28.046653][ T232] Format for linking two devices is "netnsfd_a:ifidx_a netnsfd_b:ifidx_b" (int uint int uint).
| [ 29.882988][ C1] BUG: spinlock bad magic on CPU#1, peer.sh/232
| [ 29.883299][ C1] lock: noop_qdisc+0x240/0x300, .magic: 00000000, .owner: peer.sh/232, .owner_cpu: 1
[ 29.883820][ C1] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 04/01/2014
[ 29.884163][ C1] Call Trace:
[ 29.884283][ C1]
[ 29.884368][ C1] dump_stack_lvl (lib/dump_stack.c:122)
[ 29.884532][ C1] do_raw_spin_unlock (kernel/locking/spinlock_debug.c:100 kernel/locking/spinlock_debug.c:141)
[ 29.884695][ C1] _raw_spin_unlock (./arch/x86/include/asm/preempt.h:94 ./include/linux/spinlock_api_smp.h:143 kernel/locking/spinlock.c:186)
[ 29.884852][ C1] net_tx_action (./include/net/sch_generic.h:226 ./include/net/sch_generic.h:217 ./include/net/pkt_sched.h:128 ./include/net/pkt_sched.h:124 net/core/dev.c:5323)
[ 29.885015][ C1] handle_softirqs (kernel/softirq.c:554)
[ 29.885171][ C1] ? dev_deactivate_many (./include/linux/bottom_half.h:33 ./include/linux/netdevice.h:4448 net/sched/sch_generic.c:571 net/sched/sch_generic.c:1363)
[ 29.885328][ C1] do_softirq (kernel/softirq.c:455 kernel/softirq.c:442)
[ 29.885441][ C1]
[ 29.885518][ C1]
[ 29.885599][ C1] __local_bh_enable_ip (kernel/softirq.c:382)
[ 29.885755][ C1] dev_deactivate_many (net/sched/sch_generic.c:1356)
[ 29.885909][ C1] __dev_close_many (net/core/dev.c:1547)
[ 29.886065][ C1] ? __pfx___dev_close_many (net/core/dev.c:1522)
[ 29.886215][ C1] ? __pfx_validate_chain (kernel/locking/lockdep.c:3824)
[ 29.886366][ C1] ? hlock_class (./arch/x86/include/asm/bitops.h:227 ./arch/x86/include/asm/bitops.h:239 ./include/asm-generic/bitops/instrumented-non-atomic.h:142 kernel/locking/lockdep.c:227)
[ 29.886523][ C1] dev_close_many (net/core/dev.c:1585)
[ 29.886673][ C1] ? __lock_acquire (kernel/locking/lockdep.c:5142)
[ 29.886825][ C1] ? __pfx_dev_close_many (net/core/dev.c:1575)
[ 29.886981][ C1] unregister_netdevice_many_notify (net/core/dev.c:11321)
[ 29.887170][ C1] ? nsim_destroy (drivers/net/netdevsim/netdev.c:774) netdevsim
[ 29.887342][ C1] ? __mutex_trylock_common (./arch/x86/include/asm/atomic64_64.h:101 ./include/linux/atomic/atomic-arch-fallback.h:4296 ./include/linux/atomic/atomic-long.h:1482 ./include/linux/atomic/atomic-instrumented.h:4458 kernel/locking/mutex.c:129)
[ 29.887492][ C1] ? __pfx_unregister_netdevice_many_notify (net/core/dev.c:11288)
[ 29.887677][ C1] ? __pfx___mutex_trylock_common (kernel/locking/mutex.c:104)
[ 29.887863][ C1] ? nsim_destroy (drivers/net/netdevsim/netdev.c:774) netdevsim
[ 29.888019][ C1] ? trace_contention_end (./include/trace/events/lock.h:122 (discriminator 52))
[ 29.888173][ C1] ? __mutex_lock (./arch/x86/include/asm/preempt.h:94 kernel/locking/mutex.c:618 kernel/locking/mutex.c:752)
[ 29.888324][ C1] ? mntput_no_expire (fs/namespace.c:220 fs/namespace.c:1430)
[ 29.888478][ C1] ? nsim_destroy (drivers/net/netdevsim/netdev.c:774) netdevsim
[ 29.888636][ C1] unregister_netdevice_queue (net/core/dev.c:11283)
[ 29.888787][ C1] ? __pfx_do_raw_spin_lock (kernel/locking/spinlock_debug.c:114)
[ 29.888936][ C1] ? __pfx_unregister_netdevice_queue (net/core/dev.c:11272)
[ 29.889124][ C1] nsim_destroy (drivers/net/netdevsim/netdev.c:779 (discriminator 2)) netdevsim
[ 29.889285][ C1] __nsim_dev_port_del (drivers/net/netdevsim/dev.c:426 drivers/net/netdevsim/dev.c:1426) netdevsim
[ 29.889480][ C1] nsim_dev_reload_destroy (drivers/net/netdevsim/dev.c:1435 drivers/net/netdevsim/dev.c:1658) netdevsim
[ 29.889677][ C1] nsim_drv_remove (drivers/net/netdevsim/dev.c:1675) netdevsim
[ 29.889837][ C1] device_release_driver_internal (drivers/base/dd.c:1274 drivers/base/dd.c:1295)
[ 29.890026][ C1] ? klist_put (lib/klist.c:220)
[ 29.890142][ C1] bus_remove_device (./include/linux/kobject.h:193 drivers/base/base.h:73 drivers/base/bus.c:581)
[ 29.890295][ C1] device_del (drivers/base/core.c:3869)
[ 29.890412][ C1] ? __pfx_device_del (drivers/base/core.c:3823)
[ 29.890567][ C1] ? lock_acquire.part.0 (kernel/locking/lockdep.c:466 kernel/locking/lockdep.c:5761)
[ 29.890716][ C1] ? kernfs_fop_write_iter (fs/kernfs/file.c:326)
[ 29.890868][ C1] device_unregister (drivers/base/core.c:3786 drivers/base/core.c:3910)
[ 29.891020][ C1] del_device_store (drivers/net/netdevsim/bus.c:230) netdevsim
[ 29.891218][ C1] ? __pfx_del_device_store (drivers/net/netdevsim/bus.c:197) netdevsim
[ 29.891414][ C1] ? __pfx_sysfs_kf_write (fs/sysfs/file.c:129)
[ 29.891565][ C1] ? sysfs_file_ops (fs/sysfs/file.c:31 (discriminator 1))
[ 29.891731][ C1] ? __pfx_sysfs_kf_write (fs/sysfs/file.c:129)
[ 29.891886][ C1] kernfs_fop_write_iter (fs/kernfs/file.c:334)
[ 29.892039][ C1] vfs_write (fs/read_write.c:497 fs/read_write.c:590)
[ 29.892155][ C1] ? __pfx_vfs_write (fs/read_write.c:571)
[ 29.892305][ C1] ? find_held_lock (kernel/locking/lockdep.c:5249)
[ 29.892460][ C1] ? __fget_light (./include/linux/atomic/atomic-arch-fallback.h:479 ./include/linux/atomic/atomic-instrumented.h:50 fs/file.c:1145)
[ 29.892615][ C1] ksys_write (fs/read_write.c:643)
[ 29.892729][ C1] ? __pfx_ksys_write (fs/read_write.c:633)
[ 29.892884][ C1] do_syscall_64 (arch/x86/entry/common.c:52 arch/x86/entry/common.c:83)
[ 29.893040][ C1] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130)
[ 29.893230][ C1] RIP: 0033:0x7f17d6fc6957
[ 29.893391][ C1] Code: 0b 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 48 89 54 24 18 48 89 74 24
All code
========
0: 0b 00 or (%rax),%eax
2: f7 d8 neg %eax
4: 64 89 02 mov %eax,%fs:(%rdx)
7: 48 c7 c0 ff ff ff ff mov $0xffffffffffffffff,%rax
e: eb b7 jmp 0xffffffffffffffc7
10: 0f 1f 00 nopl (%rax)
13: f3 0f 1e fa endbr64
17: 64 8b 04 25 18 00 00 mov %fs:0x18,%eax
1e: 00
1f: 85 c0 test %eax,%eax
21: 75 10 jne 0x33
23: b8 01 00 00 00 mov $0x1,%eax
28: 0f 05 syscall
2a:* 48 3d 00 f0 ff ff cmp $0xfffffffffffff000,%rax <-- trapping instruction
30: 77 51 ja 0x83
32: c3 ret
33: 48 83 ec 28 sub $0x28,%rsp
37: 48 89 54 24 18 mov %rdx,0x18(%rsp)
3c: 48 rex.W
3d: 89 .byte 0x89
3e: 74 24 je 0x64
Code starting with the faulting instruction
===========================================
0: 48 3d 00 f0 ff ff cmp $0xfffffffffffff000,%rax
6: 77 51 ja 0x59
8: c3 ret
9: 48 83 ec 28 sub $0x28,%rsp
d: 48 89 54 24 18 mov %rdx,0x18(%rsp)
12: 48 rex.W
13: 89 .byte 0x89
14: 74 24 je 0x3a
[ 29.893921][ C1] RSP: 002b:00007fff10e3e5f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
[ 29.894153][ C1] RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007f17d6fc6957
[ 29.894382][ C1] RDX: 0000000000000004 RSI: 000055da5b916790 RDI: 0000000000000001
[ 29.894608][ C1] RBP: 000055da5b916790 R08: 0000000000000000 R09: 00007f17d70394e0
[ 29.894832][ C1] R10: 00007f17d70393e0 R11: 0000000000000246 R12: 0000000000000004
Finger prints:
do_raw_spin_unlock:_raw_spin_unlock:net_tx_action:handle_softirqs:do_softirq