xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: xen-devel@lists.xenproject.org
Cc: George.Dunlap@eu.citrix.com, julien.grall@linaro.org,
	tim@xen.org, keir.xen@gmail.com, JBeulich@suse.com,
	dgdegra@tycho.nsa.gov
Subject: [V9 PATCH 5/8] pvh dom0: make xsm_map_gmfn_foreign available for x86
Date: Tue, 15 Apr 2014 17:12:49 -0700	[thread overview]
Message-ID: <1397607172-32065-6-git-send-email-mukesh.rathor@oracle.com> (raw)
In-Reply-To: <1397607172-32065-1-git-send-email-mukesh.rathor@oracle.com>

In this patch we make xsm_map_gmfn_foreign available for x86 also. This
is used in the next patch "pvh dom0: Add and remove foreign pages" in
function p2m_add_foreign.

Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
---
 xen/include/xsm/dummy.h | 14 ++++++--------
 xen/include/xsm/xsm.h   | 16 ++++++----------
 xen/xsm/dummy.c         |  4 +---
 xen/xsm/flask/hooks.c   | 18 ++++++------------
 4 files changed, 19 insertions(+), 33 deletions(-)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index e722155..c3be99a 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -477,6 +477,12 @@ static XSM_INLINE int xsm_remove_from_physmap(XSM_DEFAULT_ARG struct domain *d1,
     return xsm_default_action(action, d1, d2);
 }
 
+static XSM_INLINE int xsm_map_gmfn_foreign(XSM_DEFAULT_ARG struct domain *d, struct domain *t)
+{
+    XSM_ASSERT_ACTION(XSM_TARGET);
+    return xsm_default_action(action, d, t);
+}
+
 static XSM_INLINE int xsm_hvm_param(XSM_DEFAULT_ARG struct domain *d, unsigned long op)
 {
     XSM_ASSERT_ACTION(XSM_TARGET);
@@ -624,11 +630,3 @@ static XSM_INLINE int xsm_ioport_mapping(XSM_DEFAULT_ARG struct domain *d, uint3
 }
 
 #endif /* CONFIG_X86 */
-
-#ifdef CONFIG_ARM
-static XSM_INLINE int xsm_map_gmfn_foreign(XSM_DEFAULT_ARG struct domain *d, struct domain *t)
-{
-    XSM_ASSERT_ACTION(XSM_TARGET);
-    return xsm_default_action(action, d, t);
-}
-#endif
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 2cd3a3b..330d5d2 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -91,6 +91,7 @@ struct xsm_operations {
     int (*memory_pin_page) (struct domain *d1, struct domain *d2, struct page_info *page);
     int (*add_to_physmap) (struct domain *d1, struct domain *d2);
     int (*remove_from_physmap) (struct domain *d1, struct domain *d2);
+    int (*map_gmfn_foreign) (struct domain *d, struct domain *t);
     int (*claim_pages) (struct domain *d);
 
     int (*console_io) (struct domain *d, int cmd);
@@ -166,9 +167,6 @@ struct xsm_operations {
     int (*ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
     int (*ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow);
 #endif
-#ifdef CONFIG_ARM
-    int (*map_gmfn_foreign) (struct domain *d, struct domain *t);
-#endif
 };
 
 #ifdef XSM_ENABLE
@@ -354,6 +352,11 @@ static inline int xsm_remove_from_physmap(xsm_default_t def, struct domain *d1,
     return xsm_ops->remove_from_physmap(d1, d2);
 }
 
+static inline int xsm_map_gmfn_foreign (xsm_default_t def, struct domain *d, struct domain *t)
+{
+    return xsm_ops->map_gmfn_foreign(d, t);
+}
+
 static inline int xsm_claim_pages(xsm_default_t def, struct domain *d)
 {
     return xsm_ops->claim_pages(d);
@@ -634,13 +637,6 @@ static inline int xsm_ioport_mapping (xsm_default_t def, struct domain *d, uint3
 }
 #endif /* CONFIG_X86 */
 
-#ifdef CONFIG_ARM
-static inline int xsm_map_gmfn_foreign (xsm_default_t def, struct domain *d, struct domain *t)
-{
-    return xsm_ops->map_gmfn_foreign(d, t);
-}
-#endif /* CONFIG_ARM */
-
 #endif /* XSM_NO_WRAPPERS */
 
 #ifdef CONFIG_MULTIBOOT
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index b79e10f..792a7fa 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -112,6 +112,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
 
     set_to_dummy_if_null(ops, add_to_physmap);
     set_to_dummy_if_null(ops, remove_from_physmap);
+    set_to_dummy_if_null(ops, map_gmfn_foreign);
 
 #ifdef CONFIG_X86
     set_to_dummy_if_null(ops, do_mca);
@@ -136,7 +137,4 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, ioport_permission);
     set_to_dummy_if_null(ops, ioport_mapping);
 #endif
-#ifdef CONFIG_ARM
-    set_to_dummy_if_null(ops, map_gmfn_foreign);
-#endif
 }
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 4ce31c9..9a6b199 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1078,6 +1078,11 @@ static int flask_remove_from_physmap(struct domain *d1, struct domain *d2)
     return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__PHYSMAP);
 }
 
+static int flask_map_gmfn_foreign(struct domain *d, struct domain *t)
+{
+    return domain_has_perm(d, t, SECCLASS_MMU, MMU__MAP_READ | MMU__MAP_WRITE);
+}
+
 static int flask_hvm_param(struct domain *d, unsigned long op)
 {
     u32 perm;
@@ -1460,13 +1465,6 @@ static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq
 }
 #endif /* CONFIG_X86 */
 
