Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp81672pxj; Thu, 10 Jun 2021 15:28:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzF5dqaenwUzCHfCcJGEoeheGSBh3a9tV3uGYM1bqPJEabyX15eGpBRRKIBI+7J4EpiS9Ww X-Received: by 2002:a17:906:d297:: with SMTP id ay23mr641301ejb.418.1623364128999; Thu, 10 Jun 2021 15:28:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623364128; cv=none; d=google.com; s=arc-20160816; b=o/v7A8s9a29MOOaVT6wuI5lL3tCSyTVLvIwmnOylAvGXgnloOpTeO1PdE+H752ITlm y0Z+HsmKzf4JBENTFTs3rih9ckGUQRikRygngfrmvt+ZPhFQuZn60BfVRxX3/URCTolG 2aTLVW9NRIkr2cT5LpA1aYpndlrG4wBzm494+j/5RLpzgC05heOUoXKz5YgcOXVnoaj3 tiSYAFVB0I3VvI6yBF/+dnNzp8m1RIDkES9Hj51sxXgC+By2RVRYlSqghpD017TP6zHX DTM6tWNwlZ/VM+Z7I3kTmdqDAuHDS5DaMEruCdv/ky8MuPgldlWO61uOZk59njrguH1s NjwQ== 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 :user-agent:message-id:date:cc:to:from:subject:ironport-sdr :ironport-sdr; bh=gPUkCvbqQN2+5tLab4xgW7AoaEwZfAADiQaL59ZHTSc=; b=lAIEwpvIhz1sxa7IzLsGfsUmb0nGIdCLOBwybTikeZjz9stRpZkiZOyCskVydQEKZf 1MZ8kTt8w4qzuWheQCnpYglYgVyYIK+P2JTpwVxx1ptnKXsybjw7K86IuRkCOgIQJwzk AWgwfL9oEiaOMLxTM2bAa9aPDPnIw2w24DEIb8vShc4MkV4tKnnfG3Tl1wH0FWNWAZCG Ql9hez+BJ5seT14tZUGkypyrQES+dMwIe922ec0Q77FVS/crasmvaK5uhOKWZqmxn6H1 DVUAyTisZsIn5NIdcCtuiW6VNEXqY1VR/AoO40FyzNnPqH6SlQf1pL9GM/EtvAJqW2l7 2QUw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g15si3061871ejt.569.2021.06.10.15.28.25; Thu, 10 Jun 2021 15:28:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231140AbhFJW14 (ORCPT + 99 others); Thu, 10 Jun 2021 18:27:56 -0400 Received: from mga05.intel.com ([192.55.52.43]:26504 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230358AbhFJW14 (ORCPT ); Thu, 10 Jun 2021 18:27:56 -0400 IronPort-SDR: M+2dIhfdn7I45hJXO7jmYYtCsIRkfdUlsxO8kk9lJ+y/xcRs+T58S5K5k4CeOXKwWSedjjx3ye PFJ2l4I15KYA== X-IronPort-AV: E=McAfee;i="6200,9189,10011"; a="291048367" X-IronPort-AV: E=Sophos;i="5.83,264,1616482800"; d="scan'208";a="291048367" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2021 15:25:58 -0700 IronPort-SDR: PkThYScbSj0g+5RZ2lwhwHWG6CyiPwTzjjYWDBkyFHpE4UcFRW9gMWcKNrkpeuYERq9uDYSwFm qMmEqcl19v8g== X-IronPort-AV: E=Sophos;i="5.83,264,1616482800"; d="scan'208";a="486361110" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.25]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2021 15:25:58 -0700 Subject: [PATCH 0/5] cxl/pmem: Add core infrastructure for PMEM support From: Dan Williams To: linux-cxl@vger.kernel.org Cc: nvdimm@lists.linux.dev, ben.widawsky@intel.com, alison.schofield@intel.com, vishal.l.verma@intel.com, ira.weiny@intel.com, linux-kernel@vger.kernel.org Date: Thu, 10 Jun 2021 15:25:57 -0700 Message-ID: <162336395765.2462439.11368504490069925374.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.18-3-g996c MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org CXL Memory Expander devices (CXL 2.0 Type-3) support persistent memory in addition to volatile memory expansion. The most significant changes this requires of the existing LIBNVDIMM infrastructure, compared to what was needed to support ACPI NFIT defined PMEM, is the ability to dynamically provision regions in addition to namespaces, and a formal model for hotplug. Before region provisioning can be added the CXL enabling needs to enumerate "nvdimm" devices on a CXL nvdimm-bus. This is modeled as a CXL-nvdimm-bridge device (bridging CXL to nvdimm) and an associated driver to activate and deactivate that bus-bridge. Once the bridge is registered it scans for CXL nvdimm devices registered by endpoints. The CXL core bus is used as a rendezvous for nvdimm bridges and endpoints allowing them to be registered and enabled in any order. At the end of this series the ndctl utility can see CXL nvdimm resources just like any other nvdimm bus. # ndctl list -BDiu -b CXL { "provider":"CXL", "dev":"ndbus1", "dimms":[ { "dev":"nmem1", "state":"disabled" }, { "dev":"nmem0", "state":"disabled" } ] } Follow-on patches extend the nvdimm core label support for CXL region and namespace labels. For now just add the machinery to register the bus and nvdimm base objects. --- Dan Williams (5): cxl/core: Add cxl-bus driver infrastructure cxl/pmem: Add initial infrastructure for pmem support libnvdimm: Export nvdimm shutdown helper, nvdimm_delete() libnvdimm: Drop unused device power management support cxl/pmem: Register 'pmem' / cxl_nvdimm devices drivers/cxl/Kconfig | 13 ++ drivers/cxl/Makefile | 2 drivers/cxl/acpi.c | 37 +++++- drivers/cxl/core.c | 281 ++++++++++++++++++++++++++++++++++++++++++++ drivers/cxl/cxl.h | 57 +++++++++ drivers/cxl/mem.h | 2 drivers/cxl/pci.c | 23 +++- drivers/cxl/pmem.c | 230 ++++++++++++++++++++++++++++++++++++ drivers/nvdimm/bus.c | 64 ++++++---- drivers/nvdimm/dimm_devs.c | 18 +++ include/linux/libnvdimm.h | 1 11 files changed, 697 insertions(+), 31 deletions(-) create mode 100644 drivers/cxl/pmem.c base-commit: 40ba17afdfabb01688c61565dbe02a916241bc05