[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1507068976.29211.156.camel@infradead.org>
Date: Tue, 03 Oct 2017 23:16:16 +0100
From: David Woodhouse <dwmw2@...radead.org>
To: Robin Murphy <robin.murphy@....com>, joro@...tes.org
Cc: ashok.raj@...el.com, leedom@...lsio.com, Harsh@...lsio.com,
herbert@...dor.apana.org.au, iommu@...ts.linux-foundation.org,
linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iommu/vt-d: Fix scatterlist offset handling
On Tue, 2017-10-03 at 19:05 +0100, Robin Murphy wrote:
>
> Now, there are indeed plenty of drivers and subsystems which do work on
> lists of explicitly single pages - anything doing some variant of
> "addr = kmap_atomic(sg_page(sg)) + sg->offset;" is easy to spot - but I
> don't think DMA API implementations are in a position to make any kind
> of assumption; nearly all of them just shut up and handle sg->length
> bytes from sg_phys(sg) without questioning the caller, and I reckon
> that's exactly what they should be doing.
So what's the point in sg->page in the first place? If even the
*offset* can be greater than page size, it isn't even the *first* page
(as you called it). Why aren't we just using a physical address,
instead of an arbitrary page and an offset from that?
Can we have *negative* sg->offset too? :)
Download attachment "smime.p7s" of type "application/x-pkcs7-signature" (4938 bytes)
Powered by blists - more mailing lists