From patchwork Fri Jun 24 03:13:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Chen X-Patchwork-Id: 9196479 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 3872B60871 for ; Fri, 24 Jun 2016 03:18:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 29DD528452 for ; Fri, 24 Jun 2016 03:18:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E69428482; Fri, 24 Jun 2016 03:18:05 +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.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9A10628452 for ; Fri, 24 Jun 2016 03:18:04 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bGHak-0002SH-Hb; Fri, 24 Jun 2016 03:15:38 +0000 Received: from eu-smtp-delivery-143.mimecast.com ([146.101.78.143]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bGHah-0002MF-Jo for linux-arm-kernel@lists.infradead.org; Fri, 24 Jun 2016 03:15:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=jScAZVj5MQ13OUOf2mwMZMxS/A86kOC7iMxIbjoT2O4=; b=MonCpjp6WbRxjb9VEPk7aNWIRYLxpAIgd1P7ZdUPCo1/kYi6sLWmlwCkU19j4ufsVQTlFjmwbTRDLoo5YezU0kgjJwrxOBybUkiPvwJ5QlAA6PozfZ3GXeRbSgp50PHNVIeFSqjGpuvd4AQyPJirqCmlFhwnLyELKXmezNre4Gc= Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01lp0244.outbound.protection.outlook.com [213.199.154.244]) (Using TLS) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-19-3nVgchCSOO6_ZOkGnhiutQ-1; Fri, 24 Jun 2016 04:15:13 +0100 Received: from AM3PR08CA0080.eurprd08.prod.outlook.com (10.163.23.176) by AM5PR0801MB1362.eurprd08.prod.outlook.com (10.167.217.16) with Microsoft SMTP Server (TLS) id 15.1.523.12; Fri, 24 Jun 2016 03:15:10 +0000 Received: from DB3FFO11FD035.protection.gbl (2a01:111:f400:7e04::153) by AM3PR08CA0080.outlook.office365.com (2a01:111:e400:8854::48) with Microsoft SMTP Server (TLS) id 15.1.523.12 via Frontend Transport; Fri, 24 Jun 2016 03:15:11 +0000 Received: from nebula.arm.com (217.140.96.140) by DB3FFO11FD035.mail.protection.outlook.com (10.47.217.66) with Microsoft SMTP Server (TLS) id 15.1.517.7 via Frontend Transport; Fri, 24 Jun 2016 03:15:10 +0000 Received: from dennis-ws.asiapac.arm.com (10.1.2.79) by mail.arm.com (10.1.105.66) with Microsoft SMTP Server id 14.3.294.0; Fri, 24 Jun 2016 04:14:37 +0100 From: Dennis Chen To: Subject: [PATCH v2 2/2] arm64:acpi Fix the acpi alignment exeception when 'mem=' specified Date: Fri, 24 Jun 2016 11:13:47 +0800 Message-ID: <1466738027-15066-2-git-send-email-dennis.chen@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1466738027-15066-1-git-send-email-dennis.chen@arm.com> References: <1466738027-15066-1-git-send-email-dennis.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:217.140.96.140; IPV:CAL; SCL:-1; CTRY:GB; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(438002)(199003)(189002)(575784001)(86362001)(356003)(92566002)(2906002)(48376002)(50466002)(87936001)(19580405001)(8936002)(4326007)(8676002)(50986999)(110136002)(246002)(19580395003)(76176999)(189998001)(106466001)(6806005)(104016004)(26826002)(47776003)(77096005)(2950100001)(2351001)(7696003)(7846002)(50226002)(5003600100003)(33646002)(36756003)(586003)(305945005)(229853001)(5003940100001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0801MB1362; H:nebula.arm.com; FPR:; SPF:Pass; PTR:fw-tnat.cambridge.arm.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD035; 1:4nE2HMPvcVfEMqEUqqWwSc1vKe7QRiZu1D7op46tOzViV/KTm7j5UkQWxS6mnZxLmsBhUV/Cjp7d1RkDByjvt3y6QjfxH1qbUHjDOkHO3rEVMhZ98A/F8w3WmMoxjxsm9/7LL0k4RtJ47hLLmY6rxQPd6cZqUsQY4X3sT0s44hVZ0KgQ9OCmct0DaQCR+i7WjS+xOyHD56EwWhJGlUSljcxBs2YudlgVFgksi+0Dy1pxANTRTbIZMXyfPloqoRj3W+gDCz4DXPd8Wb7VabgAzjZr56c4+llng4GrXhXHlsMJDWNXrNNWSULXQrzDMx5x3mYPcg53NyxAyPu4YWQ9koQ0vaH3K5lf7ZwB3HiyzU1UTwwq4oPIKkfGVH8ZmqD/Y/bTkNZ41i4Vw6l5b2hhFmz2/J5Byo1iUBT9T0F/ZAu3uCQNpKkBVkcfOsc+yyf/ZgC/YlwN7zYGk3H1sJQIqpvTrP/JIWD5dNXZNe05aTS9FAkn6YTeXQ7q7orNueoXXWjJKOZyordlDnxrP2fq//Koxl8EcWvanMqktAb3SpoQ+DrhW+oA3YdbiZJRVLSzhHMvAV6POoFelrrX/hf+MXCnyp73MfZqW/mUQ1IIWeg= X-MS-Office365-Filtering-Correlation-Id: 25c6a7fe-99a5-4423-102f-08d39bddc080 X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1362; 2:suxuHanYD8E1tk3pdUbvv8hEh+XeWf/qEA++YPv05T2YwtqGhQkxbLjS+5rkma5kIuvMDfx0mWmTAOGm87kake+lSWz8EkjlYiz5eocqN/4pkHRwjFT4FvzY4Tf1yp4M64gMe87ojvbjdG3w4cCXIX/73v58Bo44IPzHIUsUmzxVoaspzywvrAMljXqN2YRw; 3:8yFAaCXemvG/7RrRfr6/rAZIpoUE0Dz+3Y/FINMIWTlID2JRLBcuLnjZPOaUrrkN2wTctyoyirTMCaiXmUq506HjDKcwJR50IhrdC1C5HsLdcAPJfUeM9kAZ79ChRqN8LAG8x0LP6mDMDsPoJohKo6iwUzpJb4jGUr3D06MN3xAY8BZE6ZIBmZVY9z12vewGaasKD8ss0mTutfIzMC2tjBUPEE/OPVGv0cjjFo2MCfThLG4doWg5pZWUUTHepm3HstAwuTXqlzD4GUARqurS7A== X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:AM5PR0801MB1362; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1362; 25:fD2BWqWPZ8Xnkto23+rSlCN+47bbXVy68hsqg/HCEzQXnWOn9NA4yRY++ZZ+llZQyd5pCjIeZFZukctYR7/hl9+NbqxDU9t1FDrpz6ECMNu0BJIBTP/PEMHielyELR7yzH0cTZlkrAAYUnDpihVp3JrU2FHLGWLqpVg+3fSouzG0ZmoZ4oVGDISvObRrGFCYyx9xdEYugSqSiy+Dc3V0newbnI7yVGH2otZzEJYnJ5FzAeHuxZDu/jAd8K/bLBB88l+XXBfEpVzqY7mselWZkKZP4pkT+K8MSbSElZ4tM/Ok+u78jWcCqqVCeuA7OfeVkHvbRFoYmHylto2o44noSL9vIUfl70/7aaPZMv8EV7/qCU+Lbqz8MxJJ37EMvzFOdkMFnMwTcaCERd3uaQ8BANye2ISfPRmEki/j1OxW6r7JyRlXQImuHtg2fPJYBVo30q1zWkG2OiDWXDJrH/1zDtGes2zKjCeqMuvXDNg8z6mez+OI67IadScecYhv/6T5PMxk1nTxNMyayGIZmIghTP/wrpvp3VcAx+yJzKzPTuyJji4k11doCdDg79Km64jYpJDed9/XQmlVFvuWdl25j4m8i8fp3l0NPfWTqf25JKOW4+I+uOMGZ/DTcZx63Y/fklIZX58G6rUc8qy59bUpms4t7U4EB0W/NlNUEX15H0gKu0ymryx8TdmPO04siv2Lmh0/+xpGI68yUVlCBi8toMOIZDs01AC492Ysz1Bez50MoiDHzuEv3fgM8gay1Uq+HJT9rveJUIqvbFeu90HfVw== NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1362; 20:QtRl9r5oRL9PeEafI/Ocqt4YiDNWJAKXFHWKjwO7scabfqx5V6nE+AEGmYh9Xn8eau6HFSvzsssV4RuoW8DuGIJtiuzoo2KdKCIDSVL+vPjwx3BWWIeRpWCbpemGzOES4dLLe5GGvFKXwEJ/pJNAIBx40UhPjz5+oNvx+BqiUi70G/ZfCxPGRDrdF4am6HCVF5XGwclwZGK64ckibfWmc5Sj+xbIqVQl5O4np21uMIXYsvxACWAFMPhv7WVPnxyc; 4:kMvkpFDCr3Z481tP8BgtNhB3w9PvsXcZ2IbdbuGy+tpcUROjg2YVqJVRNLMxGOqc95mDlzSd3iBeAGNQx0IS358QUiijscKMdWefdwSj+ZkeijONhEOs92PvPjzqTbRpXd2ko4CrpBRhYboGCB1lY+dWz+VMgf0juEwRLKUSpDpLB3LkKIGkbLVqRYiJ4E/XFVQdgviYX2po8noAZyWYFYko/g6L2y9WNCpwgwraemc76pnAme3miYwD09NKIao92KfpkyUnNqZe1L4f9vyqxv6YdSBTpuAHcujrRggdsPUATrZ017DXiMBf0FXDxTu/SqELRJc7PNsqPA2FIoosgvsb39ZuLbl7/8lXZGdvmnjI1hZRiRstCCZNixgwtxe8OaDrqQtawHzhTWbLmkV60fJWo2Ra+Gu1BqCvVH2gldRjwVEvEnWHrKF1daP5nb9igBjYS9bwZAXFKrSguc/CoFTDZTlTmzZUtX4pbrsn2PldDofrxT7/sq1UwY/epXbZsYoREKbN7lCxoatw/xki1xzY/nwSLiYnOmULnO5vWvodtU6dGur2ZycAhGdGXxBi X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(9452136761055)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(13020025)(13024025)(13023025)(13013025)(3002001)(10201501046)(6055026); SRVR:AM5PR0801MB1362; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0801MB1362; X-Forefront-PRVS: 0983EAD6B2 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0801MB1362; 23:ECbKGu3pu8PSHFz1fQh/jfzhM0CJpOJnEN/EaER?= =?us-ascii?Q?c5+2rqFqjJERni2ygVekOpmBCfj642sc90P9foWqXrdFnYcY303qlcvKVf2j?= =?us-ascii?Q?71bTSyOXFt28FPW9q+3X6x4JiLemKUoGd5bUOohtgfphtlDNGvaI2+4R7lvn?= =?us-ascii?Q?RiYEMym0hX1OozQMtnxlghfEAS5+7Y5sJ2UFrZZpmFnxoQVftc3VV439myeD?= =?us-ascii?Q?/+5ZrAo882XYFMIjZ5uzT8hBpWZ1Qpq41KYXvTKJhXImo/DZjep0zxxpq+8/?= =?us-ascii?Q?63dWTiOCN9aA1FXU/k+kgZFgGzPSi7FZwK05hyFWSU2UwqCqwWU9mQBMmoVI?= =?us-ascii?Q?qmiCNj8f80qMkLS2XM7t8E2GfbZ6irA1U97lUBwQOxwWC23g5odiSLByN/a5?= =?us-ascii?Q?K5YS50i2j0NJHoH1JkqhA4dCUEDReMP6Xli1cDkymx0Q1+NrflAmWqPjbCnA?= =?us-ascii?Q?e0rb5DGt7OwqtoxwjBaasQobq6rihB2b/vk4dkDFV9GZr0SJH5mccGU9GNtB?= =?us-ascii?Q?cB4SaeDSWb6HYB0GS+83dB4bxU1U/fwFT270m3blwGELLyQbQf5NWw4xPzX7?= =?us-ascii?Q?feNe5exSrWTnQnReSMpSlgYo0n0sTe6ibs/eW2Gdo90r3QJg/fCewY1W6D31?= =?us-ascii?Q?XWpX8E4Yz+Hix2APJ0zFQ07UKz/5cHy0aouJZELcC1fWAd6WWKysnMWZgZKr?= =?us-ascii?Q?obwfnEd9uZ4DXhv5KBlsqyS4GmuarpebjDCjM61IvlZ1stliJP0W2K3PXgzI?= =?us-ascii?Q?f4HsREo80aoSe+WVMBDygd98wXFrLfTH4wexSPDJMLYiEg3Kj1tJklB8b9y/?= =?us-ascii?Q?9/GRKJXM+c0SPyH0Q1Cuv/Cckznx0z6Fbmp28E/ps28iy0u/c2N0EfekcGjH?= =?us-ascii?Q?0bssQDbUXCLyBsbL4YyTEsWxur0Lxy/BYBTppG5JfO6nQHvOy4CtpxxedVTR?= =?us-ascii?Q?6lLnHg6h5SIifnRCmkIdz14QbjjveTIbOsXuG18eY9w888HXZoHzmw6bhQGF?= =?us-ascii?Q?/jxJ5VJeAVO+G4gwwBZJvbZOaDTjVeyQbQwjVxDzdBsWGVjN7GyZH4/i/q3M?= =?us-ascii?Q?yGxS17u4=3D?= X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1362; 6:tv5ZsZgtx6a0V0iJKNS4qUX1g2IqKb9H3EdyVlG762buZhqEjaNQmzJJfIo+0kQr7CNo7KuV67NIxvMTHJnIxLRO6GRlDjuYyvHQrJgkl1+7LJMrrEK4M+Xod3tVaLya0XABCDV4q0VPWTvBC13G6AcUSsAAViPoFPVydS9Ubx/CJXmC+LJ/a39X4MKqsZ67uWS3ZyDwR/97ATKPUthjDepMvlaFsHCmEZalppzB6FBtrEx+PwFFs2ipTFkzj2/WWFMVMCkSB3JYESByzCafnvqKv70GYUytfH44wtyKAtShRVAFOSl5B9gZHcongYya3dRg7Hm2pYFzL/fHCwqp9j4M8oKrBAJG7b0Z3FSvlP0=; 5:ieSRtQ40bmFc83WAW9MkgMbKFGAZU3LP12aZbJMRMUHkHXrv8HmnuF9c5CuYTOJlsWOZvwP+oZYhZ/uiwaHJ01cwimrfbAONlINK6RmDuXlM0Kt6qd5O/Rq9wgw4dGhMt7ZoF8UzEKXvpCxtalhH/g==; 24:WXGy99Q0HuSryteD0vQA94Yo5a9JztL0QeTr/hW1ROBxVwLQZlG8sjE0gtxFVUb73/J6GP9xpWxrhH2TT2pCwbhVGx8RHTQPPdf+9tii4yo=; 7:eFPqscimGmUT7eZHXN0m8NDpbSOHos9pn2uxVeM3+nbmGSDwnp9PT2niPClJVr5/i7gcbRzd39v3p7Hgop3vgXDHXRul6BkjuGfNYPT/+UU2yXb08/iQYePJJ3S930MK1ZJCF9pCMwg5gUdkkRMqB1nAnHM67nf26yJMmehXQ0KXsZWUlnd2O8wF4Uk8tS+pgontcEQ3ipV7sjdDVdwVv5gnggBN0Q+GRtTT03lfHQdpb8yLp6f7CPq+80JlvOHgz++YnwP8ThZ/qGS8U83Z/g== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1362; 20:gJQGzS4MAR1eiXs55pguMaOrH+wkEIhAkbMpGFo1mwjRxP7kk/EtS2Q0ZfB/un3GUnSqGV1q9gYr9pbzJMtIZFba2xveT5w8r88v4B1wVylC+p9WUi9VlNvFX67A+lB4bYSzwqZk040a+33P+AQ2W6bhdKbjYB4tbjsH1XbN6vU= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jun 2016 03:15:10.6571 (UTC) X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[217.140.96.140]; Helo=[nebula.arm.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1362 X-MC-Unique: 3nVgchCSOO6_ZOkGnhiutQ-1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160623_201535_943556_5B2386B9 X-CRM114-Status: GOOD ( 14.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , "Rafael J . Wysocki" , linux-acpi@vger.kernel.org, Ard Biesheuvel , Matt Fleming , Catalin Marinas , Steve Capper , Will Deacon , linux-mm@kvack.org, linux-efi@vger.kernel.org, Dennis Chen , nd@arm.com 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 When booting an ACPI enabled kernel with 'mem=', probably the ACPI data regions loaded by firmware will beyond the limit of the memory, in this case we need to nomap the region above the limit while not removing it from memblock, because once region removed from memblock, the ACPI will think that region is not a normal memory and map it as device type memory accordingly. Since the ACPI core will produce non-alignment access when paring AML data stream, hence result in alignment fault upon the io mapped memory space. For example, below is an alignment exception observed on softIron board when booting the kernel with 'acpi=force mem=8G': ... [ 0.542475] Unable to handle kernel paging request at virtual address ffff0000080521e7 [ 0.550457] pgd = ffff000008aa0000 [ 0.553880] [ffff0000080521e7] *pgd=000000801fffe003, *pud=000000801fffd003, *pmd=000000801fffc003, *pte=00e80083ff1c1707 [ 0.564939] Internal error: Oops: 96000021 [#1] PREEMPT SMP [ 0.570553] Modules linked in: [ 0.573626] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.7.0-rc3-next-20160616+ #172 [ 0.581344] Hardware name: AMD Overdrive/Supercharger/Default string, BIOS ROD1001A 02/09/2016 [ 0.590025] task: ffff800001ef0000 ti: ffff800001ef8000 task.ti: ffff800001ef8000 [ 0.597571] PC is at acpi_ns_lookup+0x520/0x734 [ 0.602134] LR is at acpi_ns_lookup+0x4a4/0x734 [ 0.606693] pc : [] lr : [] pstate: 60000045 [ 0.614145] sp : ffff800001efb8b0 [ 0.617478] x29: ffff800001efb8c0 x28: 000000000000001b [ 0.622829] x27: 0000000000000001 x26: 0000000000000000 [ 0.628181] x25: ffff800001efb9e8 x24: ffff000008a10000 [ 0.633531] x23: 0000000000000001 x22: 0000000000000001 [ 0.638881] x21: ffff000008724000 x20: 000000000000001b [ 0.644230] x19: ffff0000080521e7 x18: 000000000000000d [ 0.649580] x17: 00000000000038ff x16: 0000000000000002 [ 0.654929] x15: 0000000000000007 x14: 0000000000007fff [ 0.660278] x13: ffffff0000000000 x12: 0000000000000018 [ 0.665627] x11: 000000001fffd200 x10: 00000000ffffff76 [ 0.670978] x9 : 000000000000005f x8 : ffff000008725fa8 [ 0.676328] x7 : ffff000008a8df70 x6 : ffff000008a8df70 [ 0.681679] x5 : ffff000008a8d000 x4 : 0000000000000010 [ 0.687027] x3 : 0000000000000010 x2 : 000000000000000c [ 0.692378] x1 : 0000000000000006 x0 : 0000000000000000 ... [ 1.262235] [] acpi_ns_lookup+0x520/0x734 [ 1.267845] [] acpi_ds_load1_begin_op+0x174/0x4fc [ 1.274156] [] acpi_ps_build_named_op+0xf8/0x220 [ 1.280380] [] acpi_ps_create_op+0x208/0x33c [ 1.286254] [] acpi_ps_parse_loop+0x204/0x838 [ 1.292215] [] acpi_ps_parse_aml+0x1bc/0x42c [ 1.298090] [] acpi_ns_one_complete_parse+0x1e8/0x22c [ 1.304753] [] acpi_ns_parse_table+0x8c/0x128 [ 1.310716] [] acpi_ns_load_table+0xc0/0x1e8 [ 1.316591] [] acpi_tb_load_namespace+0xf8/0x2e8 [ 1.322818] [] acpi_load_tables+0x7c/0x110 [ 1.328516] [] acpi_init+0x90/0x2c0 [ 1.333603] [] do_one_initcall+0x38/0x12c [ 1.339215] [] kernel_init_freeable+0x148/0x1ec [ 1.345353] [] kernel_init+0x10/0xec [ 1.350529] [] ret_from_fork+0x10/0x40 [ 1.355878] Code: b9009fbc 2a00037b 36380057 3219037b (b9400260) [ 1.362035] ---[ end trace 03381e5eb0a24de4 ]--- [ 1.366691] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b With 'efi=debug', we can see those ACPI regions loaded by firmware on that board as: [ 0.000000] efi: 0x0083ff1b5000-0x0083ff1c2fff [ACPI Reclaim Memory| | | | | | | | |WB|WT|WC|UC]* [ 0.000000] efi: 0x0083ff223000-0x0083ff224fff [ACPI Memory NVS | | | | | | | | |WB|WT|WC|UC]* This patch is trying to address the above issues by nomaping the region instead of removing it. Signed-off-by: Dennis Chen Cc: Catalin Marinas Cc: Steve Capper Cc: Ard Biesheuvel Cc: Will Deacon Cc: Mark Rutland Cc: Rafael J. Wysocki Cc: Matt Fleming Cc: linux-mm@kvack.org Cc: linux-acpi@vger.kernel.org Cc: linux-efi@vger.kernel.org --- Changes in v2: Update the commit message and remove the memblock_is_map_memory() check according to the suggestion from Mark Rutland. arch/arm64/mm/init.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index d45f862..6af2456 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -222,12 +222,13 @@ void __init arm64_memblock_init(void) /* * Apply the memory limit if it was set. Since the kernel may be loaded - * high up in memory, add back the kernel region that must be accessible - * via the linear mapping. + * in the memory regions above the limit, so we need to clear the + * MEMBLOCK_NOMAP flag of this region to make it can be accessible via + * the linear mapping. */ if (memory_limit != (phys_addr_t)ULLONG_MAX) { - memblock_enforce_memory_limit(memory_limit); - memblock_add(__pa(_text), (u64)(_end - _text)); + memblock_mem_limit_mark_nomap(memory_limit); + memblock_clear_nomap(__pa(_text), (u64)(_end - _text)); } if (IS_ENABLED(CONFIG_BLK_DEV_INITRD) && initrd_start) {