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

Re: [win-pv-devel] Xenbus hashtable usage



> -----Original Message-----
> From: win-pv-devel-bounces@xxxxxxxxxxxxxxxxxxxx [mailto:win-pv-devel-
> bounces@xxxxxxxxxxxxxxxxxxxx] On Behalf Of Paul Durrant
> Sent: 09 September 2015 10:18
> To: RafaÅ WojdyÅa; win-pv-devel@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: [win-pv-devel] Xenbus hashtable usage
> 
> > -----Original Message-----
> > From: RafaÅ WojdyÅa [mailto:omeg@xxxxxxxxxxxxxxxxxxxxxx]
> > Sent: 09 September 2015 10:17
> > To: Paul Durrant; win-pv-devel@xxxxxxxxxxxxxxxxxxxx
> > Subject: Re: [win-pv-devel] Xenbus hashtable usage
> >
> > On 2015-09-09 10:34, Paul Durrant wrote:
> > >> -----Original Message-----
> > >> From: win-pv-devel-bounces@xxxxxxxxxxxxxxxxxxxx [mailto:win-pv-
> devel-
> > >> bounces@xxxxxxxxxxxxxxxxxxxx] On Behalf Of Rafal Wojdyla
> > >> Sent: 09 September 2015 01:44
> > >> To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
> > >> Subject: [win-pv-devel] Xenbus hashtable usage
> > >>
> > >> Is the hash table from hash_table.c supposed to accept arbitrary key
> > >> values?
> 
> Ok, cool. I'll get a fix together a.s.a.p.
> 

I think this should do it:

diff --git a/src/xenbus/hash_table.c b/src/xenbus/hash_table.c
index a9c1b79..c7c6101 100644
--- a/src/xenbus/hash_table.c
+++ b/src/xenbus/hash_table.c
@@ -90,7 +90,7 @@ HashTableHash(

         Accumulator = (Accumulator << 4) + Array[Index];

-        Overflow = Accumulator & 0x00000f00;
+        Overflow = Accumulator & 0x0000ff00;
         if (Overflow != 0) {
             Accumulator ^= Overflow >> 8;
             Accumulator ^= Overflow;

Can you test?

  Paul

>   Paul
> 
> > >
> > > That's the idea. What are you intending to do with it? I have been
> > wondering about exposing it as an interface.
> > >
> > I wanted to use it for storing address <-> map handles for gnttab as you
> > suggested.
> >
> > >> I've been tripping the assertion in HashTableHash() on keys that
> > >> were 64bit addresses.
> > >>
> > >
> > > That sounds like a straightforward bug then. I'll have a look.
> > >
> > > Cheers,
> > >
> > >     Paul
> > >
> >
> > --
> > RafaÅ WojdyÅa
> > Qubes Tools for Windows developer
> > https://www.qubes-os.org/
> _______________________________________________
> win-pv-devel mailing list
> win-pv-devel@xxxxxxxxxxxxxxxxxxxx
> http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel
_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

 


Rackspace

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