forked from linuxppc/linux-ci
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
powerpc: Make crashing cpu to be discovered first in kdump kernel.
The kernel boot parameter 'nr_cpus=' allows one to specify number of possible cpus in the system. In the normal scenario the first cpu (cpu0) that shows up is the boot cpu and hence it gets covered under nr_cpus limit. But this assumption is broken in kdump scenario where kdump kernel after a crash can boot up on an non-zero boot cpu. The paca structure allocation depends on value of nr_cpus and is indexed using logical cpu ids. The cpu discovery code brings up the cpus as they appear sequentially on device tree and assigns logical cpu ids starting from 0. This definitely becomes an issue if boot cpu id > nr_cpus. When this occurs it results into In past there were proposals to fix this by making changes to cpu discovery code to identify non-zero boot cpu and map it to logical cpu 0. However, the changes were very invasive, making discovery code more complicated and risky. Considering that the non-zero boot cpu scenario is more specific to kdump kernel, limiting the changes in panic/crash kexec path would probably be a best approach to have. Hence proposed change is, in crash kexec path, move the crashing cpu's device node to the first position under '/cpus' node, which will make the crashing cpu to be discovered as part of the first core in kdump kernel. In order to accommodate boot cpu for the case where boot_cpuid > nr_cpu_ids, align up the nr_cpu_ids to SMT threads in early_init_dt_scan_cpus(). This will allow kdump kernel to work with nr_cpus=X where X will be aligned up in multiple of SMT threads per core. Signed-off-by: Mahesh Salgaonkar <[email protected]>
- Loading branch information
Showing
4 changed files
with
142 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters