From patchwork Tue Feb 14 23:44:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jithu Joseph X-Patchwork-Id: 57282 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3265081wrn; Tue, 14 Feb 2023 15:49:53 -0800 (PST) X-Google-Smtp-Source: AK7set9lZUfIKWwOtAhkK4igg70b5yfgN1xpKSgI5Zc/huko6B54o2ZThMISSL23BtvWkVuRwz/n X-Received: by 2002:a17:906:d9c3:b0:8b1:15ab:f4cd with SMTP id qk3-20020a170906d9c300b008b115abf4cdmr232219ejb.53.1676418593062; Tue, 14 Feb 2023 15:49:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676418593; cv=none; d=google.com; s=arc-20160816; b=bihxeYsqTG7PZbNcww1I0aELP/PIVYo9coxTCAkCFIFlOBJ813VsO0msI6Ku5siajU xLNjfRJ+iL+aZVpOEIdbTApz13uxNayY4A0iIXEgLr5KuMVMKx6jhKMei3vqRCNVV+ys Toe7JPGet1Q+AJY+F2euuSKGOJz9saUL6l1bahGFIx9uisW89U+3BiOnc8Fu+5AAE+x3 sGrbVRCBmGt7JoEMIMmAsFmoG5fIl+6i6jRhXrQ9k6dLyNg63txVmceIA9+2joPXDUkF L0+7XXfbMJEACdg9tEGTP3QJk4xvHvjemyJBSg2vW388P4CTkLSoFBfcMyYlSuVM1PLz 8weQ== 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=WzLJElpttl7NsKTiv0JBXW+1Fm6QMe5ngIBupek0/jeJXueS0rk8mTOf185WUj1zr8 MCv2VxCGvGPaPyerpm4CkweP382qjvlKg8mjZdBXPRFTD5XAtDEiLVHVBV1QOgmKWzpP 9K8tHkmdvNkY2ZYRHT9tEdqppozKU1Xzx9YQQ9APCOkVsHNa68I680qPNG144oUwbg6h dEyMITAollFIjXbc6zE7omkN0BwS4MVy/Edv4klZkbtM5xfEXOGopo71mlcD9akCzyl2 Vr++GCveymJJKTAOEZPNx9S5AS5rNByzjyIDjotJBS0/r+usEYKUgVqQJEhtJfaD/51P VHkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TibgpoaU; 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 s22-20020a170906221600b008b13afdbdefsi1752160ejs.822.2023.02.14.15.49.26; Tue, 14 Feb 2023 15:49:53 -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=TibgpoaU; 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 S232720AbjBNXp6 (ORCPT + 99 others); Tue, 14 Feb 2023 18:45:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229725AbjBNXp4 (ORCPT ); Tue, 14 Feb 2023 18:45:56 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44FCC2CC42; Tue, 14 Feb 2023 15:45:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676418355; x=1707954355; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RJlwSFVpT1cewwIwRvUfBxfg5OygWbxR/zFOIt+ZgzQ=; b=TibgpoaUuRq5ZSm+amD9pUoPlf57cAzpVsHfNiYJEYNJFvEHO0Mr2Ijj XWYj4GqGiinoLsXETGizxqyVLlI3wRBp+iM7xhDgmXPOFTjelyoEYbUZ3 1CwvhpHeEsykdvBraNpVWdmdMfPcNF3LQKnicj7y8GRxgduu0yi4I8PYf XsX+Mvt3db+S9vgiwB6iIFAYt/m2JclUmcZkxj09rcoA6/te3JI0smBFC OWH9B5XibHvVQpcvCPIlwkvBwwU48GbhFnfuZ/AuWnP6ouw67KA6+nFrv qB9XVCwE86qhFGXoTH4wsWu2clxlJthdeoTEbhq8OqSw96O06ctyprbm/ g==; X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="417522992" X-IronPort-AV: E=Sophos;i="5.97,298,1669104000"; d="scan'208";a="417522992" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2023 15:45:54 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="669391008" X-IronPort-AV: E=Sophos;i="5.97,298,1669104000"; d="scan'208";a="669391008" Received: from jithujos.sc.intel.com ([172.25.103.66]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2023 15:45:53 -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 v2 1/7] x86/include/asm/msr-index.h: Add IFS Array test bits Date: Tue, 14 Feb 2023 15:44:20 -0800 Message-Id: <20230214234426.344960-2-jithu.joseph@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230214234426.344960-1-jithu.joseph@intel.com> References: <20230131234302.3997223-1-jithu.joseph@intel.com> <20230214234426.344960-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?1757852302583457395?= Define MSR bitfields for enumerating support for Array BIST test. Signed-off-by: Jithu Joseph Reviewed-by: Tony Luck --- 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 Tue Feb 14 23:44:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jithu Joseph X-Patchwork-Id: 57281 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3265049wrn; Tue, 14 Feb 2023 15:49:43 -0800 (PST) X-Google-Smtp-Source: AK7set9+CM7TyLSOpfY1dDjd56zZKype2Y2Ubm1iqxt6HEyhqHlXqUdkTUWdBmTnVZ64sJ3vblYb X-Received: by 2002:a17:906:944b:b0:8b1:3ba8:3f4d with SMTP id z11-20020a170906944b00b008b13ba83f4dmr172430ejx.70.1676418583201; Tue, 14 Feb 2023 15:49:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676418583; cv=none; d=google.com; s=arc-20160816; b=Ai73J0uXM/4exVoLcemLFQyoPBq30O3LNe4SZoZe7NdQA/VH7h4cf9tWADxILP8zfH pk2hJZ5kUi18yAgeVWA9CXL1a3t8YiuA+PPYuHdBIPV/Zg7+oIBl0v0dL3JcdM756daa TscpZ60k81SS6djVJhqHjeme6URE95XUDvlEjTNT41ApMt1H8gsKnQkQlvmKA3VOIfF6 kaEUdw7yWi9f8fCuiUDOTywlJq4q2zUh70YqkzA4q5T63RiHRZTXtKkpfTjh47kIhb5R MBNs19eGa9ZmNr+sJQVu6KWJS/BevvGHTFX8UJxCLfGOBPq/Rpp58P+RqHWz+gsJZA+8 EB7g== 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=mQ0HfA4yudtc0r3xSa6QEe9zY2R6Lo4G2gfoZJPMCmU=; b=XuGd0iQLjWnpEs6Rp53GGEnhGlAyR7SPEUyIFl+f8ZYy+c0N1iHzHoI0X6Iq28PHO4 wn1lOFd9220+G0/okpsijOuTE/D+d/tNbo/V9w+YM3GnckMKygVgsZz8/WJOYujYBEPi zpo56Ij3eORPNPc5wJ4YfvJFwafrxcvbzsfuIz26CiYs8wsrAdf+bF/ub4OmmBimseJb T+HdobzfpRSZV6lrMhUQaAly9iapduaImjH51bwcV/HO8628tkcZ5QRnPIaLNhty+AIf d+aPzcuT0ry2bl3ZBBol3TUtgAoysey8z3NqJXReSW05Jrfpi9eQaRbPn8xSg+SeUJCr lInA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Cqq0Gxw7; 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 y15-20020a170906518f00b0086e4e761d7esi20814606ejk.393.2023.02.14.15.49.18; Tue, 14 Feb 2023 15:49:43 -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=Cqq0Gxw7; 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 S232763AbjBNXqB (ORCPT + 99 others); Tue, 14 Feb 2023 18:46:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232271AbjBNXp4 (ORCPT ); Tue, 14 Feb 2023 18:45:56 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B86272BF18; Tue, 14 Feb 2023 15:45:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676418355; x=1707954355; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Mvhv6zkaH9H97cKt0p0n94x4bwBzoDv9AW5TNmZ4ZsU=; b=Cqq0Gxw76Sylkd4H9mN2Uv+Qoi4mCb+hcCOxr+zFyxtGtbEESUfE6gWL HNrsxiwcvAHu8bITbrZQwiYTD9kqMf7oqZlUJ9g+AS+JE7UaU2taYdtuA 4zYUo/fXS7KuKozxt0vrfkKf5zJAX7EbnQEa0wwXGA/J7BFKqphZIsba8 1TI4mqxAbXhawB6EyRTWaeGN8V59Cj3i2ZotVmPEEaUp0arzVnEbWCXeZ hgpRzl0W2G8KjgSram1AFD4kNvkUWJO9REJfOnwf4fNfnSXAUafWiH/vO 11IFtiozbbWG/v/feXMsZ7WTD1y25fQV8gtoDj9uDN5EKlM23Jd2UmzvN Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="417523003" X-IronPort-AV: E=Sophos;i="5.97,298,1669104000"; d="scan'208";a="417523003" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2023 15:45:55 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="669391011" X-IronPort-AV: E=Sophos;i="5.97,298,1669104000"; d="scan'208";a="669391011" Received: from jithujos.sc.intel.com ([172.25.103.66]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2023 15:45:54 -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 v2 2/7] platform/x86/intel/ifs: Introduce Array Scan test to IFS Date: Tue, 14 Feb 2023 15:44:21 -0800 Message-Id: <20230214234426.344960-3-jithu.joseph@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230214234426.344960-1-jithu.joseph@intel.com> References: <20230131234302.3997223-1-jithu.joseph@intel.com> <20230214234426.344960-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?1757852292510646024?= 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 | 5 ++ drivers/platform/x86/intel/ifs/core.c | 70 ++++++++++++++++++--------- 2 files changed, 52 insertions(+), 23 deletions(-) diff --git a/drivers/platform/x86/intel/ifs/ifs.h b/drivers/platform/x86/intel/ifs/ifs.h index 046e39304fd5..2cef88a88aa9 100644 --- a/drivers/platform/x86/intel/ifs/ifs.h +++ b/drivers/platform/x86/intel/ifs/ifs.h @@ -137,6 +137,11 @@ #define SCAN_TEST_PASS 1 #define SCAN_TEST_FAIL 2 +enum test_types { + IFS_SAF, + IFS_ARRAY, +}; + /* 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 206a617c2e02..ab234620ef4c 100644 --- a/drivers/platform/x86/intel/ifs/core.c +++ b/drivers/platform/x86/intel/ifs/core.c @@ -16,27 +16,44 @@ 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); -static struct ifs_device ifs_device = { - .data = { - .integrity_cap_bit = MSR_INTEGRITY_CAPS_PERIODIC_BIST_BIT, - .test_num = 0, +static struct ifs_device ifs_devices[] = { + [IFS_SAF] = { + .data = { + .integrity_cap_bit = MSR_INTEGRITY_CAPS_PERIODIC_BIST_BIT, + .test_num = IFS_SAF, + }, + .misc = { + .name = "intel_ifs_0", + .nodename = "intel_ifs/0", + .minor = MISC_DYNAMIC_MINOR, + }, }, - .misc = { - .name = "intel_ifs_0", - .nodename = "intel_ifs/0", - .minor = MISC_DYNAMIC_MINOR, + [IFS_ARRAY] = { + .data = { + .integrity_cap_bit = MSR_INTEGRITY_CAPS_ARRAY_BIST_BIT, + .test_num = IFS_ARRAY, + }, + .misc = { + .name = "intel_ifs_1", + .nodename = "intel_ifs/1", + .minor = MISC_DYNAMIC_MINOR, + }, }, }; +#define IFS_NUMTESTS ARRAY_SIZE(ifs_devices) + static int __init ifs_init(void) { const struct x86_cpu_id *m; + int ndevices = 0; u64 msrval; - int ret; + int i; m = x86_match_cpu(ifs_cpu_ids); if (!m) @@ -51,28 +68,35 @@ 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.data.integrity_cap_bit))) - return -ENODEV; + for (i = 0; i < IFS_NUMTESTS; i++) { + if (!(msrval & BIT(ifs_devices[i].data.integrity_cap_bit))) + continue; - ifs_device.data.pkg_auth = kmalloc_array(topology_max_packages(), sizeof(bool), GFP_KERNEL); - if (!ifs_device.data.pkg_auth) - return -ENOMEM; + ifs_devices[i].data.pkg_auth = kmalloc_array(topology_max_packages(), + sizeof(bool), GFP_KERNEL); + if (!ifs_devices[i].data.pkg_auth) + continue; + ifs_devices[i].misc.groups = ifs_get_groups(); - ret = misc_register(&ifs_device.misc); - if (ret) { - kfree(ifs_device.data.pkg_auth); - return ret; + if (misc_register(&ifs_devices[i].misc)) + kfree(ifs_devices[i].data.pkg_auth); + else + ndevices++; } - return 0; + return ndevices ? 0 : -ENODEV; } static void __exit ifs_exit(void) { - misc_deregister(&ifs_device.misc); - kfree(ifs_device.data.pkg_auth); + 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].data.pkg_auth); + } + } } module_init(ifs_init); From patchwork Tue Feb 14 23:44:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jithu Joseph X-Patchwork-Id: 57280 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3265005wrn; Tue, 14 Feb 2023 15:49:35 -0800 (PST) X-Google-Smtp-Source: AK7set+P98A7UK64WHFBlGWL4NNcWSD1/fC6fbmj9oVtRqrdbyWGGXR2YuRp7krS14aZ1dUM6/kV X-Received: by 2002:a17:906:48c3:b0:8a9:f870:d259 with SMTP id d3-20020a17090648c300b008a9f870d259mr219882ejt.48.1676418575043; Tue, 14 Feb 2023 15:49:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676418575; cv=none; d=google.com; s=arc-20160816; b=JwLzb+GbT/yRX5WpPCxZPdUb3uEuXKfLKQK6ZEb9a8kfZKaPsmyAyIu/Hpee+k3oU/ EYZzYzq4ki3+DaicY2vyIwDWrHpNsfzUpESJUtf4L74JJKk6JYMqCa7eV2z9eStbLd4x VgEG2RCOG31XHtAiVZ//paIids/Tg0XquXkc5z2v8uHot4zrn1uIUMzH/U4hfQ8xwBL3 hyG74pEIB1VGMv6ph866gk2/g8ISIKLjdlcMkoMtDNMZHHAatQNnzwncP+EPvsUXFXjn Pbj23Z+A0YtpTk9Gvh2i99+WIWduQU71Uey2WiOFbcKlKrbtEPrSv3quzaTghbxUJYO3 q22A== 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=d14+4CndGQS0tZTHb6hXfAeS4CrK9IWwix9X6jfEa7I=; b=ndrg0ZwvVTBrqfc3EYviTwpcZlBIwlwGHoS/abJShWXD8Sp5Q8eyugQ+Q7OSwxZ6O3 37Qmlp3Q26imttn3vAkghjMjuuYoWF1kssraky0VOUOr62etK7FHWFHMSvoIaJ0PLQvG nan62ACA6kvWU6MGJrIElu5tHb9C0XktJrr8IMimeF1Nkdj/CDb/SEdhzQgzQJBhUVZu dbcjZaWoo7GfrgI0DX7XEmPEPrS4qEUdBwDalgBeFczXnuS+wopQwyO8pAF440fWAkE1 K2jn0xgSBr2XRIyNzcVWtcrT/Wdiv0OZrZthF95nIhYHdfo1RZq29sdT/ILkc6r2x5e1 sXkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eWjEPY2g; 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 f18-20020a170906739200b008b1439765absi218204ejl.726.2023.02.14.15.49.12; Tue, 14 Feb 2023 15:49:35 -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=eWjEPY2g; 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 S229686AbjBNXqE (ORCPT + 99 others); Tue, 14 Feb 2023 18:46:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229551AbjBNXp5 (ORCPT ); Tue, 14 Feb 2023 18:45:57 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86FFB2914A; Tue, 14 Feb 2023 15:45:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676418356; x=1707954356; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FZhdytTplH8hafL4/6++wppoH2ryGQJ9fu1jV9238GY=; b=eWjEPY2gqEvbANrEkPWUVxpFjBToTT1qtAw6tRUCJqu7G6CMSBqXBWn+ gOA8LlA64JK83YyDwEjQhOwBQ1DRph0UOswlEH2mvVRzNHK4RbgcZZCUg ki2WqZzQvqf6tEJ5Skjt/5DILN9y1+51mRdG8kxh+J1WdxsEzEQ/1n0ml LFPCfRTZPHkWWIAk1Kx1xfDJYrIC+ZA7C+q4wdfzc3ITYSLVFpyLxFv8h Qi5qulSIrtNj7KkuHf76jp6Uw8uoVkFzJB7v+3kY4af9YVDnIPdKvhgJx vPRpp33IBl5y7QwqjXfTnuDI64M0uUck/uTbQx+qd1UPuxIz3Y5dL7/aN g==; X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="417523018" X-IronPort-AV: E=Sophos;i="5.97,298,1669104000"; d="scan'208";a="417523018" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2023 15:45:56 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="669391014" X-IronPort-AV: E=Sophos;i="5.97,298,1669104000"; d="scan'208";a="669391014" Received: from jithujos.sc.intel.com ([172.25.103.66]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2023 15:45:55 -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 v2 3/7] platform/x86/intel/ifs: Sysfs interface for Array BIST Date: Tue, 14 Feb 2023 15:44:22 -0800 Message-Id: <20230214234426.344960-4-jithu.joseph@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230214234426.344960-1-jithu.joseph@intel.com> References: <20230131234302.3997223-1-jithu.joseph@intel.com> <20230214234426.344960-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?1757852283602825433?= 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 | 21 ++++++++++++++++----- drivers/platform/x86/intel/ifs/runtest.c | 11 ++++++++++- drivers/platform/x86/intel/ifs/sysfs.c | 10 +++++++++- 4 files changed, 36 insertions(+), 7 deletions(-) diff --git a/drivers/platform/x86/intel/ifs/ifs.h b/drivers/platform/x86/intel/ifs/ifs.h index 2cef88a88aa9..a0cb2696c1d9 100644 --- a/drivers/platform/x86/intel/ifs/ifs.h +++ b/drivers/platform/x86/intel/ifs/ifs.h @@ -249,5 +249,6 @@ static inline struct ifs_data *ifs_get_data(struct device *dev) 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_array_attrs[]; #endif diff --git a/drivers/platform/x86/intel/ifs/core.c b/drivers/platform/x86/intel/ifs/core.c index ab234620ef4c..d0d4e1fb62f6 100644 --- a/drivers/platform/x86/intel/ifs/core.c +++ b/drivers/platform/x86/intel/ifs/core.c @@ -25,6 +25,7 @@ static struct ifs_device ifs_devices[] = { [IFS_SAF] = { .data = { .integrity_cap_bit = MSR_INTEGRITY_CAPS_PERIODIC_BIST_BIT, + .pkg_auth = NULL, .test_num = IFS_SAF, }, .misc = { @@ -36,6 +37,7 @@ static struct ifs_device ifs_devices[] = { [IFS_ARRAY] = { .data = { .integrity_cap_bit = MSR_INTEGRITY_CAPS_ARRAY_BIST_BIT, + .pkg_auth = NULL, .test_num = IFS_ARRAY, }, .misc = { @@ -48,6 +50,8 @@ static struct ifs_device ifs_devices[] = { #define IFS_NUMTESTS ARRAY_SIZE(ifs_devices) +ATTRIBUTE_GROUPS(plat_ifs_array); + static int __init ifs_init(void) { const struct x86_cpu_id *m; @@ -72,11 +76,18 @@ static int __init ifs_init(void) if (!(msrval & BIT(ifs_devices[i].data.integrity_cap_bit))) continue; - ifs_devices[i].data.pkg_auth = kmalloc_array(topology_max_packages(), - sizeof(bool), GFP_KERNEL); - if (!ifs_devices[i].data.pkg_auth) - continue; - ifs_devices[i].misc.groups = ifs_get_groups(); + switch (ifs_devices[i].data.test_num) { + case IFS_SAF: + ifs_devices[i].data.pkg_auth = kmalloc_array(topology_max_packages(), + sizeof(bool), GFP_KERNEL); + if (!ifs_devices[i].data.pkg_auth) + continue; + ifs_devices[i].misc.groups = ifs_get_groups(); + break; + case IFS_ARRAY: + ifs_devices[i].misc.groups = plat_ifs_array_groups; + break; + } if (misc_register(&ifs_devices[i].misc)) kfree(ifs_devices[i].data.pkg_auth); diff --git a/drivers/platform/x86/intel/ifs/runtest.c b/drivers/platform/x86/intel/ifs/runtest.c index 0bfd8fcdd7e8..65e08af70994 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,15 @@ int do_core_test(int cpu, struct device *dev) goto out; } - ifs_test_core(cpu, dev); + switch (ifsd->test_num) { + case IFS_SAF: + ifs_test_core(cpu, dev); + break; + case IFS_ARRAY: + 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 ee636a76b083..3e205fead7ab 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->test_num != IFS_ARRAY && !ifsd->loaded) rc = -EPERM; else rc = do_core_test(cpu, dev); @@ -156,3 +156,11 @@ const struct attribute_group **ifs_get_groups(void) { return plat_ifs_groups; } + +/* 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 Tue Feb 14 23:44:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jithu Joseph X-Patchwork-Id: 57279 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3264971wrn; Tue, 14 Feb 2023 15:49:26 -0800 (PST) X-Google-Smtp-Source: AK7set/1BfGPa1hCxuZVNv0Eg2iUm3+HZY21+uZg/c1KwyqZzXNB2+POEnAUHOLQ4L4ifWN06kB+ X-Received: by 2002:aa7:d38c:0:b0:4ac:c84b:1ddd with SMTP id x12-20020aa7d38c000000b004acc84b1dddmr61609edq.32.1676418566481; Tue, 14 Feb 2023 15:49:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676418566; cv=none; d=google.com; s=arc-20160816; b=fJnMvF0/q5qxOpxCKEjeTIEILpHOoGHmxzadViIAHZixiW6N0DTAs3k+vV6nrj2R7q 4eKD3NTzan3jfyjcEqUWO1ABi7LHuSRgpt0RqNVmau5qZa/3BfAJONYUin0dajRBvqmO uc2MhUuxyXyDsOiJMfPMfWBGwJd99XanHkLNwBoGmhNK8ANOAKXoBSi/IZx7vnKytGUL DeJBprmkznCP3IeMVcKS49D/I9QB5JFSgmeCW0kqu4pPzNzCRi92SmrIBlrah9TqrzJR xodJLvKGzPVrGYrZWnWXUoXm0PD48PFt0KBp1e6c90U1Ub+wbkl0HNgZnFfqgl9Bd67L MVTA== 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=7P/ddIPtozpHULaTxRt4HNaiTnyIwoyC9EdYHDOJ/54=; b=QuMZCpiZwqVpCvVxmj5r348Bl6U9TOebg2VyU4/9uiScdOw2V1vpl9m2tqohJTHH5g iHD7fC21IIuodmsaETqixzJjMaCt3ng3AqdELkJeeF6I/FOtAZVjgAAdCliQrHH7tbpw 7OVgyKqVspYLodAL/S0ovOgfIC4LpJjo9EiPBKyLxa6ERkS3rWdZ+p64jjoQJwPqh9DQ fg3YlzW9QtfoRtlLGY33Vo6zzBkGwf4eEXuC5Jp+Csecpo8NqR0IFUMWifermAXjyatO U4Z/DWBDb3TRkrx+mORqZX0gG3cyJVJV1FON6ySEapKQBeD2848qIXnyyWnYoVOgXDo0 o+ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dkEoM+Go; 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 s3-20020aa7c543000000b004acc5850334si9410128edr.20.2023.02.14.15.49.03; Tue, 14 Feb 2023 15:49: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=dkEoM+Go; 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 S231687AbjBNXqH (ORCPT + 99 others); Tue, 14 Feb 2023 18:46:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232636AbjBNXp6 (ORCPT ); Tue, 14 Feb 2023 18:45:58 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D1892FCCA; Tue, 14 Feb 2023 15:45:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676418357; x=1707954357; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SsjAevpmZdqyiSpl1ArywIOY8BazdttWbu087eKG+/g=; b=dkEoM+GoAyRFZo0rvisTTUjTD0yA6SyyRqYGhnwPlW/jQXIElQsqD0Dw XVYqKYimcndpYejJf7LMSm/aqqD9rYnh38rVOMSjOZjtPbmUFAV03YOeY JCCByYYzIUQj6XuLVlmQ2y0/mU6mp0mFjQMp9F8MXEzFT98LwcEFGbW4Q mV3y9Nr2ecaODInvdUHchJCqEyrxDrOwBqowvWdfES1/9UUN8R3mwtOXE TK4i5QL1b+rhbU2PTelaYrUXaPrU0UTbstgyQTNFlTL+xaYSaMG9Ml8zF 66RooV7XYHZI+ONZSMd+rAPzMCoOYY8eoDzqnMEClxF24cKQpJAUO1hUs Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="417523025" X-IronPort-AV: E=Sophos;i="5.97,298,1669104000"; d="scan'208";a="417523025" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2023 15:45:56 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="669391017" X-IronPort-AV: E=Sophos;i="5.97,298,1669104000"; d="scan'208";a="669391017" Received: from jithujos.sc.intel.com ([172.25.103.66]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2023 15:45:56 -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 v2 4/7] platform/x86/intel/ifs: Implement Array BIST test Date: Tue, 14 Feb 2023 15:44:23 -0800 Message-Id: <20230214234426.344960-5-jithu.joseph@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230214234426.344960-1-jithu.joseph@intel.com> References: <20230131234302.3997223-1-jithu.joseph@intel.com> <20230214234426.344960-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?1757852274542915608?= 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 | 90 ++++++++++++++++++++++++ 2 files changed, 102 insertions(+) diff --git a/drivers/platform/x86/intel/ifs/ifs.h b/drivers/platform/x86/intel/ifs/ifs.h index a0cb2696c1d9..e5375191b56d 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 @@ -194,6 +195,17 @@ union ifs_status { }; }; +/* MSR_ARRAY_BIST bit fields */ +union ifs_array { + u64 data; + struct { + u32 array_bitmask :32; + u32 array_bank :16; + u32 rsvd :15; + u32 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 65e08af70994..12880fca0aa8 100644 --- a/drivers/platform/x86/intel/ifs/runtest.c +++ b/drivers/platform/x86/intel/ifs/runtest.c @@ -229,6 +229,94 @@ 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) +{ + int cpu = smp_processor_id(); + u64 *msrs = data; + 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, msrs[0]); + /* Pass back the result of the test */ + rdmsrl(MSR_ARRAY_BIST, msrs[1]); + } + + /* 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 activate, status = {0}; + bool timed_out = false; + struct ifs_data *ifsd; + unsigned long timeout; + u64 msrvals[2]; + + ifsd = ifs_get_data(dev); + + activate.array_bitmask = ~0U; + timeout = jiffies + HZ / 2; + + do { + if (time_after(jiffies, timeout)) { + timed_out = true; + break; + } + + msrvals[0] = activate.data; + + atomic_set(&array_cpus_out, 0); + stop_core_cpuslocked(cpu, do_array_test, msrvals); + status.data = msrvals[1]; + + if (status.ctrl_result) + break; + + activate.array_bitmask = status.array_bitmask; + activate.array_bank = status.array_bank; + + } while (status.array_bitmask); + + ifsd->scan_details = status.data; + + if (status.ctrl_result) + ifsd->status = SCAN_TEST_FAIL; + else if (timed_out || status.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 +341,8 @@ int do_core_test(int cpu, struct device *dev) ifs_test_core(cpu, dev); break; case IFS_ARRAY: + ifs_array_test_core(cpu, dev); + break; default: return -EINVAL; } From patchwork Tue Feb 14 23:44:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jithu Joseph X-Patchwork-Id: 57284 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3265234wrn; Tue, 14 Feb 2023 15:50:18 -0800 (PST) X-Google-Smtp-Source: AK7set+RoHQiRYH/mqEsmqGmiq3YuJ7U9sJaF0DZ7Ld+X7LYglDlA+wvHGvmSRmdcbg30a+MyOVb X-Received: by 2002:a17:906:2c4c:b0:8b1:16b3:303b with SMTP id f12-20020a1709062c4c00b008b116b3303bmr251366ejh.43.1676418618730; Tue, 14 Feb 2023 15:50:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676418618; cv=none; d=google.com; s=arc-20160816; b=ZGisKtywVnbOUoWPxR7wWoEmaDI0U4Q2spx61GZzg2RrMESebPw0Bg8guYNjGJ4SUd gkLdIuWBzfMpknviHB0sLGyK0jiwodUn74ZPE9vHDM5Tr+zgylmHXDR+4PrjUrZKwNaX du3tatERZu9/3Akk3BtjUsBG7Db5mw5OuJxogv9mNxn/La0EPLT56YeBSCpgNriPZaeP 09E4BRor2zfvZciDDhTJ/cngzKy1u1JoyCUBDoEuJOhap9HeCpK7ltRp0IC9Xpzpltc2 y6Ms+g4k/Utu4SnX1PvL7jB85noimdTm0WpyJJOTx/4/qyfjWEEpYE1jTSKHdPjbbS4E pXcw== 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=lw8pZwxpwrYoTmUzgjy7997ARjpnUog+ePE6SBZlHfs=; b=vOhbsCo1xjS+ZcKvvh1ZUCkgSXHQogpPp1g30zp6qeSIbWsSXqoxqOt2Hkv9zEYq6a RudOL8drmwPXI9FkYN904p5yWiGc2rcRvl5K/7GZfJISt/TRmd3lQszQ9Q0QQ2CaGYrp F87kp4TTpn/Xnr/0hACzbagNW0UETwvfahY0dmPT4u3oSCvjTMU0firDWAebiBq4bd/Q 9DtJdLTX4JPyuZH9rw6MeDGvONPZ6JnjKlsv7LZEFBuWy35ijJTxTAZgOHSOXyqgkdCY dy2KzI1NicYZ/DFBtSEbqJSxD5XCxOX0sPvEJU4BLYlpwkp17qoXwd5DEleOAjDlVyTd orwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=iKz26d3A; 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 e6-20020a170906748600b0086f05817f39si21799386ejl.39.2023.02.14.15.49.55; Tue, 14 Feb 2023 15:50:18 -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=iKz26d3A; 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 S232850AbjBNXqL (ORCPT + 99 others); Tue, 14 Feb 2023 18:46:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232504AbjBNXp7 (ORCPT ); Tue, 14 Feb 2023 18:45:59 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3044C2914A; Tue, 14 Feb 2023 15:45:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676418358; x=1707954358; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=U58Wafc7htqFPRhoLYl7u0MCfTww372m3K2hlfQ7h3U=; b=iKz26d3AoUeirHw5J6DgmLk8LanUUvaFm9QZxoMDU5C5lApMg+fLySWO v+7ADvbWdzq4LsNW4m4/XwbBb6ND8suIl2rjmIc9ktbsbDcKVkFmn5guh 9iYlgzl1htpaAxf6q7Qjcpc3ME6eRvdBk7HsXe8H6BxbywHjAtQ4CvCSH ExGRGHRejqdPnBXYTX/l2TVyWPkZ3FVwDvh8f67l2V3r9iPutrciLZyl1 jtkrbAy3v6FNSKstI/e2z70Lk8i4Ld2eKLUYfVNWDXqD8wwN/d9gnWdsY 95ySRR5V6+A1o+PWJrGU6Uly2liCTzAiJTPnOFx5aQOMTyE6Mghg2OAx0 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="417523039" X-IronPort-AV: E=Sophos;i="5.97,298,1669104000"; d="scan'208";a="417523039" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2023 15:45:57 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="669391020" X-IronPort-AV: E=Sophos;i="5.97,298,1669104000"; d="scan'208";a="669391020" Received: from jithujos.sc.intel.com ([172.25.103.66]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2023 15:45:56 -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 v2 5/7] platform/x86/intel/ifs: Trace support for array test Date: Tue, 14 Feb 2023 15:44:24 -0800 Message-Id: <20230214234426.344960-6-jithu.joseph@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230214234426.344960-1-jithu.joseph@intel.com> References: <20230131234302.3997223-1-jithu.joseph@intel.com> <20230214234426.344960-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?1756584997906336167?= X-GMAIL-MSGID: =?utf-8?q?1757852329319115245?= Enable tracing support in array test flow. Signed-off-by: Jithu Joseph Reviewed-by: Tony Luck Reviewed-by: Steven Rostedt (Google) --- include/trace/events/intel_ifs.h | 25 ++++++++++++++++++++++++ drivers/platform/x86/intel/ifs/runtest.c | 1 + 2 files changed, 26 insertions(+) diff --git a/include/trace/events/intel_ifs.h b/include/trace/events/intel_ifs.h index d7353024016c..d15037943b80 100644 --- a/include/trace/events/intel_ifs.h +++ b/include/trace/events/intel_ifs.h @@ -35,6 +35,31 @@ TRACE_EVENT(ifs_status, __entry->status) ); +TRACE_EVENT(ifs_array, + + TP_PROTO(int cpu, union ifs_array activate, union ifs_array status), + + TP_ARGS(cpu, activate, status), + + TP_STRUCT__entry( + __field( u64, activate ) + __field( u64, status ) + __field( int, cpu ) + ), + + TP_fast_assign( + __entry->activate = activate.data; + __entry->status = status.data; + __entry->cpu = cpu; + ), + + TP_printk("cpu: %d, array_list: %.8llx, array_bank: %.4llx, status: %.16llx", + __entry->cpu, + __entry->activate & 0xffffffff, + (__entry->activate >> 32) & 0xffff, + __entry->status) +); + #endif /* _TRACE_IFS_H */ /* This part must be outside protection */ diff --git a/drivers/platform/x86/intel/ifs/runtest.c b/drivers/platform/x86/intel/ifs/runtest.c index 12880fca0aa8..e74004fab1aa 100644 --- a/drivers/platform/x86/intel/ifs/runtest.c +++ b/drivers/platform/x86/intel/ifs/runtest.c @@ -299,6 +299,7 @@ static void ifs_array_test_core(int cpu, struct device *dev) stop_core_cpuslocked(cpu, do_array_test, msrvals); status.data = msrvals[1]; + trace_ifs_array(cpu, activate, status); if (status.ctrl_result) break; From patchwork Tue Feb 14 23:44:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jithu Joseph X-Patchwork-Id: 57285 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3265365wrn; Tue, 14 Feb 2023 15:50:38 -0800 (PST) X-Google-Smtp-Source: AK7set+immgOzo8ZCdEiEouLaoAO16S7hKJT9LygWeM0lHN+dyn2Be2jrlNDN0qTqbrDnGJPTXex X-Received: by 2002:a17:903:1110:b0:196:8d48:8744 with SMTP id n16-20020a170903111000b001968d488744mr428139plh.40.1676418638679; Tue, 14 Feb 2023 15:50:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676418638; cv=none; d=google.com; s=arc-20160816; b=lcjoZbDLzzjkulYt3OqljpW4Tx17ctpX4BlWUzKoRhtQ4+ygvF0iH+ekWMCe0uhQsh M5eysZnW9WylH9RqVTbY/r6LcZ5Gvq2wBXHCjZkJygUUXxGThbcIlekGVtCAPB8KLWFC 6yT8J2pTM2U9pos9iap/qJjC+i5d2wUX5OpyayA+AkdvtdCA9HkDo/A892F4coIhd39R ASce5RcWyeKbNDCjkmuVx40qj8/tV6lDQHYCPqrCEb5PHnbBEuNC7mWFb/A7qY23QsFQ RlcRW2eFETAN4fdGAv6vwMc27xJqTSc/dYjyv0R+gABskFuA3k4yWNN/LlJFBcuUYpIN jXqg== 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=GhNxRO7Wpc3ZwfgAIg3hJuJ8c9jLQUKzy2LjqG2F8NQ=; b=i6eve8R2gJuhra0eHL4qyzHt0bQg5M//PB8Ybvsb1CMrLaj8nuW/Gd7O10n1QEETsO f7/kq27zV+DLq3ux/VyvZicDwSs4sEvwdNQjMXH5xd2RYf6GkkMJv1+P907bkQGoMrrq VE+STvOFP1gqpr3XQFjGhru0MPCfsJ1P3deQl088+lzPmG9/qzXi9OyNgjWsC2I9YxoZ hu9RS8J+Sf2YC8kdl/BHEV+7Uilyur46CfXNwXXOpniy8cANxHzgR93tx+KlA3TyUG7i Q/34ZvPqZ28mmZAL0msIrkziXTQYTklfXpe5kNntV2uTDbSpUngEODMUCO8MyW7qKgY1 sONw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Sf2aELFd; 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 y5-20020a1709027c8500b00188fc3a3fb1si14950305pll.184.2023.02.14.15.50.23; Tue, 14 Feb 2023 15:50:38 -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=Sf2aELFd; 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 S233042AbjBNXqO (ORCPT + 99 others); Tue, 14 Feb 2023 18:46:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229725AbjBNXqA (ORCPT ); Tue, 14 Feb 2023 18:46:00 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED00930B35; Tue, 14 Feb 2023 15:45:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676418358; x=1707954358; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Sv9VY7ZhDkazi+PPN2tu+ANJj7RA9Fo3Wl/1+QS58MM=; b=Sf2aELFd+X1Xki/QpP4UB2770AyOm8yL7OgK7idaHNpvQOJGind6CFxt WjnApE7GYlaSaJVCeZ7Xg/Xe+EMpZvlVkXfKtlA0a/0WjDISy8ZBEEcHA tIX/UaeyVHjC7PdDMwmNud/GM4Q8oq9D1DC4+qzdee7rF+HYmuUzFSg01 6mZd20Y1lBE73snR69wqRgvT8CZnY0rQ24rFWLdU8qzlPoryqrLbaw288 slcZ2omcrD3YRGZa9ngQogFD1wTd4NROOzlNe6AFTiklZ4RN4r4GnGJd5 XKJQrHvs4ElSIpExgoFi1L51xDz0WxUqf8IE1RdiTMqYwJbfQ+zAu4L5P g==; X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="417523050" X-IronPort-AV: E=Sophos;i="5.97,298,1669104000"; d="scan'208";a="417523050" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2023 15:45:58 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="669391023" X-IronPort-AV: E=Sophos;i="5.97,298,1669104000"; d="scan'208";a="669391023" Received: from jithujos.sc.intel.com ([172.25.103.66]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2023 15:45:57 -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 v2 6/7] platform/x86/intel/ifs: Update IFS doc Date: Tue, 14 Feb 2023 15:44:25 -0800 Message-Id: <20230214234426.344960-7-jithu.joseph@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230214234426.344960-1-jithu.joseph@intel.com> References: <20230131234302.3997223-1-jithu.joseph@intel.com> <20230214234426.344960-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?1757852350459523140?= 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 | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/platform/x86/intel/ifs/ifs.h b/drivers/platform/x86/intel/ifs/ifs.h index e5375191b56d..00bc86db1193 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,18 +90,18 @@ * * 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. From patchwork Tue Feb 14 23:44:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jithu Joseph X-Patchwork-Id: 57283 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3265216wrn; Tue, 14 Feb 2023 15:50:15 -0800 (PST) X-Google-Smtp-Source: AK7set/VRsVesDFsrX2kTAGlaXRzsquPhEmcPqU5hB1gi4na6XZRiCgj11wHbZZ2sdycLlDEU4SG X-Received: by 2002:a17:906:474c:b0:889:7781:f62e with SMTP id j12-20020a170906474c00b008897781f62emr272488ejs.22.1676418615725; Tue, 14 Feb 2023 15:50:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676418615; cv=none; d=google.com; s=arc-20160816; b=CtRjc/OAZhtgtMK7eVU1Dn/qKUcOi5uwIes8SkPxb6XdkGUNQEp4gPN9z7F8EFQWHr LR6GD8qARN21Ijg904Femx/Ci2pT9aubxw8RmuTQ0pi14ltQIJ9UkD9LlCLuNZRRV/75 8WiwQPVoxMvF+CVp8NZruHICM5CoUMP8M5cumVw5TCZgRMyd7GOH6u9ZKFgwcZpsd1jL +rXrYIN/GPEm3dzdtVNQhYP9YLvBHxkTkdOukhG6Tq0VJwvpje3QatYRtAI+z93qXyOz wYvsM0URlkAfiPkgDn9jAE50Pi8z7jrn6kwJOZjZrbZwf2wTQgkjBVX1YNdl9h36bXOk EXvg== 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=LJTFlv8Rtof8tF1suIy36sdSH+BBVNuV+ZNZsO7k6ewypq/1j7XSmVchLF2z2yaii4 7oPFqpXcciKnW8grT9o7JxuFFXTkR548I+EFzLQmwYWFq1muhO6E4HckgTQcBMrRounF sqeXSLkIy2f6MF0Mr2arivDG7DFYDsWJLR9sUT9AyrZg4aoYZWHC85EN7FaJqjdT/K4K ga+jZgsrrmhTt1I+NZKsoOvFdlTO2xGdKWJobgqfS7v6KTh6CQ+i3qlnfB3owiEWZ+9e gz4gZqvt9bVhoaf8ZjvVewHq0nz/mVUi7pK/eGXYJADdxzySpw7l7b484sP4N3NsLOl7 dwhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hp3GBOYZ; 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 18-20020a17090602d200b008b128e0bc67si5118199ejk.394.2023.02.14.15.49.53; Tue, 14 Feb 2023 15:50:15 -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=hp3GBOYZ; 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 S232951AbjBNXqS (ORCPT + 99 others); Tue, 14 Feb 2023 18:46:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbjBNXqA (ORCPT ); Tue, 14 Feb 2023 18:46:00 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01FF630EA1; Tue, 14 Feb 2023 15:45:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676418359; x=1707954359; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eiS3IxaAsk6x7BayF1DCQxveYExshrK1kKyFW8zL/CQ=; b=hp3GBOYZqwZ3M6mPyYU86CkDWifK7aevTJV4n52mu0YSqmcJESltHjpg U00N6YESJvCTosSEPuM9EVuK8u9ECZ6Oc8eYDGvfZylx36S7tMyOa5/MI NtdVxV/gY4ufK1o4QqGM9qy1pt1Cm5GfEt/9W8UV3alA1mnCxUwc6RWsy mgU5EHLmRE/RbVhUMYBJxm3D/oRCtVEVHP4R6N5Ja3YFjbB/oGqGkeO/r 8MwUBARMuTaXt1faeHXotPlQAUM435DY5SDRK3Cr779p2VgI8tAXgdvdN B5f19DtKhR70HtybFLfNW4NMX5UDgRjaonl2i3pGoPLy3GdxmEAPbKjUy Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="417523061" X-IronPort-AV: E=Sophos;i="5.97,298,1669104000"; d="scan'208";a="417523061" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2023 15:45:59 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="669391026" X-IronPort-AV: E=Sophos;i="5.97,298,1669104000"; d="scan'208";a="669391026" Received: from jithujos.sc.intel.com ([172.25.103.66]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2023 15:45:58 -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 v2 7/7] Documentation/ABI: Update IFS ABI doc Date: Tue, 14 Feb 2023 15:44:26 -0800 Message-Id: <20230214234426.344960-8-jithu.joseph@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230214234426.344960-1-jithu.joseph@intel.com> References: <20230131234302.3997223-1-jithu.joseph@intel.com> <20230214234426.344960-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?1757852326240655079?= 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.