On 05/17/2011 05:35 PM, Nadav Har'El wrote:

What about having a per-CPU VMCS list instead of per-CPU vcpu list?
Perhaps even easier (avoids duplication):

struct raw_vmcs {
     u32 revision_id;
     u32 abort;
     char data[0];
};

struct vmcs {
     struct raw_vmcs *raw_vmcs;
     struct list_head local_vmcs_link;
};

struct vcpu_vmx {
     ...
     struct vmcs *vmcs;  /* often points at l1_vmcs */
     struct vmcs l1_vmcs;
     ...
};

static DEFINE_PER_CPU(struct list_head, vmcss_on_cpu);
This is an interesting suggestion. My initial plan was to do something similar
to this, and I agree it could have been nicer code, but I had to change it
after bumping into too many obstacles.

For example, currently, vmclear_local_vcpus() not only VMCLEARs the vmcss,
it also sets vmx->vcpu.cpu = -1, xmv->launched=0 for the vcpus holding these
VMCSs.  If we had only a list of VMCSs, how can we mark the vcpus as being not
currently loaded (cpu=-1)?


->launched and ->cpu simply move into struct vmcs.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to