-#ifdef CONFIG_ARM
-static int flask_map_gmfn_foreign(struct domain *d, struct domain *t)
-{
-    return domain_has_perm(d, t, SECCLASS_MMU, MMU__MAP_READ | MMU__MAP_WRITE);
-}
-#endif
-
 long do_flask_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) u_flask_op);
 int compat_flask_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) u_flask_op);
 
@@ -1548,7 +1546,7 @@ static struct xsm_operations flask_ops = {
 
     .add_to_physmap = flask_add_to_physmap,
     .remove_from_physmap = flask_remove_from_physmap,
-
+    .map_gmfn_foreign = flask_map_gmfn_foreign,
 
 #if defined(HAS_PASSTHROUGH) && defined(HAS_PCI)
     .get_device_group = flask_get_device_group,
@@ -1580,10 +1578,6 @@ static struct xsm_operations flask_ops = {
     .ioport_permission = flask_ioport_permission,
     .ioport_mapping = flask_ioport_mapping,
 #endif
-
-#ifdef CONFIG_ARM
-    .map_gmfn_foreign = flask_map_gmfn_foreign,
-#endif
 };
 
 static __init int flask_init(void)
-- 
1.8.3.1

  parent reply	other threads:[~2014-04-16  0:13 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-16  0:12 [V9 PATCH 0/8] pvh dom0 patches Mukesh Rathor
2014-04-16  0:12 ` [V9 PATCH 1/8] pvh dom0: move some pv specific code to static functions Mukesh Rathor
2014-04-16  0:12 ` [V9 PATCH 2/8] pvh dom0: construct_dom0 changes Mukesh Rathor
2014-04-16  0:12 ` [V9 PATCH 3/8] pvh dom0: Introduce p2m_map_foreign Mukesh Rathor
2014-04-16  0:12 ` [V9 PATCH 4/8] pvh dom0: Add checks and restrictions for p2m_is_foreign Mukesh Rathor
2014-04-16 15:28   ` Jan Beulich
2014-04-16  0:12 ` Mukesh Rathor [this message]
2014-04-16 14:29   ` [V9 PATCH 5/8] pvh dom0: make xsm_map_gmfn_foreign available for x86 Daniel De Graaf
2014-04-16  0:12 ` [V9 PATCH 6/8] pvh dom0: Add and remove foreign pages Mukesh Rathor
2014-04-16 16:00   ` Jan Beulich
2014-04-17  1:37     ` Mukesh Rathor
2014-04-17  6:50       ` Jan Beulich
2014-04-17 12:36         ` Tim Deegan
2014-04-17 13:58           ` Jan Beulich
2014-04-19  0:59             ` Mukesh Rathor
2014-04-21 16:10               ` Jan Beulich
2014-04-24  2:21             ` Mukesh Rathor
2014-04-24  6:44               ` Jan Beulich
2014-04-24  9:46               ` Tim Deegan
2014-04-25  2:09                 ` Mukesh Rathor
2014-04-25  6:49                   ` Jan Beulich
2014-04-25 23:23                     ` Mukesh Rathor
2014-04-26  0:06                     ` Mukesh Rathor
2014-04-28  7:23                       ` Jan Beulich
2014-04-25  8:55                   ` Tim Deegan
2014-04-25 23:29                     ` Mukesh Rathor
2014-04-26  1:34                   ` Mukesh Rathor
2014-04-28  8:54                     ` Jan Beulich
2014-04-28  9:09                       ` Tim Deegan
2014-04-22  0:19       ` Mukesh Rathor
2014-04-22  7:28         ` Jan Beulich
2014-04-23  0:28           ` Mukesh Rathor
2014-04-23  9:03             ` Jan Beulich
2014-04-23 16:13               ` Andres Lagar-Cavilla
2014-04-24 16:37                 ` Tim Deegan
2014-04-16  0:12 ` [V9 PATCH 7/8] pvh dom0: check for vioapic null ptr in vioapic_range Mukesh Rathor
2014-04-16 16:05   ` Jan Beulich
2014-04-17  1:44     ` Mukesh Rathor
2014-04-17  6:54       ` Jan Beulich
2014-04-22  0:59         ` Mukesh Rathor
2014-04-22  7:33           ` Jan Beulich
2014-04-23  0:11             ` Mukesh Rathor
2014-04-23  9:07               ` Jan Beulich
2014-04-23 21:18                 ` Mukesh Rathor
2014-04-24  6:49                   ` Jan Beulich
2014-04-24 23:28                     ` Mukesh Rathor
2014-05-06  0:19                     ` Mukesh Rathor
2014-05-06  7:44                       ` Jan Beulich
2014-05-07  1:07                         ` Mukesh Rathor
2014-05-07  6:47                           ` Jan Beulich
2014-05-07 23:52                             ` Mukesh Rathor
2014-05-08  6:33                               ` Jan Beulich
2014-04-16  0:12 ` [V9 PATCH 8/8] pvh dom0: add opt_dom0pvh to setup.c Mukesh Rathor
2014-04-16 12:57   ` Konrad Rzeszutek Wilk
2014-04-16 13:01   ` Andrew Cooper
2014-04-16 16:09   ` Jan Beulich
2014-04-16 14:57 ` [V9 PATCH 0/8] pvh dom0 patches Roger Pau Monné
2014-04-16 21:15   ` Mukesh Rathor

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=1397607172-32065-6-git-send-email-mukesh.rathor@oracle.com \
    --to=mukesh.rathor@oracle.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=julien.grall@linaro.org \
    --cc=keir.xen@gmail.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /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).