From patchwork Tue Mar 7 21:35:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linda Knippers X-Patchwork-Id: 9609893 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 94E046046A for ; Tue, 7 Mar 2017 21:35:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8316528559 for ; Tue, 7 Mar 2017 21:35:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 781072855B; Tue, 7 Mar 2017 21:35:40 +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 0DB2C28559 for ; Tue, 7 Mar 2017 21:35:39 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id ED5FE80356; Tue, 7 Mar 2017 13:35:39 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0725.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe46::725]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 40DC080348 for ; Tue, 7 Mar 2017 13:35:38 -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=fw6l7iSih+ilP7rbMhyQoWx5zQu526dXl7p1y8UQ32yM7Oq+9cF17YZMDL3CgrhbOWrN1gpKewhAcNIXQ5aTFi65RpX/4k66WQpyDK5K0elzse3ubudksikjaUnhaTmmX2Sbmr1AeCOnBLlh0YgRXCYVxrAuPiSGDBeejUpvuSQ= 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 AT5PR84MB0162.NAMPRD84.PROD.OUTLOOK.COM (10.162.138.12) 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 21:35:35 +0000 From: Linda Knippers To: Subject: [PATCH 1/3] Allow override of built-in bitmasks for NVDIMM DSMs Date: Tue, 7 Mar 2017 16:35:12 -0500 Message-ID: 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: DM5PR08CA0011.namprd08.prod.outlook.com (10.175.218.21) To AT5PR84MB0162.NAMPRD84.PROD.OUTLOOK.COM (10.162.138.12) X-MS-Office365-Filtering-Correlation-Id: 857d90e3-6b03-49ab-f87f-08d465a1e48c X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:AT5PR84MB0162; X-Microsoft-Exchange-Diagnostics: 1; AT5PR84MB0162; 3:mogleNmhlA8viJS0aCYpecTAq7krQx3lg/sKOJy/Xn+tYfPCDKqc3pUhiUCpXGHr6DhuPgiCKJfG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09jQlzhgFXR3nmzJWi/tgrS3Z7tARYYx1bJEfKll4LqqbcOkK4U7BlDg4Ncp05DgwLih4dpp/sSnlom/R1UUXeTOgC7CB/s+qsCXZOH5D1xWITH3JdojIIUXv/iTXpmGGpsrTQ1KYEBSDCHZT++bGhkb2ODez+D447yQkZJRvZ1DVNy6VBx5EnYT2vpcqSGo8ZR06VoAi/SCvEJS4AoqsoN8EgEooaXe4i4lM3NQ4RVEIh/+Kr8XVv0B9tM9hW83vtAOO5wyf0JwK8WK9184mMoLAkZwTsftgT02rTf8SbB645rEIHaRYYF7JcPJKHa2Uw4ALfEwdBM1YSFqMF9RRi4ray6hsUo/9roBw+p5lw2oGT/QOz+SNgp52daYc4/1HunIchiNqGRvq5NE/nl7LItQAyx0YBGZsw0gVDpVAS2eu37zNljarYya6WV8wFI5EDuMkg0tR7RoB4cB 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)(20161123560025)(20161123558025)(20161123562025)(20161123555025)(20161123564025)(6072148); SRVR:AT5PR84MB0162; BCL:0; PCL:0; RULEID:; SRVR:AT5PR84MB0162; X-Microsoft-Exchange-Diagnostics: 1; AT5PR84MB0162; 4:6S9iNKjJHVEchXG9gvqqQbtvE14SsK2z25C/sI/5nT1N2fs6ZxTACofDNJWC+cbJY+0BKVMSEjtBZD1Yoy2q/eyMhs3mAjCF6trKJgOIUCKQMc/gr+mxdnAX8/Gj1DI7hjXlK5V+5jhd2chYhciYPO8vrTFYLrIC/S2FsbuP/GCPUGdsWe4zsaFQrIUbILRGoW8letD2NgIz28kyibF4Gk0/MFOkOI9LdTVe5Hvb3xc3uzRF+MnzhV7FBc0e13rodjbtck9ZKejiXBskbfmtrjRcuzL0utB5xVFI8I33fhaqBgOsPSYVPOqQUYZojnsCWoAw7yE5SPjwtfk23X30ngVHCTyo5m5xPYb8zl/cUbuzAAhNvEi7XppDCHYhAJ0nd+fXSJzjchzqKdQ+b8Onhf4V4kSfW6ApW6SBLBpzX65kP2JU22ij6+Hh7pC34Iw9tSXtfTs2P4XwOfkVMMIZc0dwiClyjUXIqnMaXLp1pq3abMWO7g5v/zdPseRVEefZw4GgPdBf4nHRlcPK9i5DXxs8r/JvkWP5xmyPR4cKwseAdJNpxXbLtCDS8csaPrNDzE0xg5n6HGwAC3DwC/HqrBkZzeUBuxpcMpubgClapquDgZrIc1pLY02c3CVsvDs2Lo+pIO/EBkegmHa4P9mA70/SG2qphaOIOLbtzoNmKYM= X-Forefront-PRVS: 0239D46DB6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39860400002)(39850400002)(39410400002)(39450400003)(6506006)(6486002)(50226002)(5003940100001)(2906002)(54906002)(6512007)(118296001)(76176999)(42186005)(50986999)(5660300001)(2351001)(3846002)(6116002)(4326008)(36756003)(47776003)(33646002)(48376002)(38730400002)(305945005)(110136004)(53936002)(50466002)(189998001)(4720700003)(6916009)(6666003)(2950100002)(86362001)(7736002)(8676002)(66066001)(7099028); DIR:OUT; SFP:1102; SCL:1; SRVR:AT5PR84MB0162; H:hp-dl380pgen9-02.lab.bos.redhat.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AT5PR84MB0162; 23:t1HNxY00DLTTk9Imh5BdFy1OVRLsdkOg/sYRjhJSq?= =?us-ascii?Q?DmL4GsMFZJqg3SJ5usQUz0eKNEQ4WBJQ3s1ooavZTrUT7FM3JgIbMseYWRjz?= =?us-ascii?Q?CWhK1jUzf/TweIRTqeS6Dk9hhx4/4/VG7AK9k1ECGuwRcpjWsNKm8PYPS8hz?= =?us-ascii?Q?ecCn7DDtR3T1Kabkbp+8uwL7PnMDYsrzAgp9PttlrbSEXUeQSP99YyeNv4o4?= =?us-ascii?Q?1ICPyBH81oOIpUeSIJ8ik3o+2fW2+HIwEGDzwSu05sNAmtdywEhl3MfCP1mg?= =?us-ascii?Q?q7NlOxTnk9zegkge27z6tVa3GpyGF52QxmWkLxAQCqdDSYH2sQARPKbR61Ej?= =?us-ascii?Q?uk2QuHnjUN2UUyaP3NBYY9RHzOiMiQwwhOGBbiArifyRPziVHdx/kQEMtzN0?= =?us-ascii?Q?4cERiw9mZyxXMK1UyPEfNCIgVfCL3gxdb1AZx+P1O66o5zr+/4VP2vTftxad?= =?us-ascii?Q?ycYMsr55cLRNBF0jeMfaegFTso/BAVNSyaU2G59TgGlmk878wuH8jXSeXxst?= =?us-ascii?Q?0UYytb8KIFdVXzz2hRo6m1BaUcq8ZxwvHxXxcQFzRf2KfplT9AMDdTv9fjOU?= =?us-ascii?Q?b0cZBm9gJYCTxffr1Lc73pciZIGEIH/2M02UttBgkCzy3Xga1bvwX2ndo41w?= =?us-ascii?Q?IP09c9AyZNfp0weUFAudoc8pGjD9XPYZvKhNDqwb5qbXpu9/rqpoBe3R27QJ?= =?us-ascii?Q?twG5SudAB8A8cOLaguEPc3JPi6Y4aYOiECMU5k5yBQ8uInk0orHLbBdsgqhU?= =?us-ascii?Q?m3+x0MX0prhVm4Of+I8WLy3IZQ3KfnEiwOCBMiZ0u/eprnpvgKJLUCPGmMQ0?= =?us-ascii?Q?tgyTNdhDU2JpcobdCfKHFvzOl1nqmj3+eUvctcEyqxqGMJE04kOwpDB1guyM?= =?us-ascii?Q?a2NlNwYALgbt+RWr7XTMtg79wPegYvBsQWk0vxvWm4uIiHiaBkz6VWqKCgra?= =?us-ascii?Q?7Brkhk8iFkXjBb0Y8DHGTBCvcaJr0UXWUrm603qkSP9vqvlS8r3oroFlUn4H?= =?us-ascii?Q?4hDBoww+1pwtSpK1OdLyFVBUJbzqyR8PRYCVT68f24k7A=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; AT5PR84MB0162; 6:vSbCbdATp4IpORH+L9qReiFDXPvs2cSKi+Ck16dAuxlK3HS+LVpn4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atorOrg: hpe.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2017 21:35:35.8572 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AT5PR84MB0162 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 --- 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);