aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xsm
diff options
context:
space:
mode:
authorDaniel De Graaf <dgdegra@tycho.nsa.gov>2013-04-23 11:54:01 +0200
committerJan Beulich <jbeulich@suse.com>2013-04-23 11:54:01 +0200
commit4bc22a50ebc1fb1695d59f69105797e208021edb (patch)
tree6f01eb36d8f62b7f1d203c4e6bbd8067338a540d /xen/include/xsm
parentbb812101db5117e07de1b557b355c3855850cc95 (diff)
downloadxen-4bc22a50ebc1fb1695d59f69105797e208021edb.tar.gz
xen-4bc22a50ebc1fb1695d59f69105797e208021edb.tar.bz2
xen-4bc22a50ebc1fb1695d59f69105797e208021edb.zip
x86/hvm: convert access check for nested HVM to XSM
This adds an XSM hook for enabling nested HVM support, replacing an IS_PRIV check. This hook is a partial duplicate with the xsm_hvm_param hook, but using the existing hook would require adding the index to the hook and would require the use of a custom hook for the xsm-disabled case (using XSM_OTHER, which is less immediately readable) - whereas adding a new hook retains the clarity of the existing code. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (release perspective)
Diffstat (limited to 'xen/include/xsm')
-rw-r--r--xen/include/xsm/dummy.h6
-rw-r--r--xen/include/xsm/xsm.h6
2 files changed, 12 insertions, 0 deletions
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 025936a5a1..191e493b43 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -473,6 +473,12 @@ static XSM_INLINE int xsm_hvm_param(XSM_DEFAULT_ARG struct domain *d, unsigned l
return xsm_default_action(action, current->domain, d);
}
+static XSM_INLINE int xsm_hvm_param_nested(XSM_DEFAULT_ARG struct domain *d)
+{
+ XSM_ASSERT_ACTION(XSM_PRIV);
+ return xsm_default_action(action, current->domain, d);
+}
+
#ifdef CONFIG_X86
static XSM_INLINE int xsm_shadow_control(XSM_DEFAULT_ARG struct domain *d, uint32_t op)
{
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index cba744ce1a..fdc7a650d6 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -130,6 +130,7 @@ struct xsm_operations {
long (*do_xsm_op) (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op);
int (*hvm_param) (struct domain *d, unsigned long op);
+ int (*hvm_param_nested) (struct domain *d);
#ifdef CONFIG_X86
int (*shadow_control) (struct domain *d, uint32_t op);
@@ -493,6 +494,11 @@ static inline int xsm_hvm_param (xsm_default_t def, struct domain *d, unsigned l
return xsm_ops->hvm_param(d, op);
}
+static inline int xsm_hvm_param_nested (xsm_default_t def, struct domain *d)
+{
+ return xsm_ops->hvm_param_nested(d);
+}
+
#ifdef CONFIG_X86
static inline int xsm_shadow_control (xsm_default_t def, struct domain *d, uint32_t op)
{