From owner-svn-src-all@freebsd.org Sun Nov 1 19:48:16 2015 Return-Path: Delivered-To: svn-src-all@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 3C8B1A24EEB; Sun, 1 Nov 2015 19:48:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6C7F1E6D; Sun, 1 Nov 2015 19:48:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id tA1Jm9RJ039229 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 1 Nov 2015 21:48:09 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua tA1Jm9RJ039229 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id tA1Jm9Yi039228; Sun, 1 Nov 2015 21:48:09 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 1 Nov 2015 21:48:09 +0200 From: Konstantin Belousov To: Ian Lepore Cc: Jason Harmening , Ganbold Tsagaankhuu , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r289759 - in head/sys/arm: arm include Message-ID: <20151101194809.GT2257@kib.kiev.ua> References: <201510221638.t9MGc1cc053885@repo.freebsd.org> <56348FF8.3010602@gmail.com> <1446394311.91534.236.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1446394311.91534.236.camel@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Nov 2015 19:48:16 -0000 On Sun, Nov 01, 2015 at 09:11:51AM -0700, Ian Lepore wrote: > It's almost certainly not related to sysinit ordering. This exception > is happening during mmc probing after interrupts are enabled. > > It appears that the problem is the faulting code is running on one of > the very early pre-allocated kernel stacks (perhaps in an interrupt > handler on an idle thread stack), and these stacks are not in memory > represented in the vm page arrays. The mmc code is using a 64-byte > buffer on the stack and mapping it for DMA. Normally that causes a > bounce for cacheline alignment, but unluckily in this case that buffer > on the stack just happened to be aligned to a cacheline boundary and a > multiple of the cacheline size, so no bounce. That causes the new sync > logic that is based on keeping vm_page_t pointers and offsets to get a > NULL pointer back from PHYS_TO_VM_PAGE when mapping, then it dies at > sync time trying to dereference that. It used to work because the sync > logic used to use the vaddr, not a page pointer. > > Michal was working on a patch yesterday. This actually is the same as the issue I had with the DMAR busdma on x86. You could see the trick used in the sys/x86/iommu/busdma_dmar.c:dmar_bus_dmamap_load_buffer(), the dumping case. I just allocated fictitious pages to cope with kernel core dump needing to DMA from memory which is not described by vm_page_array.