xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* keeping track of Intel vmcs
@ 2011-03-16  2:58 Mukesh Rathor
  2011-03-16  8:11 ` Keir Fraser
  0 siblings, 1 reply; 2+ messages in thread
From: Mukesh Rathor @ 2011-03-16  2:58 UTC (permalink / raw)
  To: Xen-devel@lists.xensource.com

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)
v->arch.hvm_vmx.active_cpu;
v->arch.hvm_vmx.launched;
v->arch.hvm_vmx.active_list;
static DEFINE_PER_CPU(struct vmcs_struct *, current_vmcs);


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: keeping track of Intel vmcs
  2011-03-16  2:58 keeping track of Intel vmcs Mukesh Rathor
@ 2011-03-16  8:11 ` Keir Fraser
  0 siblings, 0 replies; 2+ messages in thread
From: Keir Fraser @ 2011-03-16  8:11 UTC (permalink / raw)
  To: Mukesh Rathor, Xen-devel@lists.xensource.com

On 16/03/2011 02:58, "Mukesh Rathor" <mukesh.rathor@oracle.com> 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@lists.xensource.com
> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-16  8:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-16  2:58 keeping track of Intel vmcs Mukesh Rathor
2011-03-16  8:11 ` Keir Fraser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).