From owner-freebsd-arm@FreeBSD.ORG Sun May 17 17:08:34 2015 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B755815 for ; Sun, 17 May 2015 17:08:34 +0000 (UTC) Received: from outbound3.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) by mx1.freebsd.org (Postfix) with SMTP id 3B6CB162F for ; Sun, 17 May 2015 17:08:33 +0000 (UTC) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Sun, 17 May 2015 17:07:19 +0000 (UTC) Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t4HH7OPI012678; Sun, 17 May 2015 11:07:24 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1431882444.91685.53.camel@freebsd.org> Subject: Re: Translation Fault panic when trying to use an mfs_root on BBB [solved?] [patch] From: Ian Lepore To: Keith White Cc: Warner Losh , freebsd-arm@freebsd.org Date: Sun, 17 May 2015 11:07:24 -0600 In-Reply-To: References: <1431822588.91685.48.camel@freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 May 2015 17:08:34 -0000 On Sun, 2015-05-17 at 09:59 -0400, Keith White wrote: > On Sat, 16 May 2015, Warner Losh wrote: > > > > >> On May 16, 2015, at 8:40 PM, Keith White wrote: > >> > >> On Sun, 17 May 2015, Daisuke Aoyama wrote: > >> > >>> -------------------------------------------------- > >>> From: "Ian Lepore" > >>> Sent: Sunday, May 17, 2015 9:29 AM > >>> To: "Svatopluk Kraus" > >>> Cc: "Keith White" ; > >>> Subject: Re: Translation Fault panic when trying to use an mfs_root on BBB [solved?] [patch] > >>>[...] > >> > >> Thanks Ian for looking at this! > >> > >> Based upon the comments by Daisuke Aoyama, the patch above using > >> KERNBASE becomes this using preload_addr_relocate: > >> > >> ----------------- > >> --- sys/dev/md/md.c (revision 282672) > >> +++ sys/dev/md/md.c (working copy) > >> @@ -1590,7 +1590,11 @@ > >> len = preload_fetch_size(mod); > >> if (ptr != NULL && len != 0) { > >> sx_xlock(&md_sx); > >> +#ifdef __arm__ > >> + md_preloaded(ptr - preload_addr_relocate, len, name); > >> +#else > >> md_preloaded(ptr, len, name); > >> +#endif > >> sx_xunlock(&md_sx); > >> } > >> } > > > > This is almost certainly the wrong place to fix this. The right place to fix it is in ubldr. It says that all the ptrs are AFU only on arm, and this one is likely the first of many. > > > > Warner > > > > > > You're too generous, no "almost" about it. > > ubldr is well beyond my capabilities to fix. Sticky tape for md > allows me to use an mfs_root in the meantime... > > ...keith After much code archeology and some testing I've determined that the actual problem is that we're setting preload_addr_relocate to a non-zero value at all. That should only be done when ubldr passes physical addresses in metadata, but for arm it always passes virtual addresses. I think that changed (maybe by accident) a while back in ubldr and the kernel side didn't get fixed to match until now. So, as of r283033 it should work right. -- Ian