From owner-freebsd-current@freebsd.org Wed Aug 15 09:56:03 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 29255107BF31 for ; Wed, 15 Aug 2018 09:56:03 +0000 (UTC) (envelope-from ohartmann@walstatt.org) 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 BC4C182D2F for ; Wed, 15 Aug 2018 09:56:02 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: by mailman.ysv.freebsd.org (Postfix) id 80EB8107BF2F; Wed, 15 Aug 2018 09:56:02 +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 6F97D107BF2E for ; Wed, 15 Aug 2018 09:56:02 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF63782D2E for ; Wed, 15 Aug 2018 09:56:01 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from freyja.zeit4.iv.bundesimmobilien.de ([87.138.105.249]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Ln8Tl-1gNXj02Sc9-00hQlc; Wed, 15 Aug 2018 11:55:59 +0200 Date: Wed, 15 Aug 2018 11:55:58 +0200 From: "O. Hartmann" To: Konstantin Belousov Cc: current@freebsd.org Subject: Re: EFIRT on machines with pcid after r337773 Message-ID: <20180815115550.00f73ab9@freyja.zeit4.iv.bundesimmobilien.de> In-Reply-To: <20180814221755.GV2340@kib.kiev.ua> References: <20180814221755.GV2340@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:11OgwAHIV24rgjYVej+h7c/+Fr17kyHRChg822jUsjAKuIYaWGT SB+QPLoeynDsMgblJ/Js5CXZggYDGJy3yFnIY3eTG0WkDQnlmehrgK4owjPmAzSocQg+F9m sU7LEnFP69wvLV1ShPonooERSI9A+32qK1HcF6sbKyr6pdxyEq1Kf4fmFe5m7OCqtWjl/ZQ BJEKWSI3LMZNLne6f5xJA== X-UI-Out-Filterresults: notjunk:1;V01:K0:DOW+B6n/S+o=:dnm6uLI6X/uh3zYsJQiRo7 JrV+jcfgH0xsK8ChkJoYhmuz6FGgWmsDMEE8ihkA0u80oDAmDlIyXOvczWgIMQSUE28ahlzG8 /QoKdRKL4rOlkGx9b19cRnpHaLZ/0xEupnd2NYGOr5XBFCEM+dwdFXYyEqegvT8AREKATCS9I YJDfNaCAYF2G6FpTd/caE0KkPVu4L8Rkug03TonroFlHtE58wT9zKLlfwfNvijCGH+6IquZB8 f378np2KaEDyuWTDW2wzdcuXlF+ykccoRDI4hp4j8SvOcPGhZ1rHm9BW6liw04488Lx4Ma6qc qErkyGnNadF0vRH1Tb5N6sPFDyS8uYQUewGitdnvIH9H7PJLbf8+mV/E5wG2O4olKAUsgl4Pe n/G+OeRTOlaFVBDD2CrTo26LBD41ov2ZoFuKP7lojKSMmzPESZ0W+/s9OPHqshpPX5PuDyspb +VpM6VYoNjQckta3xCZljAzRGOqDURkhmMDk2mwnXw0lkf8pqBi/YaS1I1R5AMBOWXYouDmHd i/WsSA3Xm6AYLnadZec2dXFMCkeBuc9bygtpE4QYk+s6T6Ndpvf3FkZeL6WWNZ4slOljWEGdr cwBlkDyxyTb7Ng/w85qEbnJr5/V08ACQ18FcL/m4oU6Ho9XVJ5uik+RiGsnrJL260QDCCt3O0 H1raOI01oFYUYQuEMKa/gmbyXeECviB/Rw4Yh57fk+EudQ1RuCm6QYecwwBOaRgYMoqOak3ks 6W+X7vQkL7hWf8vzjhRtgeX3JRSg9mlakOIywKUNoXuVkfLsvKSx88IkqluKc8MZ0JMiKYwQq 4MHjQMs 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 09:56:03 -0000 On Wed, 15 Aug 2018 01:17:55 +0300 Konstantin Belousov wrote: > 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; > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" Is this patch going to hit the tree soon? Since it seems crucial to UEFI booting systems having options EFIRT set in the kernel (as GENERIC does). Regards, oh