From: Julien Grall <julien.grall@linaro.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
xen-devel@lists.xensource.com
Cc: julien.grall@citrix.com, Ian.Campbell@citrix.com
Subject: Re: [PATCH v4 7/7] Revert "xen: introduce arch_grant_(un)map_page_identity"
Date: Fri, 10 Oct 2014 12:54:17 +0100 [thread overview]
Message-ID: <5437C8E9.5030302@linaro.org> (raw)
In-Reply-To: <1412941440-5646-7-git-send-email-stefano.stabellini@eu.citrix.com>
Hi Stefano,
On 10/10/2014 12:44, Stefano Stabellini wrote:
> This reverts commit e25a5f4d8cf3b55718048abdd21c7d0de64ae54c.
>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
Regards,
> ---
> xen/arch/arm/p2m.c | 26 --------------------------
> xen/drivers/passthrough/arm/smmu.c | 13 +++++++++++--
> xen/include/asm-arm/p2m.h | 4 ----
> xen/include/asm-x86/p2m.h | 4 ----
> 4 files changed, 11 insertions(+), 36 deletions(-)
>
> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
> index 6ff8c17..acad2f2 100644
> --- a/xen/arch/arm/p2m.c
> +++ b/xen/arch/arm/p2m.c
> @@ -931,32 +931,6 @@ 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;
> -
> - ASSERT(is_domain_direct_mapped(d));
> -
> - /* 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)
> -{
> - ASSERT(is_domain_direct_mapped(d));
> -
> - guest_physmap_remove_page(d, frame, frame, 0);
> - return 0;
> -}
> -
> int p2m_alloc_table(struct domain *d)
> {
> struct p2m_domain *p2m = &d->arch.p2m;
> diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
> index 9a95ac9..42bde75 100644
> --- a/xen/drivers/passthrough/arm/smmu.c
> +++ b/xen/drivers/passthrough/arm/smmu.c
> @@ -1539,6 +1539,8 @@ static void arm_smmu_iommu_domain_teardown(struct domain *d)
> static int arm_smmu_map_page(struct domain *d, unsigned long gfn,
> unsigned long mfn, unsigned int 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
> @@ -1553,7 +1555,12 @@ static int arm_smmu_map_page(struct domain *d, unsigned long gfn,
> if ( !(flags & (IOMMUF_readable | IOMMUF_writable)) )
> return -EINVAL;
>
> - return arch_grant_map_page_identity(d, mfn, flags & IOMMUF_writable);
> + t = (flags & IOMMUF_writable) ? p2m_iommu_map_rw : p2m_iommu_map_ro;
> +
> + /* The function guest_physmap_add_entry replaces the current mapping
> + * if there is already one...
> + */
> + return guest_physmap_add_entry(d, gfn, mfn, 0, t);
> }
>
> static int arm_smmu_unmap_page(struct domain *d, unsigned long gfn)
> @@ -1564,7 +1571,9 @@ static int arm_smmu_unmap_page(struct domain *d, unsigned long gfn)
> if ( !is_domain_direct_mapped(d) )
> return -EINVAL;
>
> - return arch_grant_unmap_page_identity(d, gfn);
> + guest_physmap_remove_page(d, gfn, gfn, 0);
> +
> + return 0;
> }
>
> static const struct iommu_ops arm_smmu_iommu_ops = {
> diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
> index 10bf111..da36504 100644
> --- a/xen/include/asm-arm/p2m.h
> +++ b/xen/include/asm-arm/p2m.h
> @@ -214,10 +214,6 @@ static inline int get_page_and_type(struct page_info *page,
> return rc;
> }
>
> -int arch_grant_map_page_identity(struct domain *d, unsigned long frame,
> - bool_t writeable);
> -int arch_grant_unmap_page_identity(struct domain *d, unsigned long frame);
> -
> /* get host p2m table */
> #define p2m_get_hostp2m(d) (&(d)->arch.p2m)
>
> diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
> index 90ddd15..5f7fe71 100644
> --- a/xen/include/asm-x86/p2m.h
> +++ b/xen/include/asm-x86/p2m.h
> @@ -709,10 +709,6 @@ static inline unsigned int p2m_get_iommu_flags(p2m_type_t p2mt)
> return flags;
> }
>
> -extern int arch_grant_map_page_identity(struct domain *d, unsigned long frame,
> - bool_t writeable);
> -extern int arch_grant_unmap_page_identity(struct domain *d, unsigned long frame);
> -
> #endif /* _XEN_P2M_H */
>
> /*
>
--
Julien Grall
prev parent reply other threads:[~2014-10-10 11:54 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-10 11:42 [PATCH v4 0/7] xen/arm: introduce GNTTABOP_cache_flush Stefano Stabellini
2014-10-10 11:43 ` [PATCH v4 1/7] xen: introduce gnttab_max_nr_maptrack_frames command line option Stefano Stabellini
2014-10-10 13:08 ` Jan Beulich
2014-10-13 9:59 ` Stefano Stabellini
2014-10-13 10:38 ` Jan Beulich
2014-10-13 10:45 ` Stefano Stabellini
2014-10-10 11:43 ` [PATCH v4 2/7] xen/arm: rename *_xen_dcache_* operations to *_dcache_* Stefano Stabellini
2014-10-10 11:43 ` [PATCH v4 3/7] xen/arm: introduce invalidate_dcache_va_range Stefano Stabellini
2014-10-10 11:43 ` [PATCH v4 4/7] xen/x86: introduce more cache maintenance operations Stefano Stabellini
2014-10-10 13:16 ` Jan Beulich
2014-10-13 10:35 ` Stefano Stabellini
2014-10-13 10:47 ` Jan Beulich
2014-10-13 11:09 ` Stefano Stabellini
2014-10-10 11:43 ` [PATCH v4 5/7] xen/arm: introduce GNTTABOP_cache_flush Stefano Stabellini
2014-10-10 12:04 ` Julien Grall
2014-10-10 13:25 ` Jan Beulich
2014-10-10 11:43 ` [PATCH v4 6/7] Revert "xen/arm: introduce XENFEAT_grant_map_identity" Stefano Stabellini
2014-10-10 11:53 ` Julien Grall
2014-10-10 11:44 ` [PATCH v4 7/7] Revert "xen: introduce arch_grant_(un)map_page_identity" Stefano Stabellini
2014-10-10 11:54 ` 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=5437C8E9.5030302@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.