From: Keir Fraser Subject: Re: Re: how to handle paged hypercall args? Date: Fri, 03 Dec 2010 06:37:08 -0800 Message-ID: References: <20101203091430.GC6055@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20101203091430.GC6055@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Olaf Hering Cc: xen-devel@lists.xensource.com, Jan Beulich List-Id: xen-devel@lists.xenproject.org On 03/12/2010 01:14, "Olaf Hering" wrote: >> ...Or you might have a per-domain waitqueue_head, and do the wake_up() from >> code that adds paged-in entries to the guest physmap. That would seem a >> pretty sensible way to proceed, to me. > > Thats what I'm doing right now. > > It seems that the existing MEM_EVENT_FLAG_VCPU_PAUSED code can be reused > for this. I was messing with wait_event() until I realized that the vcpu > is stopped by p2m_mem_paging_populate() already and the wake_up() ran > before the vcpu got a chance to call schedule(). Hm, not sure what you mean. The vcpu does not get synchronously stopped by _paging_populate(). Maybe you are confused. > If a vcpu happens to be scheduled and the domain is destroyed, the > BUG_ON in destroy_waitqueue_vcpu() will trigger. What can happen if > there is still an entry in the list? The cleanup should handle this > situation to not crash Xen itself. You'll get a crash if a vcpu is on a waitqueue when you kill the domain. Yes, the destroydomain path needs code to handle that. It'll get added, once I see an actual user of this waitqueue stuff. There a few other places that need fixing up like destroydomain, too. I don't know what you mean by 'vcpu is scheduled and the domain is destroyed' causing the BUG_ON(). If a vcpu is scheduled and running then presumably it is not on a waitqueue. -- Keir