From patchwork Fri Jul 6 08:29:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 10511029 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8DAF3600CA for ; Fri, 6 Jul 2018 08:29:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DE4728462 for ; Fri, 6 Jul 2018 08:29:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 61FDB28474; Fri, 6 Jul 2018 08:29:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9F0728462 for ; Fri, 6 Jul 2018 08:29:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 029686B0273; Fri, 6 Jul 2018 04:29:30 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id EF1B46B0274; Fri, 6 Jul 2018 04:29:29 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D6BFC6B0275; Fri, 6 Jul 2018 04:29:29 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by kanga.kvack.org (Postfix) with ESMTP id 730D36B0273 for ; Fri, 6 Jul 2018 04:29:29 -0400 (EDT) Received: by mail-ed1-f70.google.com with SMTP id l17-v6so4317825edq.11 for ; Fri, 06 Jul 2018 01:29:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id; bh=vmZ6xH7PJfHRF5uu/8QBiPW4AA/HFvY1zamC0G1iDWU=; b=QY5IS0IeCnbmQMBOgDuUjQp1V2zWjMlVopvnVchAGezk8ne0pikbPI2I+X9Wg0JCFa 9qP4QEPJnFV5yTGHWT9LzqPaHIbtob5Q38DZQenev1my+ymXRWm2yQ025JN7Q75876sr +Gddvp3pQ9k1om2BG9pBM5n+D7ImWHlmoRRaezW/LHJanR5j4Dsve0QKbbCh04jb6R3/ 9XYLJek9RqVPYByJce5K/7aK93I0RMRtpaefSByZr7ufteUAIlj3IhQ8Q7Vsn/j1WGmf 8/aoQjtvTtXVgTbllGtd7BTZbwuEa778nT9wnjFXJ5vtdjcOXYXBYGDLYhl/fNpZbk4U tORQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com X-Gm-Message-State: APt69E0s4z0NVTlFU0ZzdOhonWz5GbvWt21LAypHRrIEs2peR7ymix5A Qx9k1Oxz1MV67yomIFP3qBdc7cJD5L45K/bZ+RuZ656ms2SNuwCtYFhIjSh2g/4ziFIKBejfDiK naA3nk1q0dyErVCoUscw+MqOnGIvJhSfWEDAM7w5aWljfGReLo0ZFMZMnPieLMlAqBg== X-Received: by 2002:a50:9704:: with SMTP id c4-v6mr9747311edb.246.1530865768988; Fri, 06 Jul 2018 01:29:28 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcSdQdVEgQNQRU3epF+VYOoxegeHK6Kbda2WSb2GYvdULjl3+N1zWPMwqE6RDyOsd4s23vU X-Received: by 2002:a50:9704:: with SMTP id c4-v6mr9747271edb.246.1530865768226; Fri, 06 Jul 2018 01:29:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530865768; cv=none; d=google.com; s=arc-20160816; b=FtJDfL2wDyvRp6ZHkJBWNcso6z8Wnh63SWvGvMqOoIIutOVidd5UeE38yZJ7r3/wsF sdiAeUoF3DqIEJPpUslZSfaq3bm0wYcLxiRpKzYR3ZaG69NLkXdkk3YtjFdenTgrDBVs FYaR/ZRKUQrk9I3cVCH3r59xYDa3Z4PNTyZArNSAm6bAzYQl5ssomFZYs5NF2TkfqQWz cJybr13YZwymZ/uY6AkuE2zbNl5rzUFDbhk0e+RYBuhOTElhlVFViXJBTcNa9uBp3vMV Rj+QhNCpAG3BThCoEseVWTootWnxHJvHnT7FjqOFq7WPTL8YJeLvLfyQ+hxmfeClWC3G qTyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=vmZ6xH7PJfHRF5uu/8QBiPW4AA/HFvY1zamC0G1iDWU=; b=gGoQjQ7+mJR/3tfx4zsrwKlDHykux0UY+vs0ajK3ZmhWiUkQw46tnWNqUVJPbAJewk dMMrAzgRmO9JOCXiWUfePR4iD2/KgscFzXmYpO8k3fWyZFrGwgf1NgDEuuj8ijZwohu6 z5S+im+DWvvOEX5Ymc5YDMn9UrRtZacF2//RojWB28eQ8o1MgcL5SeYwXrEsk/31LZ/B LLaNOX1ysuy4Wh9ZsiIe3LGg+uYuFe21L9jzKspRHUaz8W/JgUkJl919h/HRtPRqur5b sMFSobm0gsuVbbg8sRsw8Ek+pGvJHERfSbjd3dw0qqVgmCVrWrwVZ4p9wkC2SZXowHYd B8cQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com. [148.163.158.5]) by mx.google.com with ESMTPS id y95-v6si5771221ede.17.2018.07.06.01.29.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jul 2018 01:29:28 -0700 (PDT) Received-SPF: pass (google.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) client-ip=148.163.158.5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w668SvjQ137125 for ; Fri, 6 Jul 2018 04:29:26 -0400 Received: from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204]) by mx0b-001b2d01.pphosted.com with ESMTP id 2k21j3ysqp-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 06 Jul 2018 04:29:26 -0400 Received: from localhost by e14.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 6 Jul 2018 04:29:25 -0400 Received: from b01cxnp22036.gho.pok.ibm.com (9.57.198.26) by e14.ny.us.ibm.com (146.89.104.201) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 6 Jul 2018 04:29:22 -0400 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w668TL8U9699724 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 6 Jul 2018 08:29:21 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 36FEF112065; Fri, 6 Jul 2018 04:29:13 -0400 (EDT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9C81C112063; Fri, 6 Jul 2018 04:29:11 -0400 (EDT) Received: from skywalker.in.ibm.com (unknown [9.124.31.51]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 6 Jul 2018 04:29:11 -0400 (EDT) From: "Aneesh Kumar K.V" To: akpm@linux-foundation.org, Dan Williams , Oliver Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Aneesh Kumar K.V" Subject: [RFC PATCH 1/2] mm/nvidmm: Drop x86 dependency on nvdimm e820 device Date: Fri, 6 Jul 2018 13:59:10 +0530 X-Mailer: git-send-email 2.17.1 X-TM-AS-GCONF: 00 x-cbid: 18070608-0052-0000-0000-00000309FD48 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009318; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01057295; UDB=6.00542444; IPR=6.00835215; MB=3.00022021; MTD=3.00000008; XFM=3.00000015; UTC=2018-07-06 08:29:24 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18070608-0053-0000-0000-00005D43791C Message-Id: <20180706082911.13405-1-aneesh.kumar@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-07-06_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807060094 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP This patch adds new Kconfig variable PMEM_PLATFORM_DEVICE and use that to select the nvdimm e820 device. The x86 config is now named X86_PMEM_LEGACY_DEVICE. Not-Signed-off-by: Aneesh Kumar K.V --- arch/x86/Kconfig | 5 +---- arch/x86/include/asm/e820/types.h | 2 +- arch/x86/include/uapi/asm/e820.h | 2 +- drivers/nvdimm/Kconfig | 5 ++++- drivers/nvdimm/Makefile | 2 +- tools/testing/nvdimm/Kbuild | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index f1dbb4ee19d7..1186e1330876 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -1641,13 +1641,10 @@ config ILLEGAL_POINTER_VALUE source "mm/Kconfig" config X86_PMEM_LEGACY_DEVICE - bool - -config X86_PMEM_LEGACY tristate "Support non-standard NVDIMMs and ADR protected memory" depends on PHYS_ADDR_T_64BIT depends on BLK_DEV - select X86_PMEM_LEGACY_DEVICE + select PMEM_PLATFORM_DEVICE select LIBNVDIMM help Treat memory marked using the non-standard e820 type of 12 as used diff --git a/arch/x86/include/asm/e820/types.h b/arch/x86/include/asm/e820/types.h index c3aa4b5e49e2..0fb25d04dd26 100644 --- a/arch/x86/include/asm/e820/types.h +++ b/arch/x86/include/asm/e820/types.h @@ -20,7 +20,7 @@ enum e820_type { * NVDIMM regions that persist over a reboot. * * The kernel will ignore their special capabilities - * unless the CONFIG_X86_PMEM_LEGACY=y option is set. + * unless the CONFIG_X86_PMEM_LEGACY_DEVICE=y option is set. * * ( Note that older platforms also used 6 for the same * type of memory, but newer versions switched to 12 as diff --git a/arch/x86/include/uapi/asm/e820.h b/arch/x86/include/uapi/asm/e820.h index 2f491efe3a12..b8ae7c221269 100644 --- a/arch/x86/include/uapi/asm/e820.h +++ b/arch/x86/include/uapi/asm/e820.h @@ -38,7 +38,7 @@ /* * This is a non-standardized way to represent ADR or NVDIMM regions that * persist over a reboot. The kernel will ignore their special capabilities - * unless the CONFIG_X86_PMEM_LEGACY option is set. + * unless the CONFIG_X86_PMEM_LEGACY_DEVICE option is set. * * ( Note that older platforms also used 6 for the same type of memory, * but newer versions switched to 12 as 6 was assigned differently. Some diff --git a/drivers/nvdimm/Kconfig b/drivers/nvdimm/Kconfig index 9d36473dc2a2..50d2a33de441 100644 --- a/drivers/nvdimm/Kconfig +++ b/drivers/nvdimm/Kconfig @@ -27,7 +27,7 @@ config BLK_DEV_PMEM Memory ranges for PMEM are described by either an NFIT (NVDIMM Firmware Interface Table, see CONFIG_NFIT_ACPI), a non-standard OEM-specific E820 memory type (type-12, see - CONFIG_X86_PMEM_LEGACY), or it is manually specified by the + CONFIG_X86_PMEM_LEGACY_DEVICE), or it is manually specified by the 'memmap=nn[KMG]!ss[KMG]' kernel command line (see Documentation/admin-guide/kernel-parameters.rst). This driver converts these persistent memory ranges into block devices that are @@ -112,4 +112,7 @@ config OF_PMEM Select Y if unsure. +config PMEM_PLATFORM_DEVICE + bool + endif diff --git a/drivers/nvdimm/Makefile b/drivers/nvdimm/Makefile index e8847045dac0..94f7f29146ce 100644 --- a/drivers/nvdimm/Makefile +++ b/drivers/nvdimm/Makefile @@ -3,7 +3,7 @@ obj-$(CONFIG_LIBNVDIMM) += libnvdimm.o obj-$(CONFIG_BLK_DEV_PMEM) += nd_pmem.o obj-$(CONFIG_ND_BTT) += nd_btt.o obj-$(CONFIG_ND_BLK) += nd_blk.o -obj-$(CONFIG_X86_PMEM_LEGACY) += nd_e820.o +obj-$(CONFIG_PMEM_PLATFORM_DEVICE) += nd_e820.o obj-$(CONFIG_OF_PMEM) += of_pmem.o nd_pmem-y := pmem.o diff --git a/tools/testing/nvdimm/Kbuild b/tools/testing/nvdimm/Kbuild index 0392153a0009..82e84253a6ae 100644 --- a/tools/testing/nvdimm/Kbuild +++ b/tools/testing/nvdimm/Kbuild @@ -27,7 +27,7 @@ obj-$(CONFIG_LIBNVDIMM) += libnvdimm.o obj-$(CONFIG_BLK_DEV_PMEM) += nd_pmem.o obj-$(CONFIG_ND_BTT) += nd_btt.o obj-$(CONFIG_ND_BLK) += nd_blk.o -obj-$(CONFIG_X86_PMEM_LEGACY) += nd_e820.o +obj-$(CONFIG_PMEM_PLATFORM_DEVICE) += nd_e820.o obj-$(CONFIG_ACPI_NFIT) += nfit.o ifeq ($(CONFIG_DAX),m) obj-$(CONFIG_DAX) += dax.o