ravynsoft / ravynos

A BSD-based OS project that aims to provide source and binary compatibility with macOS® and a similar user experience.
https://www.ravynos.com
Other
5.68k stars 192 forks source link

Kernel panic booting 2022-Aug-21 15:18 nightly iso #319

Closed markshank closed 6 months ago

markshank commented 2 years ago

Booting ravynOS_0.4.0pre5_f14_5654957775912960_amd64.iso on VM (qemu/kvm) fails with a kernel panic.

If I reduce the virtual cpu count to one, then it boots without issue.

Serial console output below:

?cLoading kernel... /boot/kernel/kernel text=0x1892c0 text=0xe1b988 text=0x670afc data=0x140 data=0x1cb2f0+0x433d10 0x8+0x194970+0x8+0x1b49f3| Loading configured modules... /boot/kernel/cryptodev.ko size 0x7780 at 0x234a000 /boot/kernel/nullfs.ko size 0x9108 at 0x2352000 /boot/kernel/zfs.ko size 0x60c020 at 0x235c000 /boot/kernel/mach.ko size 0x66128 at 0x2969000 /data/ramdisk.ufs size=0x1508000 can't find '/etc/hostid' /boot/kernel/geom_uzip.ko size 0x95c8 at 0x3ed8000

Hit [Enter] to boot immediately, or any other key for command prompt. Booting [/boot/kernel/kernel]...
staging 0x73800000 (not copying) tramp 0x7db2d000 PT4 0x7db24000 Start @ 0xffffffff8038a000 ... EFI framebuffer information: addr, size 0x7e900000, 0x300000 dimensions 800 x 600 stride 800 masks 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 GDB: no debug ports present KDB: debugger backends: ddb KDB: current backend: ddb ---<>--- Copyright (c) 1992-2022 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 14.0-CURRENT #0 main-n728-63ce42d3bbd: Sun Aug 21 13:25:59 UTC 2022 root@cirrus-task-4575421655154688:/usr/obj/tmp/cirrus-ci-build/amd64.amd64/sys/RAVYN amd64 ravynOSclang version 13.0.0 (git@github.com:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a303) VT(efifb): resolution 800x600 Hyper-V Version: 10.0.14393 [SP0] Features=0x232<TMREFCNT,APIC,HYPERCALL,REFTSC> PM Features=0x0 [C0] Features3=0x8 Timecounter "Hyper-V" frequency 10000000 Hz quality 2000 Setting sysctl vfs.zfs.arc_max failed: 22 mach services loaded - mach system calls available CPU: Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz (3600.00-MHz K8-class CPU) Origin="GenuineIntel" Id=0x906e9 Family=0x6 Model=0x9e Stepping=9 Features=0x1f83fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE,SSE2,SS,HTT> Features2=0xfffab223<SSE3,PCLMULQDQ,VMX,SSSE3,FMA,CX16,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,TSCDLT,AESNI,XSAVE,OSXSAVE,AVX,F16C,RDRAND,HV> AMD Features=0x2c100800<SYSCALL,NX,Page1GB,RDTSCP,LM> AMD Features2=0x121<LAHF,ABM,Prefetch> Structured Extended Features=0x9c47ab<FSGSBASE,TSCADJ,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT> Structured Extended Features2=0x4 Structured Extended Features3=0xac000400<MD_CLEAR,IBPB,STIBP,ARCH_CAP,SSBD> XSAVE Features=0xf<XSAVEOPT,XSAVEC,XINUSE,XSAVES> IA32_ARCH_CAPS=0x4c<RSBA,SKIP_L1DFL_VME> AMD Extended Feature Extensions ID EBX=0x100d000<IBPB,IBRS,STIBP,SSBD> VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID Hypervisor: Origin = "Microsoft Hv" real memory = 25769803776 (24576 MB) avail memory = 24924188672 (23769 MB) Event timer "LAPIC" quality 600 ACPI APIC Table: FreeBSD/SMP: Multiprocessor System Detected: 6 CPUs FreeBSD/SMP: 1 package(s) x 6 core(s) random: registering fast source Intel Secure Key RNG random: fast provider: "Intel Secure Key RNG" arc4random: WARNING: initial seeding bypassed the cryptographic random device because it was not yet seeded and the knob 'bypass_before_seeding' was enabled. ioapic0 <Version 1.1> irqs 0-23 Launching APs: 5 4 3 2 1 Timecounter "Hyper-V-TSC" frequency 10000000 Hz quality 3000 random: entropy device external interface md0: Preloaded image </data/ramdisk.ufs> 22052864 bytes at 0xffffffff829cf128

Fatal trap 12: page fault while in kernel mode cpuid = 5; apic id = 05 fault virtual address = 0x418 fault code = supervisor read data, page not present instruction pointer = 0x20:0xffffffff80f63fa5 stack pointer = 0x28:0xfffffe00d4e7ab60 frame pointer = 0x28:0xfffffe00d4e7ab90 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 13 (g_event) trap number = 12 panic: page fault cpuid = 5 time = 1 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00d4e7a920 vpanic() at vpanic+0x151/frame 0xfffffe00d4e7a970 panic() at panic+0x43/frame 0xfffffe00d4e7a9d0 trap_fatal() at trap_fatal+0x385/frame 0xfffffe00d4e7aa30 trap_pfault() at trap_pfault+0x4f/frame 0xfffffe00d4e7aa90 calltrap() at calltrap+0x8/frame 0xfffffe00d4e7aa90 --- trap 0xc, rip = 0xffffffff80f63fa5, rsp = 0xfffffe00d4e7ab60, rbp = 0xfffffe00d4e7ab90 --- uma_zalloc_arg() at uma_zalloc_arg+0x35/frame 0xfffffe00d4e7ab90 devctl_alloc_dei_sb() at devctl_alloc_dei_sb+0x54/frame 0xfffffe00d4e7abc0 devctl_notify() at devctl_notify+0x41/frame 0xfffffe00d4e7ac50 g_dev_taste() at g_dev_taste+0x4c7/frame 0xfffffe00d4e7ae80 g_load_class() at g_load_class+0x15c/frame 0xfffffe00d4e7aeb0 g_run_events() at g_run_events+0x11c/frame 0xfffffe00d4e7aef0 fork_exit() at fork_exit+0x7e/frame 0xfffffe00d4e7af30 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00d4e7af30 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- KDB: enter: panic [ thread pid 13 tid 100055 ] Stopped at kdb_enter+0x32: movq $0,0x127bc93(%rip) db>

mszoek commented 2 years ago

You get crashes consistently with CPU count > 1?

markshank commented 2 years ago

That was on the VM that has the VGT-g mediated passthrough iGPU that confuses the driver into acting like it has the full physical device. Many errors thrown by i915kms and drm. Not sure I would put much effort into it until we have i915kms up to speed.

I hope to test i915kms on bare metal this weekend. And barring any surprises, offer up my first PR.

mszoek commented 6 months ago

Closing as stale - try the latest once I upload it.