All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Ian Campbell <Ian.Campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: julien.grall@citrix.com, xen-devel@lists.xensource.com
Subject: Re: [RFC PATCH 1/2] xen: introduce arch_iommu_grant_(un)map_page
Date: Wed, 16 Jul 2014 19:19:46 +0100	[thread overview]
Message-ID: <53C6C242.8030007@linaro.org> (raw)
In-Reply-To: <1405526198.1087.45.camel@kazak.uk.xensource.com>

Hi Ian,

On 16/07/14 16:56, Ian Campbell wrote:
> On Tue, 2014-07-08 at 16:53 +0100, Stefano Stabellini wrote:
>> +int arch_iommu_grant_map_page(struct domain *d, unsigned long frame,
>> +                              unsigned flags)
>> +{
>> +    p2m_type_t t;
>> +
>> +    /* Grant mappings can be used for DMA requests. The dev_bus_addr returned by
>> +     * the hypercall is the MFN (not the IPA). For device protected by
>> +     * an IOMMU, Xen needs to add a 1:1 mapping in the domain p2m to
>> +     * allow DMA request to work.
>> +     * This is only valid when the domain is directed mapped.
>> +     */
>> +    BUG_ON(!is_domain_direct_mapped(d));
>
> What stops a non-1:1 guest from trying to map a grant reference and
> ending up here?

The function is protected by gnttab_need_iommu_mapping which check if 
the domain use direct mapping for the memory.

Regards,

-- 
Julien Grall

  reply	other threads:[~2014-07-16 18:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-08 15:52 [RFC PATCH 0/2] map grant refs at pfn = mfn Stefano Stabellini
2014-07-08 15:53 ` [RFC PATCH 1/2] xen: introduce arch_iommu_grant_(un)map_page Stefano Stabellini
2014-07-08 16:46   ` Julien Grall
2014-07-16 15:56   ` Ian Campbell
2014-07-16 18:19     ` Julien Grall [this message]
2014-07-23 11:27   ` Jan Beulich
2014-07-08 15:53 ` [RFC PATCH 2/2] xen/arm: introduce XENFEAT_grant_map_11 Stefano Stabellini
2014-07-16 15:59   ` Ian Campbell
2014-07-22 14:36     ` Stefano Stabellini
2014-07-23 11:17   ` Jan Beulich
2014-07-23 13:31     ` Stefano Stabellini
2014-07-23 14:15       ` Jan Beulich
2014-07-23 11:21 ` [RFC PATCH 0/2] map grant refs at pfn = mfn Jan Beulich

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=53C6C242.8030007@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 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.