FreeBSDDesktop / kms-drm

the DRM part of the linuxkpi-based KMS
63 stars 26 forks source link

drm-next crash on apple imin #3

Closed huanghwh closed 7 years ago

huanghwh commented 7 years ago

root@imin:/etc/X11 # dmesg Copyright (c) 1992-2017 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 12.0-CURRENT #2 r323002: Wed Aug 30 07:03:20 CST 2017 root@imin.gddsn.org.cn:/usr/obj/usr/src/sys/IMAC amd64 FreeBSD clang version 5.0.0 (branches/release_50 311219) (based on LLVM 5.0.0svn) VT(efifb): resolution 1920x1080 CPU: Intel(R) Core(TM) i7-2635QM CPU @ 2.00GHz (1995.51-MHz K8-class CPU) Origin="GenuineIntel" Id=0x206a7 Family=0x6 Model=0x2a Stepping=7 Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE> Features2=0x1fbae3bf<SSE3,PCLMULQDQ,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,TSCDLT,AESNI,XSAVE,OSXSAVE,AVX> AMD Features=0x28100800<SYSCALL,NX,RDTSCP,LM> AMD Features2=0x1 XSAVE Features=0x1 VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID TSC: P-state invariant, performance statistics real memory = 8589934592 (8192 MB) avail memory = 8144121856 (7766 MB) Event timer "LAPIC" quality 600 ACPI APIC Table: FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs FreeBSD/SMP: 1 package(s) x 4 core(s) x 2 hardware threads random: unblocking device. ioapic0: Changing APIC ID to 2 ioapic0 <Version 2.0> irqs 0-23 on motherboard SMP: AP CPU #1 Launched! SMP: AP CPU #5 Launched! SMP: AP CPU #4 Launched! SMP: AP CPU #7 Launched! SMP: AP CPU #2 Launched! SMP: AP CPU #6 Launched! SMP: AP CPU #3 Launched! Timecounter "TSC" frequency 1995512512 Hz quality 1000 random: entropy device external interface netmap: loaded module [ath_hal] loaded module_register_init: MOD_LOAD (vesa, 0xffffffff80f9d4a0, 0) error 19 kbd0 at kbdmux0 nexus0 cryptosoft0: on motherboard acpi0: on motherboard acpi_ec0: <Embedded Controller: GPE 0x17, ECDT> port 0x62,0x66 on acpi0 acpi0: Power Button (fixed) unknown: I/O range not supported hpet0: iomem 0xfed00000-0xfed003ff irq 0,8 on acpi0 Timecounter "HPET" frequency 14318180 Hz quality 950 Event timer "HPET" frequency 14318180 Hz quality 550 cpu0: on acpi0 cpu1: on acpi0 cpu2: on acpi0 cpu3: on acpi0 cpu4: on acpi0 cpu5: on acpi0 cpu6: on acpi0 cpu7: on acpi0 atrtc0: port 0x70-0x77 on acpi0 atrtc0: registered as a time-of-day clock, resolution 1.000000s Event timer "RTC" frequency 32768 Hz quality 0 attimer0: port 0x40-0x43,0x50-0x53 on acpi0 Timecounter "i8254" frequency 1193182 Hz quality 0 Event timer "i8254" frequency 1193182 Hz quality 100 Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 acpi_timer0: <24-bit timer at 3.579545MHz> port 0x408-0x40b on acpi0 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 pcib1: at device 1.0 on pci0 pci1: on pcib1 pcib2: at device 1.1 on pci0 pci2: on pcib2 vgapci0: port 0x2000-0x203f mem 0xa0000000-0xa03fffff,0x90000000-0x9fffffff at device 2.0 on pci0 vgapci0: Boot video device pci0: at device 22.0 (no driver attached) uhci0: <UHCI (generic) USB controller> port 0x2120-0x213f at device 26.0 on pci0 uhci0: LegSup = 0x2400 usbus0 on uhci0 usbus0: 12Mbps Full Speed USB v1.0 ehci0: <Intel Cougar Point USB 2.0 controller> mem 0xa0906c00-0xa0906fff at device 26.7 on pci0 usbus1: EHCI version 1.0 usbus1 on ehci0 usbus1: 480Mbps High Speed USB v2.0 hdac0: mem 0xa0900000-0xa0903fff at device 27.0 on pci0 pcib3: at device 28.0 on pci0 pci3: on pcib3 bge0: <Broadcom BCM57765 B0, ASIC rev. 0x57785100> mem 0xa0400000-0xa040ffff,0xa0410000-0xa041ffff at device 0.0 on pci3 bge0: CHIP ID 0x57785100; ASIC REV 0x57785; CHIP REV 0x577851; PCI-E miibus0: on bge0 brgphy0: <BCM57765 1000BASE-T media interface> PHY 1 on miibus0 brgphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto, auto-flow bge0: Using defaults for TSO: 65518/35/2048 bge0: Ethernet address: a8:20:66:23:8b:ae sdhci_pci0: <Broadcom BCM577xx SDXC/MMC Card Reader> mem 0xa0420000-0xa042ffff at device 0.1 on pci3 sdhci_pci0: 1 slot(s) allocated pcib4: at device 28.1 on pci0 pci4: on pcib4 pci4: at device 0.0 (no driver attached) pcib5: at device 28.2 on pci0 pci5: on pcib5 pcib6: at device 0.0 on pci5 pci6: on pcib6 pci6: <serial bus, FireWire> at device 0.0 (no driver attached) uhci1: <UHCI (generic) USB controller> port 0x20c0-0x20df at device 29.0 on pci0 uhci1: LegSup = 0x2400 usbus2 on uhci1 usbus2: 12Mbps Full Speed USB v1.0 ehci1: <Intel Cougar Point USB 2.0 controller> mem 0xa0906800-0xa0906bff at device 29.7 on pci0 usbus3: EHCI version 1.0 usbus3 on ehci1 usbus3: 480Mbps High Speed USB v2.0 isab0: at device 31.0 on pci0 isa0: on isab0 ahci0: port 0x2148-0x214f,0x215c-0x215f,0x2140-0x2147,0x2158-0x215b,0x2060-0x207f mem 0xa0906000-0xa09067ff at device 31.2 on pci0 ahci0: AHCI v1.30 with 6 6Gbps ports, Port Multiplier not supported ahcich0: at channel 0 on ahci0 ahcich1: at channel 1 on ahci0 ahciem0: on ahci0 acpi_button0: on acpi0 acpi_button1: on acpi0 ppc0: cannot reserve I/O port range est0: on cpu0 est1: on cpu1 est2: on cpu2 est3: on cpu3 est4: on cpu4 est5: on cpu5 est6: on cpu6 est7: on cpu7 ZFS filesystem version: 5 ZFS storage pool version: features support (5000) Timecounters tick every 1.000 msec hdacc0: at cad 0 on hdac0 hdaa0: at nid 1 on hdacc0 pcm0: <Cirrus Logic CS4206 (Analog)> at nid 11 and 12 on hdaa0 pcm1: <Cirrus Logic CS4206 (Digital)> at nid 16 and 15 on hdaa0 ses0 at ahciem0 bus 0 scbus2 target 0 lun 0 ses0: <AHCI SGPIO Enclosure 1.00 0001> SEMB S-E-S 2.00 device ses0: SEMB SES Device ada0 at ahcich0 bus 0 scbus0 target 0 lun 0 ada0: ATA8-ACS SATA 3.x device ada0: Serial Number S0X7NYAC802366 ada0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes) ada0: Command Queueing enabled ada0: 239372MB (490234752 512 byte sectors) ada1 at ahcich1 bus 0 scbus1 target 0 lun 0 ada1: ATA8-ACS SATA 3.x device ada1: Serial Number S0X7NYAC802356 ada1: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes) ada1: Command Queueing enabled ada1: 239372MB (490234752 512 byte sectors) pcm2: <Cirrus Logic CS4206 (Analog Headphones)> at nid 10 on hdaa0 hdacc1: at cad 3 on hdac0 hdaa1: at nid 1 on hdacc1 hdaa1: hdaa_audio_as_parse: Duplicate pin 0 (6) in association 1! Disabling association. hdaa1: hdaa_audio_as_parse: Duplicate pin 0 (7) in association 1! Disabling association. ugen2.1: at usbus2 ugen1.1: at usbus1 uhub0: <Intel EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus1 ugen0.1: at usbus0 uhub1: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus2 uhub2: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0 Trying to mount root from zfs:zroot/ROOT/default []... Root mount waiting for: usbus3 usbus2 usbus1 usbus0 ugen3.1: at usbus3 uhub3: <Intel EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus3 uhub1: 2 ports with 2 removable, self powered uhub2: 2 ports with 2 removable, self powered Root mount waiting for: usbus3 usbus1 Root mount waiting for: usbus3 usbus1 uhub0: 6 ports with 6 removable, self powered Root mount waiting for: usbus3 usbus1 uhub3: 8 ports with 8 removable, self powered ugen1.2: <vendor 0x0424 product 0x2513> at usbus1 uhub4 on uhub0 uhub4: <vendor 0x0424 product 0x2513, class 9/0, rev 2.00/b.b3, addr 2> on usbus1 uhub4: MTT enabled uhub4: 3 ports with 2 removable, self powered ugen3.2: <vendor 0x0424 product 0x2513> at usbus3 uhub5 on uhub3 uhub5: <vendor 0x0424 product 0x2513, class 9/0, rev 2.00/b.b3, addr 2> on usbus3 uhub5: MTT enabled Root mount waiting for: usbus3 usbus1 ugen1.3: at usbus1 uhub6 on uhub4 uhub6: <Apple Inc. BRCM20702 Hub, class 9/0, rev 2.00/1.00, addr 3> on usbus1 uhub5: 3 ports with 2 removable, self powered uhub6: 3 ports with 0 removable, self powered Root mount waiting for: usbus3 usbus1 ugen3.3: <Apple Computer, Inc. IR Receiver> at usbus3 ugen1.4: <vendor 0x05ac product 0x820a> at usbus1 ukbd0 on uhub6 ukbd0: <vendor 0x05ac product 0x820a, class 0/0, rev 2.00/1.00, addr 4> on usbus1 kbd1 at ukbd0 ugen3.4: at usbus3 ukbd1 on uhub5 ukbd1: <Dell Dell USB Entry Keyboard, class 0/0, rev 1.10/1.15, addr 4> on usbus3 kbd2 at ukbd1 Root mount waiting for: usbus3 usbus1 ugen1.5: <vendor 0x05ac product 0x820b> at usbus1 ugen3.5: at usbus3 ugen1.6: at usbus1 info: [drm] Initialized drm 1.1.0 20060810 drmn0: <Intel SandyBridge (M)> on vgapci0 info: [drm] Memory usable by graphics device = 2048M intel_iicbb0 on drmn0 iicbus0: on iicbb0 addr 0xff iic0: <I2C generic I/O> on iicbus0 iicbus1: on intel_gmbus0 iic1: <I2C generic I/O> on iicbus1 intel_iicbb1 on drmn0 iicbus2: on iicbb1 addr 0xff iic2: <I2C generic I/O> on iicbus2 iicbus3: on intel_gmbus1 iic3: <I2C generic I/O> on iicbus3 intel_iicbb2 on drmn0 iicbus4: on iicbb2 addr 0xff iic4: <I2C generic I/O> on iicbus4 iicbus5: on intel_gmbus2 iic5: <I2C generic I/O> on iicbus5 intel_iicbb3 on drmn0 iicbus6: on iicbb3 addr 0xff iic6: <I2C generic I/O> on iicbus6 iicbus7: on intel_gmbus3 iic7: <I2C generic I/O> on iicbus7 intel_iicbb4 on drmn0 iicbus8: on iicbb4 addr 0xff iic8: <I2C generic I/O> on iicbus8 iicbus9: on intel_gmbus4 iic9: <I2C generic I/O> on iicbus9 intel_iicbb5 on drmn0 iicbus10: on iicbb5 addr 0xff iic10: <I2C generic I/O> on iicbus10 iicbus11: on intel_gmbus5 iic11: <I2C generic I/O> on iicbus11 info: [drm] MSI enabled 1 message(s) info: [drm] Supports vblank timestamp caching Rev 1 (10.10.2010). info: [drm] Driver supports precise vblank timestamp query. intel_sdvo_ddc_proxy921920 on drmn0 intel_sdvo_ddc_proxy921920: detached drm_iic_dp_aux0 on drmn0 drm_iic_dp_aux1 on drmn0 drm_iic_dp_aux2 on drmn0 drmn0: taking over the fictitious range 0x90000000-0xa0000000 info: [drm] Connector VGA-1: get mode from tunables: info: [drm] - kern.vt.fb.modes.VGA-1 info: [drm] - kern.vt.fb.default_mode info: [drm] Connector HDMI-A-1: get mode from tunables: info: [drm] - kern.vt.fb.modes.HDMI-A-1 info: [drm] - kern.vt.fb.default_mode info: [drm] Connector DP-1: get mode from tunables: info: [drm] - kern.vt.fb.modes.DP-1 info: [drm] - kern.vt.fb.default_mode info: [drm] Connector HDMI-A-2: get mode from tunables: info: [drm] - kern.vt.fb.modes.HDMI-A-2 info: [drm] - kern.vt.fb.default_mode info: [drm] Connector HDMI-A-3: get mode from tunables: info: [drm] - kern.vt.fb.modes.HDMI-A-3 info: [drm] - kern.vt.fb.default_mode info: [drm] Connector DP-2: get mode from tunables: info: [drm] - kern.vt.fb.modes.DP-2 info: [drm] - kern.vt.fb.default_mode info: [drm] Connector DP-3: get mode from tunables: info: [drm] - kern.vt.fb.modes.DP-3 info: [drm] - kern.vt.fb.default_mode info: [drm] GMBUS [i915 gmbus vga] timed out, falling back to bit banging on pin 2 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 drmn0: warning: VGA-1: EDID block 0 invalid. info: [drm] Enabling RC6 states: RC6 on, RC6p off, RC6pp off fbd0 on drmn0 VT: Replacing driver "efifb" with new "fb". info: [drm] Initialized i915 1.6.0 20080730 for drmn0 on minor 0 bge0: link state changed to DOWN uhid0 on uhub5 uhid0: <Apple Computer, Inc. IR Receiver, class 0/0, rev 2.00/0.16, addr 3> on usbus3 ums0 on uhub6 ums0: <vendor 0x05ac product 0x820b, class 0/0, rev 2.00/1.00, addr 5> on usbus1 ums0: 3 buttons and [XY] coordinates ID=2 ums1 on uhub5 ums1: <Logitech USB-PS2 Optical Mouse, class 0/0, rev 2.00/27.30, addr 5> on usbus3 ums1: 8 buttons and [XYZT] coordinates ID=0 ubt0 on uhub6 ubt0: <Apple Inc. Bluetooth USB Host Controller, rev 2.00/1.47, addr 6> on usbus1 WARNING: attempt to domain_add(bluetooth) after domainfinalize() WARNING: attempt to domain_add(netgraph) after domainfinalize() ugen1.4: <vendor 0x05ac product 0x820a> at usbus1 (disconnected) ukbd0: at uhub6, port 1, addr 4 (disconnected) ukbd0: detached ugen1.5: <vendor 0x05ac product 0x820b> at usbus1 (disconnected) ums0: at uhub6, port 2, addr 5 (disconnected) ums0: detached bge0: link state changed to UP

