From: Keir Fraser Subject: Re: [PATCH] Pin vcpu for VMX domain Date: Wed, 8 Feb 2006 15:14:22 +0000 Message-ID: <6891f9c736da2bd5554c54d47c7496da@cl.cam.ac.uk> References: Mime-Version: 1.0 (Apple Message framework v623) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Jiang, Yunhong" Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 8 Feb 2006, at 12:58, Jiang, Yunhong wrote: > I'm not sure if it will has some corner case, and hope your > clarification for it. > considering following situation, assume the VMX switch from cpu 0->cpu1 > 1) on cpu0, the timer interrupt happened, so timer_softirq_action is > called, the pit_timer_fn is called, and in pit_timer_fn, it will try to > set the pit timer again. > 2) before pit_timer_fn set the pit timer on cpu0, the stop_timer is > called on cpu1 on vmx_reinstall_timers. > 3) after stop_timer finished, the pit_timer_fn on cpu0 set the ac_timer > on cpu0. > > on this situation, the stop_timer on cpu1 will has no effect. And then > the init_timer may cause error situation. > > In fact, I think the old patch itself is not safe on this situation, > since the stop_timer is called on IPI interrupt , which may run when > the > pit_timer_fn is running. Good point. I'll have to add a migrate_timer() function I think, that does the migration atomically. That'll save you the hassle of stop/init/reactivate as well. -- Keir