From owner-freebsd-current@freebsd.org Sat Aug 4 15:43:39 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 84C6A106F0AB for ; Sat, 4 Aug 2018 15:43:39 +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 0E88B7CFFF; Sat, 4 Aug 2018 15:43:38 +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 w74FhSVJ067398 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 4 Aug 2018 18:43:31 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w74FhSVJ067398 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w74FhSHE067397; Sat, 4 Aug 2018 18:43:28 +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 18:43:27 +0300 From: Konstantin Belousov To: Ian Lepore Cc: Kyle Evans , freebsd-current Current , Eitan Adler Subject: Re: panic: mutex pmap not owned at ... efirt_machdep.c:255 Message-ID: <20180804154327.GQ6049@kib.kiev.ua> References: <20180804083720.GJ6049@kib.kiev.ua> <20180804131352.GL6049@kib.kiev.ua> <1533394281.9860.5.camel@freebsd.org> <20180804152225.GP6049@kib.kiev.ua> <1533396347.9860.11.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1533396347.9860.11.camel@freebsd.org> 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 15:43:39 -0000 On Sat, Aug 04, 2018 at 09:25:47AM -0600, Ian Lepore wrote: > On Sat, 2018-08-04 at 18:22 +0300, Konstantin Belousov wrote: > > On Sat, Aug 04, 2018 at 09:58:43AM -0500, Kyle Evans wrote: > > > > > > On Sat, Aug 4, 2018 at 9:51 AM, Ian Lepore wrote: > > > > > > > > On Sat, 2018-08-04 at 08:56 -0500, Kyle Evans wrote: > > > > > > > > > > On Sat, Aug 4, 2018 at 8:13 AM, Konstantin Belousov > > > > gmail. > > > > > 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 > > > > > > bel@gm > > > > > > > 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/amd6 > > > > > > > > > 4/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? > > > > > > > This should probably just be compiled out for !arm64 && !x86 - its > > > sole purpose was to compensate for outdated loader.efi that hasn't > > > done the SetVirtualAddressMap. EFI on 32-bit ARM is "new" enough > > > that > > > it shouldn't have this problem. > > Does EFI on 32bit arm have RT support ? > > I suspect the uboot implementation doesn't, but I can't think of any > reason why other implementations are not possible/available. In > particular, even 32bit arm supports virtualization and such an > environment could provide rt support. No, I mean, does our kernel has RT support on armv7 ? I only implemented necessary VM tricks for amd64, then it was ported to arm64, and in both cases it relies on 64bit address space and specific location of the KVA.