From: "Jan Beulich" Subject: Re: [PATCH v5 08/10] xen/arm: Add relinquish_p2m_mapping to remove reference on every mapped page Date: Tue, 17 Dec 2013 10:03:24 +0000 Message-ID: <52B02F7C020000780010E0E9@nat28.tlf.novell.com> References: <1387215452-10951-1-git-send-email-julien.grall@linaro.org> <1387215452-10951-9-git-send-email-julien.grall@linaro.org> <1387272410.21086.60.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VsrUv-0002RU-6Q for xen-devel@lists.xenproject.org; Tue, 17 Dec 2013 10:03:29 +0000 In-Reply-To: <1387272410.21086.60.camel@kazak.uk.xensource.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell , Julien Grall Cc: xen-devel@lists.xenproject.org, tim@xen.org, stefano.stabellini@citrix.com, patches@linaro.org List-Id: xen-devel@lists.xenproject.org >>> On 17.12.13 at 10:26, Ian Campbell wrote: > On Mon, 2013-12-16 at 17:37 +0000, Julien Grall wrote: >> + if ( op == RELINQUISH && count == LPAE_ENTRIES && >> + hypercall_preempt_check() ) >> + { > > If hypercall_preempt_check returns false the first time it is called > then you won't ever try again. I think you want > (count+1 % LPAE_ENTRIES) == 0 > (the +1 avoids preempting without having done any work yet) And hence needing proper parenthesization: (count+1) % LPAE_ENTRIES == 0 Jan