Translation Fault panic when trying to use an mfs_root on BBB [solved?] [patch]

Warner Losh imp at bsdimp.com
Sun May 17 18:02:15 UTC 2015


> On May 17, 2015, at 11:07 AM, Ian Lepore <ian at freebsd.org> wrote:
> 
> 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 <kwhite at site.uottawa.ca> wrote:
>>>> 
>>>> On Sun, 17 May 2015, Daisuke Aoyama wrote:
>>>> 
>>>>> --------------------------------------------------
>>>>> From: "Ian Lepore" <ian at freebsd.org>
>>>>> Sent: Sunday, May 17, 2015 9:29 AM
>>>>> To: "Svatopluk Kraus" <onwahe at gmail.com>
>>>>> Cc: "Keith White" <kwhite at site.uottawa.ca>; <freebsd-arm at freebsd.org>
>>>>> 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.

Thanks Ian! You rock!

Warner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/freebsd-arm/attachments/20150517/2a48cfc3/attachment.sig>


More information about the freebsd-arm mailing list