From: David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
To: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org>,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org,
will.deacon-5wv7dgnIgG8@public.gmane.org,
catalin.marinas-5wv7dgnIgG8@public.gmane.org
Cc: laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org,
arnd-r2nGTMty4D4@public.gmane.org,
djkurtz-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org,
yingjoe.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
yong.wu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org
Subject: Re: [PATCH v4 1/4] iommu/iova: Avoid over-allocating when size-aligned
Date: Tue, 28 Jul 2015 14:31:50 +0100 [thread overview]
Message-ID: <1438090310.26913.158.camel@infradead.org> (raw)
In-Reply-To: <35cb877828b570db84e89684ef76308cd1857f0c.1437070995.git.robin.murphy-5wv7dgnIgG8@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 1394 bytes --]
On Thu, 2015-07-16 at 19:40 +0100, Robin Murphy wrote:
> Currently, allocating a size-aligned IOVA region quietly adjusts the
> actual allocation size in the process, returning a rounded-up
> power-of-two-sized allocation. This results in mismatched behaviour in
> the IOMMU driver if the original size was not a power of two, where the
> original size is mapped, but the rounded-up IOVA size is unmapped.
>
> Whilst some IOMMUs will happily unmap already-unmapped pages, others
> consider this an error, so fix it by computing the necessary alignment
> padding without altering the actual allocation size. Also clean up by
> making pad_size unsigned, since its callers always pass unsigned values
> and negative padding makes little sense here anyway.
Applied; thanks.
I'm not 100% sure we *need* the hunk in intel-iommu.c, we can probably
live without rounding the size up. It means we'll use huge pages less
often, but it's not clear that using them when we didn't *mean* to map
the full size of them was the right thing to do in the first place.
But it makes sense to apply the patch as-is, without changing the
effective behaviour, and ponder that more deeply later.
Thanks.
--
David Woodhouse Open Source Technology Centre
David.Woodhouse-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org Intel Corporation
[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 5691 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: dwmw2@infradead.org (David Woodhouse)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 1/4] iommu/iova: Avoid over-allocating when size-aligned
Date: Tue, 28 Jul 2015 14:31:50 +0100 [thread overview]
Message-ID: <1438090310.26913.158.camel@infradead.org> (raw)
In-Reply-To: <35cb877828b570db84e89684ef76308cd1857f0c.1437070995.git.robin.murphy@arm.com>
On Thu, 2015-07-16 at 19:40 +0100, Robin Murphy wrote:
> Currently, allocating a size-aligned IOVA region quietly adjusts the
> actual allocation size in the process, returning a rounded-up
> power-of-two-sized allocation. This results in mismatched behaviour in
> the IOMMU driver if the original size was not a power of two, where the
> original size is mapped, but the rounded-up IOVA size is unmapped.
>
> Whilst some IOMMUs will happily unmap already-unmapped pages, others
> consider this an error, so fix it by computing the necessary alignment
> padding without altering the actual allocation size. Also clean up by
> making pad_size unsigned, since its callers always pass unsigned values
> and negative padding makes little sense here anyway.
Applied; thanks.
I'm not 100% sure we *need* the hunk in intel-iommu.c, we can probably
live without rounding the size up. It means we'll use huge pages less
often, but it's not clear that using them when we didn't *mean* to map
the full size of them was the right thing to do in the first place.
But it makes sense to apply the patch as-is, without changing the
effective behaviour, and ponder that more deeply later.
Thanks.
--
David Woodhouse Open Source Technology Centre
David.Woodhouse at intel.com Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5691 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150728/785b9d33/attachment.bin>
next prev parent reply other threads:[~2015-07-28 13:31 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-16 18:40 [PATCH v4 0/4] arm64: IOMMU-backed DMA mapping Robin Murphy
2015-07-16 18:40 ` Robin Murphy
[not found] ` <cover.1437070995.git.robin.murphy-5wv7dgnIgG8@public.gmane.org>
2015-07-16 18:40 ` [PATCH v4 1/4] iommu/iova: Avoid over-allocating when size-aligned Robin Murphy
2015-07-16 18:40 ` Robin Murphy
[not found] ` <35cb877828b570db84e89684ef76308cd1857f0c.1437070995.git.robin.murphy-5wv7dgnIgG8@public.gmane.org>
2015-07-28 13:31 ` David Woodhouse [this message]
2015-07-28 13:31 ` David Woodhouse
2015-07-16 18:40 ` [PATCH v4 2/4] iommu: Implement common IOMMU ops for DMA mapping Robin Murphy
2015-07-16 18:40 ` Robin Murphy
[not found] ` <00fb13713dc8a69dc32b859f9311e70d78fb0c7a.1437070995.git.robin.murphy-5wv7dgnIgG8@public.gmane.org>
2015-07-28 16:45 ` Catalin Marinas
2015-07-28 16:45 ` Catalin Marinas
2015-07-16 18:40 ` [PATCH v4 3/4] arm64: Add IOMMU dma_ops Robin Murphy
2015-07-16 18:40 ` Robin Murphy
[not found] ` <f51a6dfad1367107b07ca43624a990a62f3d4f3c.1437070995.git.robin.murphy-5wv7dgnIgG8@public.gmane.org>
2015-07-28 17:27 ` Catalin Marinas
2015-07-28 17:27 ` Catalin Marinas
2015-07-16 18:40 ` [PATCH v4 4/4] arm64: Hook up " Robin Murphy
2015-07-16 18:40 ` Robin Murphy
[not found] ` <fecbcc50e62ae86639c886ab86e4ec067d52b16a.1437070995.git.robin.murphy-5wv7dgnIgG8@public.gmane.org>
2015-07-28 17:30 ` Catalin Marinas
2015-07-28 17:30 ` Catalin Marinas
2015-07-20 15:26 ` [PATCH v4 0/4] arm64: IOMMU-backed DMA mapping Joerg Roedel
2015-07-20 15:26 ` Joerg Roedel
[not found] ` <20150720152637.GD10969-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-07-20 17:23 ` Robin Murphy
2015-07-20 17:23 ` Robin Murphy
[not found] ` <55AD2E97.1040901-5wv7dgnIgG8@public.gmane.org>
2015-07-28 12:46 ` Will Deacon
2015-07-28 12:46 ` Will Deacon
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=1438090310.26913.158.camel@infradead.org \
--to=dwmw2-wegcikhe2lqwvfeawa7xhq@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=catalin.marinas-5wv7dgnIgG8@public.gmane.org \
--cc=djkurtz-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org \
--cc=laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=robin.murphy-5wv7dgnIgG8@public.gmane.org \
--cc=thunder.leizhen-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
--cc=treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=will.deacon-5wv7dgnIgG8@public.gmane.org \
--cc=yingjoe.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
--cc=yong.wu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.