From owner-freebsd-current@freebsd.org Sat Aug 4 08:37:35 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 E206D1062D59 for ; Sat, 4 Aug 2018 08:37:35 +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 5156E8BAA7; Sat, 4 Aug 2018 08:37:35 +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 w748bKbE070333 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 4 Aug 2018 11:37:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w748bKbE070333 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w748bK40070332; Sat, 4 Aug 2018 11:37:20 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 4 Aug 2018 11:37:20 +0300 From: Konstantin Belousov To: Kyle Evans Cc: freebsd-current Current Subject: Re: panic: mutex pmap not owned at ... efirt_machdep.c:255 Message-ID: <20180804083720.GJ6049@kib.kiev.ua> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) 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: 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: Sat, 04 Aug 2018 08:37:36 -0000 On Fri, Aug 03, 2018 at 11:27:02PM -0500, Kyle Evans wrote: > On Fri, Aug 3, 2018 at 10:10 PM, Eitan Adler wrote: > > Hi all, > > > > After installing the latest current kernel I get the following panic: > > > > panic: mutex pmap not owned at ... efirt_machdep.c:255 > > cpuid =3 > > time = 1 > > ... > > mtx_assert() > > efi_arch_enter() > > efirt_modevents() > > module_register_init() > > mi_startup() > > btext() > > > > This seems odd- pmap lock is acquired at [1], then asserted shortly > later at [2]... I avoid some of this stuff as well as I can, but is it > actually possible for PCPU_GET(...) acquired curpmap to not match > curthread->td_proc->p_vmspace->vm_pmap in this context? > > [1] https://svnweb.freebsd.org/base/head/sys/dev/efidev/efirt.c?view=markup#l260 > [2] https://svnweb.freebsd.org/base/head/sys/amd64/amd64/efirt_machdep.c?view=markup#l254 There could be that curpcpu not yet synced with proc0 pmap. It could be fixed. But it is not clear to me why efi_arch_enter() is called there. I see the check for GetTime belonging to the range described by a map descriptor. I do not see why do you need an enter into the EFI context for comparing integers.