diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-05-13 15:29:11 -0400 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2013-05-14 10:01:50 +0100 |
commit | bec8f17e48439ee5b8370f4e431ccd9a9514bee7 (patch) | |
tree | 59b77ff052dcef3826e1f54a5eb183ae5ceac18a /xen/include/xsm | |
parent | abf04cf04f5b6f2ce22e9f7966d63303b9487d81 (diff) | |
download | xen-bec8f17e48439ee5b8370f4e431ccd9a9514bee7.tar.gz xen-bec8f17e48439ee5b8370f4e431ccd9a9514bee7.tar.bz2 xen-bec8f17e48439ee5b8370f4e431ccd9a9514bee7.zip |
hypervisor/xen/tools: Remove the XENMEM_get_oustanding_pages and provide the data via xc_phys_info
During the review of the patches it was noticed that there exists
a race wherein the 'free_memory' value consists of information from
two hypercalls. That is the XEN_SYSCTL_physinfo and XENMEM_get_outstanding_pages.
The free memory the host has available for guest is the difference between
the 'free_pages' (from XEN_SYSCTL_physinfo) and 'outstanding_pages'. As they
are two hypercalls many things can happen in between the execution of them.
This patch resolves this by eliminating the XENMEM_get_outstanding_pages
hypercall and providing the free_pages and outstanding_pages information
via the xc_phys_info structure.
It also removes the XSM hooks and adds locking as needed.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Reviewed-by: Tim Deegan <tim@xen.org>
Acked-by: Keir Fraser <keir.xen@gmail.com>
Diffstat (limited to 'xen/include/xsm')
-rw-r--r-- | xen/include/xsm/dummy.h | 6 | ||||
-rw-r--r-- | xen/include/xsm/xsm.h | 6 |
2 files changed, 0 insertions, 12 deletions
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h index a87205661d..cc0a5a8301 100644 --- a/xen/include/xsm/dummy.h +++ b/xen/include/xsm/dummy.h @@ -259,12 +259,6 @@ static XSM_INLINE int xsm_claim_pages(XSM_DEFAULT_ARG struct domain *d) 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 58a4fbb1d1..193945323e 100644 --- a/xen/include/xsm/xsm.h +++ b/xen/include/xsm/xsm.h @@ -93,7 +93,6 @@ struct xsm_operations { 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); @@ -360,11 +359,6 @@ 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); |