diff options
author | Daniel De Graaf <dgdegra@tycho.nsa.gov> | 2013-01-11 10:09:45 +0000 |
---|---|---|
committer | Daniel De Graaf <dgdegra@tycho.nsa.gov> | 2013-01-11 10:09:45 +0000 |
commit | 996cf47b8081fc6b2efd4fa9a69f6b77028719e6 (patch) | |
tree | f0ba2341667a9c2d29971d02b1c03328eab7b096 /xen/include/xsm | |
parent | d018d6b4fb36f04086783d6883b25641ae166034 (diff) | |
download | xen-996cf47b8081fc6b2efd4fa9a69f6b77028719e6.tar.gz xen-996cf47b8081fc6b2efd4fa9a69f6b77028719e6.tar.bz2 xen-996cf47b8081fc6b2efd4fa9a69f6b77028719e6.zip |
xen: convert do_domctl to use XSM
The xsm_domctl hook now covers every domctl, in addition to the more
fine-grained XSM hooks in most sub-functions. This also removes the
need to special-case XEN_DOMCTL_getdomaininfo.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/include/xsm')
-rw-r--r-- | xen/include/xsm/dummy.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h index dc16684e80..93b1148bfd 100644 --- a/xen/include/xsm/dummy.h +++ b/xen/include/xsm/dummy.h @@ -64,8 +64,6 @@ static XSM_INLINE int xsm_scheduler(struct domain *d) static XSM_INLINE int xsm_getdomaininfo(struct domain *d) { - if ( !IS_PRIV(current->domain) ) - return -EPERM; return 0; } @@ -91,6 +89,20 @@ static XSM_INLINE int xsm_set_target(struct domain *d, struct domain *e) static XSM_INLINE int xsm_domctl(struct domain *d, int cmd) { + switch ( cmd ) + { + case XEN_DOMCTL_ioport_mapping: + case XEN_DOMCTL_memory_mapping: + case XEN_DOMCTL_bind_pt_irq: + case XEN_DOMCTL_unbind_pt_irq: { + if ( !IS_PRIV_FOR(current->domain, d) ) + return -EPERM; + break; + } + default: + if ( !IS_PRIV(current->domain) ) + return -EPERM; + } return 0; } |