Re: EFI RT page fault in init pid = 1

From: Tomoaki AOKI <junchoon_at_dec.sakura.ne.jp>
Date: Sat, 04 Jan 2025 01:39:15 UTC
On Fri, 3 Jan 2025 18:43:55 -0500
Dennis Clarke <dclarke@blastwave.org> wrote:

> 
> I wonder if anyone else has seen such a message at shutdown :
> 
> 
> 
> Fatal trap 12: page fault while in kernel mode
> cpuid = 0; apic id = 00
> fault virtual address   = 0x0
> fault code              = supervisor read data, page not present
> instruction pointer     = 0x20:0x7c38f87a
> stack pointer           = 0x28:0xfffffe035500bba8
> frame pointer           = 0x28:0x5
> 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         = 1 (init)
> rdi: fffffe035500bcd8 rsi: 0000000000000004 rdx: 0000000000000000
> rcx: 0000000000000000  r8: 0000000000000000  r9: 0000000000000000
> rax: 00000000800b0040 rbx: 0000000000000002 rbp: 0000000000000005
> r10: 00000000800b0000 r11: 0000000000000000 r12: fffff80103969000
> r13: fffff80101c57140 r14: 0000000000004008 r15: fffff801019895a8
> trap number             = 12
> EFI RT page fault
> acpi0: Powering system off
> 
> I have not seen such a thing while the machine was running.
> 
> Machine in question is 15.0-CURRENT :
> 
> Loading kernel...
> /boot/kernel/kernel text=0x1826b8 text=0xd92d38 text=0x437223 
> data=0x180+0xe80 data=0x19e1e0+0x461e20 0x8+0x198e70+0x8+0x1bcd67
> Loading configured modules...
> /boot/kernel/vmm.ko size 0x37e660 at 0x2156000
> /etc/hostid size=0x25
> /boot/kernel/zfs.ko size 0x6082b8 at 0x24d5000
> /boot/kernel/geom_mirror.ko size 0x21428 at 0x2ade000
> /boot/entropy size=0x1000
> /boot/kernel/cryptodev.ko size 0x8808 at 0x2b01000
> staging 0x6b200000 (not copying) tramp 0x6b14b000 PT4 0x6b142000
> Start @ 0xffffffff80383000 ...
> Loading splash ok
> GDB: no debug ports present
> KDB: debugger backends: ddb
> KDB: current backend: ddb
> ---<<BOOT>>---
> Copyright (c) 1992-2025 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 15.0-CURRENT #3 main-n274510-3d0a0dda3a7d-dirty: Thu Jan  2 
> 01:28:25 GMT 2025
>      root@titan:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG amd64
> FreeBSD clang version 19.1.5 (https://github.com/llvm/llvm-project.git 
> llvmorg-19.1.5-0-gab4b5a2db582)
> VT(vga): resolution 640x480
> CPU: Intel(R) Xeon(R) CPU E5-2640 v4 @ 2.40GHz (2394.50-MHz K8-class CPU)
>    Origin="GenuineIntel"  Id=0x406f1  Family=0x6  Model=0x4f  Stepping=1
>  
> 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=0x7ffefbff<SSE3,PCLMULQDQ,DTES64,MON,DS_CPL,VMX,SMX,EST,TM2,SSSE3,SDBG,FMA,CX16,xTPR,PDCM,PCID,DCA,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,TSCDLT,AESNI,XSAVE,OSXSAVE,AVX,F16C,RDRAND>
>    AMD Features=0x2c100800<SYSCALL,NX,Page1GB,RDTSCP,LM>
>    AMD Features2=0x121<LAHF,ABM,Prefetch>
>    Structured Extended 
> Features=0x21cbfbb<FSGSBASE,TSCADJ,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM,PQM,NFPUSG,PQE,RDSEED,ADX,SMAP,PROCTRACE>
>    Structured Extended Features3=0x9c000400<MD_CLEAR,IBPB,STIBP,L1DFL,SSBD>
>    XSAVE Features=0x1<XSAVEOPT>
>    VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID,VID,PostIntr
>    TSC: P-state invariant, performance statistics
> real memory  = 549739036672 (524272 MB)
> avail memory = 535434485760 (510630 MB)
> .
> .
> .
> etc
> 
> 
> 
> I suspect there are changes recently in the RT EFI world ?

Hi. Just a FYI. Not dug into.

AFAICR, there were
  commit dd2b5443644505af51c95503898ab363e7d7c29d [1]
    "amd64: on any fault during call to EFI RT, restore execution
     and print fault details"
and
  commit 3e8f4a30594fad6784504d019613ad815b6c9dc5 [2]
    "efirt: use correct ABI for runtime EFI functions"

last December. And at least the former depends on

  commit 5e3ab1894e1ef0520925038f8d4e4a451e841345 [3]
    "amd64: extract code to print fault details from trap_fatal()
     into a new helper"

which is not directly related with EFIRT itself.


[1]
https://cgit.freebsd.org/src/commit/?id=dd2b5443644505af51c95503898ab363e7d7c29d 

[2]
https://cgit.freebsd.org/src/commit/?id=3e8f4a30594fad6784504d019613ad815b6c9dc5

[3]
https://cgit.freebsd.org/src/commit/?id=5e3ab1894e1ef0520925038f8d4e4a451e841345

> 
> 
> 
> --
> Dennis Clarke
> RISC-V/SPARC/PPC/ARM/CISC
> UNIX and Linux spoken


-- 
Tomoaki AOKI    <junchoon@dec.sakura.ne.jp>