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] keeping track of Intel vmcs

To: Mukesh Rathor <mukesh.rathor@xxxxxxxxxx>, "Xen-devel@xxxxxxxxxxxxxxxxxxx" <Xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] keeping track of Intel vmcs
From: Keir Fraser <keir.xen@xxxxxxxxx>
Date: Wed, 16 Mar 2011 08:11:32 +0000
Cc:
Delivery-date: Wed, 16 Mar 2011 01:12:11 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:user-agent:date:subject:from:to:message-id :thread-topic:thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; bh=K2eL4erxI7zvKNBiO/O1o+KV8ZqB5PIB5Ey47qXu/8w=; b=aEZGJ8gY7xDW6nPjCczQsssdQRrQKtwesp5udyDzCyHoCMxTJ3KK1tLg7qds8dvxDT E+i9XhaHDGGEa50xLkrmWFPIdSjSd+SWbEzjEA9boC10g6kjAl3CTi3mfnP20YNZ0oK4 T8E8lrNqexwKAJ1R2J0k9W1E/MmAMEehIK6c4=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=user-agent:date:subject:from:to:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; b=ZMCVSAzxFwgVqubDT2vsGi+k1xLOsmZIjgeAoESK84Q9l4UWxlyy5TAaFyBGdN6Wq5 nTOeaUbuWzkQLOGuU+M0gRqLtH61h587amnFS9CcKR1d/PYHN1nXX3FVFHQjYa9OWq/g 4KTo5gVba2qWZBbJLxshsaRk+e7p0pUXkwGkU=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110315195815.17f9f0d1@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: AcvjscJgaeuYY83n7kOuVidCBoD72w==
Thread-topic: [Xen-devel] keeping track of Intel vmcs
User-agent: Microsoft-Entourage/12.28.0.101117
On 16/03/2011 02:58, "Mukesh Rathor" <mukesh.rathor@xxxxxxxxxx> wrote:

> Hi,
> 
> I always wonder about intel vmcs info tracking when i have to look at
> it. Following data structs are used to keep track of it:
> 
> static DEFINE_PER_CPU(struct foreign_vmcs, foreign_vmcs)

Used to track if a CPU is currently running on non-current vcpu's vmcs. Only
used by dom0 and stubdoms really right now. But plausibly a HVM VCPU could
do this to another HVM VCPU in future. The logic is there for that right
now.

> v->arch.hvm_vmx.active_cpu;
> v->arch.hvm_vmx.active_list;

These are actually used, in cpu offline, for one thing (in the case of the
per-cpu vmcs list). Did you actually read the code?

> static DEFINE_PER_CPU(struct vmcs_struct *, current_vmcs);

It is not true that current==v <=> current_vmcs==v's vmcs. Again, read the
code.

There are a few bits of state here it's true but they are used pretty much
entirely and straightforwardly in vmcs.c. You're not going to get much
simplification without making things slower and/or *less* obvious and/or
introducing subtle bugs. Leave alone.

 -- Keir

> It appears to me that it could be lot simpler. All we need to worry about is
> if a cpu needs to be launched or resumed. The rest can be concluded
> from existing information.  For example, current_vmcs and foreign_vmcs
> seems redundant. If current == v, then we can conclude current_vmcs is
> current, and forieng vmcs is not current! It seems all we need is
> unsetting launched in vmpclear.
> 
> Can someone from Intel tell me  what am I missing?
> 
> thanks
> Mukesh
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



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

<Prev in Thread] Current Thread [Next in Thread>