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/common/tmem.c | |
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/common/tmem.c')
-rw-r--r-- | xen/common/tmem.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/xen/common/tmem.c b/xen/common/tmem.c index 44e27721a2..ca70e86ae9 100644 --- a/xen/common/tmem.c +++ b/xen/common/tmem.c @@ -2644,6 +2644,9 @@ EXPORT long do_tmem_op(tmem_cli_op_t uops) if ( !tmem_initialized ) return -ENODEV; + if ( !tmh_current_permitted() ) + return -EPERM; + total_tmem_ops++; if ( tmh_lock_all ) |