From owner-freebsd-arm@FreeBSD.ORG Sun May 17 18:02:15 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 116561AA for ; Sun, 17 May 2015 18:02:15 +0000 (UTC) Received: from mail-ig0-f180.google.com (mail-ig0-f180.google.com [209.85.213.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB4091C17 for ; Sun, 17 May 2015 18:02:14 +0000 (UTC) Received: by igbpi8 with SMTP id pi8so70220689igb.0 for ; Sun, 17 May 2015 11:02:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=Z6ffKcmn8ncnbtiH/jpFtfnjeEboxzYez2Z6JlWeckE=; b=aDCtEVCFac9p66TdGU2JjOXbKB+jCT20dYQNVsOVUv6Q7HzVF2+zKdLUny+VH9jgbS Dvy7V0Z1qbagw/CDEpbQj59mJDGT7lO2+dyULZ83SrHIdtRvsk7Lo79h3X7KroHAU25X vJetESH5DUu6XFgs0XMDeSk5T89ilX220ids8O88jWPFSDNkCMbJ5zZ0RvoZfSpm6pDI FoQYIASUmGpU+CJomFw+a7fFS7FD1Z2wLqefht8k3LxDEM0e29MiHI1Arzu9CSAyeVoZ xVWvBpopjEV1Imkig3G3R7YCSYkLcXuDP3WwFOHzHDX7VV+FUrxfy6x6Rwrojpc0rcHN YHhw== X-Gm-Message-State: ALoCoQlryvdzXdJczu8Qv0ZT4KXkYVhgEvzivoh6krHpWwhFisG6ClaTQkK6z2rytdjMT//EP/Mv X-Received: by 10.43.5.74 with SMTP id of10mr31254469icb.67.1431885733266; Sun, 17 May 2015 11:02:13 -0700 (PDT) Received: from netflix-mac-wired.bsdimp.com ([50.253.99.174]) by mx.google.com with ESMTPSA id av6sm3864969igc.17.2015.05.17.11.02.12 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 17 May 2015 11:02:12 -0700 (PDT) Sender: Warner Losh Subject: Re: Translation Fault panic when trying to use an mfs_root on BBB [solved?] [patch] Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Content-Type: multipart/signed; boundary="Apple-Mail=_2EC75DEE-A1F7-4B39-B82D-AA9BF1C49FC7"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5b6 From: Warner Losh In-Reply-To: <1431882444.91685.53.camel@freebsd.org> Date: Sun, 17 May 2015 12:02:10 -0600 Cc: Keith White , freebsd-arm@freebsd.org Message-Id: <566BFACF-E9B2-4E8A-A36C-AB4F12A84168@bsdimp.com> References: <1431822588.91685.48.camel@freebsd.org> <1431882444.91685.53.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.2098) 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 18:02:15 -0000 --Apple-Mail=_2EC75DEE-A1F7-4B39-B82D-AA9BF1C49FC7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On May 17, 2015, at 11:07 AM, Ian Lepore wrote: >=20 > On Sun, 2015-05-17 at 09:59 -0400, Keith White wrote: >> On Sat, 16 May 2015, Warner Losh wrote: >>=20 >>>=20 >>>> On May 16, 2015, at 8:40 PM, Keith White = wrote: >>>>=20 >>>> On Sun, 17 May 2015, Daisuke Aoyama wrote: >>>>=20 >>>>> -------------------------------------------------- >>>>> 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] >>>>> [...] >>>>=20 >>>> Thanks Ian for looking at this! >>>>=20 >>>> Based upon the comments by Daisuke Aoyama, the patch above using >>>> KERNBASE becomes this using preload_addr_relocate: >>>>=20 >>>> ----------------- >>>> --- sys/dev/md/md.c (revision 282672) >>>> +++ sys/dev/md/md.c (working copy) >>>> @@ -1590,7 +1590,11 @@ >>>> len =3D preload_fetch_size(mod); >>>> if (ptr !=3D NULL && len !=3D 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); >>>> } >>>> } >>>=20 >>> 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. >>>=20 >>> Warner >>>=20 >>>=20 >>=20 >> You're too generous, no "almost" about it. >>=20 >> ubldr is well beyond my capabilities to fix. Sticky tape for md >> allows me to use an mfs_root in the meantime... >>=20 >> ...keith >=20 > 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. >=20 > So, as of r283033 it should work right. Thanks Ian! You rock! Warner --Apple-Mail=_2EC75DEE-A1F7-4B39-B82D-AA9BF1C49FC7 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJVWNejAAoJEGwc0Sh9sBEAGTcQAOBDHtdP0TtOmpjeUIoVP9Fq ESonKmNhLxWGDv9qouyLksqBzBdOJyZYOL2Q6lIjEUNSEjhkEZ+fAkgSvAVdoNhT KQ4xFfQyPVzEyrXdmNHo9+W+s7Bp9qP6g9E0hJKvShZJDF445Dlq/Ijzd796Wz3y 9e3iw+lmNdfOWo4eQUsBgZ8zy+UOD4IQ6ncz62HxK15hsEAN/iY5R79fyCNjqXqv 5npTecxIhD/ueh98jCR4zIwJb86PLKCMhHZRRwTwFOVsb3pqbCeg+tyNr0ppehR8 pgQNhZGNI0ONOUDbUI0bLJV5tmHAQB2pdsym+sZLIYLiVzKXAEwSjV8JpJAyt0aH BQXEyI8PvOO+45zbher0L7BRSShvhTELW1DyRYEv3nRi+k+wLyreru+M7pn9kxt7 1/fZAW4wFN74315Zrs80tMnhveXCuF/f8KVMaameQ0Jor6GqKhSsuEyBCVIdKQmt fNcRKkYty6EFRoh2HC4l2HhByvcKtrxfNKBFujMvrrYyS2S36BBBz8iOmwmAXPe9 7Koxjf9WY08MyXedwjGg8N+5d3riiskvGAwi4Sjg116ZtTcpC8faOVecXu7aNCxJ Dx9cUaoYdK36Oojl6MUxActpKSYr1LDLsubHgW6HYp1P/Qa/Hkbeg7g7nSI2YdEe TQnwEbo6YeX8eClNb+IL =TDbJ -----END PGP SIGNATURE----- --Apple-Mail=_2EC75DEE-A1F7-4B39-B82D-AA9BF1C49FC7--