From: Keir Fraser Subject: Re: [PATCH] [XEN][ACM] fix missing spin_unlock Date: Mon, 26 Feb 2007 23:20:38 +0000 Message-ID: References: <1172519828.9051.11.camel@941e-2.watson.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1172519828.9051.11.camel@941e-2.watson.ibm.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Stefan Berger , xen-devel Cc: sailer@us.ibm.com List-Id: xen-devel@lists.xenproject.org On 26/2/07 19:57, "Stefan Berger" wrote: > I have a question regarding the event channel data structure. It looks > like a stale entry is in the event channel array indicating that a event > channel at a given port has a certain remote domain as target. However, > that domain does not exist anymore and therefore the code section where > I add the spin_unlock() call gets triggered now. Could this be a bug in > the domain-cleanup code? > > I can trigger this problem when running the xm-test suite with ACM > compiled into Xen. After 159 domains have been created, which happens to > be during the list tests, the stale port entry shows up and remains. The > list tests when run after a reboot do not trigger this, though. When one end of a fully-bound interdomain event channel is closed, the remote port enters state ECS_UNBOUND. At this point it still refers to the remote domain by domid, even if the remote domain subsequently dies. In fact this is exactly the state that all currently-interdomain-bound remote ports will immediately enter when a domain is destroyed. It's safe and expected. Since an ACM check will happen when moving from state ECS_UNBOUND to ECS_INTERDOMAIN you get the chance to check credentials are okay and hence deal with the case that the domid gets reused by a domain who should not be allowed to communicate to the ECS_UNBOUND port. -- Keir