From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hollis Blanchard Subject: Re: [Xen-devel] schedule() vs softirqs Date: Fri, 15 Dec 2006 13:09:41 -0600 Message-ID: <1166209782.18449.40.camel@basalt> References: Reply-To: Hollis Blanchard Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-ppc-devel-bounces@lists.xensource.com Errors-To: xen-ppc-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel , xen-ppc-devel List-Id: xen-devel@lists.xenproject.org On Fri, 2006-12-15 at 17:36 +0000, Keir Fraser wrote: > On 15/12/06 17:27, "Hollis Blanchard" wrote: > > > We recently uncovered a bug on PowerPC where if a timer tick arrives > > just inside schedule() while interrupts are still enabled, the > > decrementer is never reprogrammed to that appropriate value. This is > > because once inside schedule(), we never handle any subsequent softirqs: > > we call context_switch() and resume the guest. > > Easily fixed. You need to handle softirqs in the exit path to guest context. > You need to do this final check with interrupts disabled to avoid races. Ah OK, I see now how x86 is doing that. I don't think that code flow really makes sense: why would you jump out of do_softirq() into assembly just to call do_softirq() again? Also, that doesn't solve the lazy register saving problem. However, I think I see how we can implement our desired context_switch() scheme in arch-specific code. The context_switch() call in schedule() will return, so please don't add a BUG() after that. :) -- Hollis Blanchard IBM Linux Technology Center