Received: by 10.213.65.68 with SMTP id h4csp2122625imn; Sun, 8 Apr 2018 20:15:39 -0700 (PDT) X-Google-Smtp-Source: AIpwx49tATsYf7vYrOMPFH13noIdmSpaACBm25Nui2YC/65V9YnK/H9FRjLiEC7RNTpTf6cd32/n X-Received: by 2002:a17:902:6e01:: with SMTP id u1-v6mr36355016plk.96.1523243387462; Sun, 08 Apr 2018 20:09:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243387; cv=none; d=google.com; s=arc-20160816; b=U7rFH3SDLUChBjus1/PLbZJlq7ub3UotJQMc9azosU2JVTwHRerE3OvT/zaOuTPEUd x94OKQ1cq/HJERtyDsLIh1tB/5bGAWL3j+T0i0L0iHGKlzoHJbbMVM0K/GEpgvHEMcco vXyMvjBs24c6j6sQBQyBvMqVu0P8JkKKtZ6CgMy4yB+f9YrI25R/1bpcG5XPR3zJsHlm 2tML3mT/aWcUhhgVYlZbjlsRP4KaUGoVaNV5DU1vTI+zz0QUBoOBMRbO3nhetTkNqpc1 JggoteZd66YqojLbTgGpS8fWhqXEggYoP1yFiV686vvsTdW+iuyeYZw04AscqlTs9llc mUxw== 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=tusPP0etyVizF48I1TUvwHdcrkotY8q8IWwcepcuQ3E=; b=SMW7U7fiTXbcbwRV2T9pLDGm0Jcvnk+OBNdVPodBYKGa2NDQnmr5AJWRm70tMHGk5V 6n+kf3cEYwMZe3b8EwDIoAleqgFzAz2sFzsyo//L3SCpG9TPeDRM8NYbPEwr8pFMyMuD ofyWv9OxzXYwUaXdUgm2IGSQimrOn/FcneuxbP21bUlW/7Kzn7FjfdQpdzjPSdv9ykmH AdWKRHRkKPy9tvlR1n+jkxA3XWOiSjRxFCfTaJhr3/VHUoP26gDlSOulMI5ZMxQEzeS0 zWESDljEO4WgavqyVBDUlPQt6iQgu+UBk3d7c//cnAQztpWgqTCFfeHp/ZFhio2b0e1x wv8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=GA7dB92B; 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 z22si10258396pgv.684.2018.04.08.20.09.10; Sun, 08 Apr 2018 20:09:47 -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=GA7dB92B; 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 S1757331AbeDIBVq (ORCPT + 99 others); Sun, 8 Apr 2018 21:21:46 -0400 Received: from mail-sn1nam02on0111.outbound.protection.outlook.com ([104.47.36.111]:14488 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755364AbeDIAhJ (ORCPT ); Sun, 8 Apr 2018 20:37:09 -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=tusPP0etyVizF48I1TUvwHdcrkotY8q8IWwcepcuQ3E=; b=GA7dB92BR4qKgmPjdwjygEIDBL2G/yc0wEq75JPGcqlzTXOY3hH+QPWOMbxEjCsaS/7B5JL9swAQhHb34iFsGSo1laoleg2dZprZktLanh+JriYOyXzQksk/wQezp+cRXP3UwAlQzszQYRAzXp0TYlQSo892ojn+fAdy2erHnE0= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1031.namprd21.prod.outlook.com (52.132.128.12) 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:37:05 +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:37:05 +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.4 085/162] MIPS: CPS: Prevent multi-core with dcache aliasing Thread-Topic: [PATCH AUTOSEL for 4.4 085/162] MIPS: CPS: Prevent multi-core with dcache aliasing Thread-Index: AQHTz5m4jPCq/48YGk2450rvjMCLug== Date: Mon, 9 Apr 2018 00:28:45 +0000 Message-ID: <20180409002738.163941-85-alexander.levin@microsoft.com> References: <20180409002738.163941-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002738.163941-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;DM5PR2101MB1031;7:l/krA5maP751xcMEcjkk+Q416SZ83EJXgpYoWzfD7Hv9pSp7iTuSv5a8RYq8oaPcFc5I1HzYXw50d+HPioS1bsjfF7Jc1ubuE6ANxn0PRe8873iJVQgmO708yQLN9wGpDWiRWN187JaH7Q7ctE2QH4Gj9XDx8vOpy6r+YacBEaWTKMbZ16tBPr1TyeyqkD4v0dpbzbwgjokKj0n39qg2PF1zDgiSRJ18+Onk37oiprF8A0UD5OWCbh6/IaIy39C7;20:cxlClMkvuFj4viGLreiFrkGNnpciKd5Sl+ske5uukj06Uw+j4x6rBSm6pYnN9sPmw37hfxNS/nHq9lFTQzx3QIbXc7T+KvzXLYI5iQIez75ij/hEDLuhZPtCC3NnLU/VUnvUw69HbvxmIIniWGwABmU1/2WGcRIw5v78n/2arCo= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: af529c92-7317-48b7-481e-08d59db2049e x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1031; x-ms-traffictypediagnostic: DM5PR2101MB1031: 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)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011);SRVR:DM5PR2101MB1031;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1031; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(376002)(366004)(39380400002)(346002)(39860400002)(189003)(199004)(2900100001)(10290500003)(99286004)(76176011)(14454004)(966005)(7736002)(11346002)(26005)(6666003)(86612001)(72206003)(478600001)(36756003)(106356001)(66066001)(2616005)(186003)(22452003)(86362001)(68736007)(305945005)(54906003)(102836004)(486006)(110136005)(316002)(6506007)(446003)(107886003)(53936002)(4326008)(105586002)(6306002)(6436002)(6486002)(476003)(6512007)(5660300001)(5250100002)(25786009)(3846002)(6116002)(1076002)(97736004)(3280700002)(2501003)(2906002)(81156014)(8676002)(10090500001)(81166006)(8936002)(3660700001)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1031;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: WffPFkdITJJe0wqa2IUgAbIl4kr5KjPQgSE3q11ChnJLl0GdFucMi84tV95e3b2tJU3SRbNnAdp4Kuijn4zSnx7+/ztyehnSsaW7PBgQGi7ezz3paLAwWk8+kGVcyNfyWVNQAFee1rFyw5Wc7zUr10ZVRLbE/IweCQgQ6iPK3mLfJlFxdu/ATyOUMioOZMzAq1sjOCOxtXU53ql4r857U1C192QbLOLYgFmEec6sHexmbr9CkPB0wbttlv7VHmdIEfdFNCtCyXOeoNu6iqIj5EOLy7L35MBkzkrsPEv9bW1mVXEn5vC2BSQpK3os3l3P3gRH7lgN3MwUAxSYw74UWJ35bqd6SXgo6iN5UHVVqKb63ZX6dOvVMMGNtE8rZJHBbE1BWTMnRnw3la+0jXTyZ4gmeU0dSWlDWX8eFkXKYJw= 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: af529c92-7317-48b7-481e-08d59db2049e X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:28:45.4271 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1031 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 e04c8057b882..ff0993dfeb08 100644 --- a/arch/mips/kernel/smp-cps.c +++ b/arch/mips/kernel/smp-cps.c @@ -122,9 +122,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