From owner-freebsd-current@freebsd.org Thu Jun 11 16:44:40 2020 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECF4833946E for ; Thu, 11 Jun 2020 16:44:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 49jV7r5RWWz42x9 for ; Thu, 11 Jun 2020 16:44:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: by mailman.nyi.freebsd.org (Postfix) id BAB4B339945; Thu, 11 Jun 2020 16:44:40 +0000 (UTC) Delivered-To: current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA7CF339641 for ; Thu, 11 Jun 2020 16:44:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49jV7q50fmz430G; Thu, 11 Jun 2020 16:44:39 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 05BGiMcI042507 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 11 Jun 2020 19:44:25 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 05BGiMcI042507 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 05BGiLER042502; Thu, 11 Jun 2020 19:44:21 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 11 Jun 2020 19:44:21 +0300 From: Konstantin Belousov To: David Wolfskill , Xin Li , Mark Johnston , current@freebsd.org Subject: Re: Panic "vm_fault_lookup: fault on nofault entry" amd64 r362008 -> r362045 Message-ID: <20200611164421.GQ48478@kib.kiev.ua> References: <20200611130500.GW1392@albert.catwhisker.org> <20200611132129.GL48478@kib.kiev.ua> <20200611132924.GX1392@albert.catwhisker.org> <20200611134658.GM48478@kib.kiev.ua> <20200611154456.GY1392@albert.catwhisker.org> <20200611155143.GN48478@kib.kiev.ua> <20200611161156.GB1392@albert.catwhisker.org> <20200611162417.GD32928@raichu> <20200611163331.GC1392@albert.catwhisker.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200611163331.GC1392@albert.catwhisker.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 49jV7q50fmz430G X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [2.01 / 15.00]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_SPAM_SHORT(0.48)[0.476]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all:c]; NEURAL_SPAM_MEDIUM(0.84)[0.842]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.69)[0.689]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.33 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, 11 Jun 2020 16:44:41 -0000 On Thu, Jun 11, 2020 at 09:33:31AM -0700, David Wolfskill wrote: > On Thu, Jun 11, 2020 at 12:24:17PM -0400, Mark Johnston wrote: > > ... > > > Unfortunately, I ran out of time to do further experiments for now; I'll > > > need to do some work-related things for a while, but thought that this > > > might at least provide some useful information. > > > > > > Here is what I commented out: > > > > > > g1-55(12.1-S)[2] grep KIB boot/loader.conf > > > # KIB coretemp_load="YES" > > > # KIB iwn5000fw_load="YES" > > > # KIB linux_load="YES" > > > # KIB nvidia-modeset_load="YES" > > > # KIB cuse_load="YES" > > > # KIB geom_eli_load="YES" > > > # KIB filemon_load="YES" > > > > Thanks. I'm able to reproduce a somewhat similar problem in bhyve: if I > > preload iwn5000fw.ko, a r362045 kernel fails to boot very early with > > > > ---<>--- > > ACPI: Failed to map RSDT > > APIC: Could not find any APICs. > > panic: running without device atpic requires a local APIC > > Ah -- excellent (that you are able to pretty much reproduce this). And > it explains why my build machine wasn't affected: it doesn't use > wireless drivers at all. > > > Reverting r362035 allows the kernel to boot again, but so does adding a > > few printf() calls to the pmap and ACPI code. > > Kinky. :-} This should fix noexec for modules. diff --git a/sys/x86/x86/mp_x86.c b/sys/x86/x86/mp_x86.c index 81db4d7ca85..cb84fc95691 100644 --- a/sys/x86/x86/mp_x86.c +++ b/sys/x86/x86/mp_x86.c @@ -1698,7 +1698,7 @@ smp_targeted_tlb_shootdown(cpuset_t mask, u_int vector, pmap_t pmap, int cpu; /* It is not necessary to signal other CPUs while in the debugger. */ - if (kdb_active || KERNEL_PANICKED()) { + if (kdb_active || KERNEL_PANICKED() || !smp_started) { curcpu_cb(pmap, addr1, addr2); return; } @@ -1759,13 +1759,10 @@ void smp_masked_invltlb(cpuset_t mask, pmap_t pmap, smp_invl_cb_t curcpu_cb) { - if (smp_started) { - smp_targeted_tlb_shootdown(mask, IPI_INVLTLB, pmap, 0, 0, - curcpu_cb); + smp_targeted_tlb_shootdown(mask, IPI_INVLTLB, pmap, 0, 0, curcpu_cb); #ifdef COUNT_XINVLTLB_HITS - ipi_global++; + ipi_global++; #endif - } } void @@ -1773,13 +1770,10 @@ smp_masked_invlpg(cpuset_t mask, vm_offset_t addr, pmap_t pmap, smp_invl_cb_t curcpu_cb) { - if (smp_started) { - smp_targeted_tlb_shootdown(mask, IPI_INVLPG, pmap, addr, 0, - curcpu_cb); + smp_targeted_tlb_shootdown(mask, IPI_INVLPG, pmap, addr, 0, curcpu_cb); #ifdef COUNT_XINVLTLB_HITS - ipi_page++; + ipi_page++; #endif - } } void @@ -1787,24 +1781,20 @@ smp_masked_invlpg_range(cpuset_t mask, vm_offset_t addr1, vm_offset_t addr2, pmap_t pmap, smp_invl_cb_t curcpu_cb) { - if (smp_started) { - smp_targeted_tlb_shootdown(mask, IPI_INVLRNG, pmap, - addr1, addr2, curcpu_cb); + smp_targeted_tlb_shootdown(mask, IPI_INVLRNG, pmap, addr1, addr2, + curcpu_cb); #ifdef COUNT_XINVLTLB_HITS - ipi_range++; - ipi_range_size += (addr2 - addr1) / PAGE_SIZE; + ipi_range++; + ipi_range_size += (addr2 - addr1) / PAGE_SIZE; #endif - } } void smp_cache_flush(smp_invl_cb_t curcpu_cb) { - if (smp_started) { - smp_targeted_tlb_shootdown(all_cpus, IPI_INVLCACHE, NULL, - 0, 0, curcpu_cb); - } + smp_targeted_tlb_shootdown(all_cpus, IPI_INVLCACHE, NULL, 0, 0, + curcpu_cb); } /*