Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932248AbcLBHMb (ORCPT ); Fri, 2 Dec 2016 02:12:31 -0500 Received: from mail-bl2nam02on0087.outbound.protection.outlook.com ([104.47.38.87]:60192 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752385AbcLBHM2 (ORCPT ); Fri, 2 Dec 2016 02:12:28 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Robert.Richter@cavium.com; Date: Fri, 2 Dec 2016 08:11:57 +0100 From: Robert Richter To: James Morse CC: Will Deacon , Catalin Marinas , Ard Biesheuvel , David Daney , Mark Rutland , Hanjun Guo , , Subject: Re: [PATCH v2] arm64: mm: Fix memmap to be initialized for the entire section Message-ID: <20161202071157.GQ2213@rric.localdomain> References: <1480530091-1092-1-git-send-email-rrichter@cavium.com> <20161201164538.GB1236@arm.com> <58405D5F.90805@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <58405D5F.90805@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [92.229.95.210] X-ClientProxiedBy: DB5PR10CA0034.EURPRD10.PROD.OUTLOOK.COM (10.165.4.172) To BY2PR07MB2341.namprd07.prod.outlook.com (10.166.114.143) X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB2341;2:ZS17YzK6YYjk6w/jtPSlbilCAYfnLMuaVpwmre6/cPeKTCOAtGVAl59MLUfKa9gIWGedbitzlMlxF3sHRSLAYf5dbtLH5lOqq1PrqzoO8wkieXdlm0dVzFjNxUZfaPNG/vEm0ktWoUnjR1SPnJ1dmbFNn7RN3ZeT6W5Q1NcPkJU=;3:j8l22NpQaEsOApzmrMLVh43Ao1M7DKNDREpk8VqLFv10opN4c7h/3PgXHF7V5FzrsA13kNDOZfJcT6dnwl5BZ+qlUlI1CfUaSzFrYOj/4qUzAuvtUi+q9SZgrDh5D5Y9JVa0REUfFG/KTHz5GSgzohi9mNWbcPSUOouzBLx+PR4= X-MS-Office365-Filtering-Correlation-Id: ea0dddb0-a2f6-4cad-dc39-08d41a828e34 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BY2PR07MB2341; X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB2341;25:+pOjYwcaTXN+/x6MTYSqMB+sxECqGoDSozhPOYpTtDlM4bU4ZzipseufWMdsd+8X6u2KRm9V6v50HdwetdB+J3kWQk2MvNCjiUunlfGbMk9ESh89edmOQ6GcVnBlj6l9neNvrgTEsa+hS9hAQjbAw/zyp76wmU8nyQqxy1tvjdmMQrwft/f2f0OoW2NDbqvpnGItuETWcq/VWtqGl6NZc9/fxmDLmmiwSmHDHusND10yHH0lXKgCzB0OjKfLZM/24KWyqX4BWhEyWAiqYHFOpKETYnLV0VPxSRkcBFxagfWh0ph4qKyHtcGEsls/VMZp0yuiK5aFHT0vOgX4I3ZKbzsR/jI/8SGcEn4mvnXkNz9gcWcfKfg3OuscfbZpcZTdplC3M7WDaMIpz4LQ5ohnW6tfHUpCf9QgqoDLbAm5DZX0bxEBA1TZXLTu9SxKF1enJC23ZQ2F/QEw/UyIKs0qmvgCvPLRq9Qb6WH/CmeFF0LmKSLdtJgTEsZ255BJp6acsT3JyPoyqv9PaU9GnPPyV3h0oJrlEPscgVRoyesDLmUfZ83wIlUiW2PgC5uj3PD3kY11eqTxXGqT859ojfmCQWbdZUy5C4q9Daq+r5vB6S0qBhk0gworFzDM4DVkRO7L450XKE+FqPmIOiVBCA30o8cubbpAjwh3i38odX+orPa9RmPcfKaAroUNIF9Al7GVWRH761amRskGZCLiWXqFbwlSLGtdTCs9zthPPpfayn8G42w+lvEu49JNDmpQ41T+ X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB2341;31:OYS41X862d0HhGjozv58WoFvec+ExMBG+fs5sAyfNJD7egMpZMSl7a1J3joGkZsUM0+6toVOboDlkzyYQ4Qbqz8tR4AUhBAkY3dJmGl8nd2TLlT2alqxrAbGnfl6v+z5yFhMuDcmVnS82nUh/9hkePH4Z//kMY42EqN9wqOkw0hHbYXPnKaLXuRn5s1rMgrtCTNrL1PDFbL0+4a40bsngbR45ky4l3Xg2xWN9wvKZWH+/zLuGl0fD8WnBX+uqgLodZpt8GQNCRM5nHm9h0SxGQ==;20:baTHYw4FaJ34e2MNoPxD4Xse0kW2mlOAXCnlc72xJRokx8oAU3s2OTNF94Tfqb5MImL9O5knpM9uvZd2yQw+S3+Eg+qcigl42gmeT9tiNJREdJ9idrWA6HMb5UO/T+jbt4qME67Lw2UJoJspI/bavnV3fSw9/rn2hKmMiQNubthcRsLpWao8BLGOdx9CiwA1eeMfYIh1TAa1971na1hJNOaJJece6XU+MsOW9PsgFt/IHQi04A5mYflG1PngnC2VRzHpT+CrIKHw1mVNm/geXAMW3AIJW06+Er7/SIDduq8XSs2R2WbHhgRRjBzO0NzYIYqaDT9PKSS6lRoG1mf9AgxxuA4tej2TcOeAqv391vz90CLZCRSHxnMz2x4bUR8hW3ZrOR3ZUcJiUhE/ROMxBT9/BJnbXQq1HG0jJZ+mNOaUXzs5PSxSuu9J7GZZUBnA7VJLTm5eTYaIGFXE3hJKBGdCrG+QJLlsKmSAK/gEj8Ats+TtVV14p+k0ZXhHZ+7C X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123560025)(20161123555025)(20161123562025)(20161123564025)(6072148);SRVR:BY2PR07MB2341;BCL:0;PCL:0;RULEID:;SRVR:BY2PR07MB2341; X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB2341;4:Ac48XEP/cSS2adVkRATMspN7ORj2eUfV97qgF5vnAaM2QcYaW5tSCDcPbuUjqqu3hIrSl2CpaqAUzy9DL+0Y/x3KmmGKXNgDfcfxIKEE6tXaym3CrQmUHlC/Z6Ga+Qu8Y5n1kaMmATETCdv5c8OBPbjPDfqHcs5hPCimR8uD9cVEpdJB8PrFAK0vW6uZNhOnv92WDEwL2OSk72+qbDNM0SpjTMm17JZfOOQtFTA023C1rACXg/sduN3x4h2zuXbRLx1a7du7UhAEm8AvTVh/FIgDS1GrIxDc74MW85/bdRgn2CQ+vNLopCJOE05dAmvMe9rRuxe7Jxwjefxch+F08U1sUNO3ohgigpVtmsgrUcBLfOuyIxuEnayCJkJ04/kqmxLqDi6ohgALy3mDmRRTlbDxjRLx/R60qMfA6Sh0CRb9pKwgyKswJQ8gqCbD7IzW1YPe+m8LRZFq2r6PnDB5IrmLE3AoNSIvQdwDweL46GDYwT7t83xsWy+3tfRnBM+renh0GDWq2AXYLILm+harI9OY+1uGjQXvsDVZqPoob8kVhp8yjplyxaxAN6t/fTi+SSBTVzTdVAQirXqF+bp75Q== X-Forefront-PRVS: 0144B30E41 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(7916002)(189002)(57704003)(24454002)(199003)(38730400001)(42186005)(97756001)(7736002)(1076002)(68736007)(54356999)(101416001)(229853002)(6506004)(76176999)(39410400001)(2906002)(4326007)(23726003)(39450400002)(7846002)(47776003)(66066001)(50986999)(733004)(97736004)(33656002)(92566002)(105586002)(3846002)(106356001)(86362001)(6116002)(4001350100001)(9686002)(189998001)(81166006)(305945005)(83506001)(110136003)(81156014)(50466002)(8676002)(46406003)(2950100002)(6666003)(6916009)(5660300001)(18370500001);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2PR07MB2341;H:rric.localdomain;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR07MB2341;23:s5Nok9EeJ7vrmKyNURp3qAemog1uprC8PDVuugSif?= =?us-ascii?Q?NekzYKle9C6xXFWGgwfGk0D1gjJrDkX3ta5gFausKE/4sh8/ozb1vK+xaLcg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znyjSeTmNRVllzDjdBt0/1UJhM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB2341;7:W6F2NF6DUg/EM+c4QGyKIcsRlvdmDFGNnhg/iU27DTawkfUKylu7JcBtA1lyoN8jrdAjn8Oy5cDDqiQcnbNByPplNSQbMEa54WLLBrUR7Ybi2GESF/fLedVheLzPkH7peqaic1F/gMzhDq3/xxV3vIK9dZ9MvcVfK8DumQ3+VYerJfx7CkEPIjKiGA+HimQIH/NKDYhCz4ek6EyqKDfapxFpDO81cGVRwuthSAfjQ2C9RyCXxBUZ7oj/WQx5qZaS6lCzuI/YEI32QnV935nWs5jszArS00oHdwZ6GRd5/ZQavIpCTzV6hK9q7XV+h6QtmLQzhznOgKKPaQtWMVWOMTIqlLUDxct/ytPQB8xf0sI= X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2016 07:12:17.7894 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR07MB2341 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1441 Lines: 34 James, On 01.12.16 17:26:55, James Morse wrote: > On 01/12/16 16:45, Will Deacon wrote: > > Thanks for sending out the new patch. Whilst I'm still a bit worried about > > changing pfn_valid like this, I guess we'll just have to fix up any callers > > which suffer from this change. > > Hibernate's core code falls foul of this. This patch causes a panic when copying > memory to build the 'image'[0]. > saveable_page() in kernel/power/snapshot.c broadly assumes that pfn_valid() > pages can be accessed. > > Fortunately the core code exposes pfn_is_nosave() which we can extend to catch > 'nomap' pages, but only if they are also marked as PageReserved(). > > Are there any side-effects of marking all the nomap regions with > mark_page_reserved()? (it doesn't appear to be the case today). Reserving the page adds it to the memory management which is what we would like to avoid for NOMAP pages. I don't believe we should do this. Since NOMAP is to some degree now core functionality I would rather implement pfn_is_nomap() that defaults to pfn_is_valid() but calls memblock_is_nomap() for arm64 or does something equivalent. The question arises what to do with that mem at all. There could be mappings by the kernel, e.g. of acpi tables. We can't assume the mem regions still come out the same from the BIOS during resume. Do we need to save the mem? I can't answer that as I don't know much about hibernation yet. Thanks, -Robert