From patchwork Tue Mar 7 00:25:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linda Knippers X-Patchwork-Id: 9607889 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DD7CE60414 for ; Tue, 7 Mar 2017 00:25:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D49AC28482 for ; Tue, 7 Mar 2017 00:25:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9A932848D; Tue, 7 Mar 2017 00:25:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4640A28482 for ; Tue, 7 Mar 2017 00:25:38 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3702D80348; Mon, 6 Mar 2017 16:25:38 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0717.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe42::717]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E10E980347 for ; Mon, 6 Mar 2017 16:25:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=HPEnterprise.onmicrosoft.com; s=selector1-hpe-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=d0v1sPtHrryfnFeL9uP5/GaigHDsq+K0zYfI8xYtUuk=; b=OqF35ekimgTIJnQ0F3SlSnWrnrMAqJqctbxSJUPZ1bTSmtXHxsG5bR+dCgaLm2znWsxrekqO1sGwbNVpDB2xOegO+Mm7RcfwRTyKBNNSV+gouP2XcfhLW50Ev5aCI90A8+AZxNhCvFsKGKsYJMGCSXQHN8aEcOxCWYpKQlpYzyw= Authentication-Results: lists.01.org; dkim=none (message not signed) header.d=none; lists.01.org; dmarc=none action=none header.from=hpe.com; Received: from hp-dl380pgen9-02.lab.bos.redhat.com (66.187.233.206) by CS1PR84MB0167.NAMPRD84.PROD.OUTLOOK.COM (10.162.190.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12; Tue, 7 Mar 2017 00:25:34 +0000 From: Linda Knippers To: Subject: [PATCH 1/3] Allow override of built-in bitmasks for NVDIMM DSMs Date: Mon, 6 Mar 2017 19:25:04 -0500 Message-ID: <8d9f517851514711df1012ed03d218931ea12b55.1488844291.git.linda.knippers@hpe.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [66.187.233.206] X-ClientProxiedBy: CY4PR15CA0003.namprd15.prod.outlook.com (10.172.74.13) To CS1PR84MB0167.NAMPRD84.PROD.OUTLOOK.COM (10.162.190.139) X-MS-Office365-Filtering-Correlation-Id: ce842a15-dbf3-4f4b-18d7-08d464f07937 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:CS1PR84MB0167; X-Microsoft-Exchange-Diagnostics: 1; CS1PR84MB0167; 3:K1Gn85JyOikK8uESAEw0hmiF1Y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Fd2QmnRwkqCohH2/+tMYtiH5IL8dgQHkMts8jC7UKsJ/Xz4c9UGgXUDFQNWib8opo+iCydgUErRsdlGLUbuBZNHt/9PMpPOAXwkuAa9XktLFZdPoVk52EzXTeWHboKeg1piUetWapLUdm9OKuBVSv/b2xscvNnLoYx0ta+t5inTXA8bxicVUVZuTSqakElOR/u/Nu1wJZ3rymGiG52QZHMKROaLLeRsSck/EMPa8Z/MwaBUkrDriVxnyEOCWxoAJ5PAeNiCeCmgXLUcYtdYgXSh+6cRftZdzDrPoTInDqn2frUpL6gsXz1gBI9bBCISrBI+Mu0viYEuUbqfGuhDGVd+L92xRuJV7TU7lNd3PsfMI6LSaLL9eb5cxBdbiIDoXExJJvJTAqAbJLmlupEFFOilOkqkj05AHCshxgnq3MwC9ywLDDckt1g1K92uEsmdHNhe60bq6oS3Zk2TXdT/AG X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(227479698468861); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6041248)(20161123562025)(20161123558025)(20161123560025)(20161123555025)(20161123564025)(6072148); SRVR:CS1PR84MB0167; BCL:0; PCL:0; RULEID:; SRVR:CS1PR84MB0167; X-Microsoft-Exchange-Diagnostics: 1; CS1PR84MB0167; 4:6HaSKvyfhST2j2qo34KPMUrn9VWjXzIhGtCccgG00+65Zz6kXHGdJMo+K9YqkOWRkZizWFwLOXlGaL1LWc/ic7ezr+Ck2JavMqvVq21G1Qm4Pkil/fkhc+rW4NpMob8kDQ5tH9OgrDz3cZ+JU9TvzhwOy+kIYoI47yHIKo7RYng+Evg6mKU4mbEwe68N43Fpe7ADnNByHkH5hsZLN3eOjccsx77PyLiKfxOqeGAStHOl0Z9eWaq+6X0IgUfmCh8faii9Uk70wYPr7ueRw4cKied45hgmdvf+PfJ/yBZyXP3aUqgsW3rl4ClpndqHDNg0OB39LgnNuuuUd+CYW8vFHyZ/Ss9RUaJIpwZio85LKAHGStxQg4ZpHmjFDW05OjwIpCQKJQzAkRcecOzckh7Yu4p4oKmIFFkugkNTuEVOFD0qR3Oq6rhOF3DNk9mK+5Ot7KGPLvqm4R/Vw2n0As8ToNERGDDQ2hjaSc3fgdhh67FgnkELHvlR0ft8EyFFw1k5kksjAlpaNdDS8Z0AGUjVlHOrLzLsyUhoU5IDTdB8Ik6YC8P6JPYGus+UPg61Vued1/fmVi9McNkErLAUggmg6qNL60XFlihWOAkw6vJ573/L6XdwhlugradQGhGcfXJsee3TOUnMMZgtzsG/a55EeHUO+X/XZWHWItPXEZt3lIk= X-Forefront-PRVS: 0239D46DB6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(39840400002)(39860400002)(39850400002)(39410400002)(39450400003)(5003940100001)(2351001)(5660300001)(189998001)(33646002)(50986999)(54906002)(66066001)(47776003)(6512007)(86362001)(76176999)(81166006)(50226002)(8676002)(92566002)(36756003)(53936002)(48376002)(50466002)(118296001)(38730400002)(6506006)(6916009)(110136004)(2950100002)(6666003)(42186005)(4720700003)(2906002)(305945005)(7736002)(4326008)(6486002)(6116002)(3846002)(7099028); DIR:OUT; SFP:1102; SCL:1; SRVR:CS1PR84MB0167; H:hp-dl380pgen9-02.lab.bos.redhat.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CS1PR84MB0167; 23:JsTZvmZPXHcMmg6rOlqqAVLpwIuYqJt5p6NxHd4NO?= =?us-ascii?Q?7npgvdXBfIJ42JO0rDFUI/U6httXRUey3RiNOD8FKTYGDSubibzrbTvLS0OB?= =?us-ascii?Q?U4lVPTabNQ7vkGqQnFzHglq/VSMIb0Y7/5L2MRdijWET8d3q0kCI/DdQVEVh?= =?us-ascii?Q?FLkhWzPFISITxY1f8tVGa2iaQDT63zyK2jqbuMv8dnJsUeXX9tGfhVDq50vB?= =?us-ascii?Q?H2Nrpqd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WdN/j?= =?us-ascii?Q?3dvvNcIMVs=3D?= X-Microsoft-Exchange-Diagnostics: 1; CS1PR84MB0167; 6:jz22PdZ5bhLrjM6rE1IXcdJ7XOfo/2+hf796Uz891+d3U11yx/mJv4KpmkvqkyMe3txXWGpMoA7Wm9RgMo3ZNpT905ANuyMjRpQ1mOTNANYSmWC54X4ziYKjGWLX/5YkfOY9rmQ+Tbq5OY2Gk23bpz6B9vmuiduTndf6kHXEtMNbQi3GNZ9/80Shyjky7yWywrOhiwXQPkELj1mfE2ZIQntV80dSlMps/ZhfQSuVapcyhGaCrkILftw6i46zIGT004pzUtS47LM+hYEN8figuNZ2qf603KnQMB5w3/IPFkvG5yv5btgf8SNUQQ8ZEsKIlnWiT8WYEt+f/GTigbjUOIq90SNJUQkpxTi3KNy19kpkeuYBmaJ5D2/6nItydJYR1nK7zwMtkHMu5jUnNp5NaMuO3L3IbfJhdjuHTvF1EPg=; 5:Za4T1jdoOc9w8DzUJx8RLhrR7ElWoVK7N8/4zUjMgdiNAMGh8fZtDs3iB+iwvbpIdQ7sLkj/trCpERoXav06uaJT5wmnAnAOlZVblnsDewhKhkNU3BMJVixPcDB5g/GWAb9laRB25DT0x/fiNij8HQ==; 24:rMLLUfX968xs5IFvYWlmttt0Uo8rIKKfAQDrlYtZEGmxJ15g01t/jThG4XlZ6xZOtRcdj2xLMMtGlkOtrjzNhL+svH5RtQ4pYlPEgG+TzGM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CS1PR84MB0167; 7:TVZxHnsjUjy00xsSXf6eD+OiJXDNWiUydr/ViCzf9HpQU17UgH2Wxq3RCpje4AUnLk/fLr751YyQ1mjcBZg/n+S9fdz/QPRyIA5dsOcM8AI+hmD8LkTy5Sr+Kyhcyr/9bsn8zCNtTNXXxkilFrre8Rgv5G9a++L+PBEtRQHAowXsgaKBS02i0NP7fosuppMt+oHq6mVr26jBCtVKQexsOogbCwX6Gs1JMvKUqV2atDR6IHMvXH1HSTDit0Qu2ynhmp0prvcdRS0AhuiyMVTyfJ6H7vQIVl4nj/ZKXAZPGn6otFLhDW1weZvUoHPvwW7dnoI4wyD4nn6Bs5qYfOm1Gw== X-OriginatorOrg: hpe.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2017 00:25:34.9196 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR84MB0167 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP 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: Linda Knippers Reviewed-by: Johannes Thumshirn --- drivers/acpi/nfit/core.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index 662036b..97d42ff 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -51,6 +51,10 @@ MODULE_PARM_DESC(disable_vendor_specific, "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); DEFINE_MUTEX(acpi_desc_lock); @@ -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 */ 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; if (disable_vendor_specific) dsm_mask &= ~(1 << ND_CMD_VENDOR);