From: "Jan Beulich" Subject: Re: [PATCH 3/4] VT-d/qinval: clean up error handling Date: Fri, 20 Jun 2014 08:27:56 +0100 Message-ID: <53A3FE9C020000780001BDFF@mail.emea.novell.com> References: <539F025A020000780001AA25@mail.emea.novell.com> <539F03D0020000780001AA3C@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WxtEr-0001m3-SN for xen-devel@lists.xenproject.org; Fri, 20 Jun 2014 07:27:57 +0000 In-Reply-To: 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: Yang Z Zhang Cc: xen-devel , Xiantao Zhang List-Id: xen-devel@lists.xenproject.org >>> On 20.06.14 at 04:12, wrote: > Jan Beulich wrote on 2014-06-16: >> - neither qinval_update_qtail() nor qinval_next_index() can fail: make >> the former return "void", and drop caller error checks for the latter >> (all of which would otherwise return with a spin lock still held) > > I saw lots of other functions are never fail too, e.g., gen_cc_inv_dsc(), > gen_iotlb_inv_dsc(), gen_wait_dsc() and others. Any reason only changes the > above two and keeps others? I wanted to leave the gen_* function family aside for the moment, as they're having more problems than just their return types: Their use of qinval_lock is completely bogus, as in all cases the callers already hold iommu->register_lock. The former lock therefore could go away altogether. And then it becomes rather questionable whether these single-use functions really need to be separate ones or wouldn't better be integrated into their callers. Jan