[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170928154345.GA101272@otc-nc-03>
Date: Thu, 28 Sep 2017 08:43:46 -0700
From: "Raj, Ashok" <ashok.raj@...el.com>
To: Robin Murphy <robin.murphy@....com>
Cc: Casey Leedom <leedom@...lsio.com>,
"joro@...tes.org" <joro@...tes.org>,
"dwmw2@...radead.org" <dwmw2@...radead.org>,
Harsh Jain <Harsh@...lsio.com>,
"herbert@...dor.apana.org.au" <herbert@...dor.apana.org.au>,
"iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>,
"linux-crypto@...r.kernel.org" <linux-crypto@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Michael Werner <werner@...lsio.com>,
Atul Gupta <atul.gupta@...lsio.com>
Subject: Re: [PATCH] iommu/vt-d: Fix scatterlist offset handling
Hi Robin
thanks.. i have no idea.. i see all the other patches from you :-)
my email has decided to play games with me i suppose :-)
On Thu, Sep 28, 2017 at 05:59:11PM +0100, Robin Murphy wrote:
> I hope our email server hasn't got blacklisted again... Said patch is
> the top of this very thread we're replying on[1] - you were definitely
> on cc :(
(sg->dma_address + sg->dma_len) ----+
sg->dma_address ---------+ |
iov_pfn------+ | |
| | |
v v v
iova: a b c d e f
|--------|--------|--------|--------|--------|
<...calculated....>
[_____mapped______]
pfn: 0 1 2 3 4 5
|--------|--------|--------|--------|--------|
^ ^ ^
| | |
sg->page ----+ | |
sg->offset --------------+ |
(sg->offset + sg->length) ----------+
The picture seems right. Looking at the code i'm not sure if i understand
it correctly.
pgoff = sg->offset & ~PAGE_MASK;
this gets the offset past the start of page.
sg->dma_address = ((dma_addr_t)iov_pfn << VTD_PAGE_SHIFT) + pgoff;
this would set dma_address at b+off instead of starting at c+off correct?
>
> Robin
>
> [1]:https://lists.linuxfoundation.org/pipermail/iommu/2017-September/024371.html
Powered by blists - more mailing lists