[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 5/5] tools/foreignmem: Support querying the size of a resource



On Tue, Jul 28, 2020 at 03:14:39PM +0100, Andrew Cooper wrote:
> On 28/07/2020 12:37, Andrew Cooper wrote:
> > With the Xen side of this interface fixed to return real sizes, userspace
> > needs to be able to make the query.
> >
> > Introduce xenforeignmemory_resource_size() for the purpose, bumping the
> > library minor version and providing compatiblity for the non-Linux builds.
> >
> > Its not possible to reuse the IOCTL_PRIVCMD_MMAP_RESOURCE infrastructure,
> > because it depends on having already mmap()'d a suitably sized region before
> > it will make an XENMEM_acquire_resource hypercall to Xen.
> >
> > Instead, open a xencall handle and make an XENMEM_acquire_resource hypercall
> > directly.
> >
> > Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> > ---
> > CC: Ian Jackson <Ian.Jackson@xxxxxxxxxx>
> > CC: Wei Liu <wl@xxxxxxx>
> > CC: Paul Durrant <paul@xxxxxxx>
> > CC: Michał Leszczyński <michal.leszczynski@xxxxxxx>
> > CC: Hubert Jasudowicz <hubert.jasudowicz@xxxxxxx>
> 
> I've folded:
> 
> diff --git a/tools/Rules.mk b/tools/Rules.mk
> index 5ed5664bf7..b8ccf03ea9 100644
> --- a/tools/Rules.mk
> +++ b/tools/Rules.mk
> @@ -123,7 +123,7 @@ LDLIBS_libxencall = $(SHDEPS_libxencall)
> $(XEN_LIBXENCALL)/libxencall$(libextens
>  SHLIB_libxencall  = $(SHDEPS_libxencall) -Wl,-rpath-link=$(XEN_LIBXENCALL)
>  
>  CFLAGS_libxenforeignmemory = -I$(XEN_LIBXENFOREIGNMEMORY)/include
> $(CFLAGS_xeninclude)
> -SHDEPS_libxenforeignmemory = $(SHLIB_libxentoolcore)
> +SHDEPS_libxenforeignmemory = $(SHLIB_libxentoolcore) $(SHDEPS_libxencall)
>  LDLIBS_libxenforeignmemory = $(SHDEPS_libxenforeignmemory)
> $(XEN_LIBXENFOREIGNMEMORY)/libxenforeignmemory$(libextension)
>  SHLIB_libxenforeignmemory  = $(SHDEPS_libxenforeignmemory)
> -Wl,-rpath-link=$(XEN_LIBXENFOREIGNMEMORY)
>  
> diff --git a/tools/libs/foreignmemory/Makefile
> b/tools/libs/foreignmemory/Makefile
> index 8e07f92c59..f3a61e27c7 100644
> --- a/tools/libs/foreignmemory/Makefile
> +++ b/tools/libs/foreignmemory/Makefile
> @@ -4,7 +4,7 @@ include $(XEN_ROOT)/tools/Rules.mk
>  MAJOR    = 1
>  MINOR    = 4
>  LIBNAME  := foreignmemory
> -USELIBS  := toollog toolcore
> +USELIBS  := toollog toolcore call
>  
>  SRCS-y                 += core.c
>  SRCS-$(CONFIG_Linux)   += linux.c
> 
> to fix the build in certain containers.

Acked-by: Wei Liu <wl@xxxxxxx>



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.