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

Re: [Xen-devel] [PATCH v3 21/23] xsplice: Add support for shadow variables



On Mon, Mar 07, 2016 at 08:40:47AM +0100, Martin Pohlack wrote:
> On 12.02.2016 19:05, Konrad Rzeszutek Wilk wrote:
> > From: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
> > 
> > Shadow variables are a piece of infrastructure to be used by xsplice
> > modules. They are used to attach a new piece of data to an existing
> > structure in memory.
> > 
> > Signed-off-by: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
> > ---
> >  xen/common/Makefile             |   1 +
> >  xen/common/xsplice_shadow.c     | 105 
> > ++++++++++++++++++++++++++++++++++++++++
> >  xen/include/xen/xsplice_patch.h |  39 +++++++++++++++
> >  3 files changed, 145 insertions(+)
> >  create mode 100644 xen/common/xsplice_shadow.c
> >  create mode 100644 xen/include/xen/xsplice_patch.h
> > 
> > diff --git a/xen/common/Makefile b/xen/common/Makefile
> > index a8ceaff..f4d54ad 100644
> > --- a/xen/common/Makefile
> > +++ b/xen/common/Makefile
> > @@ -75,3 +75,4 @@ subdir-$(CONFIG_HAS_DEVICE_TREE) += libfdt
> >  
> >  obj-$(CONFIG_XSPLICE) += xsplice.o
> >  obj-$(CONFIG_XSPLICE) += xsplice_elf.o
> > +obj-$(CONFIG_XSPLICE) += xsplice_shadow.o
> > diff --git a/xen/common/xsplice_shadow.c b/xen/common/xsplice_shadow.c
> > new file mode 100644
> > index 0000000..619cdee
> > --- /dev/null
> > +++ b/xen/common/xsplice_shadow.c
> > @@ -0,0 +1,105 @@
> > +#include <xen/init.h>
> > +#include <xen/kernel.h>
> > +#include <xen/lib.h>
> > +#include <xen/list.h>
> > +#include <xen/spinlock.h>
> > +#include <xen/xsplice_patch.h>
> > +
> > +#define SHADOW_SLOTS 256
> 
> Using something very round here will give you lot's of hash collisions
> at the price of a very fast hash computation as compilers, linkers, and
> memory allocators tend to align starting addresses.  I would suggest to
> use a small prime here, e.g., 257 or 251, to have a first approximation
> of a simple hash function.

Hey!

I totally missed this comment. Let me spoll this up in my TODO to
change this to 257 for v5.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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