with drm-next, I got this panic: drm-next

markjdb commented 7 years ago

Are you sure you're using the drm module from the port? The dmesg you pasted suggests that you're using drm.ko from the base system and i915kms from the port, which won't work.

iotamudelta commented 7 years ago

As stated in pkg-message, for i915kms you need something like kld_list="/boot/modules/drm.ko /boot/modules/i915kms.ko" in your /etc/rc.conf. Note that drm.ko must be loaded before i915kms.ko to ensure the correct drm.ko is loaded.

huanghwh commented 7 years ago

Sorry, dmesg is from CURRENT without drm-next-kmod port, just for reference.

I use single user login, then kldload /boot/modules/drm.ko, and then kldload /boot/modules/i915kms.ko, and I got the panic.

iotamudelta commented 7 years ago

Could you paste loader.conf and rc.conf?

huanghwh commented 7 years ago

% cat rc.conf clear_tmp_enable="YES" syslogd_flags="-ss" sendmail_enable="NONE" hostname="imin.gddsn.org.cn" ifconfig_bge0="inet 10.44.8.133 netmask 255.255.255.128" defaultrouter="10.44.8.254" sshd_enable="YES" dumpdev="AUTO" zfs_enable="YES"

dbus_enable="YES" slim_enable="YES"

mysql_enable="YES"

