Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jan 2013 13:32:17 -0700
From:      Ian Lepore <ian@FreeBSD.org>
To:        Olivier Houchard <mlfbsd@ci0.org>
Cc:        Konstantin Belousov <kostikbel@gmail.com>, arm@FreeBSD.org
Subject:   Re: bud_dmamap_load_buffer()
Message-ID:  <1359664337.93359.337.camel@revolution.hippie.lan>
In-Reply-To: <20130131201623.GA58163@ci0.org>
References:  <20130131192426.GL2522@kib.kiev.ua> <20130131201623.GA58163@ci0.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 2013-01-31 at 21:16 +0100, Olivier Houchard wrote:
> On Thu, Jan 31, 2013 at 09:24:27PM +0200, Konstantin Belousov wrote:
> > I noted that arm/busdma_machdep.c uses essentially inlined pmap_kextract()
> > to get the physical address from the kernel address.  I consulted with
> > gonzo, who said that he does not see a reason for inlining the code.
> > 
> > My theory is that before r240983, pmap_kextract() locked the pmap, which
> > caused unneeded and probably wrong locking in the busdma load path. Since
> > this issue is fixed, I see no reason for directly walking the page tables.
> > 
> > Could somebody please review and test the patch ? v6 busdma already uses
> > pmap_kextract().
> > 
> > Do not remove me from Cc:.
> 
> Hi Konstantin,
> 
> It's that way for historical reasons. It used to check the caching attributes
> of the page, as well as its physical address, to try hard to avoid doing
> unnecessery cache flush if the page is already mapped as uncache. Now that
> code is long gone, and there's no reason anymore not to just use
> pmap_kextract(). Your patch looks fine to me.
> 
> Regards,
> 
> Olivier

That would help explain that XXX comment about checking coherent
mappings in user maps that never made much sense to me.  I think we
should delete the comment now as well.

I've applied and tested the patch, it's working fine.

-- Ian





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1359664337.93359.337.camel>