From: Keir Fraser Subject: Re: [Patch] continue_hypercall_on_cpu rework using tasklets Date: Thu, 15 Apr 2010 10:08:35 +0100 Message-ID: References: <4BC6CE61.1010505@ts.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4BC6CE61.1010505@ts.fujitsu.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Juergen Gross Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 15/04/2010 09:29, "Juergen Gross" wrote: >> There is only one ASSERT in __sync_lazy_execstate, and it's safe for this >> case. Bear in mind that our softirqs always run in the context of whatever >> domain happens to be running on that cpu currently -- they don't have their >> own proper vcpu context. > > I don't see how it should be guaranteed that the current vcpu MUST be an idle > one... It's odd because someone else asked this exact same question, so the code must be more subtle than I thought. Note that the ASSERT is inside if(switch_required), and switch_required is true only if the vcpu whose state is loaded on this CPU is not the same as the currently-scheduled vcpu. This odd situation is only possible if we are lazy-syncing the former vcpu's state, and that only occurs if the currently-running vcpu is the idle vcpu (as all other vcpus would need their state loaded immediately, so lazy sync does not apply). -- Keir