public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Hollis Blanchard <hollisb@us.ibm.com>
To: Avi Kivity <avi@redhat.com>
Cc: kvm-devel <kvm@vger.kernel.org>, Rusty Russell <rusty@ozlabs.au.ibm.com>
Subject: Re: [PATCH] KVM: use modern cpumask primitives, no cpumask_t on stack
Date: Thu, 11 Dec 2008 10:51:24 -0600	[thread overview]
Message-ID: <1229014284.26586.9.camel@localhost.localdomain> (raw)
In-Reply-To: <20081208160945.7535A25006E@cleopatra.tlv.redhat.com>

On Mon, 2008-12-08 at 16:09 +0000, Avi Kivity wrote:
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index ba4275d..2d6ca79 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -568,14 +570,17 @@ static bool make_all_cpus_request(struct kvm *kvm, unsigned int req)
>  		if (test_and_set_bit(req, &vcpu->requests))
>  			continue;
>  		cpu = vcpu->cpu;
> -		if (cpu != -1 && cpu != me)
> -			cpu_set(cpu, cpus);
> -	}
> -	if (!cpus_empty(cpus)) {
> -		smp_call_function_mask(cpus, ack_flush, NULL, 1);
> -		called = true;
> +		if (cpus != NULL && cpu != -1 && cpu != me)
> +			cpumask_set_cpu(cpu, cpus);
>  	}
> +	if (unlikely(cpus == NULL))
> +		smp_call_function_many(cpu_online_mask, ack_flush, NULL, 1);
> +	else if (!cpumask_empty(cpus))
> +		smp_call_function_many(cpus, ack_flush, NULL, 1);
> +	else
> +		called = false;
>  	put_cpu();
> +	free_cpumask_var(cpus);
>  	return called;
>  }

This patch breaks uniprocessor builds, because smp_call_function_many()
is only defined for CONFIG_SMP.

Avi, I think you should be able to build a PowerPC KVM kernel at this
point? That would have caught this error. Rusty, could you ack the
following:



cpumask: define smp_call_function_many() for non-SMP builds

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>

diff --git a/include/linux/smp.h b/include/linux/smp.h
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -67,13 +67,6 @@ int smp_call_function(void(*func)(void *
 /* Deprecated: use smp_call_function_many() which uses a cpumask ptr. */
 int smp_call_function_mask(cpumask_t mask, void(*func)(void *info), void *info,
                                int wait);
-
-static inline void smp_call_function_many(const struct cpumask *mask,
-                                         void (*func)(void *info), void *info,
-                                         int wait)
-{
-       smp_call_function_mask(*mask, func, info, wait);
-}
 
 int smp_call_function_single(int cpuid, void (*func) (void *info), void *info,
                                int wait);
@@ -151,6 +144,13 @@ static inline void init_call_single_data
 }
 #endif /* !SMP */
 
+static inline void smp_call_function_many(const struct cpumask *mask,
+                                         void (*func)(void *info), void *info,
+                                         int wait)
+{
+       smp_call_function_mask(*mask, func, info, wait);
+}
+
 /*
  * smp_processor_id(): get the current CPU ID.
  *

-- 
Hollis Blanchard
IBM Linux Technology Center


       reply	other threads:[~2008-12-11 16:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20081208160945.7535A25006E@cleopatra.tlv.redhat.com>
2008-12-11 16:51 ` Hollis Blanchard [this message]
2008-12-15  8:34   ` [PATCH] KVM: use modern cpumask primitives, no cpumask_t on stack Rusty Russell
2008-12-18 22:10     ` [PATCH] Define smp_call_function_many for UP Rusty Russell
2008-12-18 22:16       ` Linus Torvalds
2008-12-19  5:43         ` Rusty Russell
2008-12-19 17:03           ` Linus Torvalds
2008-12-21  8:11             ` Rusty Russell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1229014284.26586.9.camel@localhost.localdomain \
    --to=hollisb@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=rusty@ozlabs.au.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox