From owner-freebsd-current@freebsd.org Thu Aug 30 08:56:15 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B30DB10990F9 for ; Thu, 30 Aug 2018 08:56:15 +0000 (UTC) (envelope-from rhurlin@gwdg.de) Received: from imailer.gwdg.de (imailer.gwdg.de [134.76.11.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51FDF77F1F; Thu, 30 Aug 2018 08:56:15 +0000 (UTC) (envelope-from rhurlin@gwdg.de) Received: from excmbx-24.um.gwdg.de ([134.76.9.234] helo=email.gwdg.de) by mailer.gwdg.de with esmtp (Exim 4.90_1) (envelope-from ) id 1fvIkJ-00014H-GS; Thu, 30 Aug 2018 10:56:07 +0200 Received: from krabat.raven.hur (91.8.156.212) by EXCMBX-24.um.gwdg.de (134.76.9.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1531.3; Thu, 30 Aug 2018 10:56:07 +0200 Subject: Re: r336921 broke booting on MBP 2017, EFIRT related To: Kyle Evans , CC: Konstantin Belousov , FreeBSD Current References: <499f05f4-4fab-9b31-5d37-83ecb554013c@yuripv.net> <20180829102727.GD2340@kib.kiev.ua> From: Rainer Hurling Message-ID: <7162d397-43df-01bc-f97d-0dae6a8f6926@gwdg.de> Date: Thu, 30 Aug 2018 10:56:06 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Originating-IP: [91.8.156.212] X-ClientProxiedBy: EXCMBX-14.um.gwdg.de (134.76.9.225) To EXCMBX-24.um.gwdg.de (134.76.9.234) X-Virus-Scanned: (clean) by clamav X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2018 08:56:15 -0000 Am 29.08.18 um 16:12 schrieb Kyle Evans: > On Wed, Aug 29, 2018 at 6:53 AM Yuri Pankov wrote: >> >> Yuri Pankov wrote: >>> Konstantin Belousov wrote: >>>> On Wed, Aug 29, 2018 at 12:37:52PM +0300, Yuri Pankov wrote: >>>>> Hi, >>>>> >>>>> I've noticed that all recent snapshots (ALPHA3, ALPHA2, ALPHA1, >>>>> 20180802) fail to boot on MBP 2017: >>>>> >>>>> kbd0 at kbdmux0 >>>>> netmap: loaded module >>>>> nexus0 >>>>> >>>>> Fatal trap 12: page fault while in kernel mode >>>>> cpuid = 2: apic id = 02 >>>>> fault virtual address = 0x74c64a50 >>>>> fault code = supervisor read data, page not present >>>>> instruction pointer = 0x20: 0x7abece31 >>>>> stack pointer = 0x28: 0xffffffff82b2f7c0 >>>>> frame pointer = 0x28: 0xffffffff82b2f810 >>>>> 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 (swapper) >>>>> [ thread pid 0 tid 100000 ] >>>>> Stopped at 0x7abece31: calll *0x18(%rax) >>>>> db> >>>>> >>>>> Sadly, there's no support for internal keyboard yet (it's connected via >>>>> SPI), and external USB one stops working. >>>>> >>>>> A (not so quick) bisect is pointing at r336921, which enabled EFIRT. >>>>> >>>>> Some questions here: >>>>> - is this something that can/should be fixed? >>>>> - can we print some "enabling EFIRT" message to the console to make >>>>> guesses about the problem source a bit easier? >>>> >>>> It is not in 'enabling'. Looking at the faulting VA, I believe that >>>> it occurs inside the BIOS code. >>>> >>>> Disable efirt by removing the kernel option, then try to load the module >>>> at runtime. Does it still fault ? Also, get the efi mem map for the >>>> machine and look at which region the faulting address and the faulting >>>> instruction belong. >>> >>> kldload'ing the efirt module gets the same fault. Several top lines of >>> backtrace: >>> >>> kernphys() at 0x7abece31 >>> efi_get_time() at efi_get_time+0xd9 >>> efirtc_probe() at efirtc_probe+0x17 >> >> For the efi mem map, if I'm understanding it correctly, there's the >> following: >> >> ... >> BootServicesData 00007421d000 000000000000 00000a8b UC WC WT WB >> ... >> RuntimeServicesCode 00007ab9f000 000000000000 00000070 UC WC WT WB >> ... >> > > Hi, > > I guess this patch might do it: > https://people.freebsd.org/~kevans/efi-bootmap.diff > > Linux commit messages depict a tale in which they used to also only > map RUNTIME entries, but they were effectively forced to back down on > that because of buggy firmware that does exactly what you've described > and they later reintroduced the restrictive mapping for i386-only > where they'd not found such bugs. > > Thanks, > > Kyle Evans Hi Kyle, After Yuri had no success with the patches of kib, I tried your patch on a DELL Latitude E6520 with BIOS version A21. Kernel config file contains OPTIONS EFIRT, efi.rt.disabled is commented out in /boot/loader.conf. Unfortunately, it also does not work. My trap message is this: [..snip..] netmap: loaded module kbd1 at kbdmux0 nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms 390.77 Tue Jul. 10 21:54:30 PDT 2018 nexus0 Fatal trap 12: page fault while in kernel mode cpuid = 0: apic id = 00 fault virtual address = 0xce09ee60 fault code = supervisor read data, page not present instruction pointer = 0x20: 0xcf58334d stack pointer = 0x28: 0xffffffff83252920 frame pointer = 0x28: 0xffffffff832529a0 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 (swapper) trap number = 12 panic: page fault cpuid = 0 time = 1 Uptime: 1s Automatic reboot in 15 seconds ... Regards, Rainer Hurling