diff options
author | Daniel De Graaf <dgdegra@tycho.nsa.gov> | 2011-12-02 13:47:08 -0800 |
---|---|---|
committer | Daniel De Graaf <dgdegra@tycho.nsa.gov> | 2011-12-02 13:47:08 -0800 |
commit | 3d7895b3bbe977e3abd2d4128e42c1daba5e3fa4 (patch) | |
tree | 3a17a23357b787f377dc3dc669824cc88e352306 /xen/xsm/dummy.c | |
parent | 65d744c6d56f92401b9d279c9cf8fe618397be0e (diff) | |
download | xen-3d7895b3bbe977e3abd2d4128e42c1daba5e3fa4.tar.gz xen-3d7895b3bbe977e3abd2d4128e42c1daba5e3fa4.tar.bz2 xen-3d7895b3bbe977e3abd2d4128e42c1daba5e3fa4.zip |
xsm: Expand I/O resource hooks
The XSM hooks inside rangeset are not useful in capturing the PIRQ
mappings in HVM domains. They can also be called from softirq context
where current->domain is invalid, causing spurious AVC denials from
unrelated domains on such calls.
Within FLASK code, the rangeset hooks were already divided between
IRQs, I/O memory, and x86 IO ports; propagate this division back
through the XSM hooks and call the XSM functions directly when needed.
This removes XSM checks for the initial rangeset population for dom0
and the removal checks on domain destruction; denying either of these
actions does not make sense.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/xsm/dummy.c')
-rw-r--r-- | xen/xsm/dummy.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c index ef461e6ea8..a629396afe 100644 --- a/xen/xsm/dummy.c +++ b/xen/xsm/dummy.c @@ -273,13 +273,12 @@ static long dummy___do_xsm_op(XEN_GUEST_HANDLE(xsm_op_t) op) return -ENOSYS; } -static int dummy_add_range (struct domain *d, char *name, unsigned long s, unsigned long e) +static int dummy_irq_permission (struct domain *d, int pirq, uint8_t allow) { return 0; } -static int dummy_remove_range (struct domain *d, char *name, unsigned long s, - unsigned long e) +static int dummy_iomem_permission (struct domain *d, uint64_t s, uint64_t e, uint8_t allow) { return 0; } @@ -462,6 +461,10 @@ static int dummy_vcpuextstate (struct domain *d, uint32_t cmd) return 0; } +static int dummy_ioport_permission (struct domain *d, uint32_t s, uint32_t e, uint8_t allow) +{ + return 0; +} #endif struct xsm_operations dummy_xsm_ops; @@ -536,8 +539,8 @@ void xsm_fixup_ops (struct xsm_operations *ops) set_to_dummy_if_null(ops, kexec); set_to_dummy_if_null(ops, schedop_shutdown); - set_to_dummy_if_null(ops, add_range); - set_to_dummy_if_null(ops, remove_range); + set_to_dummy_if_null(ops, irq_permission); + set_to_dummy_if_null(ops, iomem_permission); set_to_dummy_if_null(ops, __do_xsm_op); @@ -577,5 +580,6 @@ void xsm_fixup_ops (struct xsm_operations *ops) set_to_dummy_if_null(ops, pin_mem_cacheattr); set_to_dummy_if_null(ops, ext_vcpucontext); set_to_dummy_if_null(ops, vcpuextstate); + set_to_dummy_if_null(ops, ioport_permission); #endif } |