summaryrefslogtreecommitdiff
path: root/arch/mips/kernel/smp-mt.c
diff options
context:
space:
mode:
authorJiaxun Yang <jiaxun.yang@flygoat.com>2023-05-21 23:31:22 +0100
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>2023-06-09 10:34:14 +0200
commit96cb8ae28c652e7ef0633b1c0786eb0f529ed516 (patch)
tree3490ae910dca2655c0fd16b9ece2d4974dc9e886 /arch/mips/kernel/smp-mt.c
parentdfbd992e0ef2319b869bf69fe649d34d2dc49e4b (diff)
MIPS: Rework smt cmdline parameters
Provide a generic smt parameters interface aligned with s390 to allow users to limit smt usage and threads per core. It replaced previous undocumented "nothreads" parameter for smp-cps which is ambiguous and does not cover smp-mt. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch/mips/kernel/smp-mt.c')
-rw-r--r--arch/mips/kernel/smp-mt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/mips/kernel/smp-mt.c b/arch/mips/kernel/smp-mt.c
index 5f04a0141068..7729cc733421 100644
--- a/arch/mips/kernel/smp-mt.c
+++ b/arch/mips/kernel/smp-mt.c
@@ -46,7 +46,8 @@ static void __init smvp_copy_vpe_config(void)
static unsigned int __init smvp_vpe_init(unsigned int tc, unsigned int mvpconf0,
unsigned int ncpu)
{
- if (tc > ((mvpconf0 & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT))
+ if (tc >= smp_max_threads ||
+ (tc > ((mvpconf0 & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT)))
return ncpu;
/* Deactivate all but VPE 0 */