Hello! I came across a kernel panic ("domain is NULL") when booting my system recently. The panic occurs when bhyve starts, and I reduced the problem to this commit: 2eeb95ccf39ac5d79326c4482112b6b7dd5fc8b2 When I revert 2eeb95ccf39ac5d79326c4482112b6b7dd5fc8b2 the panic disappears, and I can use the VM as usual. The VM in question is passing through a nvidia graphics card to a Linux VM in case it's relevant. I also have a nvidia patch applied, taken from https://github.com/Beckhoff/freebsd-src/commits/phab/corvink/15.0/nvidia-wip in case it's relevant. If any more information is needed please let me know. Regards, Robert
What is the backtrace, and the source file/line with the assert?
Created attachment 259405 [details] Kernel panic I had some trouble getting dumping the trace to disk. I attached a screenshot instead. Please let me know if I can provide anymore information. Thanks
Created attachment 259407 [details] Be more liberal against iommu attach failures
Created attachment 259408 [details] Kernel panic #2 Thanks for the patch. Applied. New panic.
I want to see the panic on FreeBSD.
Created attachment 259409 [details] vm_assign_pptdev: only call vm_iommu_map() once
Okay. Here is what I did. I rebuilt the kernel. Unless world is needed. Let me know. You can find the patches here: https://github.com/0x1eef/freebsd-patches $ sourcezap sh $ git remote add freebsd/upstream https://github.com/freebsd/freebsd-src $ git fetch freebsd/upstream $ git checkout -t freebsd/upstream/main $ git rev-parse HEAD 253c83058deb5ff77dc0a3b60bf7c1d10f9ef5e8 $ git apply nvidia.patch $ git apply konstantin1.patch # sourcezap install # cd /usr/src # rm -rf /usr/obj/* # make -j12 kernel # reboot But my system becomes unusable :) Doesn't even boot the kernel. I saw you added a new patch. Will try. I will have to continue with the hardenedbsd kernel for the time being. Otherwise I will try to figure something out. Thanks for the support.
Hello, I can confirm your second patch fixes the issue for me.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=42e4938fdbf8e2b5180e0d6aeb0075c589cf3bca commit 42e4938fdbf8e2b5180e0d6aeb0075c589cf3bca Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2025-04-09 11:20:30 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2025-04-09 12:20:08 +0000 vm_assign_pptdev: only call vm_iommu_map() once for the first assigned pass-through device. PR: 285976 Sponsored by: The FreeBSD Foundation sys/amd64/vmm/vmm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3f3ce5ec77c8ae051fbd284342057d7f5185c0e4 commit 3f3ce5ec77c8ae051fbd284342057d7f5185c0e4 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2025-04-09 09:46:57 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2025-04-09 12:20:08 +0000 bhyve amd64: allow iommu to fail attaching device to host domain If iommu does not want to handle some device, e.g. because the ACPI table does not list it as translated, this is not a reason to fail creating the host domain. PR: 285976 Sponsored by: The FreeBSD Foundation sys/amd64/vmm/io/iommu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)