Re: Call function on all processors
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com On Nov 21, 2006, at 2:26 PM, Paul Litvak 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. Derek _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... On 11/17/06, Michael Smith <drivers@mu.org> wrote: 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. This email sent to site_archiver@lists.apple.com
participants (1)
-
Derek Kumar