Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751717AbdI0RNy (ORCPT ); Wed, 27 Sep 2017 13:13:54 -0400 Received: from mail-oi0-f48.google.com ([209.85.218.48]:44763 "EHLO mail-oi0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750752AbdI0RNx (ORCPT ); Wed, 27 Sep 2017 13:13:53 -0400 X-Google-Smtp-Source: AOwi7QCj/YKBpBTJ2VBsqwBWDsq33ULA2ogLMMxnYIPV9rnxrki4R4SkItsRiVc/w2bJp/qXuzQe2smm2S9ktRR+RRY= MIME-Version: 1.0 In-Reply-To: References: <20170920080151.GA3348@gondor.apana.org.au> <26992a1e-edb3-ed78-ce8e-31e0739d75f4@arm.com> <20170925155430.GB131920@otc-nc-03> <6d2af675-7b97-6eaf-4daa-d7bf80a05923@chelsio.com> <437a9bd8-d4d6-22ca-1a64-1a3e73f1101a@arm.com> From: Dan Williams Date: Wed, 27 Sep 2017 10:13:51 -0700 Message-ID: Subject: Re: DMA error when sg->offset value is greater than PAGE_SIZE in Intel IOMMU To: Casey Leedom Cc: 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1283 Lines: 25 On Wed, Sep 27, 2017 at 9:31 AM, Casey Leedom wrote: > | From: Dan Williams > | Sent: Tuesday, September 26, 2017 9:10 AM > | > | On Tue, Sep 26, 2017 at 9:06 AM, Casey Leedom wrote: > | > | From: Robin Murphy > | > | Sent: Tuesday, September 26, 2017 7:22 AM > | > |... > | > ... > | > Regardless, it seems that you agree that there's an issue with the Intel > | > I/O MMU support code with regard to the legal values which a (struct > | > scatterlist) can take on? I still can't find any documentation for this > | > and, personally, I'm a bit baffled by a Page-oriented Scatter/Gather List > | > representation where [Offset, Offset+Length) can reside outside the Page. > | > | Consider the case where the page represents a huge page, then an > | offset greater than PAGE_SIZE (up to HPAGE_SIZE) makes sense. > > Okay, but whatever the underlaying Page Size is, should [Offset, > Offset+Length) completely reside within the referenced Page? I'm just > trying to understand the Invariance Conditions which are assumed by all of > the code which processes Scatter/gather Lists ... As far as I can see "Offset can be greater than PAGE_SIZE" is the only safe assumption for core code.