From: Julien Grall <julien.grall@linaro.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: julien.grall@citrix.com, xen-devel@lists.xensource.com,
Ian.Campbell@citrix.com
Subject: Re: [PATCH v4 3/3] xen/arm: introduce XENFEAT_grant_map_identity
Date: Mon, 28 Jul 2014 16:24:00 +0100 [thread overview]
Message-ID: <53D66B10.4030805@linaro.org> (raw)
In-Reply-To: <alpine.DEB.2.02.1407281620420.2293@kaball.uk.xensource.com>
On 07/28/2014 04:21 PM, Stefano Stabellini wrote:
> On Mon, 28 Jul 2014, Julien Grall wrote:
>> Hi Stefano,
>>
>> On 07/28/2014 11:16 AM, Stefano Stabellini wrote:
>>> The flag specifies that the hypervisor maps a grant page to guest
>>> physical address == machine address of the page in addition to the
>>> normal grant mapping address.
>>>
>>> Frontends are allowed to map the same page multiple times using multiple
>>> grant references. On the backend side it can be difficult to find out
>>> the physical address corresponding to a particular machine address,
>>> especially at the completation of a dma operation. To simplify address
>>
>> completion
>>
>> [..]
>>
>>> if ( err )
>>> {
>>> @@ -941,9 +951,18 @@ __gnttab_unmap_common(
>>> int err = 0;
>>> mapcount(lgt, rd, op->frame, &wrc, &rdc);
>>> if ( (wrc + rdc) == 0 )
>>> - err = iommu_unmap_page(ld, op->frame);
>>> - else if ( wrc == 0 )
>>> - err = iommu_map_page(ld, op->frame, op->frame, IOMMUF_readable);
>>> + {
>>> + if ( is_domain_direct_mapped(ld) )
>>> + err = arch_grant_unmap_page_identity(ld, op->frame);
>>> + else
>>> + err = iommu_unmap_page(ld, op->frame);
>>> + } else if ( wrc == 0 )
>>> + {
>>> + if ( is_domain_direct_mapped(ld) )
>>> + err = arch_grant_map_page_identity(ld, op->frame, 0);
>>> + else
>>> + err = iommu_map_page(ld, op->frame, op->frame, IOMMUF_readable);
>>
>> With this solution, iommu_map_page will never be called on ARM. It's
>> because gnttab_need_iommu_mapping is checking the domain is using direct
>> mapping.
>>
>> So, I think you can drop the iommu_map_page callback of the SMMU in
>> patch #2.
>
> OK. Should I keep your acked-by on that patch?
Yes, I'm fine with one of 2 solutions (i.e either keep as it is or
removing the {,un}map_page callback).
Regards,
--
Julien Grall
prev parent reply other threads:[~2014-07-28 15:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-28 10:14 [PATCH v4 0/3] map grant refs at pfn = mfn Stefano Stabellini
2014-07-28 10:16 ` [PATCH v4 1/3] xen/x86: introduce is_domain_direct_mapped(d) as ((void)(d), 0) on x86 Stefano Stabellini
2014-07-28 10:48 ` Jan Beulich
2014-07-28 10:16 ` [PATCH v4 2/3] xen: introduce arch_grant_(un)map_page_identity Stefano Stabellini
2014-07-28 10:52 ` Jan Beulich
2014-07-28 10:53 ` Stefano Stabellini
2014-07-28 10:16 ` [PATCH v4 3/3] xen/arm: introduce XENFEAT_grant_map_identity Stefano Stabellini
2014-07-28 10:55 ` Jan Beulich
2014-07-28 12:05 ` Julien Grall
2014-07-28 15:21 ` Stefano Stabellini
2014-07-28 15:22 ` Stefano Stabellini
2014-07-28 15:24 ` Julien Grall [this message]
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=53D66B10.4030805@linaro.org \
--to=julien.grall@linaro.org \
--cc=Ian.Campbell@citrix.com \
--cc=julien.grall@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/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).