kld_list="i915kms"

kld_list="/boot/modules/drm.ko /boot/modules/i915kms.ko"

syslogd_enable="NO" % cat /boot/loader.conf kern.geom.label.disk_ident.enable="0" kern.geom.label.gptid.enable="0" zfs_load="YES"

iotamudelta commented 7 years ago

Thanks, assuming the second kld_list was used for drm-next-kmod port, looks OK. @markjdb any ideas?

huanghwh commented 7 years ago

I used drm-next from git in April, it is OK.

markjdb commented 7 years ago

Does the panic happen when loading just drm.ko from ports? Either way, could you paste the full set of messages printed by drm.ko?

markjdb commented 7 years ago

Also, if you're able to capture a kernel dump, it would be useful to see the line numbers in the backtrace. If you ensure the gdb package is installed, and type "dump" at the ddb prompt and reboot after it finishes, you should end up with a core.txt file under /var/crash. Could you paste the contents of that file here?

hselasky commented 7 years ago

Hi, Did you use the binary package or did you build from sources?

hselasky commented 7 years ago

If you built from sources, make sure you have the latest FreeBSD-12-current kernel sources!

hselasky commented 7 years ago

Also make sure there is no drm.ko in /boot/kernel . When using the ports they install into /boot/modules .

huanghwh commented 7 years ago

