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-ia64-devel

[Xen-ia64-devel] [PATCH] Merge vpsr.i with evtchn_upcall_mask to solve o

To: <xen-ia64-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-ia64-devel] [PATCH] Merge vpsr.i with evtchn_upcall_mask to solve one trickish bug
From: "Tian, Kevin" <kevin.tian@xxxxxxxxx>
Date: Wed, 29 Mar 2006 21:49:38 +0800
Delivery-date: Wed, 29 Mar 2006 13:51:05 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcZTN5vyWYPMZ7npSRexzTDFW0QVZA==
Thread-topic: [PATCH] Merge vpsr.i with evtchn_upcall_mask to solve one trickish bug
This patch merges current interrupt_delivery_enabled on xen/ia64 with
evtchn_upcall_mask in shared_info_area. Currently when guest clears
vpsr.i, interrupt_delivery_enabled is cleared correspondingly to prevent
further interrupt injection. However evtchn_upcall_mask is left
untouched,
which makes event_pending(v) check valid and thus may result a window 
to drop guest into dead loop. For example:

1. Guest disable interrupts
        (interrupt_delivery_enabled:0 evtchn_upcall_mask:0)
2. Guest calls a hypercall, like do_console_io with CONSOLEIO_write
3. guest_console_write in Xen will check whether any events pending to
preempt current hypercall. If pending with evtchn_upcall_mask cleared, 
create a continuation context and resume to guest to re-execute
hypercall
4. Before resuming to guest, xen checks whether any pending interrupts 
to inject into guest. However because guest interrupt is disabled,
pending
events won't be injected into guest and still pends there
5. Then guest re-executes hypercall, and back to step 2 and INFINITE 
loop occurs because events are not handled

One typical example is timer oops message occurring in guest timer 
handler, which may halt the machine sometimes if events happen to pend 
there due to above reason.

So in this case, we need update evtchn_upcall_mask together with 
Interrupt delivery enabled flag. However there'll be some race
conditions 
to operate two flags non-atomically. Actually since two flags serves for

same purpose, it's better to merge them as one which also makes 
xen/ia64 adapting to common code a bit since the latter always assumes 
upon evtchn_upcall_mask.

That's why this patch comes, and tested upon tip.

Signed-off-by Kevin Tian <kevin.tian@xxxxxxxxx>

Thanks,
Kevin

Attachment: merge_i_msk.patch
Description: merge_i_msk.patch

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
<Prev in Thread] Current Thread [Next in Thread>