mbox series

[ndctl,00/16] Firmware Activation and Test Updates

Message ID 159408961822.2386154.888266173771881937.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive)
Headers show
Series Firmware Activation and Test Updates | expand

Message

Dan Williams July 7, 2020, 2:40 a.m. UTC
Some persistent memory devices run a firmware locally on the device /
"DIMM" to perform tasks like media management, capacity provisioning,
and health monitoring. The process of updating that firmware typically
involves a reboot because it has implications for in-flight memory
transactions. However, reboots are disruptive and at least the Intel
persistent memory platform implementation, described by the Intel ACPI
DSM specification [1], has added support for activating firmware at
runtime.

As mentioned in the kernel patches adding support for firmware-activate
[2], ndctl is extended with the following functionality:

1/ The existing update-firmware command will 'arm' devices where the
   firmware image is staged by default.

    ndctl update-firmware all -f firmware_image.bin

2/ The existing ability to enumerate firmware-update capabilities now
   includes firmware activate capabilities at the 'bus' and 'dimm/device'
   level:

    ndctl list -BDF -b nfit_test.0
    [
      {
        "provider":"nfit_test.0",
        "dev":"ndbus2",
        "scrub_state":"idle",
        "firmware":{
          "activate_method":"suspend",
          "activate_state":"idle"
        },
        "dimms":[
          {
            "dev":"nmem1",
            "id":"cdab-0a-07e0-ffffffff",
            "handle":0,
            "phys_id":0,
            "security":"disabled",
            "firmware":{
              "current_version":0,
              "can_update":true
            }
          },
    ...

3/ When the system can support activation without quiesce, or when the
   hibernate-resume requirement is going to be suppressed, the new
   activate-firmware command wraps that functionality:

    ndctl activate-firmware nfit_test.0 --force

   Otherwise, if activate_method is "suspend" then the activation can be
   triggered by the mem-quiet hibernate debug state, or a full hibernate
   resume:

    echo mem-quiet > /sys/power/pm_debug
    echo disk > /sys/power/state

In addition to firmware activate support this patch-set also includes
some miscellaneous test updates and build fixes.

[1]: https://pmem.io/documents/IntelOptanePMem_DSM_Interface-V2.0.pdf
[2]: http://lore.kernel.org/r/159408711335.2385045.2567600405906448375.stgit@dwillia2-desk3.amr.corp.intel.com

---

Dan Williams (16):
      ndctl/build: Fix zero-length array warnings
      ndctl/dimm: Fix chatty status messages
      ndctl/list: Indicate firmware update capability
      ndctl/dimm: Detect firmware-update vs ARS conflict
      ndctl/dimm: Improve firmware-update failure message
      ndctl/dimm: Prepare to emit dimm json object after firmware update
      ndctl/dimm: Emit dimm firmware details after update
      ndctl/list: Add firmware activation enumeration
      ndctl/dimm: Auto-arm firmware activation
      ndctl/bus: Add 'activate-firmware' command
      ndctl/docs: Update copyright date
      ndctl/test: Test firmware-activation interface
      test: Validate strict iomem protections of pmem
      ndctl: Refactor nfit.h to acpi.h
      daxctl: Add 'split-acpi' command to generate custom ACPI tables
      test/ndctl: mremap pmd confusion


 Documentation/copyright.txt                     |    2 
 Documentation/ndctl/Makefile.am                 |    3 
 Documentation/ndctl/ndctl-activate-firmware.txt |  130 +++
 Documentation/ndctl/ndctl-list.txt              |   39 +
 Documentation/ndctl/ndctl-update-firmware.txt   |   40 +
 acpi.h                                          |  236 ++++++
 daxctl/Makefile.am                              |    1 
 daxctl/acpi.c                                   |  870 +++++++++++++++++++++++
 daxctl/builtin.h                                |    1 
 daxctl/daxctl.c                                 |    1 
 ndctl/Makefile.am                               |    1 
 ndctl/action.h                                  |    1 
 ndctl/builtin.h                                 |    1 
 ndctl/bus.c                                     |  173 ++++-
 ndctl/create-nfit.c                             |   66 --
 ndctl/dimm.c                                    |  278 +++++--
 ndctl/firmware-update.h                         |    1 
 ndctl/lib/hpe1.h                                |    4 
 ndctl/lib/libndctl.c                            |  258 +++++++
 ndctl/lib/libndctl.sym                          |   14 
 ndctl/lib/msft.h                                |    2 
 ndctl/lib/private.h                             |    3 
 ndctl/libndctl.h                                |   35 +
 ndctl/list.c                                    |   13 
 ndctl/ndctl.c                                   |    1 
 ndctl/ndctl.h                                   |    2 
 ndctl/util/json-firmware.c                      |   80 --
 nfit.h                                          |   65 --
 test.h                                          |    2 
 test/Makefile.am                                |    9 
 test/dax-dev.c                                  |    4 
 test/dax-pmd.c                                  |   99 +++
 test/device-dax.c                               |    7 
 test/firmware-update.sh                         |   50 +
 test/revoke-devmem.c                            |  143 ++++
 util/json.c                                     |  181 +++++
 util/json.h                                     |   20 -
 37 files changed, 2509 insertions(+), 327 deletions(-)
 create mode 100644 Documentation/ndctl/ndctl-activate-firmware.txt
 create mode 100644 acpi.h
 create mode 100644 daxctl/acpi.c
 delete mode 100644 ndctl/util/json-firmware.c
 delete mode 100644 nfit.h
 create mode 100644 test/revoke-devmem.c

base-commit: c7767834871f7ce50a2abe1da946e9e16fb08eda