1. 03 Jul, 2017 2 commits
  2. 02 Jul, 2017 1 commit
  3. 01 Jul, 2017 8 commits
  4. 30 Jun, 2017 1 commit
  5. 29 Jun, 2017 6 commits
  6. 27 Jun, 2017 5 commits
    • Dan Williams's avatar
      dax: remove default copy_from_iter fallback · 5d61e43b
      Dan Williams authored
      Require all dax-drivers to register a ->copy_from_iter() operation so
      that it is clear which dax_operations are optional and which must be
      implemented for filesystem-dax to operate.
      
      Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com>
      Suggested-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      5d61e43b
    • Dan Williams's avatar
      libnvdimm, nfit: enable support for volatile ranges · c9e582aa
      Dan Williams authored
      Allow volatile nfit ranges to participate in all the same infrastructure
      provided for persistent memory regions. A resulting resulting namespace
      device will still be called "pmem", but the parent region type will be
      "nd_volatile". This is in preparation for disabling the dax ->flush()
      operation in the pmem driver when it is hosted on a volatile range.
      
      Cc: Jan Kara <jack@suse.cz>
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Matthew Wilcox <mawilcox@microsoft.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      c9e582aa
    • Dan Williams's avatar
      libnvdimm, pmem: fix persistence warning · c00b396e
      Dan Williams authored
      The pmem driver assumes if platform firmware describes the memory
      devices associated with a persistent memory range and
      CONFIG_ARCH_HAS_PMEM_API=y that it has all the mechanism necessary to
      flush data to a power-fail safe zone. We warn if the firmware does not
      describe memory devices, but we also need to warn if the architecture
      does not claim pmem support.
      
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Matthew Wilcox <mawilcox@microsoft.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      c00b396e
    • Dan Williams's avatar
      x86, libnvdimm, pmem: remove global pmem api · ca6a4657
      Dan Williams authored
      Now that all callers of the pmem api have been converted to dax helpers that
      call back to the pmem driver, we can remove include/linux/pmem.h and
      asm/pmem.h.
      
      Cc: <x86@kernel.org>
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Toshi Kani <toshi.kani@hpe.com>
      Cc: Oliver O'Halloran <oohall@gmail.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      ca6a4657
    • Dan Williams's avatar
      x86, libnvdimm, pmem: move arch_invalidate_pmem() to libnvdimm · f2b61257
      Dan Williams authored
      Kill this globally defined wrapper and move to libnvdimm so that we can
      ultimately remove include/linux/pmem.h and asm/pmem.h.
      
      Cc: <x86@kernel.org>
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Matthew Wilcox <mawilcox@microsoft.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      f2b61257
  7. 15 Jun, 2017 17 commits
    • Toshi Kani's avatar
      acpi/nfit: Add support of NVDIMM memory error notification in ACPI 6.2 · 56b47fe6
      Toshi Kani authored
      ACPI 6.2 defines a new ACPI notification value to NVDIMM Root Device
      in Table 5-169.
      
       0x81 Unconsumed Uncorrectable Memory Error Detected
            Used to pro-actively notify OSPM of uncorrectable memory errors
            detected (for example a memory scrubbing engine that continuously
            scans the NVDIMMs memory). This is an optional notification. Only
            locations that were mapped in to SPA by the platform will generate
            a notification.
      
      Add support of this notification value by initiating an ARS scan. This
      will find new error locations and add their badblocks information.
      
      Link: http://www.uefi.org/sites/default/files/resources/ACPI_6_2.pdfSigned-off-by: default avatarToshi Kani <toshi.kani@hpe.com>
      Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
      Cc: Vishal Verma <vishal.l.verma@intel.com>
      Cc: Linda Knippers <linda.knippers@hpe.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      56b47fe6
    • Dan Williams's avatar
      x86, dax, libnvdimm: remove wb_cache_pmem() indirection · 4e4f00a9
      Dan Williams authored
      With all handling of the CONFIG_ARCH_HAS_PMEM_API case being moved to
      libnvdimm and the pmem driver directly we do not need to provide global
      wrappers and fallbacks in the CONFIG_ARCH_HAS_PMEM_API=n case. The pmem
      driver will simply not link to arch_wb_cache_pmem() in that case.  Same
      as before, pmem flushing is only defined for x86_64, via
      clean_cache_range(), but it is straightforward to add other archs in the
      future.
      
      arch_wb_cache_pmem() is an exported function since the pmem module needs
      to find it, but it is privately declared in drivers/nvdimm/pmem.h because
      there are no consumers outside of the pmem driver.
      
      Cc: <x86@kernel.org>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Oliver O'Halloran <oohall@gmail.com>
      Cc: Matthew Wilcox <mawilcox@microsoft.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Suggested-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      4e4f00a9
    • Dan Williams's avatar
      x86, dax: replace clear_pmem() with open coded memset + dax_ops->flush · 81f55870
      Dan Williams authored
      The clear_pmem() helper simply combines a memset() plus a cache flush.
      Now that the flush routine is optionally provided by the dax device
      driver we can avoid unnecessary cache management on dax devices fronting
      volatile memory.
      
      With clear_pmem() gone we can follow on with a patch to make pmem cache
      management completely defined within the pmem driver.
      
      Cc: <x86@kernel.org>
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Matthew Wilcox <mawilcox@microsoft.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      81f55870
    • Dan Williams's avatar
      filesystem-dax: convert to dax_flush() · 6318770a
      Dan Williams authored
      Filesystem-DAX flushes caches whenever it writes to the address returned
      through dax_direct_access() and when writing back dirty radix entries.
      That flushing is only required in the pmem case, so the dax_flush()
      helper skips cache management work when the underlying driver does not
      specify a flush method.
      
      We still do all the dirty tracking since the radix entry will already be
      there for locking purposes. However, the work to clean the entry will be
      a nop for some dax drivers.
      
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Matthew Wilcox <mawilcox@microsoft.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      6318770a
    • Dan Williams's avatar
      dm: add ->flush() dax operation support · abebfbe2
      Dan Williams authored
      Allow device-mapper to route flush operations to the
      per-target implementation. In order for the device stacking to work we
      need a dax_dev and a pgoff relative to that device. This gives each
      layer of the stack the information it needs to look up the operation
      pointer for the next level.
      
      This conceptually allows for an array of mixed device drivers with
      varying flush implementations.
      Reviewed-by: default avatarToshi Kani <toshi.kani@hpe.com>
      Reviewed-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      abebfbe2
    • Dan Williams's avatar
      dax, pmem: introduce an optional 'flush' dax_operation · 3c1cebff
      Dan Williams authored
      Filesystem-DAX flushes caches whenever it writes to the address returned
      through dax_direct_access() and when writing back dirty radix entries.
      That flushing is only required in the pmem case, so add a dax operation
      to allow pmem to take this extra action, but skip it for other dax
      capable devices that do not provide a flush routine.
      
      An example for this differentiation might be a volatile ram disk where
      there is no expectation of persistence. In fact the pmem driver itself might
      front such an address range specified by the NFIT. So, this "no flush"
      property might be something passed down by the bus / libnvdimm.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Matthew Wilcox <mawilcox@microsoft.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      3c1cebff
    • Dan Williams's avatar
      filesystem-dax: convert to dax_copy_from_iter() · fec53774
      Dan Williams authored
      Now that all possible providers of the dax_operations copy_from_iter
      method are implemented, switch filesytem-dax to call the driver rather
      than copy_to_iter_pmem.
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      fec53774
    • Toshi Kani's avatar
      libnvdimm, pmem: Add sysfs notifications to badblocks · 975750a9
      Toshi Kani authored
      Sysfs "badblocks" information may be updated during run-time that:
       - MCE, SCI, and sysfs "scrub" may add new bad blocks
       - Writes and ioctl() may clear bad blocks
      
      Add support to send sysfs notifications to sysfs "badblocks" file
      under region and pmem directories when their badblocks information
      is re-evaluated (but is not necessarily changed) during run-time.
      Signed-off-by: default avatarToshi Kani <toshi.kani@hpe.com>
      Cc: Vishal Verma <vishal.l.verma@intel.com>
      Cc: Linda Knippers <linda.knippers@hpe.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      975750a9
    • Yasunori Goto's avatar
      tools/testing/nvdimm: fix nfit_test buffer overflow · a117699c
      Yasunori Goto authored
      The root cause of panic is the num_pm of nfit_test1 is wrong.
      Though 1 is specified for num_pm at nfit_test_init(), it must be 2,
      because nfit_test1->spa_set[] array has 2 elements.
      
      Since the array is smaller than expected, the driver breaks other area.
      (it is often the link list of devres).
      
      As a result, panic occurs like the following example.
      
          CPU: 4 PID: 2233 Comm: lt-libndctl Tainted: G           O    4.12.0-rc1+ #12
          RIP: 0010:__list_del_entry_valid+0x6c/0xa0
          Call Trace:
           release_nodes+0x76/0x260
           devres_release_all+0x3c/0x50
           device_release_driver_internal+0x159/0x200
           device_release_driver+0x12/0x20
           bus_remove_device+0xfd/0x170
           device_del+0x1e8/0x330
           platform_device_del+0x28/0x90
           platform_device_unregister+0x12/0x30
           nfit_test_exit+0x2a/0x93b [nfit_test]
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarYasunori Goto <y-goto@jp.fujitsu.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      a117699c
    • Dan Williams's avatar
      libnvdimm, label: switch to using v1.2 labels by default · 8990cdf1
      Dan Williams authored
      The rules for which version of the label specification are in effect at
      any given point in time are as follows:
      
      1/ If a DIMM has an existing / valid index block then the version
         specified is used regardless if it is a previous version.
      
      2/ By default when the kernel is initializing new index blocks the
         latest specification version (v1.2 at time of writing) is used.
      
      3/ An environment that wants to force create v1.1 label-sets must
         arrange for userspace to disable all active regions / namespaces /
         dimms and write a valid set of v1.1 index blocks to the dimms.
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      8990cdf1
    • Dan Williams's avatar
      libnvdimm, label: add address abstraction identifiers · b3fde74e
      Dan Williams authored
      Starting with v1.2 labels, 'address abstractions' can be hinted via an
      address abstraction id that implies an info-block format. The standard
      address abstraction in the specification is the v2 format of the
      Block-Translation-Table (BTT). Support for that is saved for a later
      patch, for now we add support for the Linux supported address
      abstractions BTT (v1), PFN, and DAX.
      
      The new 'holder_class' attribute for namespace devices is added for
      tooling to specify the 'abstraction_guid' to store in the namespace label.
      For v1.1 labels this field is undefined and any setting of
      'holder_class' away from the default 'none' value will only have effect
      until the driver is unloaded. Setting 'holder_class' requires that
      whatever device tries to claim the namespace must be of the specified
      class.
      
      Cc: Vishal Verma <vishal.l.verma@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      b3fde74e
    • Dan Williams's avatar
      libnvdimm, label: add v1.2 label checksum support · 355d8388
      Dan Williams authored
      The v1.2 namespace label specification adds a fletcher checksum to each
      label instance. Add generation and validation support for the new field.
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      355d8388
    • Dan Williams's avatar
      libnvdimm, label: update 'nlabel' and 'position' handling for local namespaces · 3934d841
      Dan Williams authored
      The v1.2 namespace label specification requires 'nlabel' and 'position'
      to be valid for the first ("lowest dpa") label in the set. It also
      requires all non-first labels to set those fields to 0xff.
      
      Linux does not much care if these values are correct, because we can
      just trust the count of labels with the matching uuid like the v1.1
      case. However, we set them correctly in case other environments care.
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      3934d841
    • Dan Williams's avatar
      libnvdimm, label: populate 'isetcookie' for blk-aperture namespaces · 8f2bc243
      Dan Williams authored
      Starting with the v1.2 definition of namespace labels, the isetcookie
      field is populated and validated for blk-aperture namespaces. This adds
      some safety against inadvertent copying of namespace labels from one
      DIMM-device to another.
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      8f2bc243
    • Dan Williams's avatar
      libnvdimm, label: populate the type_guid property for v1.2 namespaces · faec6f8a
      Dan Williams authored
      The type_guid refers to the "Address Range Type GUID" for the region
      backing a namespace as defined the ACPI NFIT (NVDIMM Firmware Interface
      Table). This 'type' identifier specifies an access mechanism for the
      given namespace. This capability replaces the confusing usage of the
      'NSLABEL_FLAG_LOCAL' flag to indicate a block-aperture-mode namespace.
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      faec6f8a
    • Dan Williams's avatar
      libnvdimm, label: honor the lba size specified in v1.2 labels · f979b13c
      Dan Williams authored
      Previously we only honored the lba size for blk-aperture mode
      namespaces. For pmem namespaces the lba size was just assumed to be 512.
      With the new v1.2 label definition and compatibility with other
      operating environments, the ->lbasize property is now respected for pmem
      namespaces.
      
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      f979b13c
    • Dan Williams's avatar
      libnvdimm, label: add v1.2 interleave-set-cookie algorithm · c12c48ce
      Dan Williams authored
      The interleave-set-cookie algorithm is extended to incorporate all the
      same components that are used to generate an nvdimm unique-id. For
      backwards compatibility we still maintain the old v1.1 definition.
      Reported-by: default avatarNicholas Moulin <nicholas.w.moulin@intel.com>
      Reported-by: default avatarKaushik Kanetkar <kaushik.a.kanetkar@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      c12c48ce