From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 19 14:27:04 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29469106564A for ; Wed, 19 Nov 2008 14:27:04 +0000 (UTC) (envelope-from prvs=1209f9aad2=marc.loerner@hob.de) Received: from mailgate.hob.de (mailgate.hob.de [212.185.199.3]) by mx1.freebsd.org (Postfix) with ESMTP id DCDFD8FC17 for ; Wed, 19 Nov 2008 14:27:03 +0000 (UTC) (envelope-from prvs=1209f9aad2=marc.loerner@hob.de) Received: from imap.hob.de (mail2.hob.de [172.25.1.102]) by mailgate.hob.de (Postfix) with ESMTP id 27E9A52001F for ; Wed, 19 Nov 2008 15:06:01 +0100 (CET) Received: from linux03.hob.de (linux03.hob.de [172.22.0.190]) by imap.hob.de (Postfix on SuSE eMail Server 2.0) with ESMTP id B5D43FD77A for ; Wed, 19 Nov 2008 15:06:00 +0100 (CET) From: Marc =?iso-8859-1?q?L=F6rner?= Organization: hob To: freebsd-hackers@freebsd.org Date: Wed, 19 Nov 2008 15:07:20 +0100 User-Agent: KMail/1.6.2 References: <200811121823.14400.marc.loerner@hob.de> <200811131502.04370.jhb@freebsd.org> In-Reply-To: <200811131502.04370.jhb@freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Message-Id: <200811191507.22455.marc.loerner@hob.de> Subject: Re: ide with DMA and ram > 4GB X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2008 14:27:04 -0000 On Thursday 13 November 2008 21:02, John Baldwin wrote: > On Wednesday 12 November 2008 12:23:14 pm Marc Lörner wrote: > > Hello, > > I just stepped over a problem with my IDE disk running in DMA-mode > > and having more than 4GB of RAM. > > It seems that the whole way down GEOM, ata-disk, ata-dma never is checked > > whether physical address of buffer is less than 4GB an so fits in 32bits. > > => when PRD is set the address is rigorously truncated to fit into 32bit, > > with buffer < 4GB all is quite fine. > > bus_dmamap_load() in ata-dma.c should result in bounce pages being > allocated and having the data copied to pages below 4GB and having those > addresses passed to the callback and stored in the PRD. Thanks for pointing this out! So it seems that bounce-pages are counted with helper-function run_filter. But this function does never return 1 with dma-pages not lying in range (e.g. paddr > 4GB) but being aligned. Did nobody else have problems on 64bit ide-dma, or is it already working, but I didn't grasp functionality, yet? For now, I came around this by adding a flag in "/sys/bus_dma.h" and setting this flag on tag-creation. So I now can check in run_filter whether I'm doing an ide-dma, relying on this and on check whether I got paddr > 4GB, I then can tell bus_dmamap_load to use bounce-pages. Any thoughts or comments? Regards, Marc Loerner