WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] current not very current (vs curr_vcpu)

To: Mukesh Rathor <mukesh.rathor@xxxxxxxxxx>
Subject: Re: [Xen-devel] current not very current (vs curr_vcpu)
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Sat, 20 Feb 2010 07:45:26 +0000
Cc: "Xen-devel@xxxxxxxxxxxxxxxxxxx" <Xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 19 Feb 2010 23:46:09 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20100219195003.6d1fb125@xxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acqx38/R0pvzRF8fRyOtrCnSfdCp6QAINp1o
Thread-topic: [Xen-devel] current not very current (vs curr_vcpu)
User-agent: Microsoft-Entourage/12.23.0.091001
On 20/02/2010 03:50, "Mukesh Rathor" <mukesh.rathor@xxxxxxxxxx> wrote:

> ah, I see what's going on. context_switch() is scheduling idle vcpu, and
> calls continue_idle_domain() to reset_stack_and_jump(idle_loop).
> well, reset_stack_and_jump() is setting rsp to guest_cpu_user_regs(),
> and interrupt is coming right at that instant. so:
> 
> diff = (char *)guest_cpu_user_regs() - (char *)(r)  is 0
> 
> and as a result, guest_mode(regs) == true.

Well, I don't see how this scenario works. If rsp==g_c_u_r() at the instant
the interrupt comes in, then the stack frame for the interrupt will be
*above* g_c_u_r(). Thus 'diff' in guest_mode() will evaluate non-zero and
positive, and regs->{rip,rsp} should point at hypervisor code/stack.

Also: in your original email you said regs.rsp pointed at dom0 stack. That
doesn't tally with you saying that rsp==g_c_u_r() (an address in hypervisor
space) immediately before the interrupt, in this email. Regs->rsp in the
scenario you describe here should be exactly equal to g_c_u_r().

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel