From owner-svn-src-head@freebsd.org Sat Feb 25 08:09:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBDF0CEC4B1; Sat, 25 Feb 2017 08:09:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 94ABCB60; Sat, 25 Feb 2017 08:09:48 +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 v1P89g5q083828 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 25 Feb 2017 10:09:42 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v1P89g5q083828 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v1P89gqA083827; Sat, 25 Feb 2017 10:09:42 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 25 Feb 2017 10:09:42 +0200 From: Konstantin Belousov To: Andriy Gapon Cc: "Jonathan T. Looney" , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r314216 - head/sys/x86/x86 Message-ID: <20170225080942.GA2092@kib.kiev.ua> References: <201702241856.v1OIu150004903@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.2 (2016-11-26) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Feb 2017 08:09:49 -0000 On Sat, Feb 25, 2017 at 09:50:32AM +0200, Andriy Gapon wrote: > On 24/02/2017 20:56, Jonathan T. Looney wrote: > > Author: jtl > > Date: Fri Feb 24 18:56:00 2017 > > New Revision: 314216 > > URL: https://svnweb.freebsd.org/changeset/base/314216 > > > > Log: > > We have seen several cases recently where we appear to get a double-fault: > > We have an original panic. Then, instead of writing the core to the dump > > device, the kernel has a second panic: "smp_targeted_tlb_shootdown: > > interrupts disabled". This change is an attempt to fix that second panic. > > Just curious if you were able to find out what code caused those shootdowns to > be sent. > It's pretty unusual for the after-panic code to do things like that. Memory allocations for busdma in coredumping path do that. I know this from spending a lot of time making core dumps working with DMAR busdma. > > > > When the other CPUs are stopped, we can't notify them of the TLB shootdown, > > so we skip that operation. However, when the CPUs come back up, we > > invalidate the TLB to ensure they correctly observe any changes to the > > page mappings. > > > > Reviewed by: kib > > Sponsored by: Netflix > > Differential Revision: https://reviews.freebsd.org/D9786 > > > > Modified: > > head/sys/x86/x86/mp_x86.c > > > > Modified: head/sys/x86/x86/mp_x86.c > > ============================================================================== > > --- head/sys/x86/x86/mp_x86.c Fri Feb 24 17:36:55 2017 (r314215) > > +++ head/sys/x86/x86/mp_x86.c Fri Feb 24 18:56:00 2017 (r314216) > > @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); > > #ifdef GPROF > > #include > > #endif > > +#include > > #include > > #include > > #include > > @@ -1269,6 +1270,12 @@ cpustop_handler_post(u_int cpu) > > CPU_CLR_ATOMIC(cpu, &started_cpus); > > CPU_CLR_ATOMIC(cpu, &stopped_cpus); > > > > + /* > > + * We don't broadcast TLB invalidations to other CPUs when they are > > + * stopped. Hence, we clear the TLB before resuming. > > + */ > > + invltlb_glob(); > > + > > #if defined(__amd64__) && defined(DDB) > > amd64_db_resume_dbreg(); > > #endif > > @@ -1427,6 +1434,10 @@ smp_targeted_tlb_shootdown(cpuset_t mask > > uint32_t generation; > > int cpu; > > > > + /* It is not necessary to signal other CPUs while in the debugger. */ > > + if (kdb_active || panicstr != NULL) > > + return; > > + > > /* > > * Check for other cpus. Return if none. > > */ > > > > > -- > Andriy Gapon