From patchwork Mon Dec 11 05:33:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Kushwaha X-Patchwork-Id: 10104249 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DE31D602D8 for ; Mon, 11 Dec 2017 05:36:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D286B2934D for ; Mon, 11 Dec 2017 05:36:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C6F5429352; Mon, 11 Dec 2017 05:36:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A353F2934D for ; Mon, 11 Dec 2017 05:36:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=e/t3t5m7oKb8/WO7hAMe+CRLEnSyf95hnbi9EvR7+Y8=; b=JiXhgdNJ6MZveK Ygua3p7bzX+pzwxL+UL7L5r9pcijiJYixelhC9FA+kYmwbd3ZRpyPVdceP4R2pV125bdDQzX04PPI 60B3Yex0d1cxDuh2xDTJZA67m7swx/jjn+gFzNNl6gsZIj5aq98gmFnLzpBsW4pNZl0+oeJ7Jt/z8 x3S0N5UwczEFaHhD9ZUi/ekewdeCMMDhsrQOU3OGlFtdo6G69tTLRENS1N6EOoonO68UGIJWQNXbR uUewmF38atYDc19riCyYy+BwkDuibrKYIq9RYviIBdm6fuduQqSfXfIZYF+/8byts9pjgqsjKqiJo QFP2jW+sldAp7ZoYMnOA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eOGl2-00089n-Ex; Mon, 11 Dec 2017 05:36:04 +0000 Received: from mail-sn1nam01on0050.outbound.protection.outlook.com ([104.47.32.50] helo=NAM01-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eOGje-0005Ss-TT for linux-arm-kernel@lists.infradead.org; Mon, 11 Dec 2017 05:34:45 +0000 Received: from BN3PR03CA0090.namprd03.prod.outlook.com (2a01:111:e400:7a4d::50) by BN1PR0301MB0723.namprd03.prod.outlook.com (2a01:111:e400:4c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Mon, 11 Dec 2017 05:34:14 +0000 Received: from BN1AFFO11OLC003.protection.gbl (2a01:111:f400:7c10::153) by BN3PR03CA0090.outlook.office365.com (2a01:111:e400:7a4d::50) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Mon, 11 Dec 2017 05:34:14 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11OLC003.mail.protection.outlook.com (10.58.53.74) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Mon, 11 Dec 2017 05:34:09 +0000 Received: from VirtualBox.ap.freescale.net ([10.232.132.175]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBB5Y9kg009931; Sun, 10 Dec 2017 22:34:10 -0700 From: Prabhakar Kushwaha To: Subject: [PATCH] arch/arm64: elfcorehdr should be the first allocation Date: Mon, 11 Dec 2017 11:03:32 +0530 Message-ID: <1512970412-5472-1-git-send-email-prabhakar.kushwaha@nxp.com> X-Mailer: git-send-email 2.7.4 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131574440492826325; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(39860400002)(376002)(39380400002)(346002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(5660300001)(104016004)(6916009)(498600001)(6666003)(51416003)(305945005)(4326008)(86362001)(33646002)(85426001)(59450400001)(356003)(97736004)(8656006)(77096006)(106466001)(16586007)(316002)(105606002)(47776003)(48376002)(2351001)(54906003)(36756003)(53936002)(50226002)(2906002)(81156014)(8676002)(8936002)(81166006)(50466002)(68736007); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR0301MB0723; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11OLC003; 1:fNQUcMCVofPMErF4LQ/XwbYWh0YBq5okdmSUZRxFSUSe0Hs9aYoVhObpwd4ptS1j3tY+vaR4i44kgSBBwNu1kiJIeVWvaTNAB909BpEOrPijtKippyt+9z24OSzu8xQE MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a0c2e700-8ffb-4f45-7ed5-08d54058cd8f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4628075)(201703131517081)(2017052603307); SRVR:BN1PR0301MB0723; X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0723; 3:00kbcwC+v+MZ87G68kyzq6W6GKL9NJMs9CorBpSUkew2UTluBYauXR7pOYulDXvLwAQ4nBG5jIJJnU/iPPlFB8w0yIeLN5ipbCkWVCuCWOECOsp/SM5dEvpcjN4FgYUT4ldglnaMeisepqnWkTsZxYaeZwODyyx3GuKm96IkmXAhzbGIaI3IIXAts4Qh1Lp7dLLyMnv1Q7Jm/EpbKf+VPLidukHapZUYkv2CUdGE34aRrrzhGjKp4nCBxqb9r7ulWkBCF7IjTKI9figyUV80/EGx7a1FyrzmEaT8Fx5Tt7xou8xzsZa7SBo6og3T3KTkHO54lrudnC7XXa+dhhbjUfV+Q1omoLgEoLLLxw9P3OI=; 25:Iodyi4PEWpImgAYzPWjAwLDc1drV3QPR9wm21vJYB+B7kdzLH7eBpDCt0JSkVPMhHCYah2AAoFHIp2mAOIs12zDlWcXDUzOeU5XsH0PmszufPoiFNJRIEk8vJfzexwfIUopAXyqEEB0XBroQ0G77xcBDQnNFmPE2TY34rbvU8rshVRnYKldfWkVyuYFXyFU7kHz7On2BjBdddA72PbV3d/NungBj/er7INxXIJ/AUEFLXNbdakLLDPHCKWE7BHJJ+ieG5KHSIOd+Evvfx28xguUPD9iQW+1B1RZrWMAw/Rv8sWVzuQY+TtWoigvsUs9E1T4GjaROxYd0L526+8XEtqagR6j6svL7MVOMDookA10= X-MS-TrafficTypeDiagnostic: BN1PR0301MB0723: X-Microsoft-Exchange-Diagnostics: 1; BN1PR0301MB0723; 31:nkTFSjebH+c7aNrsPioVOX48j3wpCUrQZvsdv98U3EcU7gQrYNuKntNpOTz360nfe1bt1QFkr2hfHo1NLn66tQ0YZ1Ej/kvO6ZRdJncQ7uaON1ABo44kNAjlWc83LTaMGgXNOMbxk8cX95uPo1I3hr76GkAcA4NiO4HOICmG43z7Y+M0F1/r6I4eD88Emlg47qpglYkxlv35jckRV7DII1RI/Lsgzky7aNoyy6E0ViY=; 4:5A9NtTGh6IH8sna+LO5nEGurZjgw7/vTaZ1LwFk0LH1inoYy7oM39mJlJhZOvrpD62XAuI71UoR1K8h/S2W57J/YGVofTZJdPzW/j47wAfp5I2O7lytLmgIhNUCoDSWRvlo0rPtO3vXM+tgKhKDGZn/XBZPLJ8P46TzX1fciprPVTdXDnB4wXq3pIgbSJTICBxi7kG0TMawcaTBGMxXkS8BSrGlYTa+uKJlj+oRtNL4ooUucq08tI3La5b6N6QlRMLVNmM4SH0Yo4NJo/StUcxIFgj3HJw9GlhYM3uYCC0cSpgBFLIDjlLbF4IuGMLiJ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(3231022)(6055026)(6096035)(20161123565025)(20161123556025)(20161123561025)(20161123563025)(20161123559100)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(201708071742011); SRVR:BN1PR0301MB0723; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN1PR0301MB0723; X-Forefront-PRVS: 0518EEFB48 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR0301MB0723; 23:zIbP22702TPAd121ej01FgNKP4pDkeTORvyiwzZ?= =?us-ascii?Q?660JtAbJb+/HoCxhyBnKf3CvGOoYS0UaXCApwgMVVgIheV/RB89aayf02hiN?= =?us-ascii?Q?XHs4fyzXzfESppx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: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2017 05:34:09.1110 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a0c2e700-8ffb-4f45-7ed5-08d54058cd8f X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR0301MB0723 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171210_213440_319628_6F449587 X-CRM114-Status: GOOD ( 12.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Poonam Aggrwal , takahiro.akashi@linaro.org, Guanhua , james.morse@arm.com, Abhimanyu Saini Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Abhimanyu Saini elfcorehdr_addr is assigned by kexec-utils and device tree of dump kernel is fixed in chosen node with parameter "linux,elfcorehdr". So, memory should be first reserved for elfcorehdr, otherwise overlaps may happen with other memory allocations which were done before the allocation of elcorehdr in the crash kernel Signed-off-by: Guanhua Signed-off-by: Poonam Aggrwal Signed-off-by: Abhimanyu Saini --- arch/arm64/mm/init.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 5960bef0170d..551048cfcfff 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -453,6 +453,10 @@ void __init arm64_memblock_init(void) * Register the kernel text, kernel data, initrd, and initial * pagetables with memblock. */ + + /* make this the first reservation so that there are no chances of + * overlap */ + reserve_elfcorehdr(); memblock_reserve(__pa_symbol(_text), _end - _text); #ifdef CONFIG_BLK_DEV_INITRD if (initrd_start) { @@ -474,8 +478,6 @@ void __init arm64_memblock_init(void) reserve_crashkernel(); - reserve_elfcorehdr(); - dma_contiguous_reserve(arm64_dma_phys_limit); memblock_allow_resize();