Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965586AbcKXN6K (ORCPT ); Thu, 24 Nov 2016 08:58:10 -0500 Received: from mail-by2nam03on0067.outbound.protection.outlook.com ([104.47.42.67]:43040 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965266AbcKXN6G (ORCPT ); Thu, 24 Nov 2016 08:58:06 -0500 X-Greylist: delayed 58152 seconds by postgrey-1.27 at vger.kernel.org; Thu, 24 Nov 2016 08:58:06 EST Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Robert.Richter@cavium.com; Date: Thu, 24 Nov 2016 14:42:38 +0100 From: Robert Richter To: Ard Biesheuvel CC: Will Deacon , Robert Richter , Mark Rutland , Catalin Marinas , David Daney , Hanjun Guo , "linux-arm-kernel@lists.infradead.org" , "linux-efi@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] arm64: mm: Fix memmap to be initialized for the entire section Message-ID: <20161124134238.GI10776@rric.localdomain> References: <20161017185801.GT25086@rric.localdomain> <20161027160136.GD24290@arm.com> <20161028091905.GM22012@rric.localdomain> <20161107210514.GP20591@arm.com> <20161109195132.GZ22012@rric.localdomain> <20161117142528.GJ22855@arm.com> <20161117151805.GJ2151@rric.localdomain> <20161123211538.GH10776@rric.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [92.229.88.216] X-ClientProxiedBy: HE1PR0801CA0012.eurprd08.prod.outlook.com (10.167.184.22) To BL2PR07MB2339.namprd07.prod.outlook.com (10.167.101.17) X-Microsoft-Exchange-Diagnostics: 1;BL2PR07MB2339;2:hhkTM7onvSC02YxVP2H/RFSMw+kRmnqaRRHD8LOOLgPB5Kp8z4oFsv9vJ3WsDmK6ERcEyCtxAqA05BTiUm3a5ZHZHvmTT0K0zVtYXShbKoq0JYmGIi6hcSbgf4Sg7ajHLBgP/jQC9X6B+LJC/5viUv4ddH5gBw3TTZ0Ge0nTY78=;3:UsPG2VF7lEmqcq58NJ2/DVkeEEAK9ux9sYIKTCahx2DiLR3x0qT1q5kBGhQ4/d6dIV/l0Fe9wWubKFxMqDEGymh2ij0gwTh5/Bab1nS5jfS7kssoE6RAlrEL7FuqfFCnwNSXlHXgN/RxBc7H/8kOhq1/osdWTmd4y5auHCr/Kao= X-MS-Office365-Filtering-Correlation-Id: 73e079be-5cfc-44e2-cf83-08d4146fcbce X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BL2PR07MB2339; X-Microsoft-Exchange-Diagnostics: 1;BL2PR07MB2339;25:JV450kKL4GXazGWfooxs80tSo6zTDvyIspJEUrTvDPhKedbPN7s2WOc/ZZu2GMObV7N2NBewfU2ASkRxpea+tHt9IJLSI+if/V0+vpiIUygJIFKCGmAKDKjtPLtruFaFdlHbu2coJhtEEMxLBQ7ensTXf7PNSvk7qENvcrpfaYPaoG3EGw3GswG7NdGfOblWPPlJ66dHNDkCOOdNVnbQYjf86+TbkdzyzeN9RzC0j9DYShcXAj4UGodctiHiHqwV0mVITHwaBfR3FxwRhvZxrTdV7Yk7Y3QxG36BTISOZXI5VghDnaLWddq31CWI5GfbLHGhn8isr4gh7ppdSQ/U2QDL9OQUlXCsCOqt1yrzvoDAidcZtZLW7pAj2+VY0o/Uv1f9bHln24z1TlSTVnH8yIqW0/DUDsA4olQtHQD9QAhoBwnZHTgRo6fwFM8zJn/T+rpdapWOvp2DTjpdwHvFYOIIUffbofNM/pAVKjdoKOjszrLeUUzoL1ym/ABpp6eynkquUlRnW0iFs4OkEmgW61rdzQai1xxzsDbjsZoC+pP11GkWrpLq6wsFmTNdHslM8L6xaVrishc8Uk28j6trNgGCUtGuB0b84axpJ+64PLlyYx1JPiPyotoors5S9jUKte8KfbK6nmTYAKb8lqZd5qCJXoqbrJSCc22Xsc1iml9tfgQoMpu/n2wsGx4mQzH2hNCvlogY8NHbay2OIKmeyI+yfKTVhWygezgf3S6wUvMC2PRYTsHoYKHEZNy6Yr3+ X-Microsoft-Exchange-Diagnostics: 1;BL2PR07MB2339;31:68kYBhZUvscvRatNNvDp1o+Ej3wuu1Hty9nSnnK6+ZLSpE/86FgQenq7uaM2tYa2XSWkGzFmEQ23M8ay6DpARW4SSaXkbAE0mZ3pHHCPrxN9ifuJacUH9r0kzCjE7OBQS1yRgapxtVr7E3sQFB5/VmrH+YdfOm3cVLQvB7P2Wf2R8kM7PMQhnI5grohqMQVg0y2ns63sCGCppJnZigeL6qgH/SMSMVDRZgFY78rWw83UP/AqZ4zYFtOYL6sRVmC6fKI908tPUyiUslR+4oOzSQ==;20:ZBVrF/OQ0zs47n6l8BHFl4yacVgeX9gQ3E3NAsCzSCQDTY0QQVXYcjdtFyg2/sS8+5pX7LdB+PwUsCELEZ2Y5CIwhdwBYCPy0bNN7b/ImZisd74L7i+fUviEc2vbsPJ2RnrvxB4wf0gy5I/047+cW0Nw/eyRBrGQu9LFZBLV2r4E8DS7q+YLkeAVsCvqSKs74gHEQ5nnngJ+n0Yrm6NPTYhLq4HZG2KSOcQ/1VSiL0S2uPgc+NQ8OtCVxmQRIWKwohQoaO5/XaOUZB7L8EpCZALl/ggS9oq8IprkUi7zN4VO4VvgjuCq+mVw4W0yb4aHvRC6D1LjnKX8sduiZ93nvK6nlVutZSO+QDTof42RmK9Q8/ocNeHroilUxv00YymMSLy76EZoNvZYuFVaOxtG2f8ZPlVsL0MNHsy5CcfU458hnU5iAQIQPve0tELW9yuXhxAtrOt1TB42te8NdbqioLoDpkiCu7FQ8pcGXM9IWfiAZBzKgbG0Go+BnFUfKVEx X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6060326)(6045199)(6040361)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(6061324)(20161123564025)(20161123562025)(20161123555025)(20161123558021)(20161123560025);SRVR:BL2PR07MB2339;BCL:0;PCL:0;RULEID:;SRVR:BL2PR07MB2339; X-Microsoft-Exchange-Diagnostics: 1;BL2PR07MB2339;4:3Tah2rSNZQpkebaTMkkm3mBzUYG/1AKUpc5kLuK7+e52envFujPDrliMvAJEctqQr6csauFXQvcRMEtOdXhF/oDgoSfK7JPMYm4cB+Mhic2moBzDe+bs7WcnMvHckD/5oukA1aiVYTMsaQ1+JLXT5lVP7jwJk9EeWgAGvqb5Rev4fZ8yraFih8phlkAeNz8LmhK3z39uwJO5Z5m9R7ICf92/xGEe1p5aTLBq5wP5Yl6kJYhar2Sa2JrCbqIQ7Dvg0EU0dMIPeT0GmlbYl2mzv/B5AbxLg1UAhUi+mco6tDGm47Aygs3IpbVhzAMlp06IZ387Hs2nh8Um11S+ZXSIQxCOXQnIkO6R/BbQ4EVGBL3EtVzoF1YYfppcQlFjrLiO1EsaQyOKZAiiWC2oXGvF0OMbkzNAn05qVUbDsT05HR5smr5UqrmygRVL+EJWtgpqpvGvYV0sXxLoV7dxCeTuyguFqwejI/n38O4A26ydX7xOZ5yd/aeXmey1NdAGcV/vfn2IyIUc1bdDqig37Z2+3nkEKvWWIK15MSZByugC1NyQT+6zE3nwEhyDRWom7bDEqxPIxxkDRiImZRWiWBY5Q6ufD+phJQdUphtA8wkMbxvmJr7kShTpSIPdDZ9QvvKuWnAtpaBiYmF5GSAbvdobRw== X-Forefront-PRVS: 0136C1DDA4 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(7916002)(199003)(24454002)(189002)(8676002)(76176999)(54356999)(77096005)(97736004)(189998001)(97756001)(305945005)(33656002)(7846002)(101416001)(47776003)(3846002)(6116002)(66066001)(39390400001)(39400400001)(7736002)(1076002)(81156014)(38730400001)(2950100002)(4001350100001)(6916009)(81166006)(23726003)(50466002)(93886004)(50986999)(86362001)(6666003)(110136003)(9686002)(106356001)(39410400001)(92566002)(39380400001)(105586002)(42186005)(68736007)(83506001)(2906002)(5660300001)(46406003)(229853002)(4326007)(18370500001);DIR:OUT;SFP:1101;SCL:1;SRVR:BL2PR07MB2339;H:rric.localdomain;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BL2PR07MB2339;23:2uieBd1RXehjgpV9lstZOMRGbFHMYIVgMxn+wL5Uz?= =?us-ascii?Q?w1UTokILxB9t9K7pRYI11yF3PFwhUpCFNWaEwD1m/Zf3SFVSpdBIu50SwhPb?= =?us-ascii?Q?ABnTgu1p3D4pkcU+6tBNOIE1/y5PlFqOdu2t5sjprqq7Y1f5ryF7CSPp//Ok?= =?us-ascii?Q?QneuSk1huFn0Yd+dCLLZye1g4TRuSLEjqqDHtSQbDGjGMU7D4iBOzZynTD1a?= =?us-ascii?Q?t8joZqMTzJRSgqngt2thUpr4pq6dX6PksM5kZbPYFVmeDB5J3OswSSc42BNf?= =?us-ascii?Q?cXAacW2nIrD1xUW/Nv5ImamEeJ9qAMvw6p3IL9xblWh0JuDfCKgSYyaqBorv?= =?us-ascii?Q?heqT/693TwHGvDeDdD3o8wACdpdrhOjiOeeaSEEjdPsy6Wib+r7suvgw47lw?= =?us-ascii?Q?OOImr8dYYpBlx9I5Hujyv8PjoNG9XebmgAd9LP7E3m/wSV/9xNwRBT8nBZCj?= =?us-ascii?Q?L8yk7smsdV23v4pdj3v2uVyTIpQ3J9Jf/Tawyzh1EL522gUy16RYqWVvoUAm?= =?us-ascii?Q?NPKgz14vxSahUHkw0ttU8HUuEwCNhdKcJly7UmjqYM3V9yiUTZU7pc6XtGUa?= =?us-ascii?Q?60MIB3yzwmiQo8lMUA4zKwMFyO5mDqX2wEmzgnafFXiM03a9/54G3QwtSvCH?= =?us-ascii?Q?fvCftDHV7uUayI7R3oqaYyhEJ46i2Ji+3E43Nw50PkvVEu6Hqr5b92byzL4/?= =?us-ascii?Q?7Kyit7DPjgFPGbJ7Cc9fagyePt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VyAYGkbZamatdgJBZsZcnnyzxhETTMS8QsLQj9iz2kS+bD+zPzCObgpNRGQhBLrZIiMlpkRfTAhKuCCQCs=;5:J1ReoJUF3YKod7wodNGHDDHyFBpK8UiPlIPsJ8mxbPC9irK8/oTOiw1w/uTPQGqOWvqZKB7v/Ubz4XkQiM+LSZcsSIyFRuVwCiDzbz+T4AsBgeyTZGu9/b/WMmV4gTf1WpgTdFKJ1LdgaMpr3B8GPeIUhZAZfiP5xwD8e/iio2o=;24:MqBGsJqvWgf0sOvgdVtu1PG8Ju8q2qR3TRCxF0UCHVaUr4JZOVX69lTBy7X/3KPPgwLGPUIByRREl8MNs5V55RaK+BEU5n8RHciPqYTG+B4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BL2PR07MB2339;7:kWReBnExyp2srGbsCmCO+9ppR1gZ/CSVfLePVim8mIN4N3sMusJi9iIgkOh9s34ibrn53gzxlkEolNhI1T5kAEIRlFHDLgErx5mhAgTwnHBIHkwRcHAQnmzjLg274LauuW4bDlPx4FwLlCpuVIZ5cUWO/4N8Mz42zjAqjshJq2KvrNVWGEXraOv/Iqcw7gG2X/zRVjbWKqDG3fY8yYwpNa6k7Mrk3aZLbf8SycIdDr1kfH7NH48k5B8Bsa9fEjRsh5GuWvk3Qani6XMvw12SEjBgEH7ku/qUA1v3ufFN2qNG3eIDeRvOa+OG8kpQbXrydKVh/xQTilE+I8HbSF7IAi0rwALtX7l/FMe0VN74so0= X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Nov 2016 13:42:53.8459 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR07MB2339 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1340 Lines: 30 On 23.11.16 21:25:06, Ard Biesheuvel wrote: > Why? MEMREMAP_WB is used often, among other things for mapping > firmware tables, which are marked as NOMAP, so in these cases, the > linear address is not mapped. If fw tables are mapped wb, that is wrong and needs a separate fix. > > If you think pfn_valid() is wrong here, I am happy to send a patch > > that fixes this by using page_is_ram(). In any case, the worst case > > that may happen is to behave the same as v4.4, we might fix then the > > wrong use of pfn_valid() where it is not correctly used to check for > > ram. > > > > page_is_ram() uses string comparisons to look for regions called > 'System RAM'. Is that something we can tolerate for each pfn_valid() > calll? > > Perhaps the solution is to reimplement page_is_ram() for arm64 using > memblock_is_memory() instead, But that still means we need to modify > the generic memremap() code first to switch to it before changing the > arm64 implementation of pfn_valid No, that's not the solution. pfn_valid() should just check if there is a valid struct page, as other archs do. And if there is a mis-use of pfn_valid() to check for ram, only that calls should be fixed to use page_is_ram(), however this is implemented, or something appropriate. But I don't see any problematic code, and if so, I will fix that. -Robert