@markjdb , It is not panic if just load drm.ko: only one line print out: [drm] Initialized

kldstat -v | egrep "drm|linuxkpi|debugfs" 119 drmn/fbd 13 1 0xffffffff82965000 71b71 drm.ko (/boot/modules/drm.ko) 517 drmn 14 3 0xffffffff829d7000 ebc1 linuxkpi.ko (/boot/modules/linuxkpi.ko) 15 2 0xffffffff829e6000 ec2b linuxkpi_gplv2.ko (/boot/modules/linuxkpi_gplv2.ko) 16 1 0xffffffff829f5000 715 debugfs.ko (/boot/modules/debugfs.ko) 516 debugfs

I am not in front of imin now, will try to capture kernel dump later.

@hselasky , I build it from ports, and also use latest FreeBSD-12-current kernel sources, uname -a FreeBSD imin.gddsn.org.cn 12.0-CURRENT FreeBSD 12.0-CURRENT #3 r323002: Wed Aug 30 14:20:00 CST 2017 root@imin.gddsn.org.cn:/usr/obj/usr/src/sys/IMAC amd64

vishwin commented 7 years ago

It appears I'm hitting the same panic. I have a ThinkPad with a Broadwell chip, for reference. The port is the current version, as of this writing, in the ports tree HEAD and has been compiled with DEBUG set.

