From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751028AbdJAI7l (ORCPT ); Sun, 1 Oct 2017 04:59:41 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:44084 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750953AbdJAI7j (ORCPT ); Sun, 1 Oct 2017 04:59:39 -0400 Date: Sun, 1 Oct 2017 01:59:13 -0700 From: Christoph Hellwig To: Dan Williams Cc: Casey Leedom , Robin Murphy , Harsh Jain , "Raj, Ashok" , Herbert Xu , David Woodhouse , "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" , "linux-crypto@vger.kernel.org" , "dwmw2@infradead.org" , Michael Werner Subject: Re: DMA error when sg->offset value is greater than PAGE_SIZE in Intel IOMMU Message-ID: <20171001085913.GA29880@infradead.org> References: <20170925155430.GB131920@otc-nc-03> <6d2af675-7b97-6eaf-4daa-d7bf80a05923@chelsio.com> <437a9bd8-d4d6-22ca-1a64-1a3e73f1101a@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 27, 2017 at 10:13:51AM -0700, Dan Williams wrote: > As far as I can see "Offset can be greater than PAGE_SIZE" is the only > safe assumption for core code. It seems completely bogus to me, but if it is the current assumption we'll have to document it. But this brings me back to that our scatterlists are a pretty horrible data structure to start with as they try to mix virtual and physical addressing together. We'd be much better of by passing a chain of bio_vecs where we just need virtual addresses, a chain of [bus_addr,len] pairs where we just need a physical address, and both where we need both instead of this giant structure that tries to do both at the same time..