From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v2 1/6] gnttab: eliminate several explicit version checks Date: Mon, 15 Jun 2015 14:13:48 +0100 Message-ID: <557ECF8C.70400@citrix.com> References: <557EDDDD0200007800084C94@mail.emea.novell.com> <557EE0270200007800084CB4@mail.emea.novell.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 1Z4UE9-0006da-G9 for xen-devel@lists.xenproject.org; Mon, 15 Jun 2015 13:15:01 +0000 In-Reply-To: <557EE0270200007800084CB4@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , xen-devel Cc: Ian Campbell , Ian Jackson , Keir Fraser , Tim Deegan List-Id: xen-devel@lists.xenproject.org On 15/06/15 13:24, Jan Beulich wrote: > @@ -1977,10 +1969,6 @@ __acquire_grant_for_copy( > > read_lock(&rgt->lock); > > - if ( rgt->gt_version == 0 ) > - PIN_FAIL(gt_unlock_out, GNTST_general_error, > - "remote grant table not ready\n"); > - > if ( unlikely(gref >= nr_grant_entries(rgt)) ) > PIN_FAIL(gt_unlock_out, GNTST_bad_gntref, > "Bad grant reference %ld\n", gref); > @@ -2482,19 +2470,15 @@ gnttab_set_version(XEN_GUEST_HANDLE_PARA > change the version number, except for the first 8 entries which > are allowed to be in use (xenstore/xenconsole keeps them mapped). > (You need to change the version number for e.g. kexec.) */ > - if ( gt->gt_version != 0 ) > + for ( i = GNTTAB_NR_RESERVED_ENTRIES; i < nr_grant_entries(gt); i++ ) > { > - for ( i = GNTTAB_NR_RESERVED_ENTRIES; i < nr_grant_entries(gt); i++ ) > + if ( read_atomic(&_active_entry(gt, i).pin) != 0 ) > { > - if ( read_atomic(&_active_entry(gt, i).pin) != 0 ) > - { > - gdprintk(XENLOG_WARNING, > - "tried to change grant table version from %d to %d, but some grant entries still in use\n", > - gt->gt_version, > - op.version); > - res = -EBUSY; > - goto out_unlock; > - } > + gdprintk(XENLOG_WARNING, > + "tried to change grant table version from %d to %d, but some grant entries still in use\n", > + gt->gt_version, op.version); As you are moving this printf, both %d should be %u. As for the main part of the change, Reviewed-by: Andrew Cooper