WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: mthca use of dma_sync_single is bogus

To: Keir Fraser <keir@xxxxxxxxxxxxx>
Subject: [Xen-devel] Re: mthca use of dma_sync_single is bogus
From: Roland Dreier <rdreier@xxxxxxxxx>
Date: Mon, 09 Jul 2007 14:31:32 -0700
Authentication-results: sj-dkim-4; header.From=rdreier@xxxxxxxxx; dkim=pass ( sig from cisco.com/sjdkim4002 verified; );
Cc: mst@xxxxxxxxxxxxxx, Lukas Hejtmanek <xhejtman@xxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, general@xxxxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 10 Jul 2007 10:12:42 -0700
Dkim-signature: v=0.5; a=rsa-sha256; q=dns/txt; l=861; t=1184016693; x=1184880693; c=relaxed/simple; s=sjdkim4002; h=Content-Type:From:Subject:Content-Transfer-Encoding:MIME-Version; d=cisco.com; i=rdreier@xxxxxxxxx; z=From:=20Roland=20Dreier=20<rdreier@xxxxxxxxx> |Subject:=20Re=3A=20mthca=20use=20of=20dma_sync_single=20is=20bogus |Sender:=20; bh=e6qiRLIRc82lI/S6XcouCXGzn5CqwdCY+CNcOrqundQ=; b=GsDQTt7YtMsS9DGMQW42nTfzXUb0Lb8DazkElCc9vW0mKytBBRl/f9cQ3p/9y+wL9r/6EecT /TbDmP/pDewp0oRKb2KMBusISu6bGFS0dFuJLFKrIq7iJTC4CHv5nn/s;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C2B867D5.A917%keir@xxxxxxxxxxxxx> (Keir Fraser's message of "Mon, 09 Jul 2007 22:31:49 +0100")
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <C2B867D5.A917%keir@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.20 (linux)
 > One thought is that if you *do* move to dma_sync_single_range() then
 > lib/swiotlb.c still needs fixing. It's buggy in that
 > swiotlb_sync_single_range(dma_addr, offset) calls
 > swiotlb_sync_single(dma_addr+offset), and this will fail if the offset is
 > large enough that it ends up dereferencing a different slot index in
 > io_tlb_orig_addr.

Yes, I realized the same thing (our emails crossed).

 > So, I should be able to get my swiotlb workaround fixes accepted upstream as
 > a genuine bug fix. :-)

Yeah, seems so.

 > dma_sync_single_range() looks to me to be the right thing for you to be
 > using. But I'm not a DMA-API expert.

yes, I'll try to get confirmation from James Bottomley and/or Dave Miller
that it is the right thing to do (and also fix the documentation to
match what the kernel actually implements).

 - R.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel