Nick Bowler reported that sparc64 failed to bring all his CPU's online, and that turned out to be an easy fix.
The sparc64 build was rather noisy with a lot of warnings which had irritated me enough to go ahead and fix them. With this set of patches my arch/sparc/ is almost warning free for all{no,yes,mod}config + defconfig builds.
There is one warning about "clone3 not implemented", which I have ignored.
The warning fixes hides the fact that sparc64 is not yet y2038 prepared, and it would be preferable if someone knowledgeable would fix this poperly.
All fixes looks like 6.9 material to me.
Sam
--- Sam Ravnborg (10): sparc64: Fix prototype warning for init_vdso_image sparc64: Fix prototype warnings in traps_64.c sparc64: Fix prototype warning for vmemmap_free sparc64: Fix prototype warning for alloc_irqstack_bootmem sparc64: Fix prototype warning for uprobe_trap sparc64: Fix prototype warning for dma_4v_iotsb_bind sparc64: Fix prototype warnings in adi_64.c sparc64: Fix prototype warning for sched_clock sparc64: Fix number of online CPUs sparc64: Fix prototype warnings for vdso
arch/sparc/include/asm/smp_64.h | 2 -- arch/sparc/include/asm/vdso.h | 10 ++++++++++ arch/sparc/kernel/adi_64.c | 14 +++++++------- arch/sparc/kernel/kernel.h | 4 ++++ arch/sparc/kernel/pci_sun4v.c | 6 +++--- arch/sparc/kernel/prom_64.c | 4 +++- arch/sparc/kernel/setup_64.c | 3 +-- arch/sparc/kernel/smp_64.c | 14 -------------- arch/sparc/kernel/time_64.c | 1 + arch/sparc/kernel/traps_64.c | 10 +++++----- arch/sparc/kernel/uprobes.c | 2 ++ arch/sparc/mm/init_64.c | 5 ----- arch/sparc/vdso/vclock_gettime.c | 1 + arch/sparc/vdso/vma.c | 5 +++-- 14 files changed, 40 insertions(+), 41 deletions(-) --- base-commit: 84b76d05828a1909e20d0f66553b876b801f98c8 change-id: 20240329-sparc64-warnings-668cc90ef53b
Best regards,
From: Sam Ravnborg sam@ravnborg.org
Nick Bowler reported: When using newer kernels on my Ultra 60 with dual 450MHz UltraSPARC-II CPUs, I noticed that only CPU 0 comes up, while older kernels (including 4.7) are working fine with both CPUs.
I bisected the failure to this commit:
9b2f753ec23710aa32c0d837d2499db92fe9115b is the first bad commit commit 9b2f753ec23710aa32c0d837d2499db92fe9115b Author: Atish Patra atish.patra@oracle.com Date: Thu Sep 15 14:54:40 2016 -0600
sparc64: Fix cpu_possible_mask if nr_cpus is set
This is a small change that reverts very easily on top of 5.18: there is just one trivial conflict. Once reverted, both CPUs work again.
Maybe this is related to the fact that the CPUs on this system are numbered CPU0 and CPU2 (there is no CPU1)?
The current code that adjust cpu_possible based on nr_cpu_ids do not take into account that CPU's may not come one after each other. Move the chech to the function that setup the cpu_possible mask so there is no need to adjust it later.
Signed-off-by: Sam Ravnborg sam@ravnborg.org Fixes: 9b2f753ec237 ("sparc64: Fix cpu_possible_mask if nr_cpus is set") Reported-by: Nick Bowler nbowler@draconx.ca Tested-by: Nick Bowler nbowler@draconx.ca Link: https://lore.kernel.org/sparclinux/20201009161924.c8f031c079dd852941307870@g... Link: https://lore.kernel.org/all/CADyTPEwt=ZNams+1bpMB1F9w_vUdPsGCt92DBQxxq_VtaLo... Cc: stable@vger.kernel.org # v4.8+ Cc: Andreas Larsson andreas@gaisler.com Cc: "David S. Miller" davem@davemloft.net Cc: Atish Patra atish.patra@oracle.com Cc: Bob Picco bob.picco@oracle.com Cc: Vijay Kumar vijay.ac.kumar@oracle.com Cc: David S. Miller davem@davemloft.net --- arch/sparc/include/asm/smp_64.h | 2 -- arch/sparc/kernel/prom_64.c | 4 +++- arch/sparc/kernel/setup_64.c | 1 - arch/sparc/kernel/smp_64.c | 14 -------------- 4 files changed, 3 insertions(+), 18 deletions(-)
diff --git a/arch/sparc/include/asm/smp_64.h b/arch/sparc/include/asm/smp_64.h index 505b6700805d..0964fede0b2c 100644 --- a/arch/sparc/include/asm/smp_64.h +++ b/arch/sparc/include/asm/smp_64.h @@ -47,7 +47,6 @@ void arch_send_call_function_ipi_mask(const struct cpumask *mask); int hard_smp_processor_id(void); #define raw_smp_processor_id() (current_thread_info()->cpu)
-void smp_fill_in_cpu_possible_map(void); void smp_fill_in_sib_core_maps(void); void __noreturn cpu_play_dead(void);
@@ -77,7 +76,6 @@ void __cpu_die(unsigned int cpu); #define smp_fill_in_sib_core_maps() do { } while (0) #define smp_fetch_global_regs() do { } while (0) #define smp_fetch_global_pmu() do { } while (0) -#define smp_fill_in_cpu_possible_map() do { } while (0) #define smp_init_cpu_poke() do { } while (0) #define scheduler_poke() do { } while (0)
diff --git a/arch/sparc/kernel/prom_64.c b/arch/sparc/kernel/prom_64.c index 998aa693d491..ba82884cb92a 100644 --- a/arch/sparc/kernel/prom_64.c +++ b/arch/sparc/kernel/prom_64.c @@ -483,7 +483,9 @@ static void *record_one_cpu(struct device_node *dp, int cpuid, int arg) ncpus_probed++; #ifdef CONFIG_SMP set_cpu_present(cpuid, true); - set_cpu_possible(cpuid, true); + + if (num_possible_cpus() < nr_cpu_ids) + set_cpu_possible(cpuid, true); #endif return NULL; } diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c index 1d519f18d2b2..63615f5c99b4 100644 --- a/arch/sparc/kernel/setup_64.c +++ b/arch/sparc/kernel/setup_64.c @@ -671,7 +671,6 @@ void __init setup_arch(char **cmdline_p)
paging_init(); init_sparc64_elf_hwcap(); - smp_fill_in_cpu_possible_map(); /* * Once the OF device tree and MDESC have been setup and nr_cpus has * been parsed, we know the list of possible cpus. Therefore we can diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c index f3969a3600db..e50c38eba2b8 100644 --- a/arch/sparc/kernel/smp_64.c +++ b/arch/sparc/kernel/smp_64.c @@ -1220,20 +1220,6 @@ void __init smp_setup_processor_id(void) xcall_deliver_impl = hypervisor_xcall_deliver; }
-void __init smp_fill_in_cpu_possible_map(void) -{ - int possible_cpus = num_possible_cpus(); - int i; - - if (possible_cpus > nr_cpu_ids) - possible_cpus = nr_cpu_ids; - - for (i = 0; i < possible_cpus; i++) - set_cpu_possible(i, true); - for (; i < NR_CPUS; i++) - set_cpu_possible(i, false); -} - void smp_fill_in_sib_core_maps(void) { unsigned int i;
On Sat, Mar 30, 2024, at 10:57, Sam Ravnborg via B4 Relay wrote:
Nick Bowler reported that sparc64 failed to bring all his CPU's online, and that turned out to be an easy fix.
The sparc64 build was rather noisy with a lot of warnings which had irritated me enough to go ahead and fix them. With this set of patches my arch/sparc/ is almost warning free for all{no,yes,mod}config + defconfig builds.
Patches 1-9 look good to me,
Acked-by: Arnd Bergmann arnd@arndb.de
There is one warning about "clone3 not implemented", which I have ignored.
The warning fixes hides the fact that sparc64 is not yet y2038 prepared, and it would be preferable if someone knowledgeable would fix this poperly.
The clone3 bug has been around for ages, it's probably not even that hard to fix and just needs a little bit of testing.
If anyone wants to work on the time64 support for the vdso, I can explain the details for how it's done.
Both of these are real bugs that should be addressed, unlike the other warning fixes that are mostly cosmetic aside from allowing the build with CONFIG_WERROR=y.
Arnd
Hi Arnd,
On Sat, Mar 30, 2024 at 11:19:37AM +0100, Arnd Bergmann wrote:
On Sat, Mar 30, 2024, at 10:57, Sam Ravnborg via B4 Relay wrote:
Nick Bowler reported that sparc64 failed to bring all his CPU's online, and that turned out to be an easy fix.
The sparc64 build was rather noisy with a lot of warnings which had irritated me enough to go ahead and fix them. With this set of patches my arch/sparc/ is almost warning free for all{no,yes,mod}config + defconfig builds.
Patches 1-9 look good to me,
Acked-by: Arnd Bergmann arnd@arndb.de
Thanks!
There is one warning about "clone3 not implemented", which I have ignored.
The warning fixes hides the fact that sparc64 is not yet y2038 prepared, and it would be preferable if someone knowledgeable would fix this poperly.
The clone3 bug has been around for ages, it's probably not even that hard to fix and just needs a little bit of testing.
I looked briefly and it involves a better understanding of the window register manipulation than what I have today.
If anyone wants to work on the time64 support for the vdso, I can explain the details for how it's done.
I am happy to type the patches but need to rely on others for testing. Anything to help me get started would be super.
Sam
On 2024-03-30 19:39, Sam Ravnborg wrote:
Hi Arnd,
On Sat, Mar 30, 2024 at 11:19:37AM +0100, Arnd Bergmann wrote:
On Sat, Mar 30, 2024, at 10:57, Sam Ravnborg via B4 Relay wrote:
Nick Bowler reported that sparc64 failed to bring all his CPU's online, and that turned out to be an easy fix.
The sparc64 build was rather noisy with a lot of warnings which had irritated me enough to go ahead and fix them. With this set of patches my arch/sparc/ is almost warning free for all{no,yes,mod}config + defconfig builds.
Patches 1-9 look good to me,
Acked-by: Arnd Bergmann arnd@arndb.de
Thanks!
Picking up patches 1-8 to my for-next with
Reviewed-by: Andreas Larsson andreas@gaisler.com Tested-by: Andreas Larsson andreas@gaisler.com
and, having run it only on single core qemu, patch 9 with
Reviewed-by: Andreas Larsson andreas@gaisler.com
There is one warning about "clone3 not implemented", which I have ignored.
The warning fixes hides the fact that sparc64 is not yet y2038 prepared, and it would be preferable if someone knowledgeable would fix this poperly.
The clone3 bug has been around for ages, it's probably not even that hard to fix and just needs a little bit of testing.
I looked briefly and it involves a better understanding of the window register manipulation than what I have today.
If anyone wants to work on the time64 support for the vdso, I can explain the details for how it's done.
I am happy to type the patches but need to rely on others for testing. Anything to help me get started would be super.
I'm not picking up patch 10 at the moment, but it would be really nice to get allmodconfig builds to not fail due to prototype Werrors.
Thanks, Andreas
linux-stable-mirror@lists.linaro.org