Re: DRM-current-kmod is still a problem at r353339

From: Mateusz Guzik <mjguzik_at_gmail.com>
Date: Sun, 13 Oct 2019 16:37:35 +0200
On 10/13/19, Evilham <contact_at_evilham.com> wrote:
> Hello,
>
> I somehow had managed to mess up my build system and only
> yesterday got it back to compiling properly.
>

So to be clear, there is an unrelated bug where it seems the module can
decide to abort loading and then it crashes in pseudofs. This can happen
if there is a mismatch between the kernel and the module itself.

>
> On ds., oct. 12 2019, Mateusz Guzik wrote:
>
>> Try this:
>>
>> https://people.freebsd.org/~mjg/pmap-fict-invl.diff
>
>
> I tested this patch on top of r353449 and a panic is still
> ocurring when the drm-kmod modules are loaded.
>
> This is on a Lenovo A485 Laptop, which is an AMD Ryzen processor
> and a Radeon Vega graphics.
> My last known working revision is r352987.
>
>
> Here are bits of the core dump, I hope they are useful, if more
> information is needed, please don't hesitate to ask.
> BTW: I usually compile GENERIC-NODEBUG, if that results in the
> dump being useless (sadly I can't tell), I can disable all the
> performance goodies and compile GENERIC :-).
> --
> Evilham
>
>
> Fatal trap 12: page fault while in kernel mode
> cpuid = 2; apic id = 02
> fault virtual address   = 0xf8
> fault code              = supervisor read data, page not present
> instruction pointer     = 0x20:0xffffffff80b1be61
> stack pointer           = 0x28:0xfffffe00dd81ccc0
> frame pointer           = 0x28:0xfffffe00dd81ccf0
> 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         = 24022 (kldload)
> trap number             = 12
> panic: page fault
> cpuid = 2
> time = 1570970502
> KDB: stack backtrace:
> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame
> 0xfffffe00dd81c920
> vpanic() at vpanic+0x17e/frame 0xfffffe00dd81c980
> panic() at panic+0x43/frame 0xfffffe00dd81c9e0
> trap_pfault() at trap_pfault/frame 0xfffffe00dd81ca50
> trap_pfault() at trap_pfault+0x4f/frame 0xfffffe00dd81cac0
> trap() at trap+0x288/frame 0xfffffe00dd81cbf0
> calltrap() at calltrap+0x8/frame 0xfffffe00dd81cbf0
> --- trap 0xc, rip = 0xffffffff80b1be61, rsp = 0xfffffe00dd81ccc0,
>     rbp = 0xfffffe00dd81ccf0 ---
> pfs_destroy() at pfs_destroy+0x11/frame 0xfffffe00dd81ccf0
> pfs_uninit() at pfs_uninit+0x16/frame 0xfffffe00dd81cd10
> vfs_modevent() at vfs_modevent+0x474/frame 0xfffffe00dd81cd50
> module_register_init() at module_register_init+0xa4/frame
> 0xfffffe00dd81cd80
> linker_load_module() at linker_load_module+0xb49/frame
> 0xfffffe00dd81d0a0
> linker_load_dependencies() at linker_load_dependencies+0x18c/frame
> 0xfffffe00dd81d0f0
> link_elf_load_file() at link_elf_load_file+0x1127/frame
> 0xfffffe00dd81d1b0
> linker_load_module() at linker_load_module+0x89a/frame
> 0xfffffe00dd81d4d0
> linker_load_dependencies() at linker_load_dependencies+0x18c/frame
> 0xfffffe00dd81d520
> link_elf_load_file() at link_elf_load_file+0x1127/frame
> 0xfffffe00dd81d5e0
> linker_load_module() at linker_load_module+0x89a/frame
> 0xfffffe00dd81d900
> kern_kldload() at kern_kldload+0xbd/frame 0xfffffe00dd81d950
> sys_kldload() at sys_kldload+0x5b/frame 0xfffffe00dd81d980
> amd64_syscall() at amd64_syscall+0x3a3/frame 0xfffffe00dd81dab0
> fast_syscall_common() at fast_syscall_common+0x101/frame
> 0xfffffe00dd81dab0
> --- syscall (304, FreeBSD ELF64, sys_kldload), rip = 0x8002d1cda,
>     rsp = 0x7fffffffd748, rbp = 0x7fffffffdcc0 ---
> KDB: enter: panic
>
>
> __curthread () at /freebsd/src/sys/amd64/include/pcpu_aux.h:55
> 55              __asm("movq %%gs:%P1,%0" : "=r" (td) : "n"
> (offsetof(struct pcpu,
> (kgdb) #0  __curthread () at
> /freebsd/src/sys/amd64/include/pcpu_aux.h:55
> #1  doadump (textdump=0) at
>  /freebsd/src/sys/kern/kern_shutdown.c:392
> #2  0xffffffff80496a7a in db_dump (dummy=<optimized out>,
>     dummy2=<unavailable>, dummy3=<unavailable>,
>     dummy4=<unavailable>)
>     at /freebsd/src/sys/ddb/db_command.c:575
> #3  0xffffffff8049683c in db_command (last_cmdp=<optimized out>,
>     cmd_table=<optimized out>, dopager=1)
>     at /freebsd/src/sys/ddb/db_command.c:482
> #4  0xffffffff804965ad in db_command_loop ()
>     at /freebsd/src/sys/ddb/db_command.c:535
> #5  0xffffffff80499858 in db_trap (type=<optimized out>,
>  code=<optimized out>)
>     at /freebsd/src/sys/ddb/db_main.c:252
> #6  0xffffffff80c322a7 in kdb_trap (type=3, code=0, tf=<optimized
>  out>)
>     at /freebsd/src/sys/kern/subr_kdb.c:692
> #7  0xffffffff8105d925 in trap (frame=0xfffffe00dd81c850)
>     at /freebsd/src/sys/amd64/amd64/trap.c:585
> #8  <signal handler called>
> #9  kdb_enter (why=0xffffffff811dee7e "panic", msg=<optimized
>  out>)
>     at /freebsd/src/sys/kern/subr_kdb.c:479
> #10 0xffffffff80be377a in vpanic (fmt=<optimized out>,
>  ap=<optimized out>)
>     at /freebsd/src/sys/kern/kern_shutdown.c:897
> #11 0xffffffff80be35d3 in panic (
>     fmt=0xffffffff818e4c18 <vt_conswindow+16>
>     "\357\327\037\201\377\377\377\377") at
>     /freebsd/src/sys/kern/kern_shutdown.c:835
> #12 0xffffffff8105ddb0 in trap_fatal (frame=0xfffffe00dd81cc00,
>  eva=248)
>     at /freebsd/src/sys/amd64/amd64/trap.c:925
> #13 0xffffffff8105ddff in trap_pfault (frame=0xfffffe00dd81cc00,
>     usermode=<optimized out>, signo=<optimized out>,
>     ucode=<optimized out>)
>     at /freebsd/src/sys/amd64/amd64/trap.c:743
> #14 0xffffffff8105d458 in trap (frame=0xfffffe00dd81cc00)
>     at /freebsd/src/sys/amd64/amd64/trap.c:407
> #15 <signal handler called>
> #16 pfs_destroy (pn=0x0) at
>  /freebsd/src/sys/fs/pseudofs/pseudofs.c:324
> #17 0xffffffff80b1ca96 in pfs_uninit (
>     pi=0xffffffff8360f120 <anon_inodefs_info>,
>     vfc=0xffffffff8360f010 <anon_inodefs_vfsconf>)
>     at /freebsd/src/sys/fs/pseudofs/pseudofs.c:473
> #18 0xffffffff80caddd4 in vfs_register (
>     vfc=0xffffffff8360f010 <anon_inodefs_vfsconf>)
>     at /freebsd/src/sys/kern/vfs_init.c:497
> #19 vfs_modevent (mod=<optimized out>, type=<optimized out>,
>     data=0xffffffff8360f010 <anon_inodefs_vfsconf>)
>     at /freebsd/src/sys/kern/vfs_init.c:582
> #20 0xffffffff80bc0b24 in module_register_init (
>     arg=0xffffffff8360eff8 <anon_inodefs_mod>)
>     at /freebsd/src/sys/kern/kern_module.c:123
> #21 0xffffffff80bb26b9 in linker_file_sysinit (lf=<optimized out>)
>     at /freebsd/src/sys/kern/kern_linker.c:236
> #22 linker_load_file (filename=<optimized out>, result=<optimized
>  out>)
>     at /freebsd/src/sys/kern/kern_linker.c:462
> #23 linker_load_module (kldname=<optimized out>,
>     modname=0xffffffff835d4c80 "linuxkpi_gplv2", parent=<optimized
>     out>,
>     verinfo=<optimized out>, lfpp=<optimized out>)
>     at /freebsd/src/sys/kern/kern_linker.c:2110
> #24 0xffffffff80bb4eec in linker_load_dependencies
>  (lf=0xfffff800060dcc00)
>     at /freebsd/src/sys/kern/kern_linker.c:2200
> #25 0xffffffff810d6027 in link_elf_load_file (cls=<optimized out>,
>     filename=0xfffff8000645bcc0 "/boot/modules/drm.ko",
>     result=0xfffffe00dd81d358) at
>     /freebsd/src/sys/kern/link_elf_obj.c:1004
> #26 0xffffffff80bb240a in LINKER_LOAD_FILE (
>     cls=0xffffffff81972e90 <link_elf_class>, filename=<optimized
>     out>,
>     result=<optimized out>) at ./linker_if.h:180
> #27 linker_load_file (filename=<optimized out>, result=<optimized
>  out>)
>     at /freebsd/src/sys/kern/kern_linker.c:447
> #28 linker_load_module (kldname=<optimized out>,
>     modname=0xffffffff83542bc4 "drmn", parent=<optimized out>,
>     verinfo=<optimized out>, lfpp=<optimized out>)
>     at /freebsd/src/sys/kern/kern_linker.c:2110
> #29 0xffffffff80bb4eec in linker_load_dependencies
>  (lf=0xfffff800060db200)
>     at /freebsd/src/sys/kern/kern_linker.c:2200
> #30 0xffffffff810d6027 in link_elf_load_file (cls=<optimized out>,
>     filename=0xfffff8000503ed80 "/boot/modules/amdgpu.ko",
>     result=0xfffffe00dd81d788) at
>     /freebsd/src/sys/kern/link_elf_obj.c:1004
> #31 0xffffffff80bb240a in LINKER_LOAD_FILE (
>     cls=0xffffffff81972e90 <link_elf_class>, filename=<optimized
>     out>,
>     result=<optimized out>) at ./linker_if.h:180
> #32 linker_load_file (filename=<optimized out>, result=<optimized
>  out>)
>     at /freebsd/src/sys/kern/kern_linker.c:447
> #33 linker_load_module (kldname=<optimized out>,
>     modname=0xfffff8000612b000 "amdgpu", parent=<optimized out>,
>     verinfo=<optimized out>, lfpp=<optimized out>)
>     at /freebsd/src/sys/kern/kern_linker.c:2110
> #34 0xffffffff80bb3f2d in kern_kldload (td=<optimized out>,
>     file=<optimized out>, fileid=0xfffffe00dd81d964)
>     at /freebsd/src/sys/kern/kern_linker.c:1089
> #35 0xffffffff80bb406b in sys_kldload (td=0xfffff800125d8000,
>     uap=<optimized out>) at
>     /freebsd/src/sys/kern/kern_linker.c:1115
> #36 0xffffffff8105e973 in syscallenter (td=0xfffff800125d8000)
>     at /freebsd/src/sys/amd64/amd64/../../kern/subr_syscall.c:144
> #37 amd64_syscall (td=0xfffff800125d8000, traced=0)
>     at /freebsd/src/sys/amd64/amd64/trap.c:1162
> #38 <signal handler called>
> #39 0x00000008002d1cda in ?? ()
> Backtrace stopped: Cannot access memory at address 0x7fffffffd748
> (kgdb)
>


-- 
Mateusz Guzik <mjguzik gmail.com>
Received on Sun Oct 13 2019 - 12:37:39 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:22 UTC