Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp422048rwr; Thu, 27 Apr 2023 03:23:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5BWhSm/jcYReAIannjv8HQy2lpiDU3jaMlHjPQdKlwZl4L0ZIzDK1usxXTlzNDZ9NBEpzE X-Received: by 2002:a17:90a:1a01:b0:247:9e56:d895 with SMTP id 1-20020a17090a1a0100b002479e56d895mr1338739pjk.1.1682590980125; Thu, 27 Apr 2023 03:23:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682590980; cv=none; d=google.com; s=arc-20160816; b=owjzHyZA5O2EIVzu0AcX/Lgen0AB3O8KlYJTpslYR0K7hBUH/PFNHAjjgfbCqV1686 hi5R4MiDQghA9H7zWFplQOnaRDRzrd8jIYVX6aCvfNRSDTFlfKTqiCDR3oB66S/Q+NpM 9pmB9LAdFPSv8eIigyR1sJHxYcGvX4di8xxlUDXQhWoJF03WhBcXiPRRQ9jCyACrLlhN 3lrU9WhD9JeYlJ/hkE6a8X16Z1urc6LpsTFsgtoWwZRjYcnRfeFOTeZa5AJuOH1+fKhz hENUHpC1yhA/MLFrA0MkO+gzB6qCRUu5nFzk8Zc2vuvOfa4822u67d6prQs9SAaF9s8e TPXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=BRT8csqQi84VBGbuCjwcF6IB+VGhkO+/d2296FL3ngw=; b=CeP7PNEbEoQ6GNi3ZAT7igznugiOIaYqZjwxoideX3AA9Hc5Wb7vnylmhcepbrOTWR gA6d/ISl+BCoS2wtGxKxgMQrk1o9zmCMDD4yAl0GJ9VStUuwhcAGpr9Dsikqi19ER0Rw HIeuRU+AtrLB/JqFkl8hKf1Eomc7ZhSiYYZpDEwRm/qwxVxduFJe55Rbv4AC84LhSAOF L/oeD5N6NQbqt8qjAZMJFnYRajjhKGgMwLbxs5Vk9I0f/ae2It2LsI/zO3+SF84uubVl daTo6LyUU2K3T0Hz7IqL4Sc5xJvneEG7O2FQvFbo7NV/MGp3N8pg9ZPAgv770P7LavAP VFLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i184-20020a6387c1000000b00525030ba5acsi12601344pge.279.2023.04.27.03.22.46; Thu, 27 Apr 2023 03:23:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243403AbjD0KUc (ORCPT + 99 others); Thu, 27 Apr 2023 06:20:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243534AbjD0KUH (ORCPT ); Thu, 27 Apr 2023 06:20:07 -0400 X-Greylist: delayed 64 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 27 Apr 2023 03:19:56 PDT Received: from esa2.hc1455-7.c3s2.iphmx.com (esa2.hc1455-7.c3s2.iphmx.com [207.54.90.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C09695583 for ; Thu, 27 Apr 2023 03:19:56 -0700 (PDT) X-IronPort-AV: E=McAfee;i="6600,9927,10692"; a="115055335" X-IronPort-AV: E=Sophos;i="5.99,230,1677510000"; d="scan'208";a="115055335" Received: from unknown (HELO yto-r1.gw.nic.fujitsu.com) ([218.44.52.217]) by esa2.hc1455-7.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2023 19:18:51 +0900 Received: from yto-m2.gw.nic.fujitsu.com (yto-nat-yto-m2.gw.nic.fujitsu.com [192.168.83.65]) by yto-r1.gw.nic.fujitsu.com (Postfix) with ESMTP id A4D94D66A2 for ; Thu, 27 Apr 2023 19:18:47 +0900 (JST) Received: from kws-ab1.gw.nic.fujitsu.com (kws-ab1.gw.nic.fujitsu.com [192.51.206.11]) by yto-m2.gw.nic.fujitsu.com (Postfix) with ESMTP id E58A5D35EC for ; Thu, 27 Apr 2023 19:18:46 +0900 (JST) Received: from FNSTPC.g08.fujitsu.local (unknown [10.167.226.45]) by kws-ab1.gw.nic.fujitsu.com (Postfix) with ESMTP id AE45F114626A; Thu, 27 Apr 2023 19:18:44 +0900 (JST) From: Li Zhijian To: x86@kernel.org, nvdimm@lists.linux.dev, kexec@lists.infradead.org Cc: linux-kernel@vger.kernel.org, y-goto@fujitsu.com, yangx.jy@fujitsu.com, ruansy.fnst@fujitsu.com, Li Zhijian , Dan Williams , Vishal Verma , Dave Jiang , Ira Weiny Subject: [RFC PATCH v2 2/3] drivers/nvdimm: export memmap of namespace to vmcoreinfo Date: Thu, 27 Apr 2023 18:18:33 +0800 Message-Id: <20230427101838.12267-3-lizhijian@fujitsu.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230427101838.12267-1-lizhijian@fujitsu.com> References: <20230427101838.12267-1-lizhijian@fujitsu.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSS-9.1.0.1408-9.0.0.1002-27590.006 X-TM-AS-User-Approved-Sender: Yes X-TMASE-Version: IMSS-9.1.0.1408-9.0.1002-27590.006 X-TMASE-Result: 10--5.296600-10.000000 X-TMASE-MatchedRID: mJ3yV3MWQwmUkDPUhpX2vh1kSRHxj+Z5A81piVnI+HU1SqhT+J6xsUbg XczvLJKOjx5X3FdI4UDmn3xyPJAJoh2P280ZiGmRfiKzBf4Yf9iOVGny5q72hp4Q+L3BXIWuyL5 QmWOgMfBI7ocMJBgR6/WV3EhAhFD6Sry0z8DqbhLNgrlT5Ajc7n0tCKdnhB589yM15V5aWpj6C0 ePs7A07Xi4XEoPXecxVvpTJmXb4dua6fR6Q+5OxeYzpCWDqqUZ3tGV3hp+Y+4= X-TMASE-SNAP-Result: 1.821001.0001-0-1-22:0,33:0,34:0-0 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Each namespace has its own memmap, it will be udpated when namespace initializing/creating, updating, and deleting. CC: Dan Williams CC: Vishal Verma CC: Dave Jiang CC: Ira Weiny Signed-off-by: Li Zhijian --- drivers/nvdimm/namespace_devs.c | 2 ++ drivers/nvdimm/pfn_devs.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c index c60ec0b373c5..096203e6203f 100644 --- a/drivers/nvdimm/namespace_devs.c +++ b/drivers/nvdimm/namespace_devs.c @@ -8,6 +8,7 @@ #include #include #include +#include #include "nd-core.h" #include "pmem.h" #include "pfn.h" @@ -853,6 +854,7 @@ static ssize_t size_store(struct device *dev, if (rc == 0 && val == 0 && is_namespace_pmem(dev)) { struct nd_namespace_pmem *nspm = to_nd_namespace_pmem(dev); + devm_memmap_vmcore_delete(to_ndns(dev)); kfree(nspm->uuid); nspm->uuid = NULL; } diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c index af7d9301520c..80076996b2da 100644 --- a/drivers/nvdimm/pfn_devs.c +++ b/drivers/nvdimm/pfn_devs.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "nd-core.h" #include "pfn.h" #include "nd.h" @@ -716,6 +717,8 @@ static int __nvdimm_setup_pfn(struct nd_pfn *nd_pfn, struct dev_pagemap *pgmap) } else return -ENXIO; + devm_memmap_vmcore_update(ndns, altmap->base_pfn, PHYS_PFN(offset), + nd_pfn->mode == PFN_MODE_PMEM); return 0; } -- 2.29.2