Re: [PATCH] Implement missing x86_64 function smp_call_function_mask()

From: Laurent Vivier
Date: Thu Aug 23 2007 - 05:34:53 EST


Andi Kleen wrote:
> On Thursday 23 August 2007 09:36:05 Laurent Vivier wrote:
>> This patch defines the missing function smp_call_function_mask() for x86_64,
>> this is more or less a cut&paste of i386 function.
>
> What do you need it for?

Hi Andi,

it is for KVM:

drivers/kvm/kvm_main.c:

203 void kvm_flush_remote_tlbs(struct kvm *kvm)
204 {
...
227 /*
228 * We really want smp_call_function_mask() here. But that's not
229 * available, so ipi all cpus in parallel and wait for them
230 * to complete.
231 */
232 for (cpu = first_cpu(cpus); cpu != NR_CPUS; cpu = next_cpu(cpu, cpus))
233 smp_call_function_single(cpu, ack_flush, &completed, 1, 0);
234 while (atomic_read(&completed) != needed) {
235 cpu_relax();
236 barrier();
237 }
238 }

Regards,
Laurent
--
------------- Laurent.Vivier@xxxxxxxx --------------
"Software is hard" - Donald Knuth

Attachment: signature.asc
Description: OpenPGP digital signature