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);
So the current code should be just as correct.
The similar __vcpu_clear has an obscure case where (vmx->vcpu.cpu != cpu),
but in this new function, there isn't.
--
Nadav Har'El | Monday, May 16 2011, 13 Iyyar 5771
[email protected] |-----------------------------------------
Phone +972-523-790466, ICQ 13349191 |Creativity consists of coming up with
http://nadav.harel.org.il |many ideas, not just that one great idea.
--
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