Patch "powerpc/smp: Adjust nr_cpu_ids to cover all threads of a core" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    powerpc/smp: Adjust nr_cpu_ids to cover all threads of a core

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     powerpc-smp-adjust-nr_cpu_ids-to-cover-all-threads-o.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 22d1f0c4288dadb4edbbe13dbc37537f3d571360
Author: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
Date:   Thu Feb 15 00:14:04 2024 +1100

    powerpc/smp: Adjust nr_cpu_ids to cover all threads of a core
    
    [ Upstream commit 5580e96dad5a439d561d9648ffcbccb739c2a120 ]
    
    If nr_cpu_ids is too low to include at least all the threads of a single
    core adjust nr_cpu_ids upwards. This avoids triggering odd bugs in code
    that assumes all threads of a core are available.
    
    Cc: stable@xxxxxxxxxxxxxxx
    Signed-off-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
    Link: https://msgid.link/20231229120107.2281153-1-mpe@xxxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 8537c354c560b..a64f4fb332893 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -369,6 +369,12 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
 	if (IS_ENABLED(CONFIG_PPC64))
 		boot_cpu_hwid = be32_to_cpu(intserv[found_thread]);
 
+	if (nr_cpu_ids % nthreads != 0) {
+		set_nr_cpu_ids(ALIGN(nr_cpu_ids, nthreads));
+		pr_warn("nr_cpu_ids was not a multiple of threads_per_core, adjusted to %d\n",
+			nr_cpu_ids);
+	}
+
 	/*
 	 * PAPR defines "logical" PVR values for cpus that
 	 * meet various levels of the architecture:




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux