diff options
author | Daniel De Graaf <dgdegra@tycho.nsa.gov> | 2013-05-07 16:49:18 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2013-05-07 16:49:18 +0200 |
commit | 919f59b3b99e1d845c6a1f30125e79e828805d87 (patch) | |
tree | aa20c9a715a12b2ba54bf9ec992a7f4a507c4bb7 /xen/include/xsm | |
parent | 013e34f5a61725012467f17650597d351fc0ca99 (diff) | |
download | xen-919f59b3b99e1d845c6a1f30125e79e828805d87.tar.gz xen-919f59b3b99e1d845c6a1f30125e79e828805d87.tar.bz2 xen-919f59b3b99e1d845c6a1f30125e79e828805d87.zip |
xsm: add hooks for claim
Adds XSM hooks for the recently introduced XENMEM_claim_pages and
XENMEM_get_outstanding_pages operations, and adds FLASK access vectors
for them. This makes the access control decisions for these operations
match those in the rest of the hypervisor.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (for 4.3 release)
Acked-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 9cae61cd5c..9bfe5966e4 100644 --- a/xen/include/xsm/dummy.h +++ b/xen/include/xsm/dummy.h @@ -247,6 +247,18 @@ static XSM_INLINE int xsm_memory_pin_page(XSM_DEFAULT_ARG struct domain *d1, str return xsm_default_action(action, d1, d2); } +static XSM_INLINE int xsm_claim_pages(XSM_DEFAULT_ARG struct domain *d) +{ + XSM_ASSERT_ACTION(XSM_PRIV); + return xsm_default_action(action, current->domain, d); +} + +static XSM_INLINE int xsm_xenmem_get_outstanding_pages(XSM_DEFAULT_VOID) +{ + XSM_ASSERT_ACTION(XSM_PRIV); + return xsm_default_action(action, current->domain, NULL); +} + static XSM_INLINE int xsm_evtchn_unbound(XSM_DEFAULT_ARG struct domain *d, struct evtchn *chn, domid_t id2) { diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h index 5103070243..69fe64a5ff 100644 --- a/xen/include/xsm/xsm.h +++ b/xen/include/xsm/xsm.h @@ -92,6 +92,8 @@ struct xsm_operations { int (*memory_pin_page) (struct domain *d1, struct domain *d2, struct page_info *page); int (*add_to_physmap) (struct domain *d1, struct domain *d2); int (*remove_from_physmap) (struct domain *d1, struct domain *d2); + int (*claim_pages) (struct domain *d); + int (*xenmem_get_outstanding_pages) (void); int (*console_io) (struct domain *d, int cmd); @@ -350,6 +352,16 @@ static inline int xsm_remove_from_physmap(xsm_default_t def, struct domain *d1, return xsm_ops->remove_from_physmap(d1, d2); } +static inline int xsm_claim_pages(xsm_default_t def, struct domain *d) +{ + return xsm_ops->claim_pages(d); +} + +static inline int xsm_xenmem_get_outstanding_pages(xsm_default_t def) +{ + return xsm_ops->xenmem_get_outstanding_pages(); +} + static inline int xsm_console_io (xsm_default_t def, struct domain *d, int cmd) { return xsm_ops->console_io(d, cmd); |