WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] Add SCHEDOP_block_on

To: John Levon <levon@xxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Add SCHEDOP_block_on
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Fri, 10 Mar 2006 16:49:47 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 10 Mar 2006 16:50:18 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20060310153439.GB28403@xxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20060310153439.GB28403@xxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx

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(<dummy irq handler>);
        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


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel