Tian, Kevin
2006-Mar-31 01:50 UTC
RE: [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@lists.xensource.com http://lists.xensource.com/xen-devel
Jimi Xenidis
2006-Mar-31 02:20 UTC
Re: [Xen-devel] [patch] make hypercall_preempt_check() a little moresensitive
On Mar 30, 2006, at 8:50 PM, Tian, Kevin wrote:>> 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,Yes, some bits can be controlled by xenlinux> to > disable real external interrupts on that physical processor,Yes, even this bit, tho'' it this is on the 970 class of processor, newer processors can be configured to not disable externals, but they can still set the bit.> 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. :-)I understand your preference, but we''ve found with other hypervisors, that under server class workloads it does not matter. I could see how this would be a big deal for real-time, but Xen doesn''t do that.. yet :)> > 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.This is an interesting example, but why deliver an upcall thru the HV in the first place, why not just call the evtchn handler directly?> So hypercall_preempt_check is only one place directly related to > that bug.hmm, this is quite the pathological case, but I cannot deny it will hit us else where. We expect to explore the Linux change when the xen-patches make it to kernel.org. -JX _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel