* [PATCH -next] x86/kvm: Fix build with CONFIG_SMP disabled
@ 2020-09-29 11:50 Wang ShaoBo
2020-09-29 12:32 ` Paolo Bonzini
0 siblings, 1 reply; 2+ messages in thread
From: Wang ShaoBo @ 2020-09-29 11:50 UTC (permalink / raw)
Cc: weiyongjun1, huawei.libin, cj.chengjian, pbonzini,
sean.j.christopherson, kvm, linux-kernel, x86
When CONFIG_SMP is disabled, build failed like this:
arch/x86/kernel/kvm.c: In function ‘kvm_alloc_cpumask’:
arch/x86/kernel/kvm.c:823:35: error: ‘kvm_send_ipi_mask_allbutself’
undeclared (first use in this function); did you mean ‘apic_send_IPI_allbutself’?
apic->send_IPI_mask_allbutself = kvm_send_ipi_mask_allbutself;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
apic_send_IPI_allbutself
arch/x86/kernel/kvm.c:823:35: note: each undeclared identifier
is reported only once for each function it appears in
It is because the declaration of kvm_send_ipi_mask_allbutself() is guarded
by CONFIG_SMP. kvm_send_ipi_mask_allbutself() do not need do anything at
this time.
Signed-off-by: Wang ShaoBo <bobo.shaobowang@huawei.com>
---
arch/x86/kernel/kvm.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index a44398d2bc44..47d65864e29c 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -611,6 +611,13 @@ static int kvm_cpu_down_prepare(unsigned int cpu)
local_irq_enable();
return 0;
}
+
+#else /* !CONFIG_SMP */
+
+static void kvm_send_ipi_mask_allbutself(const struct cpumask *mask, int vector)
+{
+}
+
#endif
static void kvm_flush_tlb_others(const struct cpumask *cpumask,
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] x86/kvm: Fix build with CONFIG_SMP disabled
2020-09-29 11:50 [PATCH -next] x86/kvm: Fix build with CONFIG_SMP disabled Wang ShaoBo
@ 2020-09-29 12:32 ` Paolo Bonzini
0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2020-09-29 12:32 UTC (permalink / raw)
To: Wang ShaoBo
Cc: weiyongjun1, huawei.libin, cj.chengjian, sean.j.christopherson,
kvm, linux-kernel, x86
On 29/09/20 13:50, Wang ShaoBo wrote:
> When CONFIG_SMP is disabled, build failed like this:
>
> arch/x86/kernel/kvm.c: In function ‘kvm_alloc_cpumask’:
> arch/x86/kernel/kvm.c:823:35: error: ‘kvm_send_ipi_mask_allbutself’
> undeclared (first use in this function); did you mean ‘apic_send_IPI_allbutself’?
> apic->send_IPI_mask_allbutself = kvm_send_ipi_mask_allbutself;
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
> apic_send_IPI_allbutself
> arch/x86/kernel/kvm.c:823:35: note: each undeclared identifier
> is reported only once for each function it appears in
>
> It is because the declaration of kvm_send_ipi_mask_allbutself() is guarded
> by CONFIG_SMP. kvm_send_ipi_mask_allbutself() do not need do anything at
> this time.
>
> Signed-off-by: Wang ShaoBo <bobo.shaobowang@huawei.com>
> ---
> arch/x86/kernel/kvm.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
> index a44398d2bc44..47d65864e29c 100644
> --- a/arch/x86/kernel/kvm.c
> +++ b/arch/x86/kernel/kvm.c
> @@ -611,6 +611,13 @@ static int kvm_cpu_down_prepare(unsigned int cpu)
> local_irq_enable();
> return 0;
> }
> +
> +#else /* !CONFIG_SMP */
> +
> +static void kvm_send_ipi_mask_allbutself(const struct cpumask *mask, int vector)
> +{
> +}
> +
> #endif
>
> static void kvm_flush_tlb_others(const struct cpumask *cpumask,
>
Hi,
a patch for this is already on the list, though I haven't committed it yet.
Thanks for the report.
Paolo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-29 12:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-29 11:50 [PATCH -next] x86/kvm: Fix build with CONFIG_SMP disabled Wang ShaoBo
2020-09-29 12:32 ` Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).