diff options
author | Daniel De Graaf <dgdegra@tycho.nsa.gov> | 2013-01-11 10:46:43 +0000 |
---|---|---|
committer | Daniel De Graaf <dgdegra@tycho.nsa.gov> | 2013-01-11 10:46:43 +0000 |
commit | a655abfd8a4bf03de9c9a8d820125be8323d64f8 (patch) | |
tree | d88e4bae8739dce5e0fd4e5c030a1dd6b8ddb2b0 /xen/include/xsm | |
parent | 0d7f18b01f69c6b89aa3654bd2b11e24f41aaf71 (diff) | |
download | xen-a655abfd8a4bf03de9c9a8d820125be8323d64f8.tar.gz xen-a655abfd8a4bf03de9c9a8d820125be8323d64f8.tar.bz2 xen-a655abfd8a4bf03de9c9a8d820125be8323d64f8.zip |
tmem: add XSM hooks
This adds a pair of XSM hooks for tmem operations: xsm_tmem_op which
controls any use of tmem, and xsm_tmem_control which allows use of the
TMEM_CONTROL operations. By default, all domains can use tmem while
only IS_PRIV domains can use control operations.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/include/xsm')
-rw-r--r-- | xen/include/xsm/dummy.h | 12 | ||||
-rw-r--r-- | xen/include/xsm/xsm.h | 12 |
2 files changed, 24 insertions, 0 deletions
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h index 4f75674da8..2c750de4f5 100644 --- a/xen/include/xsm/dummy.h +++ b/xen/include/xsm/dummy.h @@ -371,6 +371,18 @@ static XSM_INLINE int xsm_page_offline(XSM_DEFAULT_ARG uint32_t cmd) return xsm_default_action(action, current->domain, NULL); } +static XSM_INLINE int xsm_tmem_op(XSM_DEFAULT_VOID) +{ + XSM_ASSERT_ACTION(XSM_HOOK); + return xsm_default_action(action, current->domain, NULL); +} + +static XSM_INLINE int xsm_tmem_control(XSM_DEFAULT_VOID) +{ + XSM_ASSERT_ACTION(XSM_PRIV); + return xsm_default_action(action, current->domain, NULL); +} + static XSM_INLINE long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) op) { return -ENOSYS; diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h index 17b08996c9..ce5ede8fac 100644 --- a/xen/include/xsm/xsm.h +++ b/xen/include/xsm/xsm.h @@ -119,6 +119,8 @@ struct xsm_operations { int (*resource_setup_misc) (void); int (*page_offline)(uint32_t cmd); + int (*tmem_op)(void); + int (*tmem_control)(void); long (*do_xsm_op) (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op); @@ -441,6 +443,16 @@ static inline int xsm_page_offline(xsm_default_t def, uint32_t cmd) return xsm_ops->page_offline(cmd); } +static inline int xsm_tmem_op(xsm_default_t def) +{ + return xsm_ops->tmem_op(); +} + +static inline int xsm_tmem_control(xsm_default_t def) +{ + return xsm_ops->tmem_control(); +} + static inline long xsm_do_xsm_op (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op) { return xsm_ops->do_xsm_op(op); |