1. 12 Oct, 2018 2 commits
  2. 14 Jul, 2018 1 commit
  3. 07 Apr, 2018 1 commit
    • Dan Williams's avatar
      libnvdimm, dimm: fix dpa reservation vs uninitialized label area · c31898c8
      Dan Williams authored
      At initialization time the 'dimm' driver caches a copy of the memory
      device's label area and reserves address space for each of the
      namespaces defined.
      
      However, as can be seen below, the reservation occurs even when the
      index blocks are invalid:
      
       nvdimm nmem0: nvdimm_init_config_data: len: 131072 rc: 0
       nvdimm nmem0: config data size: 131072
       nvdimm nmem0: __nd_label_validate: nsindex0 labelsize 1 invalid
       nvdimm nmem0: __nd_label_validate: nsindex1 labelsize 1 invalid
       nvdimm nmem0: : pmem-6025e505: 0x1000000000 @ 0xf50000000 reserve <-- bad
      
      Gate dpa reservation on the presence of valid index blocks.
      
      Cc: <stable@vger.kernel.org>
      Fixes: 4a826c83 ("libnvdimm: namespace indices: read and validate")
      Reported-by: default avatarKrzysztof Rusocki <krzysztof.rusocki@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      c31898c8
  4. 07 Oct, 2017 1 commit
    • Dan Williams's avatar
      acpi, nfit: add support for the _LSI, _LSR, and _LSW label methods · 4b27db7e
      Dan Williams authored
      ACPI 6.2 adds support for named methods to access the label storage area
      of an NVDIMM. We prefer these new methods if available and otherwise
      fallback to the NVDIMM_FAMILY_INTEL _DSMs. The kernel ioctls,
      ND_IOCTL_{GET,SET}_CONFIG_{SIZE,DATA}, remain generic and the driver
      translates the 'package' payloads into the NVDIMM_FAMILY_INTEL 'buffer'
      format to maintain compatibility with existing userspace and keep the
      output buffer parsing code in the driver common.
      
      The output payloads are mostly compatible save for the 'label area
      locked' status that moves from the 'config_size' (_LSI) command to the
      'config_read' (_LSR) command status.
      
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Cc: Johannes Thumshirn <jthumshirn@suse.de>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      4b27db7e
  5. 28 Sep, 2017 1 commit
  6. 04 May, 2017 1 commit
  7. 19 Oct, 2016 1 commit
    • Dan Williams's avatar
      libnvdimm: allow a platform to force enable label support · 42237e39
      Dan Williams authored
      Platforms like QEMU-KVM implement an NFIT table and label DSMs.
      However, since that environment does not define an aliased
      configuration, the labels are currently ignored and the kernel registers
      a single full-sized pmem-namespace per region. Now that the kernel
      supports sub-divisions of pmem regions the labels have a purpose.
      Arrange for the labels to be honored when we find an existing / valid
      namespace index block.
      
      Cc: <qemu-devel@nongnu.org>
      Cc: Haozhong Zhang <haozhong.zhang@intel.com>
      Cc: Xiao Guangrong <guangrong.xiao@linux.intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      42237e39
  8. 02 Sep, 2016 1 commit
  9. 25 Jun, 2015 4 commits
    • Dan Williams's avatar
      libnvdimm: pmem label sets and namespace instantiation. · bf9bccc1
      Dan Williams authored
      A complete label set is a PMEM-label per-dimm per-interleave-set where
      all the UUIDs match and the interleave set cookie matches the hosting
      interleave set.
      
      Present sysfs attributes for manipulation of a PMEM-namespace's
      'alt_name', 'uuid', and 'size' attributes.  A later patch will make
      these settings persistent by writing back the label.
      
      Note that PMEM allocations grow forwards from the start of an interleave
      set (lowest dimm-physical-address (DPA)).  BLK-namespaces that alias
      with a PMEM interleave set will grow allocations backward from the
      highest DPA.
      
      Cc: Greg KH <gregkh@linuxfoundation.org>
      Cc: Neil Brown <neilb@suse.de>
      Acked-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      bf9bccc1
    • Dan Williams's avatar
      libnvdimm: namespace indices: read and validate · 4a826c83
      Dan Williams authored
      This on media label format [1] consists of two index blocks followed by
      an array of labels.  None of these structures are ever updated in place.
      A sequence number tracks the current active index and the next one to
      write, while labels are written to free slots.
      
          +------------+
          |            |
          |  nsindex0  |
          |            |
          +------------+
          |            |
          |  nsindex1  |
          |            |
          +------------+
          |   label0   |
          +------------+
          |   label1   |
          +------------+
          |            |
           ....nslot...
          |            |
          +------------+
          |   labelN   |
          +------------+
      
      After reading valid labels, store the dpa ranges they claim into
      per-dimm resource trees.
      
      [1]: http://pmem.io/documents/NVDIMM_Namespace_Spec.pdf
      
      Cc: Neil Brown <neilb@suse.de>
      Acked-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      4a826c83
    • Dan Williams's avatar
      libnvdimm: support for legacy (non-aliasing) nvdimms · 3d88002e
      Dan Williams authored
      The libnvdimm region driver is an intermediary driver that translates
      non-volatile "region"s into "namespace" sub-devices that are surfaced by
      persistent memory block-device drivers (PMEM and BLK).
      
      ACPI 6 introduces the concept that a given nvdimm may simultaneously
      offer multiple access modes to its media through direct PMEM load/store
      access, or windowed BLK mode.  Existing nvdimms mostly implement a PMEM
      interface, some offer a BLK-like mode, but never both as ACPI 6 defines.
      If an nvdimm is single interfaced, then there is no need for dimm
      metadata labels.  For these devices we can take the region boundaries
      directly to create a child namespace device (nd_namespace_io).
      Acked-by: default avatarChristoph Hellwig <hch@lst.de>
      Tested-by: default avatarToshi Kani <toshi.kani@hp.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      3d88002e
    • Dan Williams's avatar
      libnvdimm, nvdimm: dimm driver and base libnvdimm device-driver infrastructure · 4d88a97a
      Dan Williams authored
      * Implement the device-model infrastructure for loading modules and
        attaching drivers to nvdimm devices.  This is a simple association of a
        nd-device-type number with a driver that has a bitmask of supported
        device types.  To facilitate userspace bind/unbind operations 'modalias'
        and 'devtype', that also appear in the uevent, are added as generic
        sysfs attributes for all nvdimm devices.  The reason for the device-type
        number is to support sub-types within a given parent devtype, be it a
        vendor-specific sub-type or otherwise.
      
      * The first consumer of this infrastructure is the driver
        for dimm devices.  It simply uses control messages to retrieve and
        store the configuration-data image (label set) from each dimm.
      
      Note: nd_device_register() arranges for asynchronous registration of
            nvdimm bus devices by default.
      
      Cc: Greg KH <gregkh@linuxfoundation.org>
      Cc: Neil Brown <neilb@suse.de>
      Acked-by: default avatarChristoph Hellwig <hch@lst.de>
      Tested-by: default avatarToshi Kani <toshi.kani@hp.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      4d88a97a