From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Cc: Jithu Joseph <jithu.joseph@intel.com>,
Hans de Goede <hdegoede@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Ashok Raj <ashok.raj@intel.com>, Tony Luck <tony.luck@intel.com>,
linux-trace-kernel@vger.kernel.org,
platform-driver-x86@vger.kernel.org,
Shankar Ravi V <ravi.v.shankar@intel.com>
Subject: Re: [PATCH v2 3/4] platform/x86/intel/ifs: Add SBAF test support
Date: Fri, 12 Jul 2024 11:24:48 +0300 (EEST) [thread overview]
Message-ID: <d22295d5-2d2d-217b-5676-2743657938cb@linux.intel.com> (raw)
In-Reply-To: <7e1e86b9-9578-441f-9f4a-23c274234344@linux.intel.com>
[-- Attachment #1: Type: text/plain, Size: 4931 bytes --]
On Thu, 11 Jul 2024, Kuppuswamy Sathyanarayanan wrote:
> On 7/11/24 2:44 AM, Ilpo Järvinen wrote:
> > On Wed, 10 Jul 2024, Kuppuswamy Sathyanarayanan wrote:
> >
> >> From: Jithu Joseph <jithu.joseph@intel.com>
> >>
> >> In a core, the SBAF test engine is shared between sibling CPUs.
> >>
> >> An SBAF test image contains multiple bundles. Each bundle is further
> >> composed of subunits called programs. When a SBAF test (for a particular
> >> core) is triggered by the user, each SBAF bundle from the loaded test
> >> image is executed sequentially on all the threads on the core using
> >> the stop_core_cpuslocked mechanism. Each bundle execution is initiated by
> >> writing to MSR_ACTIVATE_SBAF.
> >>
> >> SBAF test bundle execution may be aborted when an interrupt occurs or
> >> if the CPU does not have enough power budget for the test. In these
> >> cases the kernel restarts the test from the aborted bundle. SBAF
> >> execution is not retried if the test fails or if the test makes no
> >> forward progress after 5 retries.
> >>
> >> Reviewed-by: Ashok Raj <ashok.raj@intel.com>
> >> Reviewed-by: Tony Luck <tony.luck@intel.com>
> >> Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
> >> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> >> ---
> >> +static const char * const sbaf_test_status[] = {
> >> + [IFS_SBAF_NO_ERROR] = "SBAF no error",
> >> + [IFS_SBAF_OTHER_THREAD_COULD_NOT_JOIN] = "Other thread could not join.",
> >> + [IFS_SBAF_INTERRUPTED_BEFORE_RENDEZVOUS] = "Interrupt occurred prior to SBAF coordination.",
> >> + [IFS_SBAF_UNASSIGNED_ERROR_CODE3] = "Unassigned error code 0x3",
> >> + [IFS_SBAF_INVALID_BUNDLE_INDEX] = "Non valid sbaf bundles. Reload test image",
> > Non-valid SBAF
> >
> > ...but given your define is named "INVALID", why not use just Invalid
> > SBAF?
>
> Above string is from the specification document.But I think it is ok to use
> "Invalid" or "Non-valid".
>
> Jithu, any concerns?
>
> >> + [IFS_SBAF_MISMATCH_ARGS_BETWEEN_THREADS] = "Mismatch in arguments between threads T0/T1.",
> >> + [IFS_SBAF_CORE_NOT_CAPABLE_CURRENTLY] = "Core not capable of performing SBAF currently",
> >> + [IFS_SBAF_UNASSIGNED_ERROR_CODE7] = "Unassigned error code 0x7",
> >> + [IFS_SBAF_EXCEED_NUMBER_OF_THREADS_CONCURRENT] = "Exceeded number of Logical Processors (LP) allowed to run Scan-At-Field concurrently",
> >> + [IFS_SBAF_INTERRUPTED_DURING_EXECUTION] = "Interrupt occurred prior to SBAF start",
> >> + [IFS_SBAF_INVALID_PROGRAM_INDEX] = "SBAF program index not valid",
> >> + [IFS_SBAF_CORRUPTED_CHUNK] = "SBAF operation aborted due to corrupted chunk",
> >> + [IFS_SBAF_DID_NOT_START] = "SBAF operation did not start",
> >> +};
> >> +
> >> +static void sbaf_message_not_tested(struct device *dev, int cpu, u64 status_data)
> >> +{
> >> + union ifs_sbaf_status status = (union ifs_sbaf_status)status_data;
> >> +
> >> + if (status.error_code < ARRAY_SIZE(sbaf_test_status)) {
> >> + dev_info(dev, "CPU(s) %*pbl: SBAF operation did not start. %s\n",
> >> + cpumask_pr_args(cpu_smt_mask(cpu)),
> >> + sbaf_test_status[status.error_code]);
> >> + } else if (status.error_code == IFS_SW_TIMEOUT) {
> >> + dev_info(dev, "CPU(s) %*pbl: software timeout during scan\n",
> >> + cpumask_pr_args(cpu_smt_mask(cpu)));
> >> + } else if (status.error_code == IFS_SW_PARTIAL_COMPLETION) {
> >> + dev_info(dev, "CPU(s) %*pbl: %s\n",
> >> + cpumask_pr_args(cpu_smt_mask(cpu)),
> >> + "Not all SBAF bundles executed. Maximum forward progress retries exceeded");
> >> + } else {
> >> + dev_info(dev, "CPU(s) %*pbl: SBAF unknown status %llx\n",
> >> + cpumask_pr_args(cpu_smt_mask(cpu)), status.data);
> >> + }
> >> +}
> >> +
> >> +static void sbaf_message_fail(struct device *dev, int cpu, union ifs_sbaf_status status)
> >> +{
> >> + /* Failed signature check is set when SBAF signature did not match the expected value */
> >> + if (status.sbaf_status == SBAF_STATUS_SIGN_FAIL) {
> >> + dev_err(dev, "CPU(s) %*pbl: Failed signature check\n",
> >> + cpumask_pr_args(cpu_smt_mask(cpu)));
> >> + }
> >> +
> >> + /* Failed to reach end of test */
> >> + if (status.sbaf_status == SBAF_STATUS_TEST_FAIL) {
> >> + dev_err(dev, "CPU(s) %*pbl: Failed to complete test\n",
> >> + cpumask_pr_args(cpu_smt_mask(cpu)));
> >> + }
> >> +}
> >> +
> >> +static bool sbaf_bundle_completed(union ifs_sbaf_status status)
> >> +{
> >> + if (status.sbaf_status || status.error_code)
> >> + return false;
> >> + return true;
> > This is same as:
> >
> > return !status.sbaf_status && !status.error_code;
>
> Yes. Your version looks good. Do you want me to send a version with
> this change or you can include it when merging it?
Please do send a new version, there were too many things to change for
me to do it while applying.
--
i.
next prev parent reply other threads:[~2024-07-12 8:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-11 0:02 [PATCH v2 0/4] Add SBAF test to IFS Kuppuswamy Sathyanarayanan
2024-07-11 0:02 ` [PATCH v2 1/4] platform/x86/intel/ifs: Refactor MSR usage in IFS test code Kuppuswamy Sathyanarayanan
2024-07-11 8:51 ` Ilpo Järvinen
2024-07-11 0:02 ` [PATCH v2 2/4] platform/x86/intel/ifs: Add SBAF test image loading support Kuppuswamy Sathyanarayanan
2024-07-11 9:01 ` Ilpo Järvinen
2024-07-11 0:02 ` [PATCH v2 3/4] platform/x86/intel/ifs: Add SBAF test support Kuppuswamy Sathyanarayanan
2024-07-11 9:44 ` Ilpo Järvinen
2024-07-11 15:58 ` Kuppuswamy Sathyanarayanan
2024-07-12 3:04 ` Joseph, Jithu
2024-07-12 8:24 ` Ilpo Järvinen [this message]
2024-07-11 21:21 ` Ashok Raj
2024-07-12 3:18 ` Joseph, Jithu
2024-07-11 0:02 ` [PATCH v2 4/4] trace: platform/x86/intel/ifs: Add SBAF trace support Kuppuswamy Sathyanarayanan
2024-07-11 9:45 ` Ilpo Järvinen
2024-07-11 23:26 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d22295d5-2d2d-217b-5676-2743657938cb@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=ashok.raj@intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hdegoede@redhat.com \
--cc=jithu.joseph@intel.com \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=mingo@redhat.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=ravi.v.shankar@intel.com \
--cc=rostedt@goodmis.org \
--cc=sathyanarayanan.kuppuswamy@linux.intel.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).