Perhaps vm_cleanup() should always be called with mem_segs_lock locked
but, if the vm is being destroyed...vm_cleanup() will also destroy the
mem_segs_lock.
Unread portion of the kernel message buffer:
panic: Lock (sx) vm mem_segs not locked @ /cobra/src/sys/amd64/vmm/vmm.c:1188.
cpuid = 6
time = 1673288410
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe01116d1890
vpanic() at vpanic+0x151/frame 0xfffffe01116d18e0
panic() at panic+0x43/frame 0xfffffe01116d1940
witness_assert() at witness_assert+0x21e/frame 0xfffffe01116d1970
vm_iommu_modify() at vm_iommu_modify+0x135/frame 0xfffffe01116d19d0
vm_unassign_pptdev() at vm_unassign_pptdev+0x2b/frame 0xfffffe01116d19f0
ppt_unassign_all() at ppt_unassign_all+0x176/frame 0xfffffe01116d1a40
vm_cleanup() at vm_cleanup+0x16/frame 0xfffffe01116d1a70
vm_destroy() at vm_destroy+0x13/frame 0xfffffe01116d1a90
vmmdev_destroy() at vmmdev_destroy+0x90/frame 0xfffffe01116d1ab0
sysctl_vmm_destroy() at sysctl_vmm_destroy+0x1de/frame 0xfffffe01116d1af0
sysctl_root_handler_locked() at sysctl_root_handler_locked+0x9c/frame 0xfffffe01116d1b40
sysctl_root() at sysctl_root+0x21c/frame 0xfffffe01116d1bc0
userland_sysctl() at userland_sysctl+0x187/frame 0xfffffe01116d1c70
kern___sysctlbyname() at kern___sysctlbyname+0x21d/frame 0xfffffe01116d1dc0
sys___sysctlbyname() at sys___sysctlbyname+0x2d/frame 0xfffffe01116d1e00
amd64_syscall() at amd64_syscall+0x12e/frame 0xfffffe01116d1f30
fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe01116d1f30
- syscall (570, FreeBSD ELF64, __sysctlbyname), rip = 0x26e59d2a480a, rsp = 0x26e59a291f78, rbp = 0x26e59a291f90 ---
KDB: enter: panic