aboutsummaryrefslogtreecommitdiffstats
path: root/xen/xsm
diff options
context:
space:
mode:
authorDaniel De Graaf <dgdegra@tycho.nsa.gov>2013-01-30 02:36:40 -0800
committerDaniel De Graaf <dgdegra@tycho.nsa.gov>2013-01-30 02:36:40 -0800
commit6cf13d0d523e20557e11a94fda51452f54c3a1b5 (patch)
tree94bb2e3ea61916df469ab5debbaab11db319a5a4 /xen/xsm
parent66eb6f8b77474fcdd140e43f819a3a80fd5a25a8 (diff)
downloadxen-6cf13d0d523e20557e11a94fda51452f54c3a1b5.tar.gz
xen-6cf13d0d523e20557e11a94fda51452f54c3a1b5.tar.bz2
xen-6cf13d0d523e20557e11a94fda51452f54c3a1b5.zip
xen/arch/arm: add XSM hook to HVMOP_{get,set}_param
This hook is not x86-specific; move it out of CONFIG_X86. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/xsm')
-rw-r--r--xen/xsm/dummy.c2
-rw-r--r--xen/xsm/flask/hooks.c46
2 files changed, 24 insertions, 24 deletions
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index dcd3e31526..6f1e0b4860 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -100,6 +100,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
set_to_dummy_if_null(ops, page_offline);
set_to_dummy_if_null(ops, tmem_op);
set_to_dummy_if_null(ops, tmem_control);
+ set_to_dummy_if_null(ops, hvm_param);
set_to_dummy_if_null(ops, do_xsm_op);
@@ -108,7 +109,6 @@ void xsm_fixup_ops (struct xsm_operations *ops)
#ifdef CONFIG_X86
set_to_dummy_if_null(ops, shadow_control);
- set_to_dummy_if_null(ops, hvm_param);
set_to_dummy_if_null(ops, hvm_set_pci_intx_level);
set_to_dummy_if_null(ops, hvm_set_isa_irq_level);
set_to_dummy_if_null(ops, hvm_set_pci_link_route);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 58695884ae..85d009c42b 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1068,6 +1068,28 @@ 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_hvm_param(struct domain *d, unsigned long op)
+{
+ u32 perm;
+
+ switch ( op )
+ {
+ case HVMOP_set_param:
+ perm = HVM__SETPARAM;
+ break;
+ case HVMOP_get_param:
+ perm = HVM__GETPARAM;
+ break;
+ case HVMOP_track_dirty_vram:
+ perm = HVM__TRACKDIRTYVRAM;
+ break;
+ default:
+ perm = HVM__HVMCTL;
+ }
+
+ return current_has_perm(d, SECCLASS_HVM, perm);
+}
+
#ifdef CONFIG_X86
static int flask_shadow_control(struct domain *d, uint32_t op)
{
@@ -1148,28 +1170,6 @@ static int flask_ioport_mapping(struct domain *d, uint32_t start, uint32_t end,
return flask_ioport_permission(d, start, end, access);
}
-static int flask_hvm_param(struct domain *d, unsigned long op)
-{
- u32 perm;
-
- switch ( op )
- {
- case HVMOP_set_param:
- perm = HVM__SETPARAM;
- break;
- case HVMOP_get_param:
- perm = HVM__GETPARAM;
- break;
- case HVMOP_track_dirty_vram:
- perm = HVM__TRACKDIRTYVRAM;
- break;
- default:
- perm = HVM__HVMCTL;
- }
-
- return current_has_perm(d, SECCLASS_HVM, perm);
-}
-
static int flask_hvm_set_pci_intx_level(struct domain *d)
{
return current_has_perm(d, SECCLASS_HVM, HVM__PCILEVEL);
@@ -1503,6 +1503,7 @@ static struct xsm_operations flask_ops = {
.page_offline = flask_page_offline,
.tmem_op = flask_tmem_op,
.tmem_control = flask_tmem_control,
+ .hvm_param = flask_hvm_param,
.do_xsm_op = do_flask_op,
@@ -1511,7 +1512,6 @@ static struct xsm_operations flask_ops = {
#ifdef CONFIG_X86
.shadow_control = flask_shadow_control,
- .hvm_param = flask_hvm_param,
.hvm_set_pci_intx_level = flask_hvm_set_pci_intx_level,
.hvm_set_isa_irq_level = flask_hvm_set_isa_irq_level,
.hvm_set_pci_link_route = flask_hvm_set_pci_link_route,