From owner-freebsd-current@freebsd.org Sat Aug 4 14:51:26 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 730DC106DA54 for ; Sat, 4 Aug 2018 14:51:26 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (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 EEA1A7AB3A for ; Sat, 4 Aug 2018 14:51:25 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: da427f57-97f5-11e8-904b-1d2e466b3c59 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id da427f57-97f5-11e8-904b-1d2e466b3c59; Sat, 04 Aug 2018 14:51:22 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w74EpLuc046084; Sat, 4 Aug 2018 08:51:21 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1533394281.9860.5.camel@freebsd.org> Subject: Re: panic: mutex pmap not owned at ... efirt_machdep.c:255 From: Ian Lepore To: Kyle Evans , Konstantin Belousov Cc: freebsd-current Current , Eitan Adler Date: Sat, 04 Aug 2018 08:51:21 -0600 In-Reply-To: References: <20180804083720.GJ6049@kib.kiev.ua> <20180804131352.GL6049@kib.kiev.ua> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit 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 14:51:26 -0000 On Sat, 2018-08-04 at 08:56 -0500, Kyle Evans wrote: > On Sat, Aug 4, 2018 at 8:13 AM, Konstantin Belousov com> wrote: > > > > On Sat, Aug 04, 2018 at 08:05:24AM -0500, Kyle Evans wrote: > > > > > > On Sat, Aug 4, 2018 at 3:37 AM, Konstantin Belousov > > ail.com> wrote: > > > > > > > > On Fri, Aug 03, 2018 at 11:27:02PM -0500, Kyle Evans wrote: > > > > > > > > > > > > > > > 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/efir > > > > > t_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. > > > This probably could have been documented better, but efi_runtime > > > pointer may (always?) point into runtime service memory that > > > isn't > > > valid/available at that point, so we get a fault and panic when > > > dereferencing it to grab rt_gettime address. We ran into this > > > wall > > > when adding the check originally. > > Wouldn't it be enough to access it by translating physical address > > into > > DMAP ? > Ah, sure, sure. [1] is proper form, yeah? > > [1] https://people.freebsd.org/~kevans/efi-dmap.diff What do we do on 32-bit arm that has no dmap but may have efi runtime support? -- Ian