From patchwork Wed Mar 1 01:59:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jithu Joseph X-Patchwork-Id: 62716 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3373962wrd; Tue, 28 Feb 2023 18:06:04 -0800 (PST) X-Google-Smtp-Source: AK7set+3I7itqrU5LD8HQSInfR7jevD2zhyoJlaXFjdEDWC2ak7KwR7U5P0morhmMZp7kG3pFX4t X-Received: by 2002:a17:906:2f89:b0:878:5bce:291a with SMTP id w9-20020a1709062f8900b008785bce291amr5074132eji.36.1677636364103; Tue, 28 Feb 2023 18:06:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677636364; cv=none; d=google.com; s=arc-20160816; b=IU1qNQgpwM6421ZFJJ6e1dfOFwqUQexZHkZ+gBLkYw3XDrEoYdro5HjjNPb5jRlbip IIvwZ89Hsoyot8XmVJ6mplux7zpNVsvpFZ567pQrnHOjvgWwSaWZSHO5a4d3fWRew8ki BRCf5lY40AAJgteUCa4Jg6kUAPlR3XwIUbdiycRD2Mxf9yNK3peKyNZPQrvAiXwvugHM IzM+zq8VhhwfdeDIp2N2x0N9preCL6yEM4yAkR3WcVffJkWGn4XuwAChBa0l9RW6sRcr fULS3DdsSwFIp/82h5G+nWPtJUaAa4Ov9alyXhzcFsRp7OkX69TVuEpOc7ajCifeBXfn xpyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=FQE8UGkljLkErQdA/qzoeiMi7ZbBpHtoBbLHHNknbBE=; b=ovoCTFQTGbCYxyw0NYwhvP58EmtXOGD+0daEZwC9leb/JSVLgUIbmOyXuWwB6p4jK1 /f1PrDjCYtJ4Q0LjforQJ6M2kIE9e/q8LtEliGveF0IX11N4nsxkHSbYBHUJSxRc0RRi jBAvIMnXnmpIl0mdNlx9/UpsZsEbn+8KtgFYeqbiIDHx9QvTM0h8G4DoBJr/Eeh1xeab dLyuw/sfkze0hMyrKGqhzXK1ZF8mY1/r5t1kIYmvr5avG43R8+dZSxgylCkQTdyqtSpj +VWt1h2ZyXlwujzkZJ64VhZMvQhRDbd1ykBK+7rBynDEG93Cby1BuGc6EmzJ7Hl6GnTC zkxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AT56iUkE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s17-20020a170906455100b008e21b9235c8si39198ejq.657.2023.02.28.18.05.41; Tue, 28 Feb 2023 18:06:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AT56iUkE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229510AbjCACBY (ORCPT + 99 others); Tue, 28 Feb 2023 21:01:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229730AbjCACBP (ORCPT ); Tue, 28 Feb 2023 21:01:15 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99EFB1C333; Tue, 28 Feb 2023 18:01:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677636072; x=1709172072; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8uVqk5jgAaGyZ47qhmWNzlU6s2zEuRvU+z9XkLL6LXs=; b=AT56iUkEtKiQ0OrdhJ/hNLNlOTrTy9w4Yega06OnDdaxh8DWd2Tw8JeJ znF7kZk04LPARNN8rggq9SWttBIgvzYIiVVP6zn2U2jEPbWaswuwhlZob mHL0KFcyLYHFpgLyn8eQYfUPAWRSNTJeyhZKeG+ZoABTBnXpGu5oyjv1k msvUg5/jfSSw2kK6QnsexS0UunNZm5LRZo+kKr6MntuSezt9rhM7lY5GA 7YDS+yAB7+6/M3R6iAzwEeKOoR+SXBqQvkGuxQmUCqWfPg+usPmpy1Wgf kEab0lrBP/+Vj8w/Mmyq6R74JZmkuzgyddhm6RgZvj50eVzEY838+A9As w==; X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="420558411" X-IronPort-AV: E=Sophos;i="5.98,223,1673942400"; d="scan'208";a="420558411" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 18:01:11 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="704639937" X-IronPort-AV: E=Sophos;i="5.98,223,1673942400"; d="scan'208";a="704639937" Received: from jithujos.sc.intel.com ([172.25.103.66]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 18:01:10 -0800 From: Jithu Joseph To: hdegoede@redhat.com, markgross@kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, gregkh@linuxfoundation.org, rostedt@goodmis.org, jithu.joseph@intel.com, ashok.raj@intel.com, tony.luck@intel.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, patches@lists.linux.dev, ravi.v.shankar@intel.com, thiago.macieira@intel.com, athenas.jimenez.gonzalez@intel.com, sohil.mehta@intel.com Subject: [PATCH v3 1/8] platform/x86/intel/ifs: Reorganize driver data Date: Tue, 28 Feb 2023 17:59:35 -0800 Message-Id: <20230301015942.462799-2-jithu.joseph@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230301015942.462799-1-jithu.joseph@intel.com> References: <20230214234426.344960-1-jithu.joseph@intel.com> <20230301015942.462799-1-jithu.joseph@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759129227952409119?= X-GMAIL-MSGID: =?utf-8?q?1759129227952409119?= The struct holding device driver data contained both read only(ro) and read write(rw) fields. Separating ro fields from rw fields was recommended as a preferable design pattern during review[1]. Group the rw fields into a separate struct whose memory is allocated during driver_init(). Associate it to the miscdevice being registered by keeping it in the same container struct as the miscdevice. Also in prepration to supporting additional tests, move ifs_pkg_auth to a global as it is only applicable for the first test type. Link: https://lore.kernel.org/lkml/Y+9H9otxLYPqMkUh@kroah.com/ [1] Signed-off-by: Jithu Joseph Reviewed-by: Tony Luck --- drivers/platform/x86/intel/ifs/ifs.h | 19 +++++++++------- drivers/platform/x86/intel/ifs/core.c | 31 ++++++++++++++++++--------- drivers/platform/x86/intel/ifs/load.c | 8 +++---- 3 files changed, 36 insertions(+), 22 deletions(-) diff --git a/drivers/platform/x86/intel/ifs/ifs.h b/drivers/platform/x86/intel/ifs/ifs.h index 046e39304fd5..e07463c794d4 100644 --- a/drivers/platform/x86/intel/ifs/ifs.h +++ b/drivers/platform/x86/intel/ifs/ifs.h @@ -197,22 +197,23 @@ union ifs_status { #define IFS_SW_TIMEOUT 0xFD #define IFS_SW_PARTIAL_COMPLETION 0xFE +struct ifs_const_data { + int integrity_cap_bit; + int test_num; +}; + /** * struct ifs_data - attributes related to intel IFS driver - * @integrity_cap_bit: MSR_INTEGRITY_CAPS bit enumerating this test * @loaded_version: stores the currently loaded ifs image version. - * @pkg_auth: array of bool storing per package auth status * @loaded: If a valid test binary has been loaded into the memory * @loading_error: Error occurred on another CPU while loading image * @valid_chunks: number of chunks which could be validated. * @status: it holds simple status pass/fail/untested * @scan_details: opaque scan status code from h/w * @cur_batch: number indicating the currently loaded test file - * @test_num: number indicating the test type + * @ro_info: ptr to struct holding fixed details */ struct ifs_data { - int integrity_cap_bit; - bool *pkg_auth; int loaded_version; bool loaded; bool loading_error; @@ -220,7 +221,7 @@ struct ifs_data { int status; u64 scan_details; u32 cur_batch; - int test_num; + struct ifs_const_data *ro_info; }; struct ifs_work { @@ -229,7 +230,8 @@ struct ifs_work { }; struct ifs_device { - struct ifs_data data; + struct ifs_const_data ro_data; + struct ifs_data *rw_data; struct miscdevice misc; }; @@ -238,9 +240,10 @@ static inline struct ifs_data *ifs_get_data(struct device *dev) struct miscdevice *m = dev_get_drvdata(dev); struct ifs_device *d = container_of(m, struct ifs_device, misc); - return &d->data; + return d->rw_data; } +extern bool *ifs_pkg_auth; int ifs_load_firmware(struct device *dev); int do_core_test(int cpu, struct device *dev); const struct attribute_group **ifs_get_groups(void); diff --git a/drivers/platform/x86/intel/ifs/core.c b/drivers/platform/x86/intel/ifs/core.c index 206a617c2e02..b518b661daf0 100644 --- a/drivers/platform/x86/intel/ifs/core.c +++ b/drivers/platform/x86/intel/ifs/core.c @@ -20,8 +20,10 @@ static const struct x86_cpu_id ifs_cpu_ids[] __initconst = { }; MODULE_DEVICE_TABLE(x86cpu, ifs_cpu_ids); +bool *ifs_pkg_auth; + static struct ifs_device ifs_device = { - .data = { + .ro_data = { .integrity_cap_bit = MSR_INTEGRITY_CAPS_PERIODIC_BIST_BIT, .test_num = 0, }, @@ -35,8 +37,8 @@ static struct ifs_device ifs_device = { static int __init ifs_init(void) { const struct x86_cpu_id *m; + struct ifs_data *ifsd; u64 msrval; - int ret; m = x86_match_cpu(ifs_cpu_ids); if (!m) @@ -53,26 +55,35 @@ static int __init ifs_init(void) ifs_device.misc.groups = ifs_get_groups(); - if (!(msrval & BIT(ifs_device.data.integrity_cap_bit))) + if (!(msrval & BIT(ifs_device.ro_data.integrity_cap_bit))) return -ENODEV; - ifs_device.data.pkg_auth = kmalloc_array(topology_max_packages(), sizeof(bool), GFP_KERNEL); - if (!ifs_device.data.pkg_auth) + ifs_pkg_auth = kmalloc_array(topology_max_packages(), sizeof(bool), GFP_KERNEL); + if (!ifs_pkg_auth) + return -ENOMEM; + + ifsd = kzalloc(sizeof(*ifsd), GFP_KERNEL); + if (!ifsd) return -ENOMEM; - ret = misc_register(&ifs_device.misc); - if (ret) { - kfree(ifs_device.data.pkg_auth); - return ret; + ifsd->ro_info = &ifs_device.ro_data; + ifs_device.rw_data = ifsd; + + if (misc_register(&ifs_device.misc)) { + kfree(ifsd); + kfree(ifs_pkg_auth); + return -ENODEV; } return 0; + } static void __exit ifs_exit(void) { misc_deregister(&ifs_device.misc); - kfree(ifs_device.data.pkg_auth); + kfree(ifs_device.rw_data); + kfree(ifs_pkg_auth); } module_init(ifs_init); diff --git a/drivers/platform/x86/intel/ifs/load.c b/drivers/platform/x86/intel/ifs/load.c index c5c24e6fdc43..cdec3316c08d 100644 --- a/drivers/platform/x86/intel/ifs/load.c +++ b/drivers/platform/x86/intel/ifs/load.c @@ -192,7 +192,7 @@ static int scan_chunks_sanity_check(struct device *dev) struct ifs_work local_work; int curr_pkg, cpu, ret; - memset(ifsd->pkg_auth, 0, (topology_max_packages() * sizeof(bool))); + memset(ifs_pkg_auth, 0, (topology_max_packages() * sizeof(bool))); ret = validate_ifs_metadata(dev); if (ret) return ret; @@ -204,7 +204,7 @@ static int scan_chunks_sanity_check(struct device *dev) cpus_read_lock(); for_each_online_cpu(cpu) { curr_pkg = topology_physical_package_id(cpu); - if (ifsd->pkg_auth[curr_pkg]) + if (ifs_pkg_auth[curr_pkg]) continue; reinit_completion(&ifs_done); local_work.dev = dev; @@ -215,7 +215,7 @@ static int scan_chunks_sanity_check(struct device *dev) ret = -EIO; goto out; } - ifsd->pkg_auth[curr_pkg] = 1; + ifs_pkg_auth[curr_pkg] = 1; } ret = 0; out: @@ -263,7 +263,7 @@ int ifs_load_firmware(struct device *dev) int ret = -EINVAL; snprintf(scan_path, sizeof(scan_path), "intel/ifs_%d/%02x-%02x-%02x-%02x.scan", - ifsd->test_num, boot_cpu_data.x86, boot_cpu_data.x86_model, + ifsd->ro_info->test_num, boot_cpu_data.x86, boot_cpu_data.x86_model, boot_cpu_data.x86_stepping, ifsd->cur_batch); ret = request_firmware_direct(&fw, scan_path, dev); From patchwork Wed Mar 1 01:59:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jithu Joseph X-Patchwork-Id: 62715 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3373896wrd; Tue, 28 Feb 2023 18:05:53 -0800 (PST) X-Google-Smtp-Source: AK7set/e49M5FGnZb0u/SlmubpcnG+vsCeXKQ7A7btmn25dquDMYlsGMvaKwgcF+m51lyUvwSw7h X-Received: by 2002:a17:907:a49:b0:8a6:5720:9101 with SMTP id be9-20020a1709070a4900b008a657209101mr6360086ejc.4.1677636352967; Tue, 28 Feb 2023 18:05:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677636352; cv=none; d=google.com; s=arc-20160816; b=S1p5LEmwzE+kvOxgiKXwzARr+9kSmq5KfwkB/iaI6HjCiADXN6pPkgX910HGWirhPN sV6K17s5sQ+RwOwCXxz5nOR/EJ8IANVFf2gOfDh9QSjP4QNYeJbuP/7gdE6KbZedLBNg Pvd6VB6nhrsmBTnDywAuxRf/hMbZsdz3dwMtiRvFjFhd//8nHud9CQxJDilFfusyx0UN FG+cNoTvsFj29YMf50E/hT6paWgbVLOZH4YJ1PKpqzUQIdRytkThWaXjHOug/N0CUV3w IEOOldYH01SQcyAjhYcZ7enw/2rEhEcIB3BfiGM5f1De7/1+bE/89NIhq3lgY7/ZOnmf HvWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=EfhR3vQdhYb8IUDElUSoxLlOpizoK8YFNgWQVpM8His=; b=gZJOfjpUHGlZS1IJeY91jS4Q214B33U+W7RHB5lkjL9muqOwRdex0xe37ku5C1Z6cg DRjdxs/KjBG7xwymuU2XzOl0VGGgL3nPxfGkegsm+OcHIcKpIwWaZixouqhhrwNdcmdr cbVuw3RIEumbCY2NmhMGH6rj0ftX6i6aDK+kPtHpKrTG28xx9jKhEUay7kYJNyzJITGy kLHB4nTAy0d9peDIk9hsWEjgtHpBWeav07I4fisnzyuv9+G0EzKuaRfY9OuhMwnLc7N4 2TKm92KqKJ0azh978IxoOK5nFwYywDU9iWIxTaVy82aCByWdhDlrIn8kR6HMDqYRDm41 Bw9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SM8JC6Dr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q15-20020a1709066b0f00b008d6a0a6ba5esi12563846ejr.903.2023.02.28.18.05.30; Tue, 28 Feb 2023 18:05:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SM8JC6Dr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229805AbjCACBS (ORCPT + 99 others); Tue, 28 Feb 2023 21:01:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229746AbjCACBP (ORCPT ); Tue, 28 Feb 2023 21:01:15 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FE231E2B8; Tue, 28 Feb 2023 18:01:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677636074; x=1709172074; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8fGhALj/6YuPeeMFkK3yfUkQG/FNpfhZ0YdkO37eDWg=; b=SM8JC6Dril1rZycfQdj0I6N+WG+ea0PKLXubU/5gzUFPzbv+jFo8L39D kptQQcvSDglVtJcHX/z1IqQSA5WzOOBBLBlY38mQ3c+FkLoNeNjlWHWf9 mDeCJtnFUPyv5eB47dPtVFS1HXJ7dCQkwE4S/82BV/KNZPkzwUlq22XYs F9FCzT2Jg84UX+XRHz/g+2gckV7/yNLOwTl7YPWupz3ZoLX2Z7e0w2e57 JVH+NvRXz3JWrLvbTep+dYvvWn1foI9kq2OW75d5OIxUnU89qSu5+IDjD DXBFgKzdDHTbHINZH54Ns1AjGRcgiMCPZr8IaxlIRyVthJF1vr5x8V4DB g==; X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="420558425" X-IronPort-AV: E=Sophos;i="5.98,223,1673942400"; d="scan'208";a="420558425" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 18:01:12 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="704639942" X-IronPort-AV: E=Sophos;i="5.98,223,1673942400"; d="scan'208";a="704639942" Received: from jithujos.sc.intel.com ([172.25.103.66]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 18:01:11 -0800 From: Jithu Joseph To: hdegoede@redhat.com, markgross@kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, gregkh@linuxfoundation.org, rostedt@goodmis.org, jithu.joseph@intel.com, ashok.raj@intel.com, tony.luck@intel.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, patches@lists.linux.dev, ravi.v.shankar@intel.com, thiago.macieira@intel.com, athenas.jimenez.gonzalez@intel.com, sohil.mehta@intel.com Subject: [PATCH v3 2/8] platform/x86/intel/ifs: IFS cleanup Date: Tue, 28 Feb 2023 17:59:36 -0800 Message-Id: <20230301015942.462799-3-jithu.joseph@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230301015942.462799-1-jithu.joseph@intel.com> References: <20230214234426.344960-1-jithu.joseph@intel.com> <20230301015942.462799-1-jithu.joseph@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759129216309792290?= X-GMAIL-MSGID: =?utf-8?q?1759129216309792290?= Cleanup incorporating misc review comments - Remove the subdirectory intel_ifs/0 for devicenode [1] - Make plat_ifs_groups non static and use it directly without using a function [2] Link: https://lore.kernel.org/lkml/Y+4kQOtrHt5pdsSO@kroah.com/ [1] Link: https://lore.kernel.org/lkml/Y9nyxNesVHCUXAcH@kroah.com/ [2] Signed-off-by: Jithu Joseph Reviewed-by: Tony Luck Reviewed-by: Hans de Goede --- drivers/platform/x86/intel/ifs/ifs.h | 2 +- drivers/platform/x86/intel/ifs/core.c | 6 +++--- drivers/platform/x86/intel/ifs/sysfs.c | 9 +-------- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/platform/x86/intel/ifs/ifs.h b/drivers/platform/x86/intel/ifs/ifs.h index e07463c794d4..ab168ddf28f1 100644 --- a/drivers/platform/x86/intel/ifs/ifs.h +++ b/drivers/platform/x86/intel/ifs/ifs.h @@ -246,6 +246,6 @@ static inline struct ifs_data *ifs_get_data(struct device *dev) extern bool *ifs_pkg_auth; int ifs_load_firmware(struct device *dev); int do_core_test(int cpu, struct device *dev); -const struct attribute_group **ifs_get_groups(void); +extern struct attribute *plat_ifs_attrs[]; #endif diff --git a/drivers/platform/x86/intel/ifs/core.c b/drivers/platform/x86/intel/ifs/core.c index b518b661daf0..62c44dbae757 100644 --- a/drivers/platform/x86/intel/ifs/core.c +++ b/drivers/platform/x86/intel/ifs/core.c @@ -20,6 +20,8 @@ static const struct x86_cpu_id ifs_cpu_ids[] __initconst = { }; MODULE_DEVICE_TABLE(x86cpu, ifs_cpu_ids); +ATTRIBUTE_GROUPS(plat_ifs); + bool *ifs_pkg_auth; static struct ifs_device ifs_device = { @@ -29,8 +31,8 @@ static struct ifs_device ifs_device = { }, .misc = { .name = "intel_ifs_0", - .nodename = "intel_ifs/0", .minor = MISC_DYNAMIC_MINOR, + .groups = plat_ifs_groups, }, }; @@ -53,8 +55,6 @@ static int __init ifs_init(void) if (rdmsrl_safe(MSR_INTEGRITY_CAPS, &msrval)) return -ENODEV; - ifs_device.misc.groups = ifs_get_groups(); - if (!(msrval & BIT(ifs_device.ro_data.integrity_cap_bit))) return -ENODEV; diff --git a/drivers/platform/x86/intel/ifs/sysfs.c b/drivers/platform/x86/intel/ifs/sysfs.c index ee636a76b083..2007d8054f04 100644 --- a/drivers/platform/x86/intel/ifs/sysfs.c +++ b/drivers/platform/x86/intel/ifs/sysfs.c @@ -141,7 +141,7 @@ static ssize_t image_version_show(struct device *dev, static DEVICE_ATTR_RO(image_version); /* global scan sysfs attributes */ -static struct attribute *plat_ifs_attrs[] = { +struct attribute *plat_ifs_attrs[] = { &dev_attr_details.attr, &dev_attr_status.attr, &dev_attr_run_test.attr, @@ -149,10 +149,3 @@ static struct attribute *plat_ifs_attrs[] = { &dev_attr_image_version.attr, NULL }; - -ATTRIBUTE_GROUPS(plat_ifs); - -const struct attribute_group **ifs_get_groups(void) -{ - return plat_ifs_groups; -} From patchwork Wed Mar 1 01:59:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jithu Joseph X-Patchwork-Id: 62720 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3374370wrd; Tue, 28 Feb 2023 18:07:02 -0800 (PST) X-Google-Smtp-Source: AK7set8+e6J/5qmNQ5GM+pvXiHcDmyx4llK+cHAxf4/eRKVON9wEJuQFmZKW6gOXp8WyZ6O+GOhD X-Received: by 2002:a05:6a20:42a3:b0:cd:83b1:420d with SMTP id o35-20020a056a2042a300b000cd83b1420dmr5853364pzj.38.1677636422020; Tue, 28 Feb 2023 18:07:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677636422; cv=none; d=google.com; s=arc-20160816; b=HvdXveDVItb0qEnZkY46iA7+tyedDCJ1wanqhCmI346FmcS93TbixxsJZjE+1jYUe/ 4ve4BjskrzB60iZjaQVD2KjsPHurcw2A1jWU/tzj5ZUkiDcz3kvAQPjoaB+Gq+DIR64C JGQCLSQOU745Y2kH5g7/6AWMRH4Od2LhEJkSJO1JMpXMSeqUy3J23lFk9nmLXcpOJCRn csCeC2akOa1+4LuLWTD31EfN1tzZDRgqDflH5qCjvH0bRai4MLKwEuzwI+y4ZjNzRaD7 fR+JGN/oKH8URTaJa/IuH2eoFNxHa2pOC2s7RPlSoXqBkokzTXle0gjxsIYsi0FQD88+ PyJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=KlZNF4bJMw7wDyGGkwEVCDxJp7qpc08PsOuSDPDhJJc=; b=Ucc74gqeOKOZ5hXPIIH+5eCe0v68rvXW5jXUYxOzwK4UVQOMRPR21r0M7VM4KJx48T aJlCIUjG9dLy9vfRMqk6N7EnoMtq/J+uo0I5AOULlqd0iAkzPkku4zpBOJOcql9BX/3U WZHFX8LdPkQcjrU7snej6w5GGi/bJ0+T62fDDVB1O9QyIehjKbSMVp/PxvKJbDxV4DPh 9/nZus1tC8kGYZ3YVObOewwBc/rqw2k58iDtjx7USyzuU3kqrzTXwapAWMy3vCyidZUm c42uZ/+CataQtWUkGCPgJCYFRAoiaNd4V7aagrCfI24s08Kofbl9xiSNA4W/0vRYF2JT 0p/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MV2yw9Uv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j1-20020a654281000000b004d23a59d6e9si10366372pgp.373.2023.02.28.18.06.48; Tue, 28 Feb 2023 18:07:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MV2yw9Uv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229845AbjCACB1 (ORCPT + 99 others); Tue, 28 Feb 2023 21:01:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229754AbjCACBP (ORCPT ); Tue, 28 Feb 2023 21:01:15 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C0062C641; Tue, 28 Feb 2023 18:01:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677636075; x=1709172075; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RJlwSFVpT1cewwIwRvUfBxfg5OygWbxR/zFOIt+ZgzQ=; b=MV2yw9Uv0afad4Nu/6Pekq++YIBU1rZHij8ADogIsuWc81MUQFMmgrrj 8T7+oNj0vUpON6b4UocgPpYZxxuLuj9LBCaQhaAzA1FSEUAmZrIdDhj8C kXbZOuf4+p4WEIprx3a07Xc7LfaTS1xtKjfyEXSjxpkkznvtS6Ted0bD5 /878HbzWW+IkuhLzRFXtC87tcnN5QJQv70qHY9L02BQelAar18/tFbB+D z4l96G0OM2tTpwMrW3AUWpn9iQ2fagN+cBdJ3f/5V2f4KTEmBsyDJTF/1 MUawczYITWX/jvYuoniPp6oweQgTcnBHfHHsOMnih83JnXb2PyaPL6+/t Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="420558438" X-IronPort-AV: E=Sophos;i="5.98,223,1673942400"; d="scan'208";a="420558438" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 18:01:13 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="704639950" X-IronPort-AV: E=Sophos;i="5.98,223,1673942400"; d="scan'208";a="704639950" Received: from jithujos.sc.intel.com ([172.25.103.66]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 18:01:12 -0800 From: Jithu Joseph To: hdegoede@redhat.com, markgross@kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, gregkh@linuxfoundation.org, rostedt@goodmis.org, jithu.joseph@intel.com, ashok.raj@intel.com, tony.luck@intel.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, patches@lists.linux.dev, ravi.v.shankar@intel.com, thiago.macieira@intel.com, athenas.jimenez.gonzalez@intel.com, sohil.mehta@intel.com Subject: [PATCH v3 3/8] x86/include/asm/msr-index.h: Add IFS Array test bits Date: Tue, 28 Feb 2023 17:59:37 -0800 Message-Id: <20230301015942.462799-4-jithu.joseph@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230301015942.462799-1-jithu.joseph@intel.com> References: <20230214234426.344960-1-jithu.joseph@intel.com> <20230301015942.462799-1-jithu.joseph@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756583687208982608?= X-GMAIL-MSGID: =?utf-8?q?1759129288598960764?= Define MSR bitfields for enumerating support for Array BIST test. Signed-off-by: Jithu Joseph Reviewed-by: Tony Luck Reviewed-by: Hans de Goede --- arch/x86/include/asm/msr-index.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h index d3fe82c5d6b6..ad8997773ad3 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h @@ -197,6 +197,8 @@ /* Abbreviated from Intel SDM name IA32_INTEGRITY_CAPABILITIES */ #define MSR_INTEGRITY_CAPS 0x000002d9 +#define MSR_INTEGRITY_CAPS_ARRAY_BIST_BIT 2 +#define MSR_INTEGRITY_CAPS_ARRAY_BIST BIT(MSR_INTEGRITY_CAPS_ARRAY_BIST_BIT) #define MSR_INTEGRITY_CAPS_PERIODIC_BIST_BIT 4 #define MSR_INTEGRITY_CAPS_PERIODIC_BIST BIT(MSR_INTEGRITY_CAPS_PERIODIC_BIST_BIT) From patchwork Wed Mar 1 01:59:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jithu Joseph X-Patchwork-Id: 62719 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3374167wrd; Tue, 28 Feb 2023 18:06:32 -0800 (PST) X-Google-Smtp-Source: AK7set9WewvbS3DNbVNrVbUku159xkbdBemnKwVZlgXsWzOeExtpd85nn4xAjUIyWBzWuaLYmDEc X-Received: by 2002:a05:6a20:4b0f:b0:cd:fc47:dda0 with SMTP id fp15-20020a056a204b0f00b000cdfc47dda0mr2293944pzb.59.1677636392183; Tue, 28 Feb 2023 18:06:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677636392; cv=none; d=google.com; s=arc-20160816; b=raiylWDQknDg83VNBcd+20Cet90giL0Wp2rAtvpJmnQLncSgnTmmxueiNGQnp/rtaw 2oapt568JdGWBzVtgPUvsFT2ZpeyXZ2Fm1xcvVn2LZIAwMl2CjrIQzdkQDCdwQOVqv0E k+WgCPijsz3D11l/us/HaOEzLJbSAfquwtVhqZQCoU0Y0huDDwDektcLSNa5pW8L8xKO rwZeLcBKSKgz4oowxSXnn/Seqmc4Zif7ZkDgX1KEWjW/JfBo7uZlBIDXZ13oUbn+/6sF t4RPcyqYg4FtObmGvzfUu2oBMGdP7F78M5obDevGNDNF13hEI38Ak4D7yh+SolcfX1Aq f7KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PF2gAG+VPVZmzDqsXLUFu0j6bbcHp2wrvPX+yDlIGnQ=; b=lJAHW3Gh2fF6ITLY7gG14PCiOo8lIS37GJ0tOhZNddoAVsDJG2Z8yf8RxpBwYuqcuu fbB86yXiozzW4Jp+ZF6mWmdmLRe936L6XmsXvSsgD6Htb+HY5Nwy/gH7gD7RKW4Gitec 4amd4T8XP6RqKyfTM6JHOinHTezLGDYw1hE52qLQvxNhBzmu2u4XR/nA5VlLWTgUnQB0 /x0Ns9purWN6EQ4cFxqxjLaQhkFKdYmniU5hIC4fD/EzsHNwV1ieytjC6pxeQyjLhGTq M14cJuudLJCpgHARdEgJOBLJNkwJJbUlyfSZ3bDbELD1/L5PhqxSw38qiTDkKG8mk9FI jiAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=oHXmonnB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r206-20020a632bd7000000b004fb80bfb579si10897833pgr.446.2023.02.28.18.06.18; Tue, 28 Feb 2023 18:06:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=oHXmonnB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229512AbjCACBj (ORCPT + 99 others); Tue, 28 Feb 2023 21:01:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229764AbjCACBQ (ORCPT ); Tue, 28 Feb 2023 21:01:16 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB6811116E; Tue, 28 Feb 2023 18:01:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677636075; x=1709172075; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rJiDCSyygrrCuqVsYU6GkuSNqtQTTbAqcfks22kGVi0=; b=oHXmonnBw1vhAGMDNGuC8sITYKlolAhO4o9pgg7mlMKs15v8Bx9+gXn1 UeYZ+HNmznYjr9IS6n4BfEGYW9ULLfuRkMZW/uqdeyg2pMeA/FMyxpGjG XdSJTF3dU3FAdbtVV/7M0Xio+TrDLtQBmNwhGbXUNstl4vyCoszrVsd36 uZtRRzbFfYtMrnGS9UyGU1wo5y2byMdvZ5/J1ZiPf4amj7USpLABtTqJL y00IzUd6pU7DrGZXXGGlw21DmWdfYmIUjexC0EwETgV17oWvCKAx7Zx+Z nTl4/LNolmiJnX+AHvgZDcn+Q0hT9eAMdzXN21x8crrkYP6i/aGlg47xG Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="420558449" X-IronPort-AV: E=Sophos;i="5.98,223,1673942400"; d="scan'208";a="420558449" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 18:01:13 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="704639956" X-IronPort-AV: E=Sophos;i="5.98,223,1673942400"; d="scan'208";a="704639956" Received: from jithujos.sc.intel.com ([172.25.103.66]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 18:01:12 -0800 From: Jithu Joseph To: hdegoede@redhat.com, markgross@kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, gregkh@linuxfoundation.org, rostedt@goodmis.org, jithu.joseph@intel.com, ashok.raj@intel.com, tony.luck@intel.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, patches@lists.linux.dev, ravi.v.shankar@intel.com, thiago.macieira@intel.com, athenas.jimenez.gonzalez@intel.com, sohil.mehta@intel.com Subject: [PATCH v3 4/8] platform/x86/intel/ifs: Introduce Array Scan test to IFS Date: Tue, 28 Feb 2023 17:59:38 -0800 Message-Id: <20230301015942.462799-5-jithu.joseph@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230301015942.462799-1-jithu.joseph@intel.com> References: <20230214234426.344960-1-jithu.joseph@intel.com> <20230301015942.462799-1-jithu.joseph@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756583758392248897?= X-GMAIL-MSGID: =?utf-8?q?1759129257378874808?= Array BIST is a new type of core test introduced under the Intel Infield Scan (IFS) suite of tests. Emerald Rapids (EMR) is the first CPU to support Array BIST. Array BIST performs tests on some portions of the core logic such as caches and register files. These are different portions of the silicon compared to the parts tested by the first test type i.e Scan at Field (SAF). Make changes in the device driver init flow to register this new test type with the device driver framework. Each test will have its own sysfs directory (intel_ifs_0 , intel_ifs_1) under misc hierarchy to accommodate for the differences in test type and how they are initiated. Upcoming patches will add actual support. Signed-off-by: Jithu Joseph Reviewed-by: Tony Luck --- drivers/platform/x86/intel/ifs/ifs.h | 3 + drivers/platform/x86/intel/ifs/core.c | 85 +++++++++++++++++++-------- 2 files changed, 62 insertions(+), 26 deletions(-) diff --git a/drivers/platform/x86/intel/ifs/ifs.h b/drivers/platform/x86/intel/ifs/ifs.h index ab168ddf28f1..b8b956e29653 100644 --- a/drivers/platform/x86/intel/ifs/ifs.h +++ b/drivers/platform/x86/intel/ifs/ifs.h @@ -137,6 +137,9 @@ #define SCAN_TEST_PASS 1 #define SCAN_TEST_FAIL 2 +#define IFS_TYPE_SAF 0 +#define IFS_TYPE_ARRAY_BIST 1 + /* MSR_SCAN_HASHES_STATUS bit fields */ union ifs_scan_hashes_status { u64 data; diff --git a/drivers/platform/x86/intel/ifs/core.c b/drivers/platform/x86/intel/ifs/core.c index 62c44dbae757..2237aaba7078 100644 --- a/drivers/platform/x86/intel/ifs/core.c +++ b/drivers/platform/x86/intel/ifs/core.c @@ -16,6 +16,7 @@ static const struct x86_cpu_id ifs_cpu_ids[] __initconst = { X86_MATCH(SAPPHIRERAPIDS_X), + X86_MATCH(EMERALDRAPIDS_X), {} }; MODULE_DEVICE_TABLE(x86cpu, ifs_cpu_ids); @@ -24,23 +25,51 @@ ATTRIBUTE_GROUPS(plat_ifs); bool *ifs_pkg_auth; -static struct ifs_device ifs_device = { - .ro_data = { - .integrity_cap_bit = MSR_INTEGRITY_CAPS_PERIODIC_BIST_BIT, - .test_num = 0, +static struct ifs_device ifs_devices[] = { + [IFS_TYPE_SAF] = { + .ro_data = { + .integrity_cap_bit = MSR_INTEGRITY_CAPS_PERIODIC_BIST_BIT, + .test_num = IFS_TYPE_SAF, + }, + .misc = { + .name = "intel_ifs_0", + .minor = MISC_DYNAMIC_MINOR, + .groups = plat_ifs_groups, + }, }, - .misc = { - .name = "intel_ifs_0", - .minor = MISC_DYNAMIC_MINOR, - .groups = plat_ifs_groups, + [IFS_TYPE_ARRAY_BIST] = { + .ro_data = { + .integrity_cap_bit = MSR_INTEGRITY_CAPS_ARRAY_BIST_BIT, + .test_num = IFS_TYPE_ARRAY_BIST, + }, + .misc = { + .name = "intel_ifs_1", + .minor = MISC_DYNAMIC_MINOR, + }, }, }; +#define IFS_NUMTESTS ARRAY_SIZE(ifs_devices) + +static void ifs_cleanup(void) +{ + int i; + + for (i = 0; i < IFS_NUMTESTS; i++) { + if (ifs_devices[i].misc.this_device) { + misc_deregister(&ifs_devices[i].misc); + kfree(ifs_devices[i].rw_data); + } + } + kfree(ifs_pkg_auth); +} + static int __init ifs_init(void) { const struct x86_cpu_id *m; struct ifs_data *ifsd; u64 msrval; + int i, ret; m = x86_match_cpu(ifs_cpu_ids); if (!m) @@ -55,35 +84,39 @@ static int __init ifs_init(void) if (rdmsrl_safe(MSR_INTEGRITY_CAPS, &msrval)) return -ENODEV; - if (!(msrval & BIT(ifs_device.ro_data.integrity_cap_bit))) - return -ENODEV; - ifs_pkg_auth = kmalloc_array(topology_max_packages(), sizeof(bool), GFP_KERNEL); if (!ifs_pkg_auth) return -ENOMEM; - ifsd = kzalloc(sizeof(*ifsd), GFP_KERNEL); - if (!ifsd) - return -ENOMEM; - - ifsd->ro_info = &ifs_device.ro_data; - ifs_device.rw_data = ifsd; - - if (misc_register(&ifs_device.misc)) { - kfree(ifsd); - kfree(ifs_pkg_auth); - return -ENODEV; + for (i = 0; i < IFS_NUMTESTS; i++) { + ifsd = NULL; + if (!(msrval & BIT(ifs_devices[i].ro_data.integrity_cap_bit))) + continue; + + ifsd = kzalloc(sizeof(*ifsd), GFP_KERNEL); + if (!ifsd) { + ret = -ENOMEM; + goto err_exit; + } + ifsd->ro_info = &ifs_devices[i].ro_data; + ifs_devices[i].rw_data = ifsd; + + if (misc_register(&ifs_devices[i].misc)) { + ret = -ENODEV; + kfree(ifsd); + goto err_exit; + } } - return 0; +err_exit: + ifs_cleanup(); + return ret; } static void __exit ifs_exit(void) { - misc_deregister(&ifs_device.misc); - kfree(ifs_device.rw_data); - kfree(ifs_pkg_auth); + ifs_cleanup(); } module_init(ifs_init); From patchwork Wed Mar 1 01:59:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jithu Joseph X-Patchwork-Id: 62717 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3374117wrd; Tue, 28 Feb 2023 18:06:25 -0800 (PST) X-Google-Smtp-Source: AK7set9ed6wf4o5c9I926sTMV2cebje5hpI6XmDLUaVqMXm3Rlm/JlT32Z5Xjz2s138ed+Nta6We X-Received: by 2002:a05:6402:194c:b0:4af:63a7:7485 with SMTP id f12-20020a056402194c00b004af63a77485mr5495946edz.17.1677636385774; Tue, 28 Feb 2023 18:06:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677636385; cv=none; d=google.com; s=arc-20160816; b=NaPWdvqtRG+s4MW5CSDwZxUc4Hc18pVyqgi1KfylrzmXuaiyhJJ4VhU5F/4AjEI5ZU BYXsoSvEAsT4dd/szQIhZDx9TrcT5DsxnWVleBW6zHUi8xR1FBOSQchLOOYQ9a5HYWE/ ehwGpBcD+20TQgiyr32XyTE9fnsma2FgnDDxKPhTUXyJiUSq/5bE8vOKf1kOkw6Qbd3X 45er2eYHSKZQ2JyXkMpeOe4MYQ2iFthJiqLUWxnCqZR2gC5TNZqz1gZuX4FjVN+mwbXd blyCReE+x5OuDp2TZd4bFbF564Z1SBbClo+MeFhSDfxd/5D+ciOV6unJpN7bQDm0+SoX UVWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tnOzNHarHeEj/SlxfmwuQp6aM41l+gcOO5vR6gY5VdM=; b=B1YkzS5ozoHv+u70SeE8KZK5Zflrhk8GavwvSUiopqWrA0IBYVfMcfChxISjxMKQFK RF0oirV5tuHnzr247K7ynk1HDmPo3y5igtV/yC5NkL9IA8O0LsDhcTb6LM33MoNIL+6S YUhI17XNIYxgvy8c/drvMOCFmFT+/Znr76SoeZxB5owCs2h/I2bG5ENsomUEyNZMS/TD U44TW5O+d9EtJFNwHFVCSgstu0Ue4T0Y550RONeevkrUooImpdMDWKKPSTWHc1C6j+dA LVYV+BA8haBatKEBcrApM51xmBAsEjFcsp2i0YLw6JHOP3JaX21N89DDqp7ZV02A4Q4H 7Daw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CR863AFl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d16-20020a056402001000b004af6c524991si11805083edu.109.2023.02.28.18.06.03; Tue, 28 Feb 2023 18:06:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CR863AFl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229871AbjCACBb (ORCPT + 99 others); Tue, 28 Feb 2023 21:01:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229787AbjCACBQ (ORCPT ); Tue, 28 Feb 2023 21:01:16 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFB2E1ADF9; Tue, 28 Feb 2023 18:01:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677636075; x=1709172075; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VHHNnfW5fd3fWGPzletn/On5RWbJs2IQEjtgzueNm/I=; b=CR863AFlSfzzBpXt4ku5onPNcnc6xme8zqp5oeBClGrQTbZ5wShZs7Ui Wi8182TmCYkg4fRyz4fzgqYTJqHCGoUTn7qmRqUBOFXpR4mEYXg6mmpHc gZGRWX1sAz7MQ2ql60KGY9Soph1gFJLUhgnXVAx47ICVasJDYyrzWzW7W ZPjq+2SdJcCo7YBzopZ5xj4glNhnwhdhCiXAJCxuAfwecROt7GQpoZf7l G2s5lpuVjyNbwOGeGd0+2f/4b2V6GPqaZcIJmv5jHSnsyKFGrtbsJs6yj SgKX8IpLqK8OkhnsTOl10kT5AMZkYJmn9U4QMUjcnnIWPnf4+PFZw3aQc g==; X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="420558458" X-IronPort-AV: E=Sophos;i="5.98,223,1673942400"; d="scan'208";a="420558458" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 18:01:14 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="704639961" X-IronPort-AV: E=Sophos;i="5.98,223,1673942400"; d="scan'208";a="704639961" Received: from jithujos.sc.intel.com ([172.25.103.66]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 18:01:13 -0800 From: Jithu Joseph To: hdegoede@redhat.com, markgross@kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, gregkh@linuxfoundation.org, rostedt@goodmis.org, jithu.joseph@intel.com, ashok.raj@intel.com, tony.luck@intel.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, patches@lists.linux.dev, ravi.v.shankar@intel.com, thiago.macieira@intel.com, athenas.jimenez.gonzalez@intel.com, sohil.mehta@intel.com Subject: [PATCH v3 5/8] platform/x86/intel/ifs: Sysfs interface for Array BIST Date: Tue, 28 Feb 2023 17:59:39 -0800 Message-Id: <20230301015942.462799-6-jithu.joseph@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230301015942.462799-1-jithu.joseph@intel.com> References: <20230214234426.344960-1-jithu.joseph@intel.com> <20230301015942.462799-1-jithu.joseph@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756583768866045221?= X-GMAIL-MSGID: =?utf-8?q?1759129250667310698?= The interface to trigger Array BIST test and obtain its result is similar to the existing scan test. The only notable difference is that, Array BIST doesn't require any test content to be loaded. So binary load related options are not needed for this test. Add sysfs interface for array BIST test, the testing support will be added by subsequent patch. Signed-off-by: Jithu Joseph Reviewed-by: Tony Luck --- drivers/platform/x86/intel/ifs/ifs.h | 1 + drivers/platform/x86/intel/ifs/core.c | 2 ++ drivers/platform/x86/intel/ifs/runtest.c | 10 +++++++++- drivers/platform/x86/intel/ifs/sysfs.c | 10 +++++++++- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/intel/ifs/ifs.h b/drivers/platform/x86/intel/ifs/ifs.h index b8b956e29653..f31966e291df 100644 --- a/drivers/platform/x86/intel/ifs/ifs.h +++ b/drivers/platform/x86/intel/ifs/ifs.h @@ -250,5 +250,6 @@ extern bool *ifs_pkg_auth; int ifs_load_firmware(struct device *dev); int do_core_test(int cpu, struct device *dev); extern struct attribute *plat_ifs_attrs[]; +extern struct attribute *plat_ifs_array_attrs[]; #endif diff --git a/drivers/platform/x86/intel/ifs/core.c b/drivers/platform/x86/intel/ifs/core.c index 2237aaba7078..c74accedfc8d 100644 --- a/drivers/platform/x86/intel/ifs/core.c +++ b/drivers/platform/x86/intel/ifs/core.c @@ -22,6 +22,7 @@ static const struct x86_cpu_id ifs_cpu_ids[] __initconst = { MODULE_DEVICE_TABLE(x86cpu, ifs_cpu_ids); ATTRIBUTE_GROUPS(plat_ifs); +ATTRIBUTE_GROUPS(plat_ifs_array); bool *ifs_pkg_auth; @@ -45,6 +46,7 @@ static struct ifs_device ifs_devices[] = { .misc = { .name = "intel_ifs_1", .minor = MISC_DYNAMIC_MINOR, + .groups = plat_ifs_array_groups, }, }, }; diff --git a/drivers/platform/x86/intel/ifs/runtest.c b/drivers/platform/x86/intel/ifs/runtest.c index 0bfd8fcdd7e8..969b3e0946d5 100644 --- a/drivers/platform/x86/intel/ifs/runtest.c +++ b/drivers/platform/x86/intel/ifs/runtest.c @@ -236,6 +236,7 @@ static void ifs_test_core(int cpu, struct device *dev) */ int do_core_test(int cpu, struct device *dev) { + struct ifs_data *ifsd = ifs_get_data(dev); int ret = 0; /* Prevent CPUs from being taken offline during the scan test */ @@ -247,7 +248,14 @@ int do_core_test(int cpu, struct device *dev) goto out; } - ifs_test_core(cpu, dev); + switch (ifsd->ro_info->test_num) { + case IFS_TYPE_SAF: + ifs_test_core(cpu, dev); + break; + case IFS_TYPE_ARRAY_BIST: + default: + return -EINVAL; + } out: cpus_read_unlock(); return ret; diff --git a/drivers/platform/x86/intel/ifs/sysfs.c b/drivers/platform/x86/intel/ifs/sysfs.c index 2007d8054f04..88234798080a 100644 --- a/drivers/platform/x86/intel/ifs/sysfs.c +++ b/drivers/platform/x86/intel/ifs/sysfs.c @@ -75,7 +75,7 @@ static ssize_t run_test_store(struct device *dev, if (down_interruptible(&ifs_sem)) return -EINTR; - if (!ifsd->loaded) + if (ifsd->ro_info->test_num != IFS_TYPE_ARRAY_BIST && !ifsd->loaded) rc = -EPERM; else rc = do_core_test(cpu, dev); @@ -149,3 +149,11 @@ struct attribute *plat_ifs_attrs[] = { &dev_attr_image_version.attr, NULL }; + +/* global array sysfs attributes */ +struct attribute *plat_ifs_array_attrs[] = { + &dev_attr_details.attr, + &dev_attr_status.attr, + &dev_attr_run_test.attr, + NULL +}; From patchwork Wed Mar 1 01:59:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jithu Joseph X-Patchwork-Id: 62718 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3374123wrd; Tue, 28 Feb 2023 18:06:26 -0800 (PST) X-Google-Smtp-Source: AK7set9+ZsHC0wfw/OsVOJ9uRl3UUD5IsQ1UKzNKiv+EAqt2VsbrsbhWqptr2DYorO47nR72W38b X-Received: by 2002:a17:907:3e1a:b0:8b1:7f87:8174 with SMTP id hp26-20020a1709073e1a00b008b17f878174mr6182582ejc.65.1677636386789; Tue, 28 Feb 2023 18:06:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677636386; cv=none; d=google.com; s=arc-20160816; b=ismS2llcOpHO+tUrFja6Kr0N6wuz6FGYhl2f+cfDe+7fzJ+VsPcTHOALMZRhsyZlTT XQmaXa4sutgs0dyLABaO4RiLDfMMsOQWocqOEEY6VZIzxZbZGETu+4/zxXpKvCluj/05 +2Ii6ztryI0pvl5Mi2rE1zWPYGrnnIsRYmDD2gg6WAQQHpLsDDe1cJQ2gVg7Jof67Shv uq3Y9LRfgLv1wb0IPOs1uX+3Cl9QMXRGNussYmr6CJSslmT7SG6GPWAt5Dqp57FLx6po ek4NBtIqFfrz/858KYxHI8xbc7xQfq8Cxj7BWpJvLxARH7tpaAr5Kc6xhKyv301/2qwW ABYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QBeUdTd7JijsrH/zcnCdSMw9W8pmfJpbN8Xeu/mOUVY=; b=M1CZFw8H9BoLfQST1laFvZ30Q0mAWzpopskJcM9oRAuXvXTbXV8zycpJAnwVoXsFKT 2rk73O7HqeUSX1C+soXcKqUMduxlDHsVak5M3iJ19M56hnLiMq6WKkk7eGoZek6RGFMZ 5pL7keccLgMbzc9QPRplOs9MWUVJsRX+9eAeGrxfleFeUfz8rrezAUFsNppSitsiufZ9 rZrpaI86ciciJyaKUsbnfW3E8pLfQunbTKRHnrAgbfbSHy5/2zhUBE+qO/FL8VW5bBQg zvuXMkCOx7UMaArM3RByxQPGNllk+viZSCzvloRwGSOOUt699OLpzioFsHinVmRHa/3L mDsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UhWYtF93; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u4-20020a170906c40400b008b17710026esi12058471ejz.565.2023.02.28.18.06.04; Tue, 28 Feb 2023 18:06:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UhWYtF93; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229879AbjCACBe (ORCPT + 99 others); Tue, 28 Feb 2023 21:01:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229791AbjCACBR (ORCPT ); Tue, 28 Feb 2023 21:01:17 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F03B61CF4F; Tue, 28 Feb 2023 18:01:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677636075; x=1709172075; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NvBDBvO9ezNsf1VTvB17bzfy8Zjk70ZlJWFcVydhwCs=; b=UhWYtF93uHpO8PMBbvkL+il7qPe/+poD693dynG/xhtaVH4s/d0emYbE e9YmI7/6DHo9XwP/Uawf7V+PMKSegVzfJIywcXZNNvgdaNy6EWYrVPPeT I2tGFs80zfGmVAoIFFXYyiIY0rog6zeMdvI5kwcYGMFk4vNgE3loPTptG OjOyNr2jr61/KvKBkR/ZJuDuCQNvnG2bRY9kaZ5WeLN4cui2CT2t2jrCd nUXV5b2GOBNFcuR3DWiwI/0rQkInSNtjhVlVxUO2OHQKzMH+LGw6gZ095 RQnddj35o3CyHpWjzn6RWG1SbsElAgBlXA1eH3QZkQKOMlajSEa1t0ml5 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="420558470" X-IronPort-AV: E=Sophos;i="5.98,223,1673942400"; d="scan'208";a="420558470" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 18:01:15 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="704639966" X-IronPort-AV: E=Sophos;i="5.98,223,1673942400"; d="scan'208";a="704639966" Received: from jithujos.sc.intel.com ([172.25.103.66]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 18:01:14 -0800 From: Jithu Joseph To: hdegoede@redhat.com, markgross@kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, gregkh@linuxfoundation.org, rostedt@goodmis.org, jithu.joseph@intel.com, ashok.raj@intel.com, tony.luck@intel.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, patches@lists.linux.dev, ravi.v.shankar@intel.com, thiago.macieira@intel.com, athenas.jimenez.gonzalez@intel.com, sohil.mehta@intel.com Subject: [PATCH v3 6/8] platform/x86/intel/ifs: Implement Array BIST test Date: Tue, 28 Feb 2023 17:59:40 -0800 Message-Id: <20230301015942.462799-7-jithu.joseph@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230301015942.462799-1-jithu.joseph@intel.com> References: <20230214234426.344960-1-jithu.joseph@intel.com> <20230301015942.462799-1-jithu.joseph@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756584168277401634?= X-GMAIL-MSGID: =?utf-8?q?1759129251583712897?= Array BIST test (for a particlular core) is triggered by writing to MSR_ARRAY_BIST from one sibling of the core. This will initiate a test for all supported arrays on that CPU. Array BIST test may be aborted before completing all the arrays in the event of an interrupt or other reasons. In this case, kernel will restart the test from that point onwards. Array test will also be aborted when the test fails, in which case the test is stopped immediately without further retry. Signed-off-by: Jithu Joseph Reviewed-by: Tony Luck --- drivers/platform/x86/intel/ifs/ifs.h | 12 ++++ drivers/platform/x86/intel/ifs/runtest.c | 81 ++++++++++++++++++++++++ 2 files changed, 93 insertions(+) diff --git a/drivers/platform/x86/intel/ifs/ifs.h b/drivers/platform/x86/intel/ifs/ifs.h index f31966e291df..1228101de201 100644 --- a/drivers/platform/x86/intel/ifs/ifs.h +++ b/drivers/platform/x86/intel/ifs/ifs.h @@ -127,6 +127,7 @@ #include #include +#define MSR_ARRAY_BIST 0x00000105 #define MSR_COPY_SCAN_HASHES 0x000002c2 #define MSR_SCAN_HASHES_STATUS 0x000002c3 #define MSR_AUTHENTICATE_AND_COPY_CHUNK 0x000002c4 @@ -192,6 +193,17 @@ union ifs_status { }; }; +/* MSR_ARRAY_BIST bit fields */ +union ifs_array { + u64 data; + struct { + u32 array_bitmask; + u16 array_bank; + u16 rsvd :15; + u16 ctrl_result :1; + }; +}; + /* * Driver populated error-codes * 0xFD: Test timed out before completing all the chunks. diff --git a/drivers/platform/x86/intel/ifs/runtest.c b/drivers/platform/x86/intel/ifs/runtest.c index 969b3e0946d5..3a5442796c7d 100644 --- a/drivers/platform/x86/intel/ifs/runtest.c +++ b/drivers/platform/x86/intel/ifs/runtest.c @@ -229,6 +229,85 @@ static void ifs_test_core(int cpu, struct device *dev) } } +#define SPINUNIT 100 /* 100 nsec */ +static atomic_t array_cpus_out; + +/* + * Simplified cpu sibling rendezvous loop based on microcode loader __wait_for_cpus() + */ +static void wait_for_sibling_cpu(atomic_t *t, long long timeout) +{ + int cpu = smp_processor_id(); + const struct cpumask *smt_mask = cpu_smt_mask(cpu); + int all_cpus = cpumask_weight(smt_mask); + + atomic_inc(t); + while (atomic_read(t) < all_cpus) { + if (timeout < SPINUNIT) + return; + ndelay(SPINUNIT); + timeout -= SPINUNIT; + touch_nmi_watchdog(); + } +} + +static int do_array_test(void *data) +{ + union ifs_array *command = data; + int cpu = smp_processor_id(); + int first; + + /* + * Only one logical CPU on a core needs to trigger the Array test via MSR write. + */ + first = cpumask_first(cpu_smt_mask(cpu)); + + if (cpu == first) { + wrmsrl(MSR_ARRAY_BIST, command->data); + /* Pass back the result of the test */ + rdmsrl(MSR_ARRAY_BIST, command->data); + } + + /* Tests complete faster if the sibling is spinning here */ + wait_for_sibling_cpu(&array_cpus_out, NSEC_PER_SEC); + + return 0; +} + +static void ifs_array_test_core(int cpu, struct device *dev) +{ + union ifs_array command = {}; + bool timed_out = false; + struct ifs_data *ifsd; + unsigned long timeout; + + ifsd = ifs_get_data(dev); + + command.array_bitmask = ~0U; + timeout = jiffies + HZ / 2; + + do { + if (time_after(jiffies, timeout)) { + timed_out = true; + break; + } + atomic_set(&array_cpus_out, 0); + stop_core_cpuslocked(cpu, do_array_test, &command); + + if (command.ctrl_result) + break; + } while (command.array_bitmask); + + ifsd->scan_details = command.data; + + if (command.ctrl_result) + ifsd->status = SCAN_TEST_FAIL; + else if (timed_out || command.array_bitmask) + ifsd->status = SCAN_NOT_TESTED; + else + ifsd->status = SCAN_TEST_PASS; +} + /* * Initiate per core test. It wakes up work queue threads on the target cpu and * its sibling cpu. Once all sibling threads wake up, the scan test gets executed and @@ -253,6 +332,8 @@ int do_core_test(int cpu, struct device *dev) ifs_test_core(cpu, dev); break; case IFS_TYPE_ARRAY_BIST: + ifs_array_test_core(cpu, dev); + break; default: return -EINVAL; } From patchwork Wed Mar 1 01:59:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jithu Joseph X-Patchwork-Id: 62721 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3374394wrd; Tue, 28 Feb 2023 18:07:04 -0800 (PST) X-Google-Smtp-Source: AK7set8rWYjKbTvzNdnlubz0nGCnd8ACmNzNF4PJwarwLrHQIKQRMvm4VFXq7AF+Zn/X1JA5Lz25 X-Received: by 2002:a05:6402:ce:b0:4af:601e:6039 with SMTP id i14-20020a05640200ce00b004af601e6039mr5964437edu.22.1677636424804; Tue, 28 Feb 2023 18:07:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677636424; cv=none; d=google.com; s=arc-20160816; b=zxymUq2D4LnQ77YV4KtwJbsVR6xOaWjbPFfhS/wSziRXeCqLYNTz4rqRMRDpTPh/Z2 hsTFdo2rJ9zKN3LSfln2Q9yORUX2cYwmPmw7ed/WXrOobhWpUobMIjMQSp5890CP/IFS hFSLGAXrSaJgkCTRvZ79p77C0CB4guUTiY4ep6r941/K1lPHX+u0O7/qsyjigK9kdF0d WtbEenhWS5GHUoJhV3VHozDJGs5vnBRaPfVZQG3g+MYYzYxIefJMtuFvOBrWZPwuQKtx 3eojcS60DBW6Ya2wa6f4VMPvu9iukFUEgkQmtoD6mYBgVsCK4Hfc1tfvPLl8XHGgU95q M/gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hW9020x24quL0dcUUMXEWAFVSk+EP9byPvXE5wSpxt0=; b=yvREOFKPvRt90g0CxvsLamyY6HuRr3Fj/4dC6LEbnq56hxrcLTqPEZsvsfmc2tY/xZ GtqGwGiwQ/wY9sWCLJFMYCEZgWSTclRoJNnNrCRDY2lJafpYCCn7No/qXmstMPJsFEvj k8IOaTop6vpRuCiK2MNnsRDuvlyjVn8pHKfIq9b/cTFB7Pofo9YcUuwoybh5hR5vLeR6 vO1etSKX6OQP6/62ZxLlFJMKcHyE7W7k301MRiMzpD+3OWqLv2zkBmiGGxFUQyx2yefo OctJa9rYPoMw1jhjdsFzoeJ1/Xp0H/EOllvgzr+89jH1XeabVb2wy1emIiB8bG9VrMKb 94rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GiHOvXKG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q4-20020a056402032400b004ab4c6b22dfsi12875236edw.336.2023.02.28.18.06.42; Tue, 28 Feb 2023 18:07:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GiHOvXKG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229890AbjCACBp (ORCPT + 99 others); Tue, 28 Feb 2023 21:01:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229697AbjCACBR (ORCPT ); Tue, 28 Feb 2023 21:01:17 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D93C41CF52; Tue, 28 Feb 2023 18:01:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677636076; x=1709172076; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GMczgXavrBgg17Er2wnixo7pn8wUH2g/Rwj8eQGunFA=; b=GiHOvXKGxvDRlfyXY40ImgMT9qTMtG4VLQj6HeZFSzG2heeVxECTL1MA os4xm9ogB/DN1xBUThPv4xIKVEs2KpowdkGKACKtnAvx/f6aGt89gJVn1 BjW+fNQhj3zay7KmQ97TvkgVLHYKUazJ1qJogOqsTGIQc2KCEFAEb0/PQ bR/q0EdCkqOcWmo0BtJJ0hjo3W6FJWDeTlDlnuhMGpFNPGR/P6jkN36JF GO0+XbHDEZkBEb9Z8sNaeK2vwGZl3MgBoLRZgLd558qxFMWc3QcDiPWaU G27odtjyE5A7z0M0uDImM+PqYUU1aP1ZfVO8yNlyxK3e23ibcZ3ShtJ/l w==; X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="420558481" X-IronPort-AV: E=Sophos;i="5.98,223,1673942400"; d="scan'208";a="420558481" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 18:01:16 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="704639969" X-IronPort-AV: E=Sophos;i="5.98,223,1673942400"; d="scan'208";a="704639969" Received: from jithujos.sc.intel.com ([172.25.103.66]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 18:01:15 -0800 From: Jithu Joseph To: hdegoede@redhat.com, markgross@kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, gregkh@linuxfoundation.org, rostedt@goodmis.org, jithu.joseph@intel.com, ashok.raj@intel.com, tony.luck@intel.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, patches@lists.linux.dev, ravi.v.shankar@intel.com, thiago.macieira@intel.com, athenas.jimenez.gonzalez@intel.com, sohil.mehta@intel.com Subject: [PATCH v3 7/8] platform/x86/intel/ifs: Update IFS doc Date: Tue, 28 Feb 2023 17:59:41 -0800 Message-Id: <20230301015942.462799-8-jithu.joseph@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230301015942.462799-1-jithu.joseph@intel.com> References: <20230214234426.344960-1-jithu.joseph@intel.com> <20230301015942.462799-1-jithu.joseph@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757852350459523140?= X-GMAIL-MSGID: =?utf-8?q?1759129291702343415?= Array BIST is the second test supported by IFS. Modify IFS doc entry to be more general. Signed-off-by: Jithu Joseph Reviewed-by: Tony Luck --- drivers/platform/x86/intel/ifs/ifs.h | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/drivers/platform/x86/intel/ifs/ifs.h b/drivers/platform/x86/intel/ifs/ifs.h index 1228101de201..34f68778c8b5 100644 --- a/drivers/platform/x86/intel/ifs/ifs.h +++ b/drivers/platform/x86/intel/ifs/ifs.h @@ -17,7 +17,7 @@ * In Field Scan (IFS) is a hardware feature to run circuit level tests on * a CPU core to detect problems that are not caught by parity or ECC checks. * Future CPUs will support more than one type of test which will show up - * with a new platform-device instance-id, for now only .0 is exposed. + * with a new platform-device instance-id. * * * IFS Image @@ -25,7 +25,10 @@ * * Intel provides a firmware file containing the scan tests via * github [#f1]_. Similar to microcode there is a separate file for each - * family-model-stepping. + * family-model-stepping. IFS Images are not applicable for some test types. + * Wherever applicable the sysfs directory would provide a "current_batch" file + * (see below) for loading the image. + * * * IFS Image Loading * ----------------- @@ -35,7 +38,7 @@ * SHA hashes for the test. Then the tests themselves. Status MSRs provide * feedback on the success/failure of these steps. * - * The test files are kept in a fixed location: /lib/firmware/intel/ifs_0/ + * The test files are kept in a fixed location: /lib/firmware/intel/ifs_/ * For e.g if there are 3 test files, they would be named in the following * fashion: * ff-mm-ss-01.scan @@ -47,7 +50,7 @@ * (e.g 1, 2 or 3 in the above scenario) into the curent_batch file. * To load ff-mm-ss-02.scan, the following command can be used:: * - * # echo 2 > /sys/devices/virtual/misc/intel_ifs_0/current_batch + * # echo 2 > /sys/devices/virtual/misc/intel_ifs_/current_batch * * The above file can also be read to know the currently loaded image. * @@ -69,16 +72,16 @@ * to migrate those applications to other cores before running a core test. * It may also be necessary to redirect interrupts to other CPUs. * - * In all cases reading the SCAN_STATUS MSR provides details on what + * In all cases reading the corresponding test's STATUS MSR provides details on what * happened. The driver makes the value of this MSR visible to applications * via the "details" file (see below). Interrupted tests may be restarted. * - * The IFS driver provides sysfs interfaces via /sys/devices/virtual/misc/intel_ifs_0/ + * The IFS driver provides sysfs interfaces via /sys/devices/virtual/misc/intel_ifs_/ * to control execution: * * Test a specific core:: * - * # echo > /sys/devices/virtual/misc/intel_ifs_0/run_test + * # echo > /sys/devices/virtual/misc/intel_ifs_/run_test * * when HT is enabled any of the sibling cpu# can be specified to test * its corresponding physical core. Since the tests are per physical core, @@ -87,21 +90,21 @@ * * For e.g. to test core corresponding to cpu5 * - * # echo 5 > /sys/devices/virtual/misc/intel_ifs_0/run_test + * # echo 5 > /sys/devices/virtual/misc/intel_ifs_/run_test * * Results of the last test is provided in /sys:: * - * $ cat /sys/devices/virtual/misc/intel_ifs_0/status + * $ cat /sys/devices/virtual/misc/intel_ifs_/status * pass * * Status can be one of pass, fail, untested * * Additional details of the last test is provided by the details file:: * - * $ cat /sys/devices/virtual/misc/intel_ifs_0/details + * $ cat /sys/devices/virtual/misc/intel_ifs_/details * 0x8081 * - * The details file reports the hex value of the SCAN_STATUS MSR. + * The details file reports the hex value of the test specific status MSR. * Hardware defined error codes are documented in volume 4 of the Intel * Software Developer's Manual but the error_code field may contain one of * the following driver defined software codes: From patchwork Wed Mar 1 01:59:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jithu Joseph X-Patchwork-Id: 62722 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3374399wrd; Tue, 28 Feb 2023 18:07:07 -0800 (PST) X-Google-Smtp-Source: AK7set/KVeNvr6ILqGXpR4lJYLFrnxWuaecbZKt2TYXN1SGYLQYjgqOqz69zsyhgx5RzAufgSWrR X-Received: by 2002:a05:6402:322:b0:4ac:b4f3:b8a7 with SMTP id q2-20020a056402032200b004acb4f3b8a7mr4970597edw.7.1677636427001; Tue, 28 Feb 2023 18:07:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677636426; cv=none; d=google.com; s=arc-20160816; b=QVuTSe/cD6/8Wo/EP/GBLAfC0qS3OhGrMoIirP4Nz0Be/N29gXxhSiNjb1xRlPD3SZ 3w6tdxEillsEtAgLHnkK8F+JaN2J4RSrfrRa/JIYKTdIZSns59vvZkouJEP85IF5wlRo uQ5fS8SchFDUZUeIqeXuIQeIh/tfNJlQjaMdbW3NECdpfX21H9jpBbjufQa1HqNelPyp alQGXGHTW9wz55EzccfKzjjeFXz60knQYvrna6aScfmQ/2wJ/8buoMvk5wyLfkFBorq5 icUDV/8JnsswlLSQpcpJGLCqwetv4D9yz24MZhM12/CtbKQKo90nRtllHemQCG2dDBCW Zc/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=FUp3x3a7xh1g6ekQ5+Pvgrqx/gfNTlKjm1yEhi2PFQ4=; b=tRFl29/ziYciCwxRcrBvRFxNjIPEyoCdfdrZyi6UQvzCV8+r32kFgaAF2a6e9+3QFA 42sfMYJMKH6mbfGJ/7Rug4TnpG/rPoRYHNu07+nUoVACgXPrmXMHr4ZTk4BJspzLmWjg hDX16RGt7QaC/CEY/+kFRg+jIkvjWwjq5pXAYZR1vpo8M/3onkBQBiaL7tygrpgM92Ij pBphUadunz6pHbeiQ/gsa7hjvXP6krY1bVnj1UMYBVuHEPqGmMSSe9aKqWusxdFzwjps NBMHEwTdxNB1cRE6oxQUZdHXKR76GvYPaekhj4D1scWpf70LNdfsNSesCfj4ThjO1S38 xy7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FrGlkLbV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f20-20020a05640214d400b004ace62d6ea9si12402987edx.529.2023.02.28.18.06.43; Tue, 28 Feb 2023 18:07:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FrGlkLbV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229901AbjCACBt (ORCPT + 99 others); Tue, 28 Feb 2023 21:01:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229806AbjCACBS (ORCPT ); Tue, 28 Feb 2023 21:01:18 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F4231CF4F; Tue, 28 Feb 2023 18:01:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677636077; x=1709172077; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eiS3IxaAsk6x7BayF1DCQxveYExshrK1kKyFW8zL/CQ=; b=FrGlkLbVaix/hv/kEgnOYcoI+4WgA3qg70myIi1h+Bxt430L31rNQt3w l2pX6QOX8C73u7Jf5MA1Myi8Fzl3YvWrf+CEz4gvAmG5KCqjt661+1rjd MzM8hcMJfNGHkNSNRU6pGTKmrFHuo87CS2+r4c3z++l780nOWeCtfY+FM ddAFTLrt9iMFUOhx5o4M3CXPSFuihuOII0JvoA/08cb0dh+iEcV70tQds 0NW2RmdS/IGQeU0sDU1zFt9rsOAAodjYPwovB4pVcDniqVoJiKyX93L+x JCK/uX8N9KeIlk8ocq1uMULk0yayBfffBHpGDEu/D1NpOtXoA7jmMjbjh w==; X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="420558493" X-IronPort-AV: E=Sophos;i="5.98,223,1673942400"; d="scan'208";a="420558493" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 18:01:17 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10635"; a="704639978" X-IronPort-AV: E=Sophos;i="5.98,223,1673942400"; d="scan'208";a="704639978" Received: from jithujos.sc.intel.com ([172.25.103.66]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 18:01:16 -0800 From: Jithu Joseph To: hdegoede@redhat.com, markgross@kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, gregkh@linuxfoundation.org, rostedt@goodmis.org, jithu.joseph@intel.com, ashok.raj@intel.com, tony.luck@intel.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, patches@lists.linux.dev, ravi.v.shankar@intel.com, thiago.macieira@intel.com, athenas.jimenez.gonzalez@intel.com, sohil.mehta@intel.com Subject: [PATCH v3 8/8] Documentation/ABI: Update IFS ABI doc Date: Tue, 28 Feb 2023 17:59:42 -0800 Message-Id: <20230301015942.462799-9-jithu.joseph@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230301015942.462799-1-jithu.joseph@intel.com> References: <20230214234426.344960-1-jithu.joseph@intel.com> <20230301015942.462799-1-jithu.joseph@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757852326240655079?= X-GMAIL-MSGID: =?utf-8?q?1759129294030180831?= Array BIST test doesn't need an IFS test image to operate unlike the SCAN test. Consequently current_batch and image_version files are not applicable for Array BIST IFS device instance, clarify this in the ABI doc. Also given that multiple tests are supported, take the opportunity to generalize descriptions wherever applicable. Signed-off-by: Jithu Joseph Reviewed-by: Tony Luck --- Documentation/ABI/testing/sysfs-platform-intel-ifs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-platform-intel-ifs b/Documentation/ABI/testing/sysfs-platform-intel-ifs index 55991983d0d0..c0cc5ef0739a 100644 --- a/Documentation/ABI/testing/sysfs-platform-intel-ifs +++ b/Documentation/ABI/testing/sysfs-platform-intel-ifs @@ -21,15 +21,16 @@ Date: Nov 16 2022 KernelVersion: 6.2 Contact: "Jithu Joseph" Description: Additional information regarding the last test. The details file reports - the hex value of the SCAN_STATUS MSR. Note that the error_code field + the hex value of the STATUS MSR for this test. Note that the error_code field may contain driver defined software code not defined in the Intel SDM. What: /sys/devices/virtual/misc/intel_ifs_/image_version Date: Nov 16 2022 KernelVersion: 6.2 Contact: "Jithu Joseph" -Description: Version (hexadecimal) of loaded IFS binary image. If no scan image - is loaded reports "none". +Description: Version (hexadecimal) of loaded IFS test image. If no test image + is loaded reports "none". Only present for device instances where a test image + is applicable. What: /sys/devices/virtual/misc/intel_ifs_/current_batch Date: Nov 16 2022 @@ -39,3 +40,4 @@ Description: Write a number less than or equal to 0xff to load an IFS test image The number written treated as the 2 digit suffix in the following file name: /lib/firmware/intel/ifs_/ff-mm-ss-02x.scan Reading the file will provide the suffix of the currently loaded IFS test image. + This file is present only for device instances where a test image is applicable.