From owner-freebsd-current@freebsd.org Wed Aug 15 10:32:11 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 F0BD9107D0AB for ; Wed, 15 Aug 2018 10:32:10 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 9229E8440A for ; Wed, 15 Aug 2018 10:32:10 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: by mailman.ysv.freebsd.org (Postfix) id 57138107D0A7; Wed, 15 Aug 2018 10:32:10 +0000 (UTC) Delivered-To: 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 1D043107D0A0 for ; Wed, 15 Aug 2018 10:32:10 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93C4684402 for ; Wed, 15 Aug 2018 10:32:09 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mh0.gentlemail.de (ezra.dcm1.omnilan.net [78.138.80.135]) by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id w7FAW8th061132; Wed, 15 Aug 2018 12:32:08 +0200 (CEST) (envelope-from freebsd@omnilan.de) Received: from titan.inop.mo1.omnilan.net (s1.omnilan.de [217.91.127.234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id 438AEACF; Wed, 15 Aug 2018 12:32:08 +0200 (CEST) Subject: Re: EFIRT on machines with pcid after r337773 To: Konstantin Belousov , current@freebsd.org References: <20180814221755.GV2340@kib.kiev.ua> From: Harry Schmalzbauer Organization: OmniLAN Message-ID: Date: Wed, 15 Aug 2018 12:32:05 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180814221755.GV2340@kib.kiev.ua> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Greylist: ACL 130 matched, not delayed by milter-greylist-4.2.7 (mx0.gentlemail.de [78.138.80.130]); Wed, 15 Aug 2018 12:32:08 +0200 (CEST) X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: 78.138.80.135; Sender-helo: mh0.gentlemail.de; ) X-Mailman-Approved-At: Wed, 15 Aug 2018 10:38:51 +0000 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: Wed, 15 Aug 2018 10:32:11 -0000 Am 15.08.2018 um 00:17 schrieb Konstantin Belousov: > If you use UEFI boot, have EFIRT compiled in kernel (the case of > GENERIC) or pre-loaded as module, and efirt is not disabled by a tunable, > and the machine resets during kernel initialization, try this. > > diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c > index d5d795ab502..c9334eab916 100644 > --- a/sys/amd64/amd64/pmap.c > +++ b/sys/amd64/amd64/pmap.c > @@ -1188,7 +1188,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr) > kernel_pmap->pm_pcids[i].pm_pcid = PMAP_PCID_KERN; > kernel_pmap->pm_pcids[i].pm_gen = 1; > } > - PCPU_SET(pcid_next, PMAP_PCID_KERN + 1); > + PCPU_SET(pcid_next, PMAP_PCID_KERN + 2); > PCPU_SET(pcid_gen, 1); > /* > * pcpu area for APs is zeroed during AP startup. > @@ -2651,8 +2651,8 @@ pmap_pinit0(pmap_t pmap) > bzero(&pmap->pm_stats, sizeof pmap->pm_stats); > pmap->pm_flags = pmap_flags; > CPU_FOREACH(i) { > - pmap->pm_pcids[i].pm_pcid = PMAP_PCID_NONE; > - pmap->pm_pcids[i].pm_gen = 0; > + pmap->pm_pcids[i].pm_pcid = PMAP_PCID_KERN + 1; > + pmap->pm_pcids[i].pm_gen = 1; > if (!pti) { > __pcpu[i].pc_kcr3 = PMAP_NO_CR3; > __pcpu[i].pc_ucr3 = PMAP_NO_CR3; Thanks a lot! Just wanted to confirm this fixed booting _without_ "efi.rt.disabled=1" for me: ---<>--- Copyright (c) 1992-2018 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-FP0_ALPHA1 #0 r337804M: Wed Aug 15 12:14:43 CEST 2018 hes@preed.egn.mo1.omnilan.net:/usr/local/share/deploy-tools/obj/HEAD-HWLYNX/usr/local/share/deploy-tools/HEAD/src/amd64.amd64/ sys/HWLYNX.titan amd64 FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on LLVM 6.0.1) WARNING: WITNESS option enabled, expect reduced performance. VT(efifb): resolution 1600x1200 link_elf_obj: symbol critical_enter undefined KLD file vboxdrv.ko - could not finalize loading info: [drm] Initialized drm 1.1.0 20060810 CPU: Intel(R) Core(TM) i3-4330 CPU @ 3.50GHz (3491.98-MHz K8-class CPU)   Origin="GenuineIntel"  Id=0x306c3  Family=0x6  Model=0x3c Stepping=3 Features=0xbfebfbff Features2=0x7fdafbbf   AMD Features=0x2c100800   AMD Features2=0x21   Structured Extended Features=0x27ab   Structured Extended Features3=0xc000000   XSAVE Features=0x1   VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID   TSC: P-state invariant, performance statistics real memory  = 17179869184 (16384 MB) avail memory = 16288931840 (15534 MB) Event timer "LAPIC" quality 600 ACPI APIC Table: FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs FreeBSD/SMP: 1 package(s) x 2 core(s) x 2 hardware threads random: unblocking device. ioapic0 irqs 0-23 on motherboard Launching APs: 1 3 2 Timecounter "TSC-low" frequency 1745992496 Hz quality 1000 Cuse v0.1.35 @ /dev/cuse random: entropy device external interface random: registering fast source Intel Secure Key RNG random: fast provider: "Intel Secure Key RNG" kbd1 at kbdmux0 netmap: loaded module module_register_init: MOD_LOAD (vesa, 0xffffffff80b6f400, 0) error 19 nexus0 efirtc0: on motherboard efirtc0: registered as a time-of-day clock, resolution 1.000000s Curious what this means: smbios0: SMBIOS checksum failed. Has always been there on this LynxPoint/Haswell machine... thanks, -harry