| 
    
 [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 1/3] xen/tools: Remove the XENMEM_get_oustanding_pages and provide the data via xc_phys_info
 On 05/08/2013 02:35 PM, Konrad Rzeszutek Wilk wrote: 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. CC: dgdera@xxxxxxxxxxxxx My email address here is missing a "g" (dgdegra). Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx> --- tools/libxc/xc_domain.c | 9 --------- tools/libxc/xenctrl.h | 2 -- tools/libxl/libxl.c | 15 +-------------- tools/libxl/libxl.h | 1 - tools/libxl/libxl_types.idl | 1 + tools/libxl/xl_cmdimpl.c | 16 +++------------- xen/common/memory.c | 8 -------- xen/common/page_alloc.c | 8 ++++++-- xen/common/sysctl.c | 3 ++- xen/include/public/memory.h | 7 ------- xen/include/public/sysctl.h | 3 ++- xen/include/xen/mm.h | 2 +- xen/include/xsm/dummy.h | 6 ------ xen/include/xsm/xsm.h | 1 - xen/xsm/dummy.c | 1 - xen/xsm/flask/hooks.c | 6 ------ 16 files changed, 16 insertions(+), 73 deletions(-) [...] 
You also need to remove the XSM-enabled function from xsm/xsm.h:
static inline int xsm_xenmem_get_outstanding_pages(xsm_default_t def)
{
    return xsm_ops->xenmem_get_outstanding_pages();
}
And the entry in xsm_operations from flask/hooks.c:
    .xenmem_get_outstanding_pages = flask_xenmem_get_outstanding_pages,
With those two changes:
Acked-by: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
--
Daniel De Graaf
National Security Agency
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
 
 
  | 
  
![]()  | 
            
         Lists.xenproject.org is hosted with RackSpace, monitoring our  |