On Mon, May 16, 2011 at 09:32:53PM +0300, Nadav Har'El wrote:
> On Mon, May 16, 2011, Marcelo Tosatti wrote about "Re: [PATCH 07/30] nVMX:
> Introduce vmcs02: VMCS used to run L2":
> > > +static void __nested_free_saved_vmcs(void *arg)
> > > +{
> > > + struct saved_vmcs *saved_vmcs = arg;
> > > +
> > > + vmcs_clear(saved_vmcs->vmcs);
> > > + if (per_cpu(current_vmcs, saved_vmcs->cpu) == saved_vmcs->vmcs)
> > > + per_cpu(current_vmcs, saved_vmcs->cpu) = NULL;
> > > +}
> >
> > Should use raw_smp_processor_id instead of saved_vmcs->cpu.
>
> Hi,
>
> __nested_free_saved_vmcs is designed to be called only on the when
> saved_vmcs->cpu is equal to the current CPU. E.g., it is called as:
>
> if (saved_vmcs->cpu != -1)
> smp_call_function_single(saved_vmcs->cpu,
> __nested_free_saved_vmcs, saved_vmcs, 1);
Yes, using raw_smp_processor_id makes that fact explicit to the reader.
> So the current code should be just as correct.
It is correct.
>
> The similar __vcpu_clear has an obscure case where (vmx->vcpu.cpu != cpu),
> but in this new function, there isn't.
--
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