[PATCH] libnvdimm/security: Require nvdimm_security_setup_events() to succeed
by Dan Williams
The following warning:
ACPI0012:00: security event setup failed: -19
...is meant to capture exceptional failures of sysfs_get_dirent(),
however it will also fail in the common case when security support is
disabled. A few issues:
1/ A dev_warn() report for a common case is too chatty
2/ The setup of this notifier is generic, no need for it to be driven
from the nfit driver, it can exist completely in the core.
3/ If it fails for any reason besides security support being disabled,
that's fatal and should abort DIMM activation. Userspace may hang if
it never gets overwrite notifications.
4/ The dirent needs to be released.
Move the call to the core 'dimm' driver, make it conditional on security
support being active, make it fatal for the exceptional case, add the
missing sysfs_put() at device disable time.
Cc: Dave Jiang <dave.jiang(a)intel.com>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
drivers/acpi/nfit/core.c | 5 -----
drivers/nvdimm/dimm.c | 6 ++++++
drivers/nvdimm/dimm_devs.c | 22 +++++++++++++++++-----
drivers/nvdimm/nd.h | 1 +
include/linux/libnvdimm.h | 1 -
5 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 9c95b82e5e5d..c38c914d8a58 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -2073,11 +2073,6 @@ static int acpi_nfit_register_dimms(struct acpi_nfit_desc *acpi_desc)
if (!nvdimm)
continue;
- rc = nvdimm_security_setup_events(nvdimm);
- if (rc < 0)
- dev_warn(acpi_desc->dev,
- "security event setup failed: %d\n", rc);
-
nfit_kernfs = sysfs_get_dirent(nvdimm_kobj(nvdimm)->sd, "nfit");
if (nfit_kernfs)
nfit_mem->flags_attr = sysfs_get_dirent(nfit_kernfs,
diff --git a/drivers/nvdimm/dimm.c b/drivers/nvdimm/dimm.c
index 0cf58cabc9ed..3cf50274fadb 100644
--- a/drivers/nvdimm/dimm.c
+++ b/drivers/nvdimm/dimm.c
@@ -26,6 +26,12 @@ static int nvdimm_probe(struct device *dev)
struct nvdimm_drvdata *ndd;
int rc;
+ rc = nvdimm_security_setup_events(dev);
+ if (rc < 0) {
+ dev_err(dev, "security event setup failed: %d\n", rc);
+ return rc;
+ }
+
rc = nvdimm_check_config_data(dev);
if (rc) {
/* not required for non-aliased nvdimm, ex. NVDIMM-N */
diff --git a/drivers/nvdimm/dimm_devs.c b/drivers/nvdimm/dimm_devs.c
index 4890310df874..efe412a6b5b9 100644
--- a/drivers/nvdimm/dimm_devs.c
+++ b/drivers/nvdimm/dimm_devs.c
@@ -578,13 +578,25 @@ struct nvdimm *__nvdimm_create(struct nvdimm_bus *nvdimm_bus,
}
EXPORT_SYMBOL_GPL(__nvdimm_create);
-int nvdimm_security_setup_events(struct nvdimm *nvdimm)
+static void shutdown_security_notify(void *data)
{
- nvdimm->sec.overwrite_state = sysfs_get_dirent(nvdimm->dev.kobj.sd,
- "security");
+ struct nvdimm *nvdimm = data;
+
+ sysfs_put(nvdimm->sec.overwrite_state);
+}
+
+int nvdimm_security_setup_events(struct device *dev)
+{
+ struct nvdimm *nvdimm = to_nvdimm(dev);
+
+ if (nvdimm->sec.state < 0 || !nvdimm->sec.ops
+ || !nvdimm->sec.ops->overwrite)
+ return 0;
+ nvdimm->sec.overwrite_state = sysfs_get_dirent(dev->kobj.sd, "security");
if (!nvdimm->sec.overwrite_state)
- return -ENODEV;
- return 0;
+ return -ENOMEM;
+
+ return devm_add_action_or_reset(dev, shutdown_security_notify, nvdimm);
}
EXPORT_SYMBOL_GPL(nvdimm_security_setup_events);
diff --git a/drivers/nvdimm/nd.h b/drivers/nvdimm/nd.h
index cfde992684e7..379bf4305e61 100644
--- a/drivers/nvdimm/nd.h
+++ b/drivers/nvdimm/nd.h
@@ -250,6 +250,7 @@ long nvdimm_clear_poison(struct device *dev, phys_addr_t phys,
void nvdimm_set_aliasing(struct device *dev);
void nvdimm_set_locked(struct device *dev);
void nvdimm_clear_locked(struct device *dev);
+int nvdimm_security_setup_events(struct device *dev);
#if IS_ENABLED(CONFIG_NVDIMM_KEYS)
int nvdimm_security_unlock(struct device *dev);
#else
diff --git a/include/linux/libnvdimm.h b/include/linux/libnvdimm.h
index 7315977b64da..ad609617aeb8 100644
--- a/include/linux/libnvdimm.h
+++ b/include/linux/libnvdimm.h
@@ -235,7 +235,6 @@ static inline struct nvdimm *nvdimm_create(struct nvdimm_bus *nvdimm_bus,
cmd_mask, num_flush, flush_wpq, NULL, NULL);
}
-int nvdimm_security_setup_events(struct nvdimm *nvdimm);
const struct nd_cmd_desc *nd_cmd_dimm_desc(int cmd);
const struct nd_cmd_desc *nd_cmd_bus_desc(int cmd);
u32 nd_cmd_in_size(struct nvdimm *nvdimm, int cmd,
3 years, 4 months
[PATCH] libnvdimm, pfn: not allocate nd_pfn->pfn_sb if already allocated
by Wei Yang
In current implementation, we might re-allocate nd_pfn->pfn_sb.
For example:
nd_dax_probe()
nd_pfn->pfn_sb = devm_kzalloc()
dax_pmem_probe()
nvdimm_setup_pfn()
nd_pfn_init()
nd_pfn->pfn_sb = devm_kzalloc()
This patch checks nd_pfn->pfn_sb before allocating it in nd_pfn_init().
Signed-off-by: Wei Yang <richardw.yang(a)linux.intel.com>
---
drivers/nvdimm/pfn_devs.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c
index 6f22272e8d80..1f4f07007483 100644
--- a/drivers/nvdimm/pfn_devs.c
+++ b/drivers/nvdimm/pfn_devs.c
@@ -687,21 +687,25 @@ static int nd_pfn_init(struct nd_pfn *nd_pfn)
u32 dax_label_reserve = is_nd_dax(&nd_pfn->dev) ? SZ_128K : 0;
struct nd_namespace_common *ndns = nd_pfn->ndns;
struct nd_namespace_io *nsio = to_nd_namespace_io(&ndns->dev);
+ struct nd_pfn_sb *pfn_sb = nd_pfn->pfn_sb;
resource_size_t start, size;
struct nd_region *nd_region;
u32 start_pad, end_trunc;
- struct nd_pfn_sb *pfn_sb;
unsigned long npfns;
phys_addr_t offset;
const char *sig;
u64 checksum;
int rc;
- pfn_sb = devm_kzalloc(&nd_pfn->dev, sizeof(*pfn_sb), GFP_KERNEL);
- if (!pfn_sb)
- return -ENOMEM;
+ if (!pfn_sb) {
+ pfn_sb = devm_kzalloc(&nd_pfn->dev,
+ sizeof(*pfn_sb), GFP_KERNEL);
+ if (!pfn_sb)
+ return -ENOMEM;
+
+ nd_pfn->pfn_sb = pfn_sb;
+ }
- nd_pfn->pfn_sb = pfn_sb;
if (is_nd_dax(&nd_pfn->dev))
sig = DAX_SIG;
else
--
2.19.1
3 years, 4 months
ЛИДЕР СРЕДИ ОНЛАЙН КАЗИНО В УКРАИНЕ - САМЫЕ ЛУЧШИЕ ВЫИГРЫШИ!
by CASINO-UA
Лидер среди онлайн казино в Украине
От подарков редко кто отказывается! Для каждого зарегистрированного гостя онлайн казино Украины предусмотрен приветственный бонус. Это внушительная сумма, которая поможет вам совершить первые шаги в освоении полюбившейся игры, приучит начинающего геймера быть осмотрительным, и даст возможность в дальнейшем уверенно играть уже на собственные деньги.
НАЧАТЬ ИГРУ »
Не нажимается кнопка?
ЖМИ СЮДА -
http://bit.ly/2FkppyR
LTD CASINO-UA Все права защищены
Отказаться от рассылки или изменить контактную информацию.
3 years, 4 months
libnvdimm fixes 5.0-rc3
by Williams, Dan J
Hi Linus, please pull from:
git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm tags/libnvdimm-fixes-5.0-rc3
...to receive a crash fix, a build warning fix, a miscellaneous small
cleanups.
In case anyone is looking for them, there was a regression caught by
testing that caused 2 patches to be dropped from this update. Those
patches [1] [2] have been reworked and will soak for another week / re-
target 5.0-rc4.
[1]: "acpi/nfit: Block function zero DSMs"
https://patchwork.kernel.org/patch/10765211/
[2]: "acpi/nfit: Fix command-supported detection"
https://patchwork.kernel.org/patch/10772123/
Everything else has been in -next release with no reported issues.
---
The following changes since commit bfeffd155283772bbe78c6a05dec7c0128ee500c:
Linux 5.0-rc1 (2019-01-06 17:08:20 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm tags/libnvdimm-fixes-5.0-rc3
for you to fetch changes up to faa8bd6e12e6aeea289d8e6ba74777b72a69434c:
libnvdimm/security: Fix nvdimm_security_state() state request selection (2019-01-15 13:54:33 -0800)
----------------------------------------------------------------
libnvdimm v5.0-rc3
* Fix driver initialization crash due to the inability to report an
'error' state for a DIMM's security capability.
* Build warning fix for little-endian ARM64 builds
* Fix a potential race between the EDAC driver's usage of the NFIT
SMBIOS id for a DIMM and the driver shutdown path.
* A small collection of one-line benign cleanups for duplicate variable
assignments, a duplicate header include and a mis-typed function
argument.
----------------------------------------------------------------
Dan Williams (1):
libnvdimm/dimm: Fix security capability detection for non-Intel NVDIMMs
Dave Jiang (1):
libnvdimm/security: Fix nvdimm_security_state() state request selection
Nathan Chancellor (1):
nfit: Mark some functions as __maybe_unused
Tony Luck (1):
acpi/nfit: Fix race accessing memdev in nfit_get_smbios_id()
Wei Yang (1):
acpi/nfit: Remove duplicate set nd_set in acpi_nfit_init_interleave_set()
Xiaochun Lee (2):
ACPI/nfit: delete the redundant header file
ACPI/nfit: delete the function to_acpi_nfit_desc
drivers/acpi/nfit/core.c | 20 +++++++-------------
drivers/acpi/nfit/intel.c | 8 ++++----
drivers/nvdimm/nd-core.h | 4 ++--
include/linux/libnvdimm.h | 1 +
4 files changed, 14 insertions(+), 19 deletions(-)
3 years, 4 months
[PATCH v3 0/2] acpi/nfit: Fix command-supported detection
by Dan Williams
Changes since v2 [1]:
* Don't allow ND_CMD_CALL to bypass dsm_mask restrictions (Jeff)
[1]: https://lists.01.org/pipermail/linux-nvdimm/2019-January/019498.html
---
One last resend to make sure all the last bits of thrash have settled.
Quote patch2 changelog:
The _DSM function number validation only happens to succeed when the
generic Linux command number translation corresponds with a
DSM-family-specific function number. This breaks NVDIMM-N
implementations that correctly implement _LSR, _LSW, and _LSI, but do
not happen to publish support for DSM function numbers 4, 5, and 6.
Recall that the support for _LS{I,R,W} family of methods results in the
DIMM being marked as supporting those command numbers at
acpi_nfit_register_dimms() time. The DSM function mask is only used for
ND_CMD_CALL support of non-NVDIMM_FAMILY_INTEL devices.
---
Dan Williams (2):
acpi/nfit: Block function zero DSMs
acpi/nfit: Fix command-supported detection
drivers/acpi/nfit/core.c | 59 +++++++++++++++++++++++++++++++++++-----------
1 file changed, 45 insertions(+), 14 deletions(-)
3 years, 4 months
[ndctl PATCH] ndctl, Documentation: Allow for Makefile variables in Documentation
by Vishal Verma
We were starting to accumulate automake variables such as configureation
file paths that were also referenced in Documentation man pages.
However, until now, the man pages simply hard coded these paths to their
default values. If a distribution were to configure such a path to
something other than the default, the man pages would be out of sync
with the reality.
Arrange for Makefile variables to be piped into an 'attrs.adoc' target
(the variables to be piped in this manner still ahve to be listed
explicitly). The different asciidoc(tor) source files can then include
attrs.adoc to use these variables.
Finally, convert instances of '/etc/ndctl/monitor.conf' in the monitor
documentation to use this new facility.
Cc: QI Fuli <qi.fuli(a)jp.fujitsu.com>
Cc: Dave Jiang <dave.jiang(a)intel.com>
Cc: Dan Williams <dan.j.williams(a)intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma(a)intel.com>
---
Documentation/ndctl/Makefile.am | 10 +++++++++-
Documentation/ndctl/ndctl-monitor.txt | 16 ++++++++++------
2 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/Documentation/ndctl/Makefile.am b/Documentation/ndctl/Makefile.am
index a30b139..7e17f20 100644
--- a/Documentation/ndctl/Makefile.am
+++ b/Documentation/ndctl/Makefile.am
@@ -51,6 +51,13 @@ man1_MANS = \
CLEANFILES = $(man1_MANS)
+.ONESHELL:
+attrs.adoc: $(srcdir)/Makefile.am
+ $(AM_V_GEN) cat <<- EOF >$@
+ :ndctl_monitorconfdir: $(ndctl_monitorconfdir)
+ :ndctl_monitorconf: $(ndctl_monitorconf)
+ EOF
+
XML_DEPS = \
../../version.m4 \
Makefile \
@@ -63,7 +70,8 @@ XML_DEPS = \
xable-namespace-options.txt \
ars-description.txt \
labels-description.txt \
- labels-options.txt
+ labels-options.txt \
+ attrs.adoc
RM ?= rm -f
diff --git a/Documentation/ndctl/ndctl-monitor.txt b/Documentation/ndctl/ndctl-monitor.txt
index 363c398..2239f04 100644
--- a/Documentation/ndctl/ndctl-monitor.txt
+++ b/Documentation/ndctl/ndctl-monitor.txt
@@ -1,5 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
+include::attrs.adoc[]
+
ndctl-monitor(1)
================
@@ -19,11 +21,13 @@ objects and dumping the json format notifications to syslog, standard
output or a logfile.
The objects to monitor and smart events to notify can be selected by
-setting options and/or the default configuration file
-(/etc/ndctl/monitor.conf). Both of the values in configuration file
-and in options will work. If there is a conflict, the values in
-options will override the values in configuration file. The changed
-values in configuration file will work after the monitor is restarted.
+setting options and/or the configuration file at
+{ndctl_monitorconfdir}/{ndctl_monitorconf}
+
+Both, the values in configuration file and in options will work. If
+there is a conflict, the values in options will override the values in
+the configuration file. Any updated values in the configuration file will
+take effect only after the monitor process is restarted.
EXAMPLES
--------
@@ -83,7 +87,7 @@ will not work if "--daemon" is specified.
-c::
--config-file=::
Provide the config file to use. This overrides the default config
- typically found in /etc/ndctl/
+ typically found in {ndctl_monitorconfdir}
--daemon::
Run a monitor as a daemon.
--
2.20.1
3 years, 4 months
[driver-core PATCH v9 0/9] Add NUMA aware async_schedule calls
by Alexander Duyck
This patch set provides functionality that will help to improve the
locality of the async_schedule calls used to provide deferred
initialization.
This patch set originally started out focused on just the one call to
async_schedule_domain in the nvdimm tree that was being used to defer the
device_add call however after doing some digging I realized the scope of
this was much broader than I had originally planned. As such I went
through and reworked the underlying infrastructure down to replacing the
queue_work call itself with a function of my own and opted to try and
provide a NUMA aware solution that would work for a broader audience.
In addition I have added several tweaks and/or clean-ups to the front of the
patch set. Patches 1 through 3 address a number of issues that actually were
causing the existing async_schedule calls to not show the performance that
they could due to either not scaling on a per device basis, or due to issues
that could result in a potential race. For example, patch 3 addresses the
fact that we were calling async_schedule once per driver instead of once
per device, and as a result we would have still ended up with devices
being probed on a non-local node without addressing this first.
I have also updated the kernel module used to test async driver probing so
that it can expose the original issue I was attempting to address.
It will fail on a system of asynchronous work either takes longer than it
takes to load a single device and a single driver with a device already
added. It will also fail if the NUMA node that the driver is loaded on does
not match the NUMA node the device is associated with.
RFC->v1:
Dropped nvdimm patch to submit later.
It relies on code in libnvdimm development tree.
Simplified queue_work_near to just convert node into a CPU.
Split up drivers core and PM core patches.
v1->v2:
Renamed queue_work_near to queue_work_node
Added WARN_ON_ONCE if we use queue_work_node with per-cpu workqueue
v2->v3:
Added Acked-by for queue_work_node patch
Continued rename from _near to _node to be consistent with queue_work_node
Renamed async_schedule_near_domain to async_schedule_node_domain
Renamed async_schedule_near to async_schedule_node
Added kerneldoc for new async_schedule_XXX functions
Updated patch description for patch 4 to include data on potential gains
v3->v4
Added patch to consolidate use of need_parent_lock
Make asynchronous driver probing explicit about use of drvdata
v4->v5
Added patch to move async_synchronize_full to address deadlock
Added bit async_probe to act as mutex for probe/remove calls
Added back nvdimm patch as code it relies on is now in Linus's tree
Incorporated review comments on parent & device locking consolidation
Rebased on latest linux-next
v5->v6:
Drop the "This patch" or "This change" from start of patch descriptions.
Drop unnecessary parenthesis in first patch
Use same wording for "selecting a CPU" in comments added in first patch
Added kernel documentation for async_probe member of device
Fixed up comments for async_schedule calls in patch 2
Moved code related setting async driver out of device.h and into dd.c
Added Reviewed-by for several patches
v6->v7:
Fixed typo which had kernel doc refer to "lock" when I meant "unlock"
Dropped "bool X:1" to "u8 X:1" from patch description
Added async_driver to device_private structure to store driver
Dropped unecessary code shuffle from async_probe patch
Reordered patches to move fixes up to front
Added Reviewed-by for several patches
Updated cover page and patch descriptions throughout the set
v7->v8:
Replaced async_probe value with dead, only apply dead in device_del
Dropped Reviewed-by from patch 2 due to significant changes
Added Reviewed-by for patches reviewed by Luis Chamberlain
v8->v9:
Dropped patch 1 as it was applied, shifted remaining patches by 1
Added new patch 9 that adds test framework for NUMA and sequential init
Tweaked what is now patch 1, and added Reviewed-by from Dan Williams
---
Alexander Duyck (9):
driver core: Establish order of operations for device_add and device_del via bitflag
device core: Consolidate locking and unlocking of parent and device
driver core: Probe devices asynchronously instead of the driver
workqueue: Provide queue_work_node to queue work near a given NUMA node
async: Add support for queueing on specific NUMA node
driver core: Attach devices on CPU local to device node
PM core: Use new async_schedule_dev command
libnvdimm: Schedule device registration on node local to the device
driver core: Rewrite test_async_driver_probe to cover serialization and NUMA affinity
drivers/base/base.h | 4
drivers/base/bus.c | 46 +----
drivers/base/core.c | 11 +
drivers/base/dd.c | 160 +++++++++++++----
drivers/base/power/main.c | 12 +
drivers/base/test/test_async_driver_probe.c | 261 +++++++++++++++++++++------
drivers/nvdimm/bus.c | 11 +
include/linux/async.h | 82 ++++++++
include/linux/device.h | 5 +
include/linux/workqueue.h | 2
kernel/async.c | 53 +++--
kernel/workqueue.c | 84 +++++++++
12 files changed, 565 insertions(+), 166 deletions(-)
--
3 years, 4 months
[PATCH] libnvdimm/label: Clear 'updating' flag after label-set update
by Dan Williams
The UEFI 2.7 specification sets expectations that the 'updating' flag is
eventually cleared. To date, the libnvdimm core has never adhered to
that protocol. The policy of the core matches the policy of other
multi-device info-block formats like MD-Software-RAID that expect
administrator intervention on inconsistent info-blocks, not automatic
invalidation.
However, some pre-boot environments may unfortunately attempt to "clean
up" the labels and invalidate a set when it fails to find at least one
"non-updating" label in the set. Clear the updating flag after set
updates to minimize the window of vulnerability to aggressive pre-boot
environments.
Ideally implementations would not write to the label area outside of
creating namespaces.
Note that this only minimizes the window, it does not close it as the
system can still crash while clearing the flag and the set can be
subsequently deleted / invalidated by the pre-boot environment.
Fixes: f524bf271a5c ("libnvdimm: write pmem label set")
Cc: <stable(a)vger.kernel.org>
Cc: Kelly Couch <kelly.j.couch(a)intel.com>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
drivers/nvdimm/label.c | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/drivers/nvdimm/label.c b/drivers/nvdimm/label.c
index a11bf4e6b451..6d6e9a12150b 100644
--- a/drivers/nvdimm/label.c
+++ b/drivers/nvdimm/label.c
@@ -755,7 +755,7 @@ static const guid_t *to_abstraction_guid(enum nvdimm_claim_class claim_class,
static int __pmem_label_update(struct nd_region *nd_region,
struct nd_mapping *nd_mapping, struct nd_namespace_pmem *nspm,
- int pos)
+ int pos, unsigned long flags)
{
struct nd_namespace_common *ndns = &nspm->nsio.common;
struct nd_interleave_set *nd_set = nd_region->nd_set;
@@ -796,7 +796,7 @@ static int __pmem_label_update(struct nd_region *nd_region,
memcpy(nd_label->uuid, nspm->uuid, NSLABEL_UUID_LEN);
if (nspm->alt_name)
memcpy(nd_label->name, nspm->alt_name, NSLABEL_NAME_LEN);
- nd_label->flags = __cpu_to_le32(NSLABEL_FLAG_UPDATING);
+ nd_label->flags = __cpu_to_le32(flags);
nd_label->nlabel = __cpu_to_le16(nd_region->ndr_mappings);
nd_label->position = __cpu_to_le16(pos);
nd_label->isetcookie = __cpu_to_le64(cookie);
@@ -1249,13 +1249,13 @@ static int del_labels(struct nd_mapping *nd_mapping, u8 *uuid)
int nd_pmem_namespace_label_update(struct nd_region *nd_region,
struct nd_namespace_pmem *nspm, resource_size_t size)
{
- int i;
+ int i, rc;
for (i = 0; i < nd_region->ndr_mappings; i++) {
struct nd_mapping *nd_mapping = &nd_region->mapping[i];
struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
struct resource *res;
- int rc, count = 0;
+ int count = 0;
if (size == 0) {
rc = del_labels(nd_mapping, nspm->uuid);
@@ -1273,7 +1273,20 @@ int nd_pmem_namespace_label_update(struct nd_region *nd_region,
if (rc < 0)
return rc;
- rc = __pmem_label_update(nd_region, nd_mapping, nspm, i);
+ rc = __pmem_label_update(nd_region, nd_mapping, nspm, i,
+ NSLABEL_FLAG_UPDATING);
+ if (rc)
+ return rc;
+ }
+
+ if (size == 0)
+ return 0;
+
+ /* Clear the UPDATING flag per UEFI 2.7 expectations */
+ for (i = 0; i < nd_region->ndr_mappings; i++) {
+ struct nd_mapping *nd_mapping = &nd_region->mapping[i];
+
+ rc = __pmem_label_update(nd_region, nd_mapping, nspm, i, 0);
if (rc)
return rc;
}
3 years, 4 months
[PATCH v2 0/2] acpi/nfit: Fix command-supported detection
by Dan Williams
Changes since v1 [1]:
* Include another patch make sure that function-number zero can be
safely used as an invalid function number (Jeff)
* Add a comment clarifying why zero is an invalid function number (Jeff)
* Pass nfit_mem to cmd_to_func() (Jeff)
* Collect a Tested-by from Sujith
[1]: https://lists.01.org/pipermail/linux-nvdimm/2019-January/019435.html
---
Quote patch2 changelog:
The _DSM function number validation only happens to succeed when the
generic Linux command number translation corresponds with a
DSM-family-specific function number. This breaks NVDIMM-N
implementations that correctly implement _LSR, _LSW, and _LSI, but do
not happen to publish support for DSM function numbers 4, 5, and 6.
Recall that the support for _LS{I,R,W} family of methods results in the
DIMM being marked as supporting those command numbers at
acpi_nfit_register_dimms() time. The DSM function mask is only used for
ND_CMD_CALL support of non-NVDIMM_FAMILY_INTEL devices.
---
Dan Williams (2):
acpi/nfit: Block function zero DSMs
acpi/nfit: Fix command-supported detection
drivers/acpi/nfit/core.c | 53 ++++++++++++++++++++++++++++++++++------------
1 file changed, 39 insertions(+), 14 deletions(-)
3 years, 4 months
[daxctl PATCH v3 0/3] daxctl: Opt-in to /sys/bus/dax ABI
by Dan Williams
Changes since v2:
* Fix up the daxtctl/config.h build dependency (Dave)
* Fix up the patch2 changelog (Vishal)
* Fix up output capitalization (Vishal)
* Fix up copyright for the new migrate.c, and while we're at it do the
same for all autogenerated documentation. (Vishal)
---
Quote patch2:
The kernel is implementing a '/sys/bus/dax' ABI to allow for alternate
device-DAX drivers to be bound to device instances. While the kernel's
conversion to '/sys/bus/dax' does not affect the primary ndctl use case
of putting namespaces into 'devdax' mode since that uses libnvdimm
namespace device relative paths, it does break current implementations
of 'ndctl list -X' and 'daxctl list'. It is also known to break fio and
some pmdk versions that explicitly reference "/sys/class/dax".
In order to avoid userspace regressions the kernel can be configured to
maintain '/sys/class/dax' as the default ABI. However, once all
'/sys/class/dax' users have been converted, or removed from the
installation, an administrator can opt-in to the new '/sys/bus/dax' ABI.
The 'dax migrate-device-model' command installs a modprobe rule to
blacklist the dax_pmem_compat module and arrange for the dax_pmem module
to auto-load in response to the detection of device-DAX instances
emitted from the libnvdimm subsystem.
---
Dan Williams (3):
daxctl: Support the /sys/bus/dax ABI
daxctl: Opt-in to /sys/bus/dax ABI
Documentation: Update copyright
.gitignore | 1
Documentation/copyright.txt | 2 -
Documentation/daxctl/Makefile.am | 3 +
.../daxctl/daxctl-migrate-device-model.txt | 47 +++++++++++++
configure.ac | 5 +
daxctl/Makefile.am | 10 +++
daxctl/builtin.h | 1
daxctl/daxctl.c | 1
daxctl/lib/Makefile.am | 2 +
daxctl/lib/daxctl.conf | 2 +
daxctl/lib/libdaxctl-private.h | 11 +++
daxctl/lib/libdaxctl.c | 70 ++++++++++++++------
daxctl/migrate.c | 41 ++++++++++++
ndctl.spec.in | 1
util/sysfs.c | 2 -
15 files changed, 176 insertions(+), 23 deletions(-)
create mode 100644 Documentation/daxctl/daxctl-migrate-device-model.txt
create mode 100644 daxctl/lib/daxctl.conf
create mode 100644 daxctl/migrate.c
3 years, 4 months