From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH RFC] tools/ocaml/xb: Correct calculations of data/space the ring Date: Wed, 28 Oct 2015 17:14:24 +0000 Message-ID: <56310270.3050707@citrix.com> References: <1446048336-19154-1-git-send-email-andrew.cooper3@citrix.com> <20151028161813.GU2924@var.bordeaux.inria.fr> <5630FB4A.6090403@citrix.com> <20151028165625.GI2924@var.bordeaux.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20151028165625.GI2924@var.bordeaux.inria.fr> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Samuel Thibault , Xen-devel , Ian Campbell , Ian Jackson , Wei Liu , David Scott List-Id: xen-devel@lists.xenproject.org On 28/10/15 16:56, Samuel Thibault wrote: > Andrew Cooper, le Wed 28 Oct 2015 16:43:54 +0000, a =E9crit : >>> 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) >=3D 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. Hmm - of course. I will scale back the adjustments to the error handling. ~Andrew