From: Alex Williamson <alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
Cc: "Singh,
Varinder"
<Varinder.Singh-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org>,
"Sundaram,
Rajesh" <Rajesh.Sundaram-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org>,
"Kimmel,
Jeff" <jeff.kimmel-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org>,
"iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org"
<iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
"Shankar,
Hari" <Hari.Shankar-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org>,
David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
"Spiller,
John" <John.Spiller-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH] On unmap, flush IOMMU TLB and return correct size
Date: Wed, 25 Sep 2013 10:33:35 -0600 [thread overview]
Message-ID: <1380126815.3030.313.camel@ul30vt.home> (raw)
In-Reply-To: <20130925155459.GA20372-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
On Wed, 2013-09-25 at 17:54 +0200, Joerg Roedel wrote:
> On Sat, Sep 21, 2013 at 09:59:00PM -0500, David Woodhouse wrote:
> > I *hate* the bizarre calling convention for iommu_unmap(). Is it
> > actually clearly documented anywhere? Why on earth is it not just
> > returning void, and expected to unmap what it was *asked* to unmap?
>
> Yeah, I agree that this should be documented since it is quite
> non-standard/non-obvious behaviour of a function. The reason the
> interface was implemented this way is that the caller should not need to
> know (or keep track of) the page-size which was used to map a given iova.
>
> So the interface is basically, that you give an iova and a size and the
> iommu driver unmaps _at_least_ a region of that size. But if you ask for
> a 4k region which is mapped by a 2M page then the whole 2M are unmapped.
> The return value tells you how much was actually unmapped.
>
> Not the best interface, I know. We should come up with a better way to
> handle this.
Actually, unmap can return zero too, which happens if you try to unmap
an offset into a super page mapping. The current interface has issues,
but both legacy kvm assignment and vfio rely on it so we don't need to
track individual mappings. Thanks,
Alex
next prev parent reply other threads:[~2013-09-25 16:33 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-02 2:24 [PATCH] On unmap, flush IOMMU TLB and return correct size Shankar, Hari
[not found] ` <CE494510.41547%hshankar-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org>
2013-09-03 4:25 ` Alex Williamson
[not found] ` <1378182340.3246.19.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org>
2013-09-05 4:05 ` Shankar, Hari
[not found] ` <CE4D489F.41EE8%hshankar-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org>
2013-09-05 4:58 ` Alex Williamson
2013-09-22 2:59 ` David Woodhouse
[not found] ` <1379818740.2547.51.camel-Fexsq3y4057IgHVZqg5X0TlWvGAXklZc@public.gmane.org>
2013-09-25 15:54 ` Joerg Roedel
[not found] ` <20130925155459.GA20372-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2013-09-25 16:05 ` David Woodhouse
[not found] ` <1380125113.28494.14.camel-W2I5cNIroUsVm/YvaOjsyQ@public.gmane.org>
2013-09-25 16:58 ` Joerg Roedel
2013-09-25 17:36 ` Alex Williamson
[not found] ` <1380130588.3030.342.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org>
2013-09-25 18:52 ` David Woodhouse
[not found] ` <1380135148.28494.26.camel-W2I5cNIroUsVm/YvaOjsyQ@public.gmane.org>
2013-09-25 19:44 ` Alex Williamson
[not found] ` <1380138243.5197.20.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org>
2013-09-25 20:11 ` David Woodhouse
[not found] ` <1380139886.28494.31.camel-W2I5cNIroUsVm/YvaOjsyQ@public.gmane.org>
2013-09-25 21:46 ` Alex Williamson
[not found] ` <1380145560.5197.94.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org>
2013-09-25 22:15 ` David Woodhouse
[not found] ` <1380147348.28494.37.camel-W2I5cNIroUsVm/YvaOjsyQ@public.gmane.org>
2013-09-25 22:40 ` Alex Williamson
2013-09-25 16:33 ` Alex Williamson [this message]
2013-10-02 15:04 ` David Woodhouse
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=1380126815.3030.313.camel@ul30vt.home \
--to=alex.williamson-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=Hari.Shankar-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org \
--cc=John.Spiller-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org \
--cc=Rajesh.Sundaram-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org \
--cc=Varinder.Singh-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org \
--cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=jeff.kimmel-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org \
--cc=joro-zLv9SwRftAIdnm+yROfE0A@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox