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.coop...@citrix.com> > > --- > > CC: Ian Jackson <ian.jack...@citrix.com> > > CC: Wei Liu <w...@xen.org> > > CC: Paul Durrant <p...@xen.org> > > CC: Michał Leszczyński <michal.leszczyn...@cert.pl> > > CC: Hubert Jasudowicz <hubert.jasudow...@cert.pl> > > 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 <w...@xen.org>