Received: by 10.213.65.68 with SMTP id h4csp2119457imn; Sun, 8 Apr 2018 20:11:07 -0700 (PDT) X-Google-Smtp-Source: AIpwx49ypAjf9RbNbXwIiTdb69sSoZ6QAbMQz3fGJZTr/jy419oxeuYbTDWfOjnjFbSXfUpOgczm X-Received: by 10.101.76.129 with SMTP id m1mr23582533pgt.90.1523243467623; Sun, 08 Apr 2018 20:11:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243467; cv=none; d=google.com; s=arc-20160816; b=nScr/xDsDMK/mGPfIF8gASfCTmMzb8zc+MJdn8oy/8AsZfRI+Ii1xM6iS+TIFyHY+f Wd7a6oLdIrNvxhwLt2KJuqwJ1S6pq8EM7S3vJT4qYL8z/U54gSos6JpksbCnJwjszb5P fa7FAM3KMCQ5QEdRVUMLg7uJVxLEVxbim3kXhx3sFf1lgO+WoyGgs1IEfvMB2BCuELjG EyogcdHMoK6Eg+0iiFt929804pnpxOdpcYxFNnPEuz/hsuFJd/IZl9CGuv18A1Fxmhgj fLKkk6QNlUSbqhNWzygSnpfzOHOLnoTHqDTn1KzXxvEBl6mkasBmLWL3ULDnFI6ORE75 I71Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=ueHMBHYDPJz7V2tYBq5LPs+h4Y4VQoe2H0SWFyjmnxQ=; b=1LvcG1s1tLNWnXjOhqNhOR7WNU4OKZv1BauLOEZxwh/wcOpqFgZWMFJ9lhQOBmXdlV 6y0MxSY0eX+2kSz0E2hkVs9vn1hVOZOJZ5cXngqZChuIL4ixSYP4XLWzfyZhkI2w5DWB sCyBOimMuyXppxejHr5lvtl9eRZLGJOA3sbFls0g4NFlUNVL+Dk6ksCWKzH6mxOpbQm1 wJot2FfFiSM6/lWhygERA9jYpsoGAcdIP5Am+saMOpHBAtnUYScT/THcOcoZmNeBQmeT Wa1lmZXustpGKVSqHnOKToApvibOT478C6dYyzJra5wPI1TslOLJRF7i3LFZLtu4UW9/ hL7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=am0ZPzO0; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z73si10552493pgz.559.2018.04.08.20.10.30; Sun, 08 Apr 2018 20:11:07 -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=@microsoft.com header.s=selector1 header.b=am0ZPzO0; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757515AbeDICHO (ORCPT + 99 others); Sun, 8 Apr 2018 22:07:14 -0400 Received: from mail-by2nam03on0126.outbound.protection.outlook.com ([104.47.42.126]:54752 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756262AbeDIAbX (ORCPT ); Sun, 8 Apr 2018 20:31:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ueHMBHYDPJz7V2tYBq5LPs+h4Y4VQoe2H0SWFyjmnxQ=; b=am0ZPzO0AH5ItBwMYpWWWqnDHLmSg++nqraXfW4JAq+878sJTyoY7FQ244QOGosTfoizS9EmSQ1FJ5cSziiiZcVEU6ymIi1jYkGLpCz6nlNHLaiDZxc0YJ0vxkrR0PhZ+fTwo2wg0nU++YQ9xkHNcan/hE0h5sCyXuJJpHCj8cY= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0917.namprd21.prod.outlook.com (52.132.132.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:31:17 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:31:17 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Paul Burton , "linux-mips@linux-mips.org" , Ralf Baechle , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 169/293] MIPS: CPS: Prevent multi-core with dcache aliasing Thread-Topic: [PATCH AUTOSEL for 4.9 169/293] MIPS: CPS: Prevent multi-core with dcache aliasing Thread-Index: AQHTz5k1mYnjTrjHV0+WKCUT8mJD5Q== Date: Mon, 9 Apr 2018 00:25:06 +0000 Message-ID: <20180409002239.163177-169-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0917;7:MJfDGnMaU83ry/RdR4+x6PtdyWTS6lEaqvhUJatGOPPvPP6hgAYtJSBozOHyQX2wLWX1aE3WPIIU7E0V8u5PgTYaGFLmSiTqtUW830k4B5bfs3sD9NYm9ZegjBibdv5woOlIBYjqnUW4rvGUwaXp5eLCcLrZ/F78xvq1mOGyCYQpXy2W99cObODQGo+qJVNwJRSqpoLLVxTF+RrFPuzFrZKPLzAJByBnxAVq3u8+uE+DJK4FpjcBripe+b4xX5oB;20:d3+hnvvJgZnBtocJhz5thprxXB3xA2DNYINTIkdeeB34LTaHFfLxgg9i2yIB8sjtGWbIoNTol5Z4TeVkbb7RHDWGrbqvMucGCuE7uI4OqA4qgm+J7g7wJjIeG8Tm3ZsTnIekGRoEve9+ZP6+IrmqdttVXTUZVSWuLhyoJivAg64= X-MS-Office365-Filtering-Correlation-Id: b3714986-f084-4211-6962-08d59db1355d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(48565401081)(2017052603328)(7193020);SRVR:DM5PR2101MB0917; x-ms-traffictypediagnostic: DM5PR2101MB0917: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0917;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0917; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39380400002)(39860400002)(366004)(396003)(346002)(376002)(189003)(199004)(99286004)(22452003)(106356001)(26005)(110136005)(478600001)(54906003)(10290500003)(316002)(1076002)(72206003)(186003)(4326008)(97736004)(66066001)(11346002)(25786009)(86362001)(476003)(446003)(2906002)(6666003)(6486002)(105586002)(86612001)(3280700002)(3660700001)(6512007)(3846002)(6306002)(6116002)(6436002)(2616005)(486006)(53936002)(7736002)(8676002)(81166006)(81156014)(8936002)(68736007)(305945005)(10090500001)(76176011)(6506007)(102836004)(36756003)(107886003)(2900100001)(2501003)(14454004)(966005)(5660300001)(5250100002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0917;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: A8UIymRzetnnlo3c/mf1FeMJKShBikiqSKi3ry51xARKk+A1cYwANRBh7JO9KszqhYG6/Rhp02dXIlGE9028I1/RdLu6m0THxoN+/obn3EEVItFzN4l5kiZ0PrnbWg4pJcCLS6tHh+yHFSLBV1bVdBwKf6FhJIti40xJ9qxVim6TySZIYJuCFSwjmg8K1XZ/AfNCQIpJr1tjFXJMzETSbbOqG0iHAxNCEj5hrG3ggaF8xM5g0tqZVDBi0OI5QdTyDRIF/bm/Iz1PL8VrCiYvSw7Ip1Jq8UZ1CgbmDrvJYhMC8Zbi6HU2z4r9HaMeg1x44xrrQ8cAVYTh/fP6A9DsVxmcj+33QnuhCrzav0+u9FMJI6hbMLPH2AR8djbhgOTjHOa7xPbP+3WYNrwS3o1VUzCtejdGVLc8MG5AlAGbMAI= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: b3714986-f084-4211-6962-08d59db1355d X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:25:06.5657 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0917 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paul Burton [ Upstream commit 5570ba2ee920de4e7760a2802b842771845b2c32 ] Systems using the MIPS Coherence Manager (CM) cannot support multi-core SMP with dcache aliasing. This is because CPU caches are VIPT, but interventions in CM-based systems provide only the physical address to remote caches. This means that interventions may behave incorrectly in the presence of an aliasing dcache, since the physical address used when handling an intervention may lead to operation on an aliased cache line rather than the correct line. Prevent us from running into this issue by refusing to boot secondary cores in systems where dcache aliasing may occur. Signed-off-by: Paul Burton Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/16196/ Signed-off-by: Ralf Baechle Signed-off-by: Sasha Levin --- arch/mips/kernel/smp-cps.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c index 6183ad84cc73..63c8136d5132 100644 --- a/arch/mips/kernel/smp-cps.c +++ b/arch/mips/kernel/smp-cps.c @@ -140,9 +140,11 @@ static void __init cps_prepare_cpus(unsigned int max_c= pus) =20 /* Warn the user if the CCA prevents multi-core */ ncores =3D mips_cm_numcores(); - if (cca_unsuitable && ncores > 1) { - pr_warn("Using only one core due to unsuitable CCA 0x%x\n", - cca); + if ((cca_unsuitable || cpu_has_dc_aliases) && ncores > 1) { + pr_warn("Using only one core due to %s%s%s\n", + cca_unsuitable ? "unsuitable CCA" : "", + (cca_unsuitable && cpu_has_dc_aliases) ? " & " : "", + cpu_has_dc_aliases ? "dcache aliasing" : ""); =20 for_each_present_cpu(c) { if (cpu_data[c].core) --=20 2.15.1