ardmore dumped core - see /var/crash/vmcore.5

Sat Sep  9 06:05:36 UTC 2017

FreeBSD ardmore 12.0-CURRENT FreeBSD 12.0-CURRENT #0 cc20e2dd998(master): Sat Sep  9 00:11:16 EDT 2017     root@ardmore:/usr/local/obj/usr/src/sys/GENERIC  amd64

panic: page fault

GNU gdb (GDB) 8.0 [GDB v8.0 for FreeBSD]
[snip]
Reading symbols from /boot/kernel/kernel...Reading symbols from /usr/lib/debug//boot/kernel/kernel.debug...done.
done.

Unread portion of the kernel message buffer:

Fatal trap 12: page fault while in kernel mode
cpuid = 2; apic id = 02
fault virtual address   = 0x20
fault code      = supervisor read data, page not present
instruction pointer = 0x20:0xffffffff84414a22
stack pointer           = 0x28:0xfffffe023410a8a0
frame pointer           = 0x28:0xfffffe023410a8c0
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     = 0 (linuxkpi_short_wq_1)
trap number     = 12
panic: page fault
cpuid = 2
time = 1504937076
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe023410a480
vpanic() at vpanic+0x19c/frame 0xfffffe023410a500
panic() at panic+0x43/frame 0xfffffe023410a560
trap_fatal() at trap_fatal+0x34d/frame 0xfffffe023410a5b0
trap_pfault() at trap_pfault+0x62/frame 0xfffffe023410a610
trap() at trap+0x2c5/frame 0xfffffe023410a7d0
calltrap() at calltrap+0x8/frame 0xfffffe023410a7d0
--- trap 0xc, rip = 0xffffffff84414a22, rsp = 0xfffffe023410a8a0, rbp = 0xfffffe023410a8c0 ---
drm_fb_helper_probe_connector_modes() at drm_fb_helper_probe_connector_modes+0x52/frame 0xfffffe023410a8c0
drm_fb_helper_initial_config() at drm_fb_helper_initial_config+0xe7/frame 0xfffffe023410a920
intel_fbdev_initial_config() at intel_fbdev_initial_config+0x2b/frame 0xfffffe023410a950
async_run_entry_fn() at async_run_entry_fn+0x4f/frame 0xfffffe023410a980
linux_work_fn() at linux_work_fn+0xf1/frame 0xfffffe023410a9e0
taskqueue_run_locked() at taskqueue_run_locked+0x15d/frame 0xfffffe023410aa40
taskqueue_thread_loop() at taskqueue_thread_loop+0x88/frame 0xfffffe023410aa70
fork_exit() at fork_exit+0x84/frame 0xfffffe023410aab0
fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe023410aab0
--- trap 0, rip = 0, rsp = 0, rbp = 0 ---
Uptime: 1m24s
Dumping 482 out of 8058 MB:..4%..14%..24%..34%..44%..54%..64%..73%..83%..93%

