From: Keir Fraser Subject: Re: [PATCH] Add SCHEDOP_block_on Date: Fri, 10 Mar 2006 16:49:47 +0000 Message-ID: <995005c62b12711cd59a792000b90093@cl.cam.ac.uk> References: <20060310153439.GB28403@totally.trollied.org> Mime-Version: 1.0 (Apple Message framework v623) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20060310153439.GB28403@totally.trollied.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: John Levon Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 10 Mar 2006, at 15:34, John Levon wrote: > This patch adds a facility to block on a particular event channel, for > when a domain needs to block, but cannot enable interrupts. I really don't much like the change this adds to evtchn_set_pending(), particularly since this patch probably doesn't have general applicability beyond debuggers. I wonder if you could get the functionality you need with the existing SCHEDOP_block interface if you do the following: HYPERVISOR_set_callbacks(); clear_evtchn_mask(evtchn); while (1) { /* Important to clear the master flag /then/ selector /then/ evtchn pending. */ vcpu_info->evtchn_upcall_pending = 0; clear_bit(evtchn, &vcpu_info->evtchn_pending_sel); clear_evtchn_pending(evtchn); if (check_for_data(evtchn)) break; HYPERVISOR_block(); } Where dummy_irq_handler is a no-op return (which should probably return leaving event delivery disabled, to prevent event-delivery storm, thus it probably really is just IRET). Certainly the above should work fine for a post-mortem debugger. Even if you need to be able to exit the debugger and continue executing normal kernel code, we can come up with some suitable code to restore normal event delivery without Xen interface changes. -- Keir