lkml.org 
[lkml]   [2022]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [PATCH] irqchip: gic-v3-its: fix build for !SMP
Date
On 22/01/22 16:16, Ard Biesheuvel wrote:
> Commit 835f442fdbce ("irqchip/gic-v3-its: Limit memreserve cpuhp state
> lifetime") added a reference to cpus_booted_once_mask, which does not
> exist on !SMP builds, breaking the build for such configurations.
>
> Given the intent of the check, short circuit it to always pass.
>
> Cc: Valentin Schneider <valentin.schneider@arm.com>
> Fixes: 835f442fdbce ("irqchip/gic-v3-its: Limit memreserve cpuhp state lifetime")
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

Sorry about that, and thanks for the fix.

This looks fine to me, though one alternative to prevent future
IS_ENABLED() proliferations would be to make cpus_booted_once_mask exist
for !SMP - the online, active, present and possible masks exist for !SMP
already after all.

---
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 407a2568f35e..7487b7061f2c 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -84,9 +84,7 @@ static DEFINE_PER_CPU(struct cpuhp_cpu_state, cpuhp_state) = {
.fail = CPUHP_INVALID,
};

-#ifdef CONFIG_SMP
cpumask_t cpus_booted_once_mask;
-#endif

#if defined(CONFIG_LOCKDEP) && defined(CONFIG_SMP)
static struct lockdep_map cpuhp_state_up_map =
@@ -2662,9 +2660,7 @@ void __init boot_cpu_init(void)
*/
void __init boot_cpu_hotplug_init(void)
{
-#ifdef CONFIG_SMP
cpumask_set_cpu(smp_processor_id(), &cpus_booted_once_mask);
-#endif
this_cpu_write(cpuhp_state.state, CPUHP_ONLINE);
}

\
 
 \ /
  Last update: 2022-01-24 13:39    [W:0.166 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site