__curthread () at ./machine/pcpu.h:232
232     __asm("movq %%gs:%1,%0" : "=r" (td)
(kgdb) #0  __curthread () at ./machine/pcpu.h:232
#1  doadump (textdump=1) at /usr/src/sys/kern/kern_shutdown.c:318
#2  0xffffffff80a64e75 in kern_reboot (howto=260)
    at /usr/src/sys/kern/kern_shutdown.c:386
#3  0xffffffff80a65466 in vpanic (fmt=<optimized out>, ap=0xfffffe023410a540)
    at /usr/src/sys/kern/kern_shutdown.c:779
#4  0xffffffff80a654b3 in panic (fmt=<unavailable>)
    at /usr/src/sys/kern/kern_shutdown.c:710
#5  0xffffffff80ef0add in trap_fatal (frame=0xfffffe023410a7e0, eva=32)
    at /usr/src/sys/amd64/amd64/trap.c:799
#6  0xffffffff80ef0b52 in trap_pfault (frame=0xfffffe023410a7e0, usermode=0)
    at /usr/src/sys/amd64/amd64/trap.c:653
#7  0xffffffff80ef0315 in trap (frame=0xfffffe023410a7e0)
    at /usr/src/sys/amd64/amd64/trap.c:420
#8  <signal handler called>
#9  0xffffffff84414a22 in ?? ()
#10 0x0000000200000004 in ?? ()
#11 0xfffff800457c01c0 in ?? ()
#12 0x0000200000002000 in ?? ()
#13 0xfffff80045adcc00 in ?? ()
#14 0xfffffe023410a920 in ?? ()
#15 0xffffffff844148f7 in ?? ()
#16 0xfffff800051e47c8 in ?? ()
#17 0x0000000000000000 in ?? ()
(kgdb) 

I manually run kldload on /boot/modules/drm.ko and /boot/modules/i915kms.ko in that exact order.

Sep  9 06:03:42 ardmore login: ROOT LOGIN (root) ON ttyv0
[drm] Initialized
drmn0: <drmn> on vgapci0
vgapci0: child drmn0 requested pci_enable_io
vgapci0: child drmn0 requested pci_enable_io
[drm] Memory usable by graphics device = 4096M
Failed to add WC MTRR for [0xc0000000-0xdfffffff]: -22; performance may suffer
Sep  9 06:04:35 ardmore kernel: Failed to add WC MTRR for [0xc0000000-0xdfffffff]: -22; performance may suffer
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] Driver supports precise vblank timestamp query.
[drm] Connector eDP-1: get mode from tunables:
[drm]   - kern.vt.fb.modes.eDP-1
[drm]   - kern.vt.fb.default_mode
[drm] Connector DP-1: get mode from tunables:
[drm]   - kern.vt.fb.modes.DP-1
[drm]   - kern.vt.fb.default_mode
[drm] Connector HDMI-A-1: get mode from tunables:
[drm]   - kern.vt.fb.modes.HDMI-A-1
[drm]   - kern.vt.fb.default_mode
[drm] Connector DP-2: get mode from tunables:
[drm]   - kern.vt.fb.modes.DP-2
[drm]   - kern.vt.fb.default_mode
[drm] Connector HDMI-A-2: get mode from tunables:
[drm]   - kern.vt.fb.modes.HDMI-A-2
[drm]   - kern.vt.fb.default_mode
[drm] Initialized i915 1.6.0 20160919 for drmn on minor 0

