From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [Patch] continue_hypercall_on_cpu rework using tasklets Date: Wed, 14 Apr 2010 08:35:22 +0100 Message-ID: References: <4BC56DE5.6040405@ts.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4BC56DE5.6040405@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 14/04/2010 08:25, "Juergen Gross" wrote: >> A tasklet also takes an arbitrary ulong parameter, which you can cast to a >> pointer to your informational structure. The parameter is specified via >> tasklet_init(). That should suffice. > > I'm already using this. The problem is to find the original calling vcpu in > case of a nested call of continue_hypercall_on_cpu() while not conflicting > with concurrent calls from other vcpus which happen to address the same pcpu. There can be only one nested invocation on any given pcpu, since a running invocation is never preempted. Hence on entry to c_h_o_c() you can check a per-cpu variable to see whether this invocation is nesting, or not. And if it is, that variable can be a pointer to an info structure which includes a pointer to the invoking vcpu. -- Keir