Re: Call function on all processors
Re: Call function on all processors
- Subject: Re: Call function on all processors
- From: Derek Kumar <email@hidden>
- Date: Fri, 1 Dec 2006 15:58:49 -0500
On Nov 21, 2006, at 2:26 PM, Paul Litvak wrote:
On 11/17/06, Michael Smith <email@hidden> wrote:
Paul Litvak wrote:
> How would you call a function on all cpus from a kernel extension?
I'm curious; why would you want to do this?
The only reasons I can think of have to do with changing per-CPU (vs.
per context) state, and the OS owns all of that state.
I am working with the Intel virtualization technology and want to
invoke the VMXON instruction on all CPUs.
For the moment, rather than invoking mp_rendezvous or variants (the
first is an unsupported export, and mp_rendezvous_no_intrs is a
legacy export; additionally, there is currently an issue with the
pmap (low level MMU management) layer wherein arbitrarily IPI-ing all
processors via those APIs can lead to deadlocks), you can spawn N
threads during initialization (where N>= the number of active CPUs,
for instance) and on each thread, execute a CPU number check (it
looks like cpu_number() is a legacy export, so you may need to obtain
the APIC ID instead; disable interrupts to avoid being preempted
during the interval of the check) and set the appropriate MSRs/
execute VMXON if you haven't already done so on that processor. Rinse/
repeat (and block) as necessary.
Derek
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden