xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Julien Grall <julien.grall@linaro.org>
Cc: xen-devel@lists.xensource.com, Ian.Campbell@citrix.com
Subject: Re: [PATCH v3 2/3] xen: introduce arch_grant_(un)map_page_identity
Date: Thu, 24 Jul 2014 17:59:09 +0100	[thread overview]
Message-ID: <53D13B5D.7070007@citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1407241756460.2293@kaball.uk.xensource.com>

On 07/24/2014 05:57 PM, Stefano Stabellini wrote:
> On Thu, 24 Jul 2014, Julien Grall wrote:
>> Hi Stefano,
>>
>> On 07/24/2014 02:31 PM, Stefano Stabellini wrote:
>>> Introduce two arch specific functions to create a new p2m mapping of
>>> granted pages at pfn == mfn.
>>> The x86 implementation just returns ENOSYS.
>>>
>>> Base the implementation of arm_smmu_(un)map_page on
>>> arch_grant_(un)map_page_identity.
>>>
>>> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>>>
>>> ---
>>> Changes in v3:
>>> - fix commit title;
>>> - use p2m_iommu types;
>>> - call arch_grant_(un)map_page_identity functions from
>>> arm_smmu_(un)map_page.
>>> ---
>>>  xen/arch/arm/p2m.c                 |   22 ++++++++++++++++++++++
>>>  xen/drivers/passthrough/arm/smmu.c |   13 ++-----------
>>>  xen/include/asm-arm/p2m.h          |    4 ++++
>>>  xen/include/asm-x86/p2m.h          |   13 +++++++++++++
>>>  4 files changed, 41 insertions(+), 11 deletions(-)
>>>
>>> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
>>> index 9960e17..6024b03 100644
>>> --- a/xen/arch/arm/p2m.c
>>> +++ b/xen/arch/arm/p2m.c
>>> @@ -555,6 +555,28 @@ void guest_physmap_remove_page(struct domain *d,
>>>                        pfn_to_paddr(mfn), MATTR_MEM, p2m_invalid);
>>>  }
>>>  
>>> +int arch_grant_map_page_identity(struct domain *d, unsigned long frame,
>>> +                                 bool_t writeable)
>>> +{
>>> +    p2m_type_t t;
>>
>> NIT: I would add an ASSERT(!is_domain_direct_mapped(d)) for sanity check.
>>
> 
> you mean ASSERT(is_domain_direct_mapped(d))

Yes. Sorry.

>>> +
>>> +    /* This is not an IOMMU mapping but it is not a regular RAM p2m type
>>> +     * either. We are using IOMMU p2m types here to prevent the pages
>>> +     * from being used as grants. */
>>> +    if ( writeable )
>>> +        t = p2m_iommu_map_rw;
>>> +    else
>>> +        t = p2m_iommu_map_ro;
>>> +
>>> +    return guest_physmap_add_entry(d, frame, frame, 0, t);
>>> +}
>>> +
>>> +int arch_grant_unmap_page_identity(struct domain *d, unsigned long frame)
>>> +{
>>
>> Same here.
>>
>>> +    guest_physmap_remove_page(d, frame, frame, 0);
>>> +    return 0;
>>> +}
>>> +
>>
>> In any case:
>>
>> Acked-by: Julien Grall <julien.grall@linaro.org>
> 
> thanks
> 


-- 
Julien Grall

  reply	other threads:[~2014-07-24 16:59 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-24 13:30 [PATCH v3 0/3] map grant refs at pfn = mfn Stefano Stabellini
2014-07-24 13:31 ` [PATCH v3 1/3] xen/x86: introduce is_domain_direct_mapped(d) as (0) on x86 Stefano Stabellini
2014-07-24 13:41   ` Julien Grall
2014-07-24 16:51     ` Stefano Stabellini
2014-07-24 13:31 ` [PATCH v3 2/3] xen: introduce arch_grant_(un)map_page_identity Stefano Stabellini
2014-07-24 13:42   ` Jan Beulich
2014-07-24 16:55     ` Stefano Stabellini
2014-07-24 13:44   ` Julien Grall
2014-07-24 16:57     ` Stefano Stabellini
2014-07-24 16:59       ` Julien Grall [this message]
2014-07-24 13:31 ` [PATCH v3 3/3] xen/arm: introduce XENFEAT_grant_map_identity Stefano Stabellini
2014-07-24 13:41   ` Jan Beulich
2014-07-24 14:10     ` Stefano Stabellini
2014-07-24 14:43       ` Jan Beulich
2014-07-24 14:47         ` Julien Grall
2014-07-24 15:02           ` Stefano Stabellini
2014-07-24 15:17             ` Julien Grall
2014-07-24 17:15               ` Stefano Stabellini
2014-07-24 13:50   ` Julien Grall
2014-07-24 14:14     ` Stefano Stabellini
2014-07-24 14:51       ` Julien Grall
2014-08-01 12:35 ` [PATCH v3 0/3] map grant refs at pfn = mfn Thomas Leonard
2014-08-01 12:37 ` Thomas Leonard
2014-08-01 15:13   ` Stefano Stabellini
2014-08-01 16:16     ` Thomas Leonard
2014-08-01 16:21       ` Julien Grall
2014-08-01 16:25         ` Stefano Stabellini
2014-08-01 16:56           ` Thomas Leonard
2014-08-01 17:01             ` Stefano Stabellini
2014-08-01 17:04               ` Thomas Leonard
2014-08-01 17:16                 ` Stefano Stabellini
2014-08-01 18:12                   ` Thomas Leonard
2014-08-06 11:22                     ` Thomas Leonard
2014-08-06 13:35                       ` Stefano Stabellini
2014-08-06 13:39                         ` Thomas Leonard
2014-08-06 13:46                           ` Stefano Stabellini
2014-08-06 14:04                             ` Thomas Leonard
2014-08-06 14:14                               ` Stefano Stabellini
2014-08-06 14:19                                 ` Thomas Leonard
2014-08-06 14:27                                   ` Stefano Stabellini
2014-08-06 14:53                                     ` Thomas Leonard
2014-08-06 15:59                                       ` Wei Liu
2014-08-06 17:50                                         ` Thomas Leonard
2014-08-06 20:46                                           ` Wei Liu
2014-08-07  7:59                                             ` Thomas Leonard
2014-08-07 10:40                                               ` Wei Liu
2014-08-07 11:19                                                 ` Thomas Leonard
2014-08-06 14:24                                 ` Thomas Leonard
2014-08-06 14:11                           ` Wei Liu

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=53D13B5D.7070007@citrix.com \
    --to=julien.grall@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=julien.grall@linaro.org \
    --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).