From owner-freebsd-current@freebsd.org Tue Aug 14 23:38: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 5410A1069CEE for ; Tue, 14 Aug 2018 23:38:15 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.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 E43908E12A for ; Tue, 14 Aug 2018 23:38:14 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id A7EAF1069CEC; Tue, 14 Aug 2018 23:38:14 +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 85DDF1069CEB for ; Tue, 14 Aug 2018 23:38:14 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yw1-xc41.google.com (mail-yw1-xc41.google.com [IPv6:2607:f8b0:4864:20::c41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 219938E128 for ; Tue, 14 Aug 2018 23:38:14 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yw1-xc41.google.com with SMTP id 139-v6so17557051ywg.12 for ; Tue, 14 Aug 2018 16:38:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=rPBFScVB4IeWpaV9VE7m3FQsR41d/JY96v5qhfj6t1s=; b=PicrDwRWTCgRKx+LHYp27omB3oSxCKfjeC44bf5j+KEqg3Gh3XL3Nwfrd7ia0KX+mv +FSJje3XBGhsMZWooeZD9zrvDJCfoNvU5BRn0ROZ/WybzLWIL7NzmzBirOfvMA0CGG6T 9IynRNtlakbCiV0NlJOm6J0ug1nXNYU6XT8GRwjUQ4URIyIdrlFFcV/LSBSx6+ySWakV VpYs+LxQu96X3KtdKDCWyYEQSXlvN5xydNXhuyRYt2Iirj3y1HeHwlcwkIp53JDrMeTI WscYg3w0TXz5epzCFa8LYzCBUft/5GxKYUhYuTIimGgMimlO5moYTCcRyrSAtFaRGMMe YdBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=rPBFScVB4IeWpaV9VE7m3FQsR41d/JY96v5qhfj6t1s=; b=rK57532nHucxUne5Fs9rGeM94X0u+wWpMb5DOINj4hRZNshij9WaJw0w0EpdhvirjJ RQcSfwRsGkC+Q3ZvWKWYN1s0FCOVwFMXvJkgjpggtb/hAw+/Ra77MTiwC1pHVneboyEx VCzbOEiDdkxqcXKxd7QqSO43m47/df9T2tuWirymZ7O8lIPcY1d/zIT/YCfOseAMniuH L5djndQ4AV8+t39n8mKAw3z3GInEW82KcwCek7uHNFkPVIYooW18ZC0xaGBfeA/Ufrjs /UmJ/QoI/JU2y19pHNQTx5IuTHM6LEl0yrSAs7Hgl6YxOo+ldqvsBHdD7ldpyTJ9qslk 1NVQ== X-Gm-Message-State: AOUpUlHZwezh35VAbN8ibWI83FHdzO+r5KlDQgF2Eiho/mFNxjc6/YOD ujh0tyKSjb4sOpjIfpBsBG01tI72pwKfypnAxFisuw== X-Google-Smtp-Source: AA+uWPwIvuxem9bQuohKhXpXvgK7C03O/QKgTrkVrTqiX9klgK33FgyOyGIGRjn/XQr9XPtm5qGVCHtDhBf9c2fkjs4= X-Received: by 2002:a5b:141:: with SMTP id c1-v6mr12676532ybp.331.1534289893647; Tue, 14 Aug 2018 16:38:13 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:f205:0:0:0:0:0 with HTTP; Tue, 14 Aug 2018 16:38:13 -0700 (PDT) In-Reply-To: <20180814221755.GV2340@kib.kiev.ua> References: <20180814221755.GV2340@kib.kiev.ua> From: Oliver Pinter Date: Wed, 15 Aug 2018 01:38:13 +0200 Message-ID: Subject: Re: EFIRT on machines with pcid after r337773 To: Konstantin Belousov Cc: current@freebsd.org, kevans@freebsd.org Content-Type: text/plain; charset="UTF-8" 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: Tue, 14 Aug 2018 23:38:15 -0000 Hi! Seems like this patch fixed the boot issue on Dell e5440 with UEFI. Once you get to MFC, please X-MFC-with the following patch: commit dfe1112fa878c5d8fa0605d1de10c96ecc993569 Author: rlibby Date: Fri Jul 21 17:11:36 2017 +0000 __pcpu: gcc -Wredundant-decls Pollution from counter.h made __pcpu visible in amd64/pmap.c. Delete the existing extern decl of __pcpu in amd64/pmap.c and avoid referring to that symbol, instead accessing the pcpu region via PCPU_SET macros. Also delete an unused extern decl of __pcpu from mp_x86.c. Reviewed by: kib Approved by: markj (mentor) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D11666 Notes: svn path=/head/; revision=321335 On 8/15/18, 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" >