* [PATCH] x86/smp: fix non-SMP broken build due to redefinition of apic_id_is_primary_thread
@ 2018-08-14 21:38 Vlastimil Babka
2018-08-14 22:00 ` Linus Torvalds
0 siblings, 1 reply; 2+ messages in thread
From: Vlastimil Babka @ 2018-08-14 21:38 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar
Cc: H . Peter Anvin, x86, linux-kernel, Linus Torvalds,
Konrad Rzeszutek Wilk, Vlastimil Babka, stable
The function has an inline "return false;" definition with CONFIG_SMP=n but the
"real" definition is also visible leading to "redefinition of
‘apic_id_is_primary_thread’" compiler error. Guard it with #ifdef CONFIG_SMP
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Fixes: 6a4d2657e048 ("x86/smp: Provide topology_is_primary_thread()")
Cc: stable@vger.kernel.org
---
arch/x86/kernel/apic/apic.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 87ff6235bbfe..84132eddb5a8 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -2193,6 +2193,7 @@ static int cpuid_to_apicid[] = {
[0 ... NR_CPUS - 1] = -1,
};
+#ifdef CONFIG_SMP
/**
* apic_id_is_primary_thread - Check whether APIC ID belongs to a primary thread
* @id: APIC ID to check
@@ -2207,6 +2208,7 @@ bool apic_id_is_primary_thread(unsigned int apicid)
mask = (1U << (fls(smp_num_siblings) - 1)) - 1;
return !(apicid & mask);
}
+#endif
/*
* Should use this API to allocate logical CPU IDs to keep nr_logical_cpuids
--
2.18.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] x86/smp: fix non-SMP broken build due to redefinition of apic_id_is_primary_thread
2018-08-14 21:38 [PATCH] x86/smp: fix non-SMP broken build due to redefinition of apic_id_is_primary_thread Vlastimil Babka
@ 2018-08-14 22:00 ` Linus Torvalds
0 siblings, 0 replies; 2+ messages in thread
From: Linus Torvalds @ 2018-08-14 22:00 UTC (permalink / raw)
To: Vlastimil Babka
Cc: Thomas Gleixner, Ingo Molnar, Peter Anvin,
the arch/x86 maintainers, Linux Kernel Mailing List,
Konrad Rzeszutek Wilk, stable
On Tue, Aug 14, 2018 at 2:39 PM Vlastimil Babka <vbabka@suse.cz> wrote:
>
> The function has an inline "return false;" definition with CONFIG_SMP=n but the
> "real" definition is also visible leading to "redefinition of
> ‘apic_id_is_primary_thread’" compiler error. Guard it with #ifdef CONFIG_SMP
Applied.
Linus
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-08-14 22:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-14 21:38 [PATCH] x86/smp: fix non-SMP broken build due to redefinition of apic_id_is_primary_thread Vlastimil Babka
2018-08-14 22:00 ` Linus Torvalds
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®