Andrew Cooper, le Wed 28 Oct 2015 16:43:54 +0000, a écrit :
> > IIRC the test is not bogus even when prod wraps around, (prod - cons)
> > will still correctly be the difference between both, modulo 2^32.
> 
> (prod - cons) >= XENSTORE_RING_SIZE checks for the prod getting more
> than a ring's worth ahead of cons.
> 
> (cons - prod) < -XENSTORE_RING_SIZE is supposed to check for cons
> getting ahead of prod

If cons is a ahead of prod, prod-cons is way bigger than
XENSTORE_RING_SIZE, and thus the first test already catches that. In the
2^32 wrap case, the difference will still be correct.

Samuel

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

Reply via email to