From: joro@8bytes.org (Joerg Roedel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RESEND] iommu/dma: Use correct offset in map_sg
Date: Thu, 7 Jan 2016 13:38:25 +0100 [thread overview]
Message-ID: <20160107123824.GI19149@8bytes.org> (raw)
In-Reply-To: <8317d001da4f48831fa23d8d7729a4659ac72b49.1451924092.git.robin.murphy@arm.com>
On Mon, Jan 04, 2016 at 04:19:42PM +0000, Robin Murphy wrote:
> When mapping a non-page-aligned scatterlist entry, we copy the original
> offset to the output DMA address before aligning it to hand off to
> iommu_map_sg(), then later adding the IOVA page address portion to get
> the final mapped address. However, when the IOVA page size is smaller
> than the CPU page size, it is the offset within the IOVA page we want,
> not that within the CPU page, which can easily be larger than an IOVA
> page and thus result in an incorrect final address.
>
> Fix the bug by taking only the IOVA-aligned part of the offset as the
> basis of the DMA address, not the whole thing.
>
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Applied, thanks.
next prev parent reply other threads:[~2016-01-07 12:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-18 17:01 [PATCH 1/3] iommu/dma: Add some missing #includes Robin Murphy
2015-12-18 17:01 ` [PATCH 2/3] iommu/dma: Use correct offset in map_sg Robin Murphy
2015-12-28 16:05 ` Joerg Roedel
2016-01-04 16:08 ` Robin Murphy
2016-01-04 16:19 ` [PATCH RESEND] " Robin Murphy
2016-01-07 12:38 ` Joerg Roedel [this message]
2016-03-09 7:50 ` [PATCH 2/3] " Magnus Damm
2016-03-09 15:00 ` Robin Murphy
2016-03-10 7:47 ` Magnus Damm
2015-12-18 17:01 ` [PATCH 3/3] iommu/dma: Avoid unlikely high-order allocations Robin Murphy
2015-12-18 22:35 ` Doug Anderson
2016-01-19 2:55 ` Yong Wu
2015-12-28 16:08 ` [PATCH 1/3] iommu/dma: Add some missing #includes Joerg Roedel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160107123824.GI19149@8bytes.org \
--to=joro@8bytes.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).