tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Page fault when reading EFI systbl on Asus X550C



Hi,

I've been having trouble booting NetBSD-9 on my UEFI-enabled Asus
laptop.  Long story short, the boot procedure crashes early with
the following dmesg output:

  efi: systbl at pa ca0d9f18
  uvm_fault(0xffffffff81714c20, 0xffffe0f8b46d9000, 1) -> e
  fatal page fault in supervisor mode
  trap type 6 code 0 rip 0xffffffff8023cac7 cs 0x8 rflags 0x10246
cr2 0xffffe0f8b46d9f28 ilevel 0x8 rsp 0xffffffff81b06e50
  curlwp 0xffffffff816574a0 pid 0.1 lowest kstack 0xffffffff81b022c0

With help on IRC, we've been able to debug this a bit.  This rip points
out to line 350 of efi.c [1], that is the first aprint_debug()
in efi_is32x64 condition.  jak suggested that this condition is probably
evaluated wrongly as I'm using the 64-bit bootloader.  However, when I
explicitly forced it to false, the code faulted in the aprint_debug()
just below the conditional.  In any case, it looked like any access to
efi sysbtl faults.

After a lot of bisecting, and comparing stable 8 branch (which works)
with trunk, I've came to the conclusion that the commit 'Limit the size
of the direct map with a 2MB granularity' [2] is actually causing
the fault.  I haven't been able to revert it on top of current trunk;
however, I've been able to verify that with a later size fix included
([3]), the commit preceding it works and this one starts failing.

On jak's suggestion, I've obtained memmap for my system (from Linux).
Full map is included at the end of the mail; however, the relevant area
seems to be:

0xca035000	0xca5d9fff	Reserved

jak tipped that the fact that systbl resides in 'reserved' area of
memory may be the culprit.  Could you advise how to solve this or debug
it further?  TIA.


[1]:https://github.com/NetBSD/src/blob/b0e10a0335adcd63e293858cf20d17bcea7bfe2b/sys/arch/x86/x86/efi.c#L350
[2]:https://github.com/NetBSD/src/commit/c813be5ea6a9535bf7242ba0c10e0b1f64f225a9
[3]:https://github.com/NetBSD/src/commit/213657f3c015a98382dc30519d6206d116367f2f

Full memmap:

0x0		0x9dfff		System RAM
0x9e000		0x9ffff		Reserved
0x100000	0x1fffffff	System RAM
0x20000000	0x201fffff	Reserved
0x20200000	0x40003fff	System RAM
0x40004000	0x40004fff	Reserved
0x40005000	0xc9713fff	System RAM
0xc9714000	0xc9715fff	Reserved
0xc9716000	0xc9721fff	System RAM
0xc9722000	0xc9725fff	Reserved
0xc9726000	0xc972afff	System RAM
0xc972b000	0xc9d2bfff	ACPI Non-volatile Storage
0xc9d2c000	0xc9d2efff	Reserved
0xc9d2f000	0xc9d3efff	System RAM
0xc9d3f000	0xc9d42fff	Reserved
0xc9d43000	0xc9d43fff	System RAM
0xc9d44000	0xc9d49fff	Reserved
0xc9d4a000	0xc9ef4fff	System RAM
0xc9ef5000	0xc9ef8fff	Reserved
0xc9ef9000	0xc9f41fff	System RAM
0xc9f42000	0xc9f43fff	Reserved
0xc9f44000	0xc9f45fff	System RAM
0xc9f46000	0xc9f59fff	Reserved
0xc9f5a000	0xc9f5cfff	System RAM
0xc9f5d000	0xc9f5efff	Reserved
0xc9f5f000	0xc9f75fff	System RAM
0xc9f76000	0xc9f7bfff	Reserved
0xc9f7c000	0xc9f89fff	System RAM
0xc9f8a000	0xc9f8afff	Reserved
0xc9f8b000	0xc9f8cfff	System RAM
0xc9f8d000	0xc9f8dfff	Reserved
0xc9f8e000	0xc9f98fff	System RAM
0xc9f99000	0xc9f9dfff	Reserved
0xc9f9e000	0xc9fc9fff	System RAM
0xc9fca000	0xc9fcafff	Reserved
0xc9fcb000	0xc9fdafff	System RAM
0xc9fdb000	0xca000fff	Reserved
0xca001000	0xca013fff	System RAM
0xca014000	0xca014fff	Reserved
0xca015000	0xca015fff	System RAM
0xca016000	0xca017fff	Reserved
0xca018000	0xca018fff	System RAM
0xca019000	0xca01dfff	Reserved
0xca01e000	0xca034fff	System RAM
0xca035000	0xca5d9fff	Reserved
0xca5da000	0xca859fff	ACPI Non-volatile Storage
0xca85a000	0xca85efff	ACPI Tables
0xca85f000	0xca85ffff	System RAM
0xca860000	0xca8a2fff	ACPI Non-volatile Storage
0xca8a3000	0xcacbafff	System RAM
0xcacbb000	0xcaff3fff	Reserved
0xcaff4000	0xcaffffff	System RAM
0xcbc00000	0xcfdfffff	Reserved
0xf8000000	0xfbffffff	Reserved
0xfec00000	0xfec00fff	Reserved
0xfed00000	0xfed03fff	Reserved
0xfed1c000	0xfed1ffff	Reserved
0xfee00000	0xfee00fff	Reserved
0xff000000	0xffffffff	Reserved
0x100000000	0x12f1fffff	System RAM


-- 
Best regards,
Michał Górny

Attachment: signature.asc
Description: This is a digitally signed message part



Home | Main Index | Thread Index | Old Index