Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp578867img; Fri, 22 Mar 2019 04:26:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqyt334KoMige9bliwuTY/ggUL0zkYprZRtTQ5IFmNcRqJISoeHPcMIxMfEkExejOJXlyxxf X-Received: by 2002:a65:6219:: with SMTP id d25mr8285319pgv.155.1553253992056; Fri, 22 Mar 2019 04:26:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553253992; cv=none; d=google.com; s=arc-20160816; b=IJIYt+Mk0piDPtjwnv7IVOQEjNkOWl6fAeLXf3AJsNWrx/xTsR3Uh7ZfOwE21CT9iL l+XaBTQy+Tsm5/MyCHeOjiocOk0ny7pP2pfSKuSxuy7chkSeDDH6AkNAO8EYr1iam2de 0pevNz618nwaxOoHez/Q7BOOJ+6EcCs4S4HL6VMGvRFVn34VbwYxebOpHoPVa3HqtdhQ A8wfEm29rZRd3PrTF31I8HsRs8GA4Cw7duhRWlSxUaI5zjuv2ABMa2PhI7LR/5cmI84x 48VcJV2IzgNo+uxtK4Yw+7U1Y6gWMWLD/cdGXen5osUSHC+ZHc0Rz0W790M2lrM3kYoX 6HGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zvgJf6/96KpMw4NMzfiDvkh44yzXT5zmJu0NQBkB3Es=; b=FvcfroNpivQEnsavh9Oftq/yf6iFTtrnfM0LKJTMdKlFRHwYSPk3Wlfu2RqDLVT/nP /M/rI5S1kofRRk4q+Znv1erE5DJDdkHVE6bNmdU72ZGi9JtbgYeuQEGyAIA61PR3qw9k vNDPzi0BCDs7l1AA/5zd6TPXYOCdOrysiN9Cw8I0p3ZRYxgUwUNmLQ+Fdos/6qf48nez 8ep6diHQcPGq0cYZo6bdSArUT7MboOlwmJ/YwqHZIR3GsffTgMgx3vIlRimkfX8+2XWd QvbSxwylvRcl9sNLJ9pUPip9Q9ORQyjtUFmSmPCReToUG9ccLsfZZuzwERCkPAk35Xrq GlHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uVUXmVUJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3si6555340plv.424.2019.03.22.04.26.17; Fri, 22 Mar 2019 04:26:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uVUXmVUJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728987AbfCVLXd (ORCPT + 99 others); Fri, 22 Mar 2019 07:23:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:50478 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728979AbfCVLXb (ORCPT ); Fri, 22 Mar 2019 07:23:31 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CD2E0218A2; Fri, 22 Mar 2019 11:23:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553253811; bh=yQLn4NMO4SBFMSiJsR0U1rV5cMOsy1McmNY/Vi3B9PA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uVUXmVUJ+f0/3G15mpbqlF2v7F+tCBBcPueG01sAO8KdXgiu9dOIV9rF6Zx8oIk0x CUMTWsNg1NdwIznzLEHIGD2Xzw5YxwE4zMgdk5wkzkUmmgzzZxZINu1tKIt7tYIlL+ m2OFZlyuUJg6lyWR73u2P0qbfAmtnigSSvaIa1Jo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Max Filippov , Sasha Levin Subject: [PATCH 3.18 062/134] xtensa: SMP: limit number of possible CPUs by NR_CPUS Date: Fri, 22 Mar 2019 12:14:35 +0100 Message-Id: <20190322111214.519863338@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190322111210.465931067@linuxfoundation.org> References: <20190322111210.465931067@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 25384ce5f9530def39421597b1457d9462df6455 ] This fixes the following warning at boot when the kernel is booted on a board with more CPU cores than was configured in NR_CPUS: smp_init_cpus: Core Count = 8 smp_init_cpus: Core Id = 0 ------------[ cut here ]------------ WARNING: CPU: 0 PID: 0 at include/linux/cpumask.h:121 smp_init_cpus+0x54/0x74 Modules linked in: CPU: 0 PID: 0 Comm: swapper Not tainted 5.0.0-rc3-00015-g1459333f88a0 #124 Call Trace: __warn$part$3+0x6a/0x7c warn_slowpath_null+0x35/0x3c smp_init_cpus+0x54/0x74 setup_arch+0x1c0/0x1d0 start_kernel+0x44/0x310 _startup+0x107/0x107 Signed-off-by: Max Filippov Signed-off-by: Sasha Levin --- arch/xtensa/kernel/smp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/xtensa/kernel/smp.c b/arch/xtensa/kernel/smp.c index 0e34c1ed4aa8..54bb8e0473a0 100644 --- a/arch/xtensa/kernel/smp.c +++ b/arch/xtensa/kernel/smp.c @@ -93,6 +93,11 @@ void __init smp_init_cpus(void) pr_info("%s: Core Count = %d\n", __func__, ncpus); pr_info("%s: Core Id = %d\n", __func__, core_id); + if (ncpus > NR_CPUS) { + ncpus = NR_CPUS; + pr_info("%s: limiting core count by %d\n", __func__, ncpus); + } + for (i = 0; i < ncpus; ++i) set_cpu_possible(i, true); } -- 2.19.1