From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752376AbcHXDF6 (ORCPT ); Tue, 23 Aug 2016 23:05:58 -0400 Received: from mail-by2nam03on0132.outbound.protection.outlook.com ([104.47.42.132]:26220 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752444AbcHXDF4 (ORCPT ); Tue, 23 Aug 2016 23:05:56 -0400 X-Greylist: delayed 11078 seconds by postgrey-1.27 at vger.kernel.org; Tue, 23 Aug 2016 23:05:56 EDT From: "Kani, Toshimitsu" To: Dan Williams CC: "Mulumudi, Abhilash Kumar" , "linux-nvdimm@lists.01.org" , "ard.biesheuvel@linaro.org" , "linux-kernel@vger.kernel.org" , "akpm@linux-foundation.org" , "brian.starkey@arm.com" Subject: RE: [PATCH] memremap: Fix NULL pointer BUG in get_zone_device_page() Thread-Topic: [PATCH] memremap: Fix NULL pointer BUG in get_zone_device_page() Thread-Index: AQHR/W5ZePHh0bI7qkGTM3px2vEum6BXIayAgAAUw4CAAA1fgIAADk3A Date: Wed, 24 Aug 2016 01:29:56 +0000 Message-ID: References: <1471977800-12688-1-git-send-email-toshi.kani@hpe.com> <1471996023.1532.6.camel@hpe.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=toshi.kani@hpe.com; x-originating-ip: [174.51.38.138] x-ms-office365-filtering-correlation-id: 638bfec3-5206-46d3-9aed-08d3cbbe2839 x-microsoft-exchange-diagnostics: 1;CS1PR84MB0056;6:I6vnv8RGD1HQU85BaVLyLWH/eYDf03aKww547RvpVf+YXvthmu3UpPV7OcJvAzm3OCGKnxvwHgngGbM0rBSlGtOOO1iMQdR61W6mn+kWyIN7ShFU/YozV3riuQqr4MN5Ix8PIgRg7gazrmBB3U6U7mfrmJyZQsXyRGH9f3Rt2fK7/UhnZVN7Z/962Xf8qciJ3vm97WbNECUkeozxFpg+IW2t/Vu1cM9iGV9YNk5E25JABxYbCfL70l9P8/qQ6bMMRRQDbV7VqTVL4GhKvKMu8qbGJ+IRhQHhAJK9K2BqfVo6BmWrb403dqjeTchSwA14hI4LsT23mDzv5CvkNax/Ng==;5:vEhf1nX0bwauckkRQndXn3d0Xuo1GuXlZfhPVv8g39r3bCK1XDLHirQFcpi1oA7E/gb4kd6ZuY2ookk43F0I0N/klTiXpPOGC1VtsSV+z6Gxjv/JcMlOPnfIkrY/6QdGirULKUOEtClkokCgge72XA==;24:vYIzG7lCNcKeKcJYhcdLf1z6+VxOVlXGAtUSgfsZ/98ooOWLb4JdGmeate2YMzohj9L99cFQ/C3o+z9YAjeH4AV0370PH1R6GbpYYhfMSOE=;7:DsbvfxjW8ZGKbo7b0IEt+ECWKytX6JRkFk+4ihshtS9PmEwv/BLFeBxM0IzFOQugO23qU4sjGXGmWePQw9VEWJSG/baqFy3YDqSYI+DuwFX/ob+GEeQoN/6nOhEnAdjnYyJDvgRjrKI2yJOwo6StZrTNyK8HV3OaGkR2BcES0PoFbDdSoKPtyU8o2Wz6ST4Y1Sp4TdlrcMcvaG8D2mV4xsHMNSJyCS7K0rSIgYRL2papSb72AJG+bVipdjor7djK x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CS1PR84MB0056; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(227479698468861); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026);SRVR:CS1PR84MB0056;BCL:0;PCL:0;RULEID:;SRVR:CS1PR84MB0056; x-forefront-prvs: 0044C17179 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(199003)(189002)(377454003)(24454002)(377424004)(586003)(3280700002)(2950100001)(77096005)(19580405001)(87936001)(7696003)(106356001)(7736002)(2900100001)(74316002)(7846002)(305945005)(2906002)(33656002)(50986999)(86362001)(5660300001)(76176999)(101416001)(575784001)(54356999)(6116002)(99286002)(102836003)(3846002)(93886004)(19580395003)(4326007)(9686002)(81156014)(92566002)(189998001)(110136002)(8676002)(66066001)(97736004)(81166006)(10400500002)(3660700001)(122556002)(106116001)(8936002)(68736007)(5002640100001)(105586002);DIR:OUT;SFP:1102;SCL:1;SRVR:CS1PR84MB0056;H:CS1PR84MB0005.NAMPRD84.PROD.OUTLOOK.COM;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: hpe.com X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Aug 2016 01:29:56.7749 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR84MB0056 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u7O3629l027504 > On Tue, Aug 23, 2016 at 4:47 PM, Kani, Toshimitsu > wrote: > > On Tue, 2016-08-23 at 15:32 -0700, Dan Williams wrote: > >> On Tue, Aug 23, 2016 at 11:43 AM, Toshi Kani > >> wrote: > > : > >> I'm not sure about this fix. The point of honoring > >> vmem_altmap_offset() is because a portion of the resource that is > >> passed to devm_memremap_pages() also contains the metadata info > block > >> for the device. The offset says "use everything past this point for > >> pages". This may work for avoiding a crash, but it may corrupt info > >> block metadata in the process. Can you provide more information > >> about the failing scenario to be sure that we are not triggering a > >> fault on an address that is not meant to have a page mapping? I.e. > >> what is the host physical address of the page that caused this fault, > >> and is it valid? > > > > The fault address in question was the 2nd page of an NVDIMM range. I > > assumed this fault address was valid and needed to be handled. Here is > > some info about the base and patched cases. Let me know if you need > > more info. > > > > Base > > ==== > > > > The following NVDIMM range was set to /dev/dax. > > With ndctl create-namespace or manually via sysfs? Specifically I'm > looking for what the 'align' attribute was set to when the > configuration was established. Can you provide a dump of the sysfs > attributes for the /dev/dax parent device? I used the ndctl command below. ndctl create-namespace -f -e namespace0.0 -m dax Here is additional info from my note for the base case. p {struct dev_pagemap} 0xffff88046d0453f0 $3 = { altmap = 0xffff88046d045410, res = 0xffff88046d0453a8, ref = 0xffff88046d0452f0, dev = 0xffff880464790410 } crash> p {struct vmem_altmap} 0xffff88046d045410 $6 = { base_pfn = 0x480000, reserve = 0x2, // PHYS_PFN(SZ_8K) free = 0x101fe, align = 0x1fe, alloc = 0x10000 } crash> p {struct resource} 0xffff88046d0453a8 $4 = { start = 0x480000000, end = 0x87fffffff, name = 0xffff880c7da5d4a8 "region0", flags = 0x200, desc = 0x0, parent = 0x0, sibling = 0x0, child = 0x0 } crash> p {struct percpu_ref} 0xffff88046d0452f0 $7 = { count = { counter = 0x8000000000000001 }, percpu_count_ptr = 0x60f380403a98, release = 0xffffffffa008a0a0, confirm_switch = 0x0, force_atomic = 0x0, rcu = { next = 0x0, func = 0x0 } } Thanks, -Toshi