aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/public
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2013-05-13 15:29:11 -0400
committerIan Campbell <ian.campbell@citrix.com>2013-05-14 10:01:50 +0100
commitbec8f17e48439ee5b8370f4e431ccd9a9514bee7 (patch)
tree59b77ff052dcef3826e1f54a5eb183ae5ceac18a /xen/include/public
parentabf04cf04f5b6f2ce22e9f7966d63303b9487d81 (diff)
downloadxen-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/public')
-rw-r--r--xen/include/public/memory.h7
-rw-r--r--xen/include/public/sysctl.h3
2 files changed, 2 insertions, 8 deletions
diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index 51d5254933..7a26dee008 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -459,13 +459,6 @@ DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
* The zero value is appropiate.
*/
-/*
- * Get the number of pages currently claimed (but not yet "possessed")
- * across all domains. The caller must be privileged but otherwise
- * the call never fails.
- */
-#define XENMEM_get_outstanding_pages 25
-
#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
#endif /* __XEN_PUBLIC_MEMORY_H__ */
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index 03710d896f..8437d31e18 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -34,7 +34,7 @@
#include "xen.h"
#include "domctl.h"
-#define XEN_SYSCTL_INTERFACE_VERSION 0x00000009
+#define XEN_SYSCTL_INTERFACE_VERSION 0x0000000A
/*
* Read console content from Xen buffer ring.
@@ -101,6 +101,7 @@ struct xen_sysctl_physinfo {
uint64_aligned_t total_pages;
uint64_aligned_t free_pages;
uint64_aligned_t scrub_pages;
+ uint64_aligned_t outstanding_pages;
uint32_t hw_cap[8];
/* XEN_SYSCTL_PHYSCAP_??? */