busdma_machdep.c with more than 512M memory

Jayachandran C. c.jayachandran at gmail.com
Fri Sep 10 07:42:32 UTC 2010


On Fri, Sep 10, 2010 at 12:36 PM, Juli Mallett <jmallett at freebsd.org> wrote:
> On Fri, Sep 10, 2010 at 00:00, Jayachandran C. <c.jayachandran at gmail.com> wrote:
>> On Fri, Sep 10, 2010 at 11:22 AM, Neel Natu <neelnatu at gmail.com> wrote:
>>> This assumes that pmap_mapdev() always returns an uncached mapping
>>> which is true for n64 kernels but not for o32 kernels with memory
>>> beyond 512MB.
>>
>> I think my original patch was incorrect, pmap_mapdev() should not be
>> used to map physical memory uncached. It may be just for mapping
>> device address space uncached, and that may be why it checks if the
>> physical address is cacheable.
>
> I think that's a wrong inference from the brokenness of pmap_mapdev
> because of using the general-purpose pmap_kenter.  pmap_mapdev is
> implicitly uncacheable -- check i386 pmap for confirmation.  Neel's
> patch is right.

Ok.  My point was using pmap_mapdev() on physical memory to remap it
uncached may not be its intended usage - and I did not notice this
when I used it in busdma_machdep.c.

But looks like it is the easiest way of doing this. My suggestion of
using pmap_kenter_attr() in busdma_machdep.c would imply duplicating
the whole pmap_mapdev code there, which is not good either.

So as it stands, all I can say is that a comment  in busdma_machdep.c
on pmap_mapdev() use would be useful :)

JC.


More information about the freebsd-mips mailing list