I believe after commit ddfc9c4c59e2ea4871100d8c076adffe3af8ff21, systems using vmd(8) crash while booting. This happens on TigerLake systems, especially ones like the HP Spectre x360 13t-aw200 where vmd(8) use is required to use NVMe. I have attached a picture of the stacktrace. Sorry if I couldn't get a text file: the keyboard wasn't working when it panicked.
(In reply to Neel Chauhan from comment #0) I think something went wrong with the attachment, since I'm not seeing any... Can you double check?
Created attachment 226144 [details] Kernel panic log (picture) Sorry if I couldn't attach it earlier. I thought I did, but it seems the picture was not posted because it was too large. I resized the photo to be smaller.
Can you page up to get the top of the stack and the panic?
^Triage: over to committer of: newbus: Move from bus_child_{pnpinfo,location}_src to bus_child_{pnpinfo,location} with sbuf (as cited)
Created attachment 226149 [details] Full kernel panic log (picture)
Created attachment 226185 [details] Full kernel panic log (picture) - Includes pre-stack ASSERTS Here is a picture with the pre-stack ASSERTS as well. It is blurry since I took this on the plane.
(In reply to Neel Chauhan from comment #6) OK. I can read this well enough, but it makes no sense to me... Maybe it's some weird corruption when we're queueing devd events... Can you see if it goes away if you set "hw.bus.devctl_queue=0" in your loader.conf file?
I still get the same error.
(In reply to Neel Chauhan from comment #8) Thanks for trying that. I have a Kaby Lake system here I'll test to see if I see the problem there. I should know later this evening. The only other thing I can think of is to try w/o vmd, and that's not going to get past mountroot().
Sadly, vmd is forced on certain TigerLake laptops like the HP Spectre x360 13t-aw200. I am unable to disable it. I will try updating the UEFI to see if I get an option for this. I don't believe it is on older Intel-based laptops. I have a WhiskeyLake-based Spectre x360 as well, and get a KabyLake-R-based ThinkPad from work that dual-boots Win10 and FreeBSD, neither which use vmd. I am just using an older kernel for now.
I did some tests by a `git revert` to before ddfc9c4c59e2ea4871100d8c076adffe3af8ff21 and for some reason it still panicked. It may be an earlier commit must be responsible for this crash.
After doing a `git bisect` as per the current@ mailing lists, it seems that it may something to do with LLVM. Sadly, I am no expert in compilers. Compiling the same "good" commit with the latest LLVM gives me the same error.
Interestingly, 13.0-STABLE does not suffer from this error.
Good news. I figured out how to get this to work and not panic. When we are probing for PCI buses, we apparently assert for "pci" only when we also need to assert for "vmd_bus" as well. Phabricator: https://reviews.freebsd.org/D31071
Taking this bug since I found the solution. imp@ feel free to take back if it's appropriate.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=ad1f608fb2f529baf028384bbe7e8fbbff5cbe23 commit ad1f608fb2f529baf028384bbe7e8fbbff5cbe23 Author: Neel Chauhan <nc@FreeBSD.org> AuthorDate: 2021-07-16 02:03:05 +0000 Commit: Neel Chauhan <nc@FreeBSD.org> CommitDate: 2021-07-16 02:26:20 +0000 vmd: Rename vmd_bus class to pci This fixes a kernel panic when probing for vmd_bus on Intel TigerLake on 14-CURRENT. Apparently, vmd_bus is a type of PCI bus, but was registered as a separate device class. PR: 256915 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D31071 sys/dev/vmd/vmd_bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Yay! I got it working and committed. Slightly differently than my original approach, but vmd_bus was a type of PCI but wasn't marked as that.
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=75547acf1cd5a5d0a495b32c8113f8311f0713bd commit 75547acf1cd5a5d0a495b32c8113f8311f0713bd Author: Neel Chauhan <nc@FreeBSD.org> AuthorDate: 2021-07-16 02:03:05 +0000 Commit: Alexander Motin <mav@FreeBSD.org> CommitDate: 2021-09-12 22:44:12 +0000 vmd: Rename vmd_bus class to pci This fixes a kernel panic when probing for vmd_bus on Intel TigerLake on 14-CURRENT. Apparently, vmd_bus is a type of PCI bus, but was registered as a separate device class. PR: 256915 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D31071 (cherry picked from commit ad1f608fb2f529baf028384bbe7e8fbbff5cbe23) sys/dev/vmd/vmd_bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)