Commit 095ab4b3 authored by Linda Knippers's avatar Linda Knippers Committed by Dan Williams

acpi, nfit: allow override of built-in bitmasks for nvdimm DSMs

As it is today, we can't enable or test new NVDIMM management functions
provided by new firmware and tools without changing the kernel.  We also
can't prevent documented DSM functions from being called in the case of
buggy firmware.  This patch provides a module parameter that overrides
the DSM function mask that is built into the kernel.

If the "disable_vendor_specific" module parameter is also used we ignore
the new parameter.
Signed-off-by: default avatarLinda Knippers <linda.knippers@hpe.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 11e63f6d
...@@ -51,6 +51,10 @@ module_param(disable_vendor_specific, bool, S_IRUGO); ...@@ -51,6 +51,10 @@ module_param(disable_vendor_specific, bool, S_IRUGO);
MODULE_PARM_DESC(disable_vendor_specific, MODULE_PARM_DESC(disable_vendor_specific,
"Limit commands to the publicly specified set\n"); "Limit commands to the publicly specified set\n");
static unsigned long override_dsm_mask;
module_param(override_dsm_mask, ulong, S_IRUGO);
MODULE_PARM_DESC(override_dsm_mask, "Bitmask of allowed NVDIMM DSM functions");
LIST_HEAD(acpi_descs); LIST_HEAD(acpi_descs);
DEFINE_MUTEX(acpi_desc_lock); DEFINE_MUTEX(acpi_desc_lock);
...@@ -1402,7 +1406,9 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc, ...@@ -1402,7 +1406,9 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
/* limit the supported commands to those that are publicly documented */ /* limit the supported commands to those that are publicly documented */
nfit_mem->family = i; nfit_mem->family = i;
if (nfit_mem->family == NVDIMM_FAMILY_INTEL) { if (override_dsm_mask && !disable_vendor_specific)
dsm_mask = override_dsm_mask;
else if (nfit_mem->family == NVDIMM_FAMILY_INTEL) {
dsm_mask = 0x3fe; dsm_mask = 0x3fe;
if (disable_vendor_specific) if (disable_vendor_specific)
dsm_mask &= ~(1 << ND_CMD_VENDOR); dsm_mask &= ~(1 << ND_CMD_VENDOR);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment