From: "Jan Beulich" Subject: Re: [PATCH v6 3/9] ioreq-server: create basic ioreq server abstraction. Date: Thu, 08 May 2014 16:05:08 +0100 Message-ID: <536BB9440200007800010893@mail.emea.novell.com> References: <1399555424-25201-1-git-send-email-paul.durrant@citrix.com> <1399555424-25201-4-git-send-email-paul.durrant@citrix.com> <536BB5070200007800010867@mail.emea.novell.com> <9AAE0902D5BC7E449B7C8E4E778ABCD034BA00@AMSPEX01CL01.citrite.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <9AAE0902D5BC7E449B7C8E4E778ABCD034BA00@AMSPEX01CL01.citrite.net> 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: Paul Durrant Cc: "Keir (Xen.org)" , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org >>> On 08.05.14 at 16:50, wrote: >> From: Jan Beulich [mailto:JBeulich@suse.com] >> >>> On 08.05.14 at 15:23, wrote: >> > +static void hvm_unmap_ioreq_page(struct hvm_ioreq_server *s, bool_t buf) >> > { >> > - spin_lock(&iorp->lock); >> > - >> > - ASSERT(d->is_dying); >> > + struct hvm_ioreq_page *iorp = buf ? &s->bufioreq : &s->ioreq; >> > >> > destroy_ring_for_helper(&iorp->va, iorp->page); >> > - >> > - spin_unlock(&iorp->lock); >> > } >> >> Are you sure you can do without any locking (i.e. neither here nor in >> the caller)? For the respective map function, afaict the locking simply >> got moved to the caller. Remember that you need to also protect >> yourself against hostile control domains... >> > > I think it's safe as the unmap is only done during domain destruction. Could > this race? I would have though other stuff would break. Yeah, if it's only during destruction, then this is perhaps fine for now. Jan