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] make hypercall_preempt_check() a little moresens

To: "Hollis Blanchard" <hollisb@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] [patch] make hypercall_preempt_check() a little moresensitive
From: "Tian, Kevin" <kevin.tian@xxxxxxxxx>
Date: Fri, 31 Mar 2006 09:50:58 +0800
Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 31 Mar 2006 01:52:40 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcZUHjaO1eud7ICOQbSd/qSRq9PIQQAQ8zKw
Thread-topic: [Xen-devel] [patch] make hypercall_preempt_check() a little moresensitive
>From: Hollis Blanchard
>Sent: 2006年3月31日 1:17
>
>Since PowerPC has a hypervisor mode in the processor, Linux is able to
>disable
>interrupts directly using the EE bit in the MSR (Machine State Register),
>just like on hardware. This bit acts like the evtchn_upcall_mask bit.

A bit curious. Do you mean xenlinux can operate real MSR directly, to 
disable real external interrupts on that physical processor, or here 
so-called MSR is a virtual MSR presented per guest to disable virtual 
interrupt on that virtual processor? I prefer to the latter. :-)

>
>It would be an invasive patch to PowerPC Linux to modify the code that
>disables the EE bit and additionally have it modify
>vcpu_info->evtchn_upcall_mask, especially when that code is in
>assembly.
>Instead, we can have hypercall_preempt_check() also check MSR:EE
>directly.
>IA64 may be able to use this facility as well, so I've CC'ed that list.

XEN/IA64 also realized this issue recently, and we've merged our 
architecture specific interrupt enable flag with the evtchn_upcall_mask, to 
avoid any race conditions when operating two flags simultaneously. After 
this effort, now XEN/IA64 is completely same as x86 where 
evtchn_upcall_mask becomes the only flag for interrupts/events, to avoid 
any future similar misunderstandings.

By following your approach, there're others places you may need similar 
wrapper to make it robust. For example, unmask_evtchn in 
xenlinux/drivers/xen/core/evtchn.c will check evtchn_upcall_mask to see 
whether force callback to fire previous pending events before unmasking. 
Based on your description for powerpc, there you also need to check the 
EE flag to avoid unnecessary force back since interrupt may be disabled 
that time.

So hypercall_preempt_check is only one place directly related to that bug.
If you really want to go that way, it's better that you can capture all 
possible places and tune all with clear comment about the difference as a 
tip to future development.
        
Thanks,
Kevin

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

<Prev in Thread] Current Thread [Next in Thread>