From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 12 17:43:43 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 430D51065679 for ; Wed, 12 Nov 2008 17:43:43 +0000 (UTC) (envelope-from prvs=1202103270=marc.loerner@hob.de) Received: from mailgate.hob.de (mailgate.hob.de [212.185.199.3]) by mx1.freebsd.org (Postfix) with ESMTP id 10CE48FC18 for ; Wed, 12 Nov 2008 17:43:43 +0000 (UTC) (envelope-from prvs=1202103270=marc.loerner@hob.de) Received: from imap.hob.de (mail2.hob.de [172.25.1.102]) by mailgate.hob.de (Postfix) with ESMTP id 0092E52001C for ; Wed, 12 Nov 2008 18:21:57 +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 A78E1FD5DF for ; Wed, 12 Nov 2008 18:21:56 +0100 (CET) From: Marc =?iso-8859-1?q?L=F6rner?= Organization: hob To: freebsd-hackers@freebsd.org Date: Wed, 12 Nov 2008 18:23:14 +0100 User-Agent: KMail/1.6.2 MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200811121823.14400.marc.loerner@hob.de> Subject: 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, 12 Nov 2008 17:43:43 -0000 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. So what do you recommend: - Easiest way (but not performantest) is to turn DMA for ide off and use PIO instead - Harder way: Bugfix ide-dma! When doing this, where do you recommend to put code? I tried to do a simple (but not performant) patch in in ata-disk functions ad_strategy and ad_done with using another aligned, with right boundary and physical address < 4GB and copying data from an to it from bp->b_data (or request->data). At least this one works, but copying from one to another buffer is not quite elegant and the code doesn't really belong there. So I thought of putting something into busdma_machdep, but right now I have now clue to where to hook in, because this function cannot modify buffer given from vfs_bio => geom => ata. Regards, Marc Loerner P.S.: I'm using kernel-sources from 7.0-RELEASE-p3