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>, "Xen-devel@xxxxxxxxxxxxxxxxxxx" <Xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] current not very current (vs curr_vcpu)
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Fri, 19 Feb 2010 08:12:18 +0000
Cc:
Delivery-date: Fri, 19 Feb 2010 00:12:50 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20100218202158.6e3aeda1@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: AcqxGzCTjbcx80pvSZqIFbvdDOHLYAAIBAfL
Thread-topic: [Xen-devel] current not very current (vs curr_vcpu)
User-agent: Microsoft-Entourage/12.23.0.091001
On 19/02/2010 04:21, "Mukesh Rathor" <mukesh.rathor@xxxxxxxxxx> wrote:

> I noticed while debugging something that current is not pointing to the
> current vcpu upon serial interrupt. The regs->SP clearly shows 64bit dom0
> stack, guest_mode(regs) returns 1, but current is pointing
> to idle vcpu. I'm not able to figure how this is possible. I can come up
> with scenario where dom0.vcpu yields cpu to idle vcpu in which case
> curr_vcpu will point to dom0.vcpu and current to idle vcpu. But in that
> case guest_mode(regs) will be false, and regs.SP will show hyp stack.
> Correct?
> 
> Am I correct that if guest_mode() then current should always point to
> guest vcpu? If yes, then I will debug this further.

The behaviour you see is expected. Guest_mode() is meaningless when running
an idle vcpu. This is because the guest regs at the bottom of the stack are
junk for an idle vcpu (and also we do lazy state synchronisation, so they
may be the valid active regs for the last scheduled non-idle vcpu).

 -- Keir



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