On Tue, May 17, 2011, Marcelo Tosatti wrote about "Re: [PATCH 08/31] nVMX: Fix local_vcpus_link handling": > > 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)? > > Do it in vcpu_clear, its just an optimization not necessary in > vmclear_local_vcpus path. Well, what if (say) we're running L2, and L1's vmcs is saved in saved_vmcs01 and is not the current vmcs of the vcpu, and then we shut down the CPU on which this saved_vmcs01 was loaded. We need not only to VMCLEAR this vmcs, we need to also remember that this vmcs is not loaded, so when we nested_vmexit back to L1, we know we need to load the vmcs again. There's solution to this (which Avi also mentioned in his email) - it is to use everywhere my "saved_vmcs" type (which I'd rename "loaded vmcs"), which includes the vmcs *and* the cpu (and possibly "launched"). If the "cpu" field was part of vmx, this was easy - but "cpu" is a field of vcpu, not vmx, so I have problems encapsulating both "vmcs" and "cpu" in one structure everywhere. These are the kind of problems I wrapped my head with, until I gave up and came up with the current solution... -- Nadav Har'El | Tuesday, May 17 2011, 14 Iyyar 5771 nyh@xxxxxxxxxxxxxxxxxxx |----------------------------------------- Phone +972-523-790466, ICQ 13349191 |Bigamy: Having one wife too many. http://nadav.harel.org.il |Monogamy: The same thing! -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html