From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: julien.grall@citrix.com, Ian.Campbell@citrix.com,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [PATCH v2 1/2] xen: introduce arch_iommu_grant_(un)map_page
Date: Wed, 23 Jul 2014 18:19:41 +0100 [thread overview]
Message-ID: <1406135982-15487-1-git-send-email-stefano.stabellini@eu.citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1407231806550.2293@kaball.uk.xensource.com>
Introduce two arch specific functions to create a new p2m mapping of
granted pages at pfn == mfn.
The x86 implementation just returns ENOSYS.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
xen/arch/arm/p2m.c | 19 +++++++++++++++++++
xen/include/asm-arm/p2m.h | 4 ++++
xen/include/asm-x86/p2m.h | 13 +++++++++++++
3 files changed, 36 insertions(+)
diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 9960e17..c38af59 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -555,6 +555,25 @@ 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;
+
+ if ( writeable )
+ t = p2m_ram_rw;
+ else
+ t = p2m_ram_ro;
+
+ return guest_physmap_add_entry(d, frame, frame, 0, t);
+}
+
+int arch_grant_unmap_page_identity(struct domain *d, unsigned long frame)
+{
+ 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/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index 911d32d..b682f51 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -181,6 +181,10 @@ 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);
+
#endif /* _XEN_P2M_H */
/*
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 0ddbadb..faead11 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -717,6 +717,19 @@ static inline unsigned int p2m_get_iommu_flags(p2m_type_t p2mt)
return flags;
}
+
+static inline int arch_grant_map_page_identity(struct domain *d,
+ unsigned long frame,
+ bool_t writeable)
+{
+ return -ENOSYS;
+}
+
+static inline int arch_grant_unmap_page_identity(struct domain *d,
+ unsigned long frame)
+{
+ return -ENOSYS;
+}
#endif /* _XEN_P2M_H */
--
1.7.10.4
next prev parent reply other threads:[~2014-07-23 17:19 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-23 17:18 [PATCH v2 0/2] map grant refs at pfn = mfn Stefano Stabellini
2014-07-23 17:19 ` Stefano Stabellini [this message]
2014-07-24 10:51 ` [PATCH v2 1/2] xen: introduce arch_iommu_grant_(un)map_page Julien Grall
2014-07-24 11:07 ` Stefano Stabellini
2014-07-24 11:14 ` Julien Grall
2014-07-24 11:16 ` Stefano Stabellini
2014-07-24 11:18 ` Julien Grall
2014-07-24 11:19 ` Stefano Stabellini
2014-07-23 17:19 ` [PATCH v2 2/2] xen/arm: introduce XENFEAT_grant_map_identity Stefano Stabellini
2014-07-24 6:48 ` Jan Beulich
2014-07-24 10:47 ` Stefano Stabellini
2014-07-24 11:58 ` Jan Beulich
2014-07-24 6:37 ` [PATCH v2 0/2] map grant refs at pfn = mfn Jan Beulich
2014-07-24 9:31 ` Tim Deegan
2014-07-24 10:28 ` Stefano Stabellini
2014-07-24 10:42 ` Tim Deegan
2014-07-24 10:55 ` Ian Campbell
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=1406135982-15487-1-git-send-email-stefano.stabellini@eu.citrix.com \
--to=stefano.stabellini@eu.citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=julien.grall@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).