[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-ia64-devel] [PATCH] Merge vpsr.i with evtchn_upcall_mask to solve one trickish bug


  • To: <xen-ia64-devel@xxxxxxxxxxxxxxxxxxx>
  • 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
  • List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
  • 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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.