Fatal trap 12: page fault while in kernel mode
cpuid = 2; apic id = 02
fault virtual address   = 0x20
fault code      = supervisor read data, page not present
instruction pointer = 0x20:0xffffffff84414a22
stack pointer           = 0x28:0xfffffe023410a8a0
frame pointer           = 0x28:0xfffffe023410a8c0
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     = 0 (linuxkpi_short_wq_1)
trap number     = 12
panic: page fault
cpuid = 2
time = 1504937076
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe023410a480
vpanic() at vpanic+0x19c/frame 0xfffffe023410a500
panic() at panic+0x43/frame 0xfffffe023410a560
trap_fatal() at trap_fatal+0x34d/frame 0xfffffe023410a5b0
trap_pfault() at trap_pfault+0x62/frame 0xfffffe023410a610
trap() at trap+0x2c5/frame 0xfffffe023410a7d0
calltrap() at calltrap+0x8/frame 0xfffffe023410a7d0
--- trap 0xc, rip = 0xffffffff84414a22, rsp = 0xfffffe023410a8a0, rbp = 0xfffffe023410a8c0 ---
drm_fb_helper_probe_connector_modes() at drm_fb_helper_probe_connector_modes+0x52/frame 0xfffffe023410a8c0
drm_fb_helper_initial_config() at drm_fb_helper_initial_config+0xe7/frame 0xfffffe023410a920
intel_fbdev_initial_config() at intel_fbdev_initial_config+0x2b/frame 0xfffffe023410a950
async_run_entry_fn() at async_run_entry_fn+0x4f/frame 0xfffffe023410a980
linux_work_fn() at linux_work_fn+0xf1/frame 0xfffffe023410a9e0
taskqueue_run_locked() at taskqueue_run_locked+0x15d/frame 0xfffffe023410aa40
taskqueue_thread_loop() at taskqueue_thread_loop+0x88/frame 0xfffffe023410aa70
fork_exit() at fork_exit+0x84/frame 0xfffffe023410aab0
fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe023410aab0
--- trap 0, rip = 0, rsp = 0, rbp = 0 ---
Uptime: 1m24s
Dumping 482 out of 8058 MB:..4%..14%..24%..34%..44%..54%..64%..73%..83%..93%

As @huanghwh said, no panic when only loading /boot/modules/drm.ko.

jeremymcox commented 7 years ago

I am also having the same kernel panic. I'm using FreeBSD 12 r323166 with a GENERIC kernel and a Haswell (i5 4430) GPU. I removed drm.ko and i915kms.ko from the /boot/kernel directory and loaded the modules from /boot/modules, and it loaded /boot/modules/drm.ko without issues, but when I tried loading /boot/modules/i915kms.ko, it panicked. Building drm-next-kmod from sources or using the pkg didn't seem to matter. It always seems to stop around drm_fb_helper_inital_config

Tracing pid 0 tid 100621 td 0xfffff8000bb2d000 drm_fb_helper_initial_config() at drm_fb_helper_initial_config+0xaa/frame 0xfffffe034e4b7940 intel_fbdev_initial_config() at intel_fbdev_initial_config+0x14/frame 0xfffffe034e4b7960 async_run_entry_fn() at async_run_entry_fn+0x27/frame 0xfffffe034e4b7980 linux_work_fn() at linux_work_fn+0xf1/frame 0xfffffe034e4b79e0 taskqueue_run_locked() at taskqueue_run_locked+0x15d/frame 0xfffffe034e4b7a40 taskqueue_thread_loop() at taskqueue_thread_loop+0x88/frame 0xfffffe034e4b7a70 fork_exit() at fork_exit+0x84/frame 0xfffffe034e4b7ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe034e4b7ab0 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- db> show reg

cs 0x20 ds 0x3b es 0x3b fs 0x13 gs 0x1b ss 0x28 rax 0xffffffff82f07750 ivb_update_plane rcx 0xfffff8000be138e8 rdx 0x2000 rbx 0x2000 rsp 0xfffffe034e4b78e0 rbp 0xfffffe034e4b7940 rsi 0x2000 rdi 0xfffff8000be101c0 r8 0x5 r9 0xfffff8000bce2380 r10 0x6cf r11 0x77 r12 0x2000 r13 0xfffff8000bcf7200 r14 0x8 r15 0x2 rip 0xffffffff82dbddba drm_fb_helper_initial_config+0xaa rflags 0x10297 drm_fb_helper_initial_config+0xaa: calll *0x20(%rax)

huanghwh commented 7 years ago

The CURRENT of today + kms-drm fix my problem:)