Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp883415ybv; Thu, 13 Feb 2020 11:17:39 -0800 (PST) X-Google-Smtp-Source: APXvYqx1XafsIjkR1W+xFYLB6fEZKo4wCqxP0RAw5pa2OdfemZ/4IqOX/9lPEXex6h8rkUku7EsK X-Received: by 2002:a05:6830:18f6:: with SMTP id d22mr7609893otf.59.1581621458950; Thu, 13 Feb 2020 11:17:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581621458; cv=none; d=google.com; s=arc-20160816; b=tMTYFMRyKB/ioz2VeezfPGdO6OoKiABsG346T9jVB+u6wrX+pgR0aTneYbkrWI2gx+ xQdZhDX7jVuXwOKodIJxRqaIQ/1p2tCuAdcTeKYCMariZSW8LN5fj5bS8ev4y2PpL39E 5aP72t7KcNlPP7a7hLeNQsLYbsfeiVxEylkI1Uc3Mv0/si5+VMlc1MsCpOXmeaBI9MtL 11tiEEdb/vGExds6xKLMai7msC/EdcmsoLpENQXVmby23C8qbLpCqyxI2iejaDQTivjU 873Jvey4/21zZNsxso5WJWR/MPOy8kM/1scGC7uRc81/reTudV1SeQ+6hM4K+tv0nMgh vkEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:dkim-signature; bh=3SQ+LK7N11bGZ8q1OPiZl9texnQsy+HSMYBO5njmoYo=; b=AXo9XnVG08wvsLpGAvyn2+8vMbSxrYfPj8DBYWxVpYjo87tmzPE6LFhtj3RyAJRjIn HrEyGoa44snVks/gidzT/q7IhzWE3t2izq8Fxr14OusiMpoafUwRJYN7bTi92fcBNgXz NoEHNTyqjQUJzUExTuiscZZnp3oGVYyvyttVFalU0GJ2cRt2/wxWsQBKIkaUKOaxxEpw GWYwsG62V7S3z+dO13v2Weg/f4toQM9FKTp2TFWN+yjZcA6oqtCmBCDTB1B78T32ZPqn PPFl+fBr8BKqqLaWEbg+4XPjkZT2PhbeNdf7+/+MTTqQgzDFh164IXZiFXJ9QJFTqPog defg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=N4Fkoj09; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t28si1461864otr.16.2020.02.13.11.17.26; Thu, 13 Feb 2020 11:17:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=N4Fkoj09; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728540AbgBMTQO (ORCPT + 99 others); Thu, 13 Feb 2020 14:16:14 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:25271 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727720AbgBMTQO (ORCPT ); Thu, 13 Feb 2020 14:16:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581621373; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3SQ+LK7N11bGZ8q1OPiZl9texnQsy+HSMYBO5njmoYo=; b=N4Fkoj09VKw5WjwIbst8XMsYyw8kQqWy/YbHe0/6sluPgRC/o7PGDSoZP2nWrdq3H8jsaa gKokiLuUoNlHNuDAlmtT3RveT4+PyutmESO/MYVak69+yl/9aMvY9774WsAZs/uEYTdVEI LTr5SBmAiLLkOpc/cjmrtnJ0H1hVfGM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-149-XG0hJnjHPBS9gjBI-CDJyA-1; Thu, 13 Feb 2020 14:16:04 -0500 X-MC-Unique: XG0hJnjHPBS9gjBI-CDJyA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2FB91107ACCC; Thu, 13 Feb 2020 19:16:02 +0000 (UTC) Received: from segfault.boston.devel.redhat.com (segfault.boston.devel.redhat.com [10.19.60.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5C5D35C100; Thu, 13 Feb 2020 19:16:01 +0000 (UTC) From: Jeff Moyer To: Dan Williams Cc: linux-nvdimm@lists.01.org, "Aneesh Kumar K.V" , vishal.l.verma@intel.com, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v2 2/4] libnvdimm/namespace: Enforce memremap_compat_align() References: <158155489850.3343782.2687127373754434980.stgit@dwillia2-desk3.amr.corp.intel.com> <158155490897.3343782.14216276134794923581.stgit@dwillia2-desk3.amr.corp.intel.com> X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 Date: Thu, 13 Feb 2020 14:16:00 -0500 In-Reply-To: <158155490897.3343782.14216276134794923581.stgit@dwillia2-desk3.amr.corp.intel.com> (Dan Williams's message of "Wed, 12 Feb 2020 16:48:29 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dan Williams writes: > The pmem driver on PowerPC crashes with the following signature when > instantiating misaligned namespaces that map their capacity via > memremap_pages(). > > BUG: Unable to handle kernel data access at 0xc001000406000000 > Faulting instruction address: 0xc000000000090790 > NIP [c000000000090790] arch_add_memory+0xc0/0x130 > LR [c000000000090744] arch_add_memory+0x74/0x130 > Call Trace: > arch_add_memory+0x74/0x130 (unreliable) > memremap_pages+0x74c/0xa30 > devm_memremap_pages+0x3c/0xa0 > pmem_attach_disk+0x188/0x770 > nvdimm_bus_probe+0xd8/0x470 > > With the assumption that only memremap_pages() has alignment > constraints, enforce memremap_compat_align() for > pmem_should_map_pages(), nd_pfn, or nd_dax cases. > > Reported-by: Aneesh Kumar K.V > Cc: Jeff Moyer > Reviewed-by: Aneesh Kumar K.V > Link: https://lore.kernel.org/r/158041477336.3889308.4581652885008605170.stgit@dwillia2-desk3.amr.corp.intel.com > Signed-off-by: Dan Williams Reviewed-by: Jeff Moyer