Received: by 10.223.185.116 with SMTP id b49csp1103889wrg; Sat, 3 Mar 2018 15:40:20 -0800 (PST) X-Google-Smtp-Source: AG47ELuTHvxIzBrwxKjwZv6sG1DgSC32brgcU/7L//UQ33IAXQdkFwXzdQBSBJlYXgZC/RqbXJUv X-Received: by 10.98.90.196 with SMTP id o187mr9323448pfb.170.1520120420444; Sat, 03 Mar 2018 15:40:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520120420; cv=none; d=google.com; s=arc-20160816; b=MkWVPaHU8q5FZo7hmB1taEEuqVmmFvZZIpA5UbZYc6mAl3ZJx5+JOfqunfVvHQcnyk Kam13hiAhDHtZZerB9Go+GVU2Xk47HhSb4dXBXm1E8z2EWVLamqJrkbxEt/OVAzOytZ6 La0gnluFDebEHTnnZGiZkRDDv2mreo3g/MonohH2K/ZLisaZS2iMhz7fR48eYmwR6Qx/ BpRzlur3Zbq741MfIf4HrUCbefL82FS1ap+MDZM6JbtvAn5DsImn0y6tUPVFN0tf2UZI h6Pc/BaSfkXNnBlCK14GKnkxDBDcUfDAb5j5SFGpS4+cMHWk2elD332ryDBzXyVEPDpc 6J7w== 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 :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=lo5iH78F7Ew5m7Bs8Zdn+pu+p+Bcq/xgqjt4GCK5sts=; b=Uaze0rvDNHmhsnwXXZ2RiTx+6wuM5Z8vAxyB+LeUo2bCZ15Uiy0jAS417YnYGvnpXh iAJ+hGNj6PFRwCvQGpBg2p8aWi5YnX/3mNd8DVU+gxOQZT0WGVIA0kmlpFjyKkRYK4nC vPumxZWvF3DCXk+1rPJPbQQMHxUPWDTst0Tne4WoXdATJ27k4vOGaudejCemZTo26zyh L/NB7ml5hBzkqn3rANBAeZyTiqMDEMtvrrCBXv+TukAP+pphFijYsG2OGcbeF11s1dlp gKhlRqWLJ+JBSiHwUmx5BpnqNgg7vIRHfxgOTBl0v4HH3c0jojbjFYbWORidpdWa5FYS u55g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=V7/p9eFt; 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 32-v6si7001730pls.319.2018.03.03.15.40.06; Sat, 03 Mar 2018 15:40:20 -0800 (PST) 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=V7/p9eFt; 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 S934214AbeCCXik (ORCPT + 99 others); Sat, 3 Mar 2018 18:38:40 -0500 Received: from mail-sn1nam02on0112.outbound.protection.outlook.com ([104.47.36.112]:45329 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933677AbeCCWfM (ORCPT ); Sat, 3 Mar 2018 17:35:12 -0500 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=lo5iH78F7Ew5m7Bs8Zdn+pu+p+Bcq/xgqjt4GCK5sts=; b=V7/p9eFtZ5flbB8Z8W6vXlmOkKB1I+iWB6TQUGtTusgaxHkRdKgRvEeZXpBBIMjaYH7sp/8v7DDhGHSpmBfGuYAtfo8ttTGY1wJwNUfGjRIFfAFMbxK7NEVaJDpR6TKAZ3+ls0oTE7XOHEggH1dYZKzQwszhakn1H5bJl3ypdZM= Received: from MW2PR2101MB1034.namprd21.prod.outlook.com (52.132.149.10) by MW2PR2101MB0924.namprd21.prod.outlook.com (52.132.152.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.588.3; Sat, 3 Mar 2018 22:34:58 +0000 Received: from MW2PR2101MB1034.namprd21.prod.outlook.com ([fe80::1d56:338f:e2b:cec0]) by MW2PR2101MB1034.namprd21.prod.outlook.com ([fe80::1d56:338f:e2b:cec0%3]) with mapi id 15.20.0567.006; Sat, 3 Mar 2018 22:34:58 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Michael Ellerman , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 145/219] powerpc/nohash: Fix use of mmu_has_feature() in setup_initial_memory_limit() Thread-Topic: [PATCH AUTOSEL for 4.9 145/219] powerpc/nohash: Fix use of mmu_has_feature() in setup_initial_memory_limit() Thread-Index: AQHTsz8S/zz2tFpZxkCodPf7zRIj/A== Date: Sat, 3 Mar 2018 22:29:20 +0000 Message-ID: <20180303222716.26640-145-alexander.levin@microsoft.com> References: <20180303222716.26640-1-alexander.levin@microsoft.com> In-Reply-To: <20180303222716.26640-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;MW2PR2101MB0924;6:6zsrt+B0mvuKoWj7VGdkHGgtnkCxZfrG8z4Rsg5qnqKWbsxzfb7IOs/ZuOHUFzxafYZprOobtW4GRFIKKBTJzFHVEokap7cGO42Iu1hOpH4sXLnelMmPBW7/H0xnbDwR5gMWJ6sM36je7dQXucYm6WQ0Qxw99+PwGQsllKj9nzu/lHSYMSd9Q+n/YeYeP21Dd+yPFiBt2CcNyz+d0+oX52qxkMyv+QLSVtmkOoQMiKH4F+xMhIarz+3MQIG+FNQGXke/Ha0g4DfqWG9toAvL1xQDdQz2IK/yQhfCvw2amOVX/fVr1faYB6Q5YqjoAu1hHbFdgUW+ZqcbN9qRz2GUxnDd7cx1v5hhFV54COml270=;5:pwhTf0h+vILlcGx3vnSVjsMpaheYZmoQp+nMAeQeJdgvpf/IEz2U7sh6fTY9bKsWY92PUGlAvmRTEqgZ6xFtJnOK5mmj+DSlYf3T20Hv7NFoVfLCSJs0sY0u5RbC3ezEpfp4G0soQzpiM/0M5h1Qq1SPO5bmINtcOrGNZuHR5/g=;24:cbMOXhKkwdpQWqWAsZKnFzm6L7rowbck+AFh/NtCbw6R5j8Pq6FFH2VjAQmskBG3uwgoH/8QfdbAqQTUk+/w+hrXMx3qcZHeSbQ5Bofawkg=;7:bDKPNAVWnMEatUmlQEjLc8SfkK7oG1PBEAsJqbstTtY6aqNY1pekJmTH5qkCOKDnGl8oyU7f+RxAkNd+DgnBrOjZudTgAp6YSJ+5IkL9bVS6WCBfjgflzUAFLhqbEYVHTRSo11aUyGeqSXAaagvtONoWkVwKuhxn8aVKkWqDtQZRW5BoGz2m8KsvqzRl+I1z92xlfxYT1yOrZhUdwZ+Y2twGYJA8UUxn/51Zz1nB1KsSHvR0ViscbYbA80V8SRNa x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: ad7e3df8-cd1a-48dc-ade7-08d58156ff12 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603307)(7193020);SRVR:MW2PR2101MB0924; x-ms-traffictypediagnostic: MW2PR2101MB0924: 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)(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231220)(944501244)(52105095)(3002001)(6055026)(61426038)(61427038)(6041288)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:MW2PR2101MB0924;BCL:0;PCL:0;RULEID:;SRVR:MW2PR2101MB0924; x-forefront-prvs: 0600F93FE1 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(376002)(39860400002)(396003)(366004)(39380400002)(189003)(199004)(102836004)(2950100002)(10090500001)(6666003)(316002)(26005)(186003)(25786009)(2900100001)(2906002)(54906003)(22452003)(110136005)(97736004)(6506007)(59450400001)(7736002)(4326008)(305945005)(5250100002)(86362001)(575784001)(2501003)(99286004)(68736007)(72206003)(53936002)(6436002)(6116002)(3846002)(5660300001)(66066001)(1076002)(76176011)(14454004)(36756003)(3660700001)(6486002)(86612001)(81156014)(8676002)(81166006)(10290500003)(6512007)(8936002)(3280700002)(478600001)(107886003)(106356001)(105586002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:MW2PR2101MB0924;H:MW2PR2101MB1034.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) 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: ad7e3df8-cd1a-48dc-ade7-08d58156ff12 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Mar 2018 22:29:20.5882 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR2101MB0924 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michael Ellerman [ Upstream commit 4868e3508d1934d28961f940ed6b9f1e347ab52c ] setup_initial_memory_limit() is called from early_init_devtree(), which runs prior to feature patching. If the kernel is built with CONFIG_JUMP_LAB= EL=3Dy and CONFIG_JUMP_LABEL_FEATURE_CHECKS=3Dy then we will potentially get the wrong value. If we also have CONFIG_JUMP_LABEL_FEATURE_CHECK_DEBUG=3Dy we get a warning and backtrace: Warning! mmu_has_feature() used prior to jump label init! CPU: 0 PID: 0 Comm: swapper Not tainted 4.11.0-rc4-gccN-next-20170331-g6a= f2434 #1 Call Trace: [c000000000fc3d50] [c000000000a26c30] .dump_stack+0xa8/0xe8 (unreliable) [c000000000fc3de0] [c00000000002e6b8] .setup_initial_memory_limit+0xa4/0x= 104 [c000000000fc3e60] [c000000000d5c23c] .early_init_devtree+0xd0/0x2f8 [c000000000fc3f00] [c000000000d5d3b0] .early_setup+0x90/0x11c [c000000000fc3f90] [c000000000000520] start_here_multiplatform+0x68/0x80 Fix it by using early_mmu_has_feature(). Fixes: c12e6f24d413 ("powerpc: Add option to use jump label for mmu_has_fea= ture()") Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/mm/tlb_nohash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/mm/tlb_nohash.c b/arch/powerpc/mm/tlb_nohash.c index 050badc0ebd3..0b50019505a5 100644 --- a/arch/powerpc/mm/tlb_nohash.c +++ b/arch/powerpc/mm/tlb_nohash.c @@ -751,7 +751,7 @@ void setup_initial_memory_limit(phys_addr_t first_membl= ock_base, * avoid going over total available memory just in case... */ #ifdef CONFIG_PPC_FSL_BOOK3E - if (mmu_has_feature(MMU_FTR_TYPE_FSL_E)) { + if (early_mmu_has_feature(MMU_FTR_TYPE_FSL_E)) { unsigned long linear_sz; unsigned int num_cams; =20 --=20 2.14.1