Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965615AbdIYSpx (ORCPT ); Mon, 25 Sep 2017 14:45:53 -0400 Received: from twosheds.infradead.org ([90.155.92.209]:44418 "EHLO twosheds.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933306AbdIYSpw (ORCPT ); Mon, 25 Sep 2017 14:45:52 -0400 Message-ID: <1506365131.5294.37.camel@infradead.org> Subject: Re: DMA error when sg->offset value is greater than PAGE_SIZE in Intel IOMMU From: David Woodhouse To: Herbert Xu , Harsh Jain Cc: joro@8bytes.org, linux-crypto@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, leedom@chelsio.com In-Reply-To: <20170920080151.GA3348@gondor.apana.org.au> References: <20170920080151.GA3348@gondor.apana.org.au> Content-Type: multipart/signed; micalg="sha-256"; protocol="application/x-pkcs7-signature"; boundary="=-jwJFof+WwAJvH+FcDzpf" Date: Mon, 25 Sep 2017 19:45:31 +0100 Mime-Version: 1.0 X-Mailer: Evolution 3.18.5.2-0ubuntu3.2 X-SRS-Rewrite: SMTP reverse-path rewritten from by twosheds.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 Content-Length: 7505 Lines: 113 --=-jwJFof+WwAJvH+FcDzpf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2017-09-20 at 16:01 +0800, Herbert Xu wrote: > Harsh Jain wrote: > >=C2=A0 > > While debugging DMA mapping error in chelsio crypto driver we > observed that when scatter/gather list received by driver has some > entry with page->offset > 4096 (PAGE_SIZE). It starts giving DMA > error.=C2=A0 Without IOMMU it works fine. >=20 > This is not a bug.=C2=A0 The network stack can and will feed us such > SG lists. Hm? Under what circumstances is the offset permitted to be > PAGE_SIZE?=C2=A0 --=-jwJFof+WwAJvH+FcDzpf Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Dispos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