aboutsummaryrefslogtreecommitdiffstats
path: root/xen/xsm
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2013-01-21 17:03:10 +0000
committerIan Campbell <ian.campbell@citrix.com>2013-01-21 17:03:10 +0000
commitcabe22c4efb37818a290f93f45a7ca7f60b6d70b (patch)
treecabe57da073579ecf93a45fc850a0074a1ce1855 /xen/xsm
parent18867baab7179673bf0715e895718c66d09fcd1d (diff)
downloadxen-cabe22c4efb37818a290f93f45a7ca7f60b6d70b.tar.gz
xen-cabe22c4efb37818a290f93f45a7ca7f60b6d70b.tar.bz2
xen-cabe22c4efb37818a290f93f45a7ca7f60b6d70b.zip
xen arm: add XSM hooks to arch_memory_op
Treat XENMEM_add_to_physmap_range the same as XENMEM_add_to_physmap. Reported-by: Lars Rasmusson <Lars.Rasmusson@sics.se> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Keir Fraser <keir@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'xen/xsm')
-rw-r--r--xen/xsm/dummy.c5
-rw-r--r--xen/xsm/flask/hooks.c25
2 files changed, 16 insertions, 14 deletions
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 529a724e71..5031e163a9 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -101,6 +101,9 @@ void xsm_fixup_ops (struct xsm_operations *ops)
set_to_dummy_if_null(ops, do_xsm_op);
+ set_to_dummy_if_null(ops, add_to_physmap);
+ set_to_dummy_if_null(ops, remove_from_physmap);
+
#ifdef CONFIG_X86
set_to_dummy_if_null(ops, shadow_control);
set_to_dummy_if_null(ops, hvm_param);
@@ -118,8 +121,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
set_to_dummy_if_null(ops, mmu_update);
set_to_dummy_if_null(ops, mmuext_op);
set_to_dummy_if_null(ops, update_va_mapping);
- set_to_dummy_if_null(ops, add_to_physmap);
- set_to_dummy_if_null(ops, remove_from_physmap);
set_to_dummy_if_null(ops, bind_pt_irq);
set_to_dummy_if_null(ops, unbind_pt_irq);
set_to_dummy_if_null(ops, ioport_permission);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index ba67502927..2a13549045 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1055,6 +1055,16 @@ static inline int flask_tmem_control(void)
return domain_has_xen(current->domain, XEN__TMEM_CONTROL);
}
+static int flask_add_to_physmap(struct domain *d1, struct domain *d2)
+{
+ return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__PHYSMAP);
+}
+
+static int flask_remove_from_physmap(struct domain *d1, struct domain *d2)
+{
+ return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__PHYSMAP);
+}
+
#ifdef CONFIG_X86
static int flask_shadow_control(struct domain *d, uint32_t op)
{
@@ -1325,16 +1335,6 @@ static int flask_update_va_mapping(struct domain *d, struct domain *f,
return domain_has_perm(d, f, SECCLASS_MMU, map_perms);
}
-static int flask_add_to_physmap(struct domain *d1, struct domain *d2)
-{
- return domain_has_perm(d1, d2, SECCLASS_MMU, MMU__PHYSMAP);
-}
-
-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_get_device_group(uint32_t machine_bdf)
{
u32 rsid;
@@ -1501,6 +1501,9 @@ static struct xsm_operations flask_ops = {
.do_xsm_op = do_flask_op,
+ .add_to_physmap = flask_add_to_physmap,
+ .remove_from_physmap = flask_remove_from_physmap,
+
#ifdef CONFIG_X86
.shadow_control = flask_shadow_control,
.hvm_param = flask_hvm_param,
@@ -1518,8 +1521,6 @@ static struct xsm_operations flask_ops = {
.mmu_update = flask_mmu_update,
.mmuext_op = flask_mmuext_op,
.update_va_mapping = flask_update_va_mapping,
- .add_to_physmap = flask_add_to_physmap,
- .remove_from_physmap = flask_remove_from_physmap,
.get_device_group = flask_get_device_group,
.test_assign_device = flask_test_assign_device,
.assign_device = flask_assign_device,