Patch "powerpc/smp: Increase nr_cpu_ids to include the boot CPU" has been added to the 6.8-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: Increase nr_cpu_ids to include the boot CPU

to the 6.8-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-increase-nr_cpu_ids-to-include-the-boot-.patch
and it can be found in the queue-6.8 subdirectory.

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



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

    powerpc/smp: Increase nr_cpu_ids to include the boot CPU
    
    [ Upstream commit 777f81f0a9c780a6443bcf2c7785f0cc2e87c1ef ]
    
    If nr_cpu_ids is too low to include the boot CPU adjust nr_cpu_ids
    upward. Otherwise the kernel will BUG when trying to allocate a paca
    for the boot CPU and fail to boot.
    
    Cc: stable@xxxxxxxxxxxxxxx
    Signed-off-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
    Link: https://msgid.link/20231229120107.2281153-2-mpe@xxxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 58e80076bed5c..77364729a1b61 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -381,6 +381,12 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
 			nr_cpu_ids);
 	}
 
+	if (boot_cpuid >= nr_cpu_ids) {
+		set_nr_cpu_ids(min(CONFIG_NR_CPUS, ALIGN(boot_cpuid + 1, nthreads)));
+		pr_warn("Boot CPU %d >= nr_cpu_ids, adjusted nr_cpu_ids to %d\n",
+			boot_cpuid, 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