linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/10] Introduce In Field Scan driver
@ 2022-04-07 19:13 Jithu Joseph
  2022-04-07 19:13 ` [PATCH v2 01/10] x86/microcode/intel: expose collect_cpu_info_early() for IFS Jithu Joseph
                   ` (10 more replies)
  0 siblings, 11 replies; 152+ messages in thread
From: Jithu Joseph @ 2022-04-07 19:13 UTC (permalink / raw)
  To: hdegoede, markgross
  Cc: tglx, mingo, bp, dave.hansen, x86, hpa, corbet, gregkh,
	andriy.shevchenko, jithu.joseph, ashok.raj, tony.luck, rostedt,
	dan.j.williams, linux-kernel, linux-doc, platform-driver-x86,
	patches, ravi.v.shankar

Note to Maintainers:
Requesting x86 Maintainers to take a look at patch1 as it
touches arch/x86 portion of the kernel.

Patch 2/10 - Adds Documentation. Requesting Documentation maintainer to review it.

Requesting Greg KH to review the sysfs changes added by patch8 (note that in
this revision we no longer touch /sys/devices/system/cpu as in previous version
and limit ourselves to only /sys/devices/platform/intel_ifs)

Patch10 - adds tracing support, requesting Steven Rostedt to review that.

Rest of the patches adds the IFS platform driver, requesting Platform driver maintainers
to review them.

This is the v2 version incorporating the review feedback from the RFC version [1]

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.
See References section to understand more about CPU core errors and how
and when they are encountered.

Intel will provide a firmware file containing the scan tests.  Similar to
microcode there is a separate file for each family-model-stepping. The
tests in the file are divided into some number of "chunks" that can be
run individually.

The driver loads the tests into memory reserved BIOS local to each CPU
socket in a two step process using writes to MSRs to first load the
SHA hashes for the test. Then the tests themselves. Status MSRs provide
feedback on the success/failure of these steps.

Tests are run by synchronizing execution of all threads on a core and
then writing to the ACTIVATE_SCAN MSR on all threads. Instruction
execution continues when:

1) all tests have completed
2) execution was interrupted
3) a test detected a problem

In all cases reading the SCAN_STATUS MSR provides details on what
happened. Interrupted tests may be restarted.

The IFS driver provides interfaces from /sys to control execution:

/sys/devices/platform/intel_ifs/run_test
  Writing <cpu#> to this file will trigger a scan on that core
  e.g echo 5 > sys/devices/platform/intel_ifs/run_test will trigger
  scan on the core containing cpu5

Results of the tests are also provided in /sys:

/sys/devices/platform/intel_ifs/status
  Status (pass/fail/untested) for the last test

/sys/devices/platform/intel_ifs/details
  Hex value of the SCAN_STATUS MSR for the most recent test.
  Note that the error_code field may contain driver
  defined software code not defined in the Intel SDM.

Driver design choices:

1) The ACTIVATE_SCAN MSR allows for running any consecutive subrange or
available tests. But the driver always tries to run all tests and only
uses the subrange feature to restart an interrupted test.

2) Hardware allows for some number of cores to be tested in parallel.
The driver does not make use of this, it only tests one core at a time.

References
Links to a few articles, papers, presentation  [2] [3] [4] [5] which
talk about cpu core errors encountered in the wild which could be
relevant to this work.

[1] https://lore.kernel.org/lkml/20220301195457.21152-1-jithu.joseph@intel.com/
[2] https://sigops.org/s/conferences/hotos/2021/papers/hotos21-s01-hochschild.pdf
[3] https://www.youtube.com/watch?v=QMF3rqhjYuM
[4] https://engineering.fb.com/2021/02/23/data-infrastructure/silent-data-corruption/
[5] https://www.theregister.com/2021/06/04/google_chip_flaws/

Changes since RFC:
 - Renamed collect_cpu_info_early() - >cpu_collect_info_early() (Patch 1; GregKH)
 - Refactored collect_cpu_info_early(), cpu_signatures_match() from
    microcode specific file to intel-generic file (Patch 1; Borislav Petkov)
 - Keep the same platform driver object through-out the life-time of
   the driver (patch 4; Dan Wiliiams)
 - Replace platform_device_register_simple() with platform_device_alloc/add()
   so that sysfs files are available instantateously (patch 4;  Dan Wiliiams)
 - Move IFS binary loading to driver_probe context from module_init
   context (patch4;  Dan Wiliiams)
 - Remove the version check during scan image load so as to allow user
   to move to any IFS binary (Patch 4)
 - Replace pr_* macros with dev_* macros (Patches 3-9;  Dan Wiliiams)
 - Replace percpu kthreads with work_queue worker threads  (Patch 7; Dan Wiliiams)
 - Remove hotplug callbacks which are no longer required due to above
   change (Patch 7;  Dan Wiliiams)
 - Remove percpu ifs_state data structure as it is no longer needed (Patch 7)
 - Refactored test logic into a separate runtest.c file (Patch 7, Tony Luck)
 - Moved sysfs interface from /sys/devices/system/cpu/ifs and
   /sys/devices/system/cpu/cpu#/ifs to /sys/devices/platform/intel_ifs
 - Done away with global/percpu testing interfaces. To trigger a test,
   there is a single run_test file which takes cpu_number as input.
   This hugely reduces the number of sysfs file needed. Userspace can iterate
   over all the cpus to achevie global testing (Patch8;  Dan Wiliiams)
 - Remove the reload sysfs interface for IFS binary loading. Since binary loading
   is done from the probe context, reloading can be acheieved using driver
   bind sysfs interface (Patch 8; Dan Williams)
 - Updated the Documentation/ ABI files to reflect the sysfs changes
 - Change trace event structure field ordering (patch 10; Steven Rostedt)
 - misc changes
     - adding enum type for ifs_status_err_code
     - replace sprintf with sysfs_emit in sysfs.c

Jithu Joseph (8):
  x86/microcode/intel: expose collect_cpu_info_early() for IFS
  platform/x86/intel/ifs: Add driver for In-Field Scan
  platform/x86/intel/ifs: Load IFS Image
  platform/x86/intel/ifs: Check IFS Image sanity
  platform/x86/intel/ifs: Authenticate and copy to secured memory
  platform/x86/intel/ifs: Add scan test support
  platform/x86/intel/ifs: Add IFS sysfs interface
  platform/x86/intel/ifs: add ABI documentation for IFS

Tony Luck (2):
  Documentation: In-Field Scan
  trace: platform/x86/intel/ifs: Add trace point to track Intel IFS
    operations

 .../ABI/testing/sysfs-platform-intel-ifs      |  54 ++++
 Documentation/x86/ifs.rst                     | 114 +++++++
 Documentation/x86/index.rst                   |   1 +
 MAINTAINERS                                   |   7 +
 arch/x86/include/asm/microcode_intel.h        |   4 +
 arch/x86/kernel/cpu/intel.c                   |  47 +++
 arch/x86/kernel/cpu/microcode/intel.c         |  55 +---
 drivers/platform/x86/intel/Kconfig            |   1 +
 drivers/platform/x86/intel/Makefile           |   1 +
 drivers/platform/x86/intel/ifs/Kconfig        |   9 +
 drivers/platform/x86/intel/ifs/Makefile       |   3 +
 drivers/platform/x86/intel/ifs/core.c         | 121 +++++++
 drivers/platform/x86/intel/ifs/ifs.h          | 137 ++++++++
 drivers/platform/x86/intel/ifs/load.c         | 285 +++++++++++++++++
 drivers/platform/x86/intel/ifs/runtest.c      | 300 ++++++++++++++++++
 drivers/platform/x86/intel/ifs/sysfs.c        | 139 ++++++++
 include/trace/events/intel_ifs.h              |  38 +++
 17 files changed, 1266 insertions(+), 50 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-platform-intel-ifs
 create mode 100644 Documentation/x86/ifs.rst
 create mode 100644 drivers/platform/x86/intel/ifs/Kconfig
 create mode 100644 drivers/platform/x86/intel/ifs/Makefile
 create mode 100644 drivers/platform/x86/intel/ifs/core.c
 create mode 100644 drivers/platform/x86/intel/ifs/ifs.h
 create mode 100644 drivers/platform/x86/intel/ifs/load.c
 create mode 100644 drivers/platform/x86/intel/ifs/runtest.c
 create mode 100644 drivers/platform/x86/intel/ifs/sysfs.c
 create mode 100644 include/trace/events/intel_ifs.h

-- 
2.17.1


^ permalink raw reply	[flat|nested] 152+ messages in thread

end of thread, other threads:[~2022-05-11 15:52 UTC | newest]

Thread overview: 152+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-07 19:13 [PATCH v2 00/10] Introduce In Field Scan driver Jithu Joseph
2022-04-07 19:13 ` [PATCH v2 01/10] x86/microcode/intel: expose collect_cpu_info_early() for IFS Jithu Joseph
2022-04-08  8:34   ` Borislav Petkov
2022-04-21 14:56     ` Thomas Gleixner
2022-04-07 19:13 ` [PATCH v2 02/10] Documentation: In-Field Scan Jithu Joseph
2022-04-07 19:13 ` [PATCH v2 03/10] platform/x86/intel/ifs: Add driver for " Jithu Joseph
2022-04-07 19:13 ` [PATCH v2 04/10] platform/x86/intel/ifs: Load IFS Image Jithu Joseph
2022-04-08  5:02   ` Greg KH
2022-04-08  5:04   ` Greg KH
2022-04-07 19:13 ` [PATCH v2 05/10] platform/x86/intel/ifs: Check IFS Image sanity Jithu Joseph
2022-04-07 19:13 ` [PATCH v2 06/10] platform/x86/intel/ifs: Authenticate and copy to secured memory Jithu Joseph
2022-04-07 19:13 ` [PATCH v2 07/10] platform/x86/intel/ifs: Add scan test support Jithu Joseph
2022-04-07 19:13 ` [PATCH v2 08/10] platform/x86/intel/ifs: Add IFS sysfs interface Jithu Joseph
2022-04-08  4:59   ` Greg KH
2022-04-07 19:13 ` [PATCH v2 09/10] platform/x86/intel/ifs: add ABI documentation for IFS Jithu Joseph
2022-04-08  5:02   ` Greg KH
2022-04-07 19:13 ` [PATCH v2 10/10] trace: platform/x86/intel/ifs: Add trace point to track Intel IFS operations Jithu Joseph
2022-04-19 16:38 ` [PATCH v3 00/11] Introduce In Field Scan driver Tony Luck
2022-04-19 16:38   ` [PATCH v3 01/11] x86/microcode/intel: Expose collect_cpu_info_early() for IFS Tony Luck
2022-04-19 16:38   ` [PATCH v3 02/11] Documentation: In-Field Scan Tony Luck
2022-04-19 16:48     ` Greg KH
2022-04-19 19:45       ` Dan Williams
2022-04-20  7:48         ` Greg KH
2022-04-19 16:38   ` [PATCH v3 03/11] platform/x86/intel/ifs: Create device for Intel IFS (In Field Scan) Tony Luck
2022-04-19 16:47     ` Greg KH
2022-04-19 18:09       ` Dan Williams
2022-04-19 22:28         ` Dan Williams
2022-04-20  7:49           ` Greg KH
2022-04-20  7:48         ` Greg KH
2022-04-20 15:27           ` Luck, Tony
2022-04-20 17:46             ` Greg KH
2022-04-20 17:57               ` Luck, Tony
2022-04-20 18:04                 ` Greg KH
2022-04-20 18:08                   ` Luck, Tony
2022-04-20 19:04                     ` Greg KH
2022-04-19 16:38   ` [PATCH v3 04/11] platform/x86/intel/ifs: Add stub driver for In-Field Scan Tony Luck
2022-04-19 16:38   ` [PATCH v3 05/11] platform/x86/intel/ifs: Read IFS firmware image Tony Luck
2022-04-19 17:14     ` Greg KH
2022-04-19 16:38   ` [PATCH v3 06/11] platform/x86/intel/ifs: Check IFS Image sanity Tony Luck
2022-04-19 17:16     ` Greg KH
2022-04-19 16:38   ` [PATCH v3 07/11] platform/x86/intel/ifs: Authenticate and copy to secured memory Tony Luck
2022-04-19 16:38   ` [PATCH v3 08/11] platform/x86/intel/ifs: Add scan test support Tony Luck
2022-04-19 16:38   ` [PATCH v3 09/11] platform/x86/intel/ifs: Add IFS sysfs interface Tony Luck
2022-04-19 17:20     ` Greg KH
2022-04-19 17:35       ` Luck, Tony
2022-04-19 17:58         ` Greg KH
2022-04-19 18:15           ` Dan Williams
2022-04-19 18:24       ` Dan Williams
2022-04-19 16:38   ` [PATCH v3 10/11] trace: platform/x86/intel/ifs: Add trace point to track Intel IFS operations Tony Luck
2022-04-20 23:38     ` Steven Rostedt
2022-04-21  4:26       ` Luck, Tony
2022-04-21 12:41         ` Steven Rostedt
2022-04-19 16:38   ` [PATCH v3 11/11] platform/x86/intel/ifs: add ABI documentation for IFS Tony Luck
2022-04-22 20:02   ` [PATCH v4 00/10] Introduce In Field Scan driver Tony Luck
2022-04-22 20:02     ` [PATCH v4 01/10] x86/microcode/intel: Expose collect_cpu_info_early() for IFS Tony Luck
2022-04-22 20:02     ` [PATCH v4 02/10] x86/msr-index: Define INTEGRITY_CAPABILITIES MSR Tony Luck
2022-04-22 20:02     ` [PATCH v4 03/10] platform/x86/intel/ifs: Add stub driver for In-Field Scan Tony Luck
2022-04-22 20:02     ` [PATCH v4 04/10] platform/x86/intel/ifs: Read IFS firmware image Tony Luck
2022-04-26 10:45       ` Greg KH
2022-04-26 16:12         ` Luck, Tony
2022-04-26 16:36           ` Greg KH
2022-04-26 18:47             ` Luck, Tony
2022-04-22 20:02     ` [PATCH v4 05/10] platform/x86/intel/ifs: Check IFS Image sanity Tony Luck
2022-04-22 20:02     ` [PATCH v4 06/10] platform/x86/intel/ifs: Authenticate and copy to secured memory Tony Luck
2022-04-22 20:02     ` [PATCH v4 07/10] platform/x86/intel/ifs: Add scan test support Tony Luck
2022-04-22 20:02     ` [PATCH v4 08/10] platform/x86/intel/ifs: Add IFS sysfs interface Tony Luck
2022-04-22 20:02     ` [PATCH v4 09/10] trace: platform/x86/intel/ifs: Add trace point to track Intel IFS operations Tony Luck
2022-04-25 14:52       ` Steven Rostedt
2022-04-25 16:49         ` Luck, Tony
2022-04-26  1:49           ` Steven Rostedt
2022-04-26 23:53             ` Luck, Tony
2022-04-27  2:42               ` Steven Rostedt
2022-04-22 20:02     ` [PATCH v4 10/10] platform/x86/intel/ifs: add ABI documentation for IFS Tony Luck
2022-04-28 15:38     ` [PATCH v5 00/10] Introduce In Field Scan driver Tony Luck
2022-04-28 15:38       ` [PATCH v5 01/10] x86/microcode/intel: Expose collect_cpu_info_early() for IFS Tony Luck
2022-05-03 15:29         ` Borislav Petkov
2022-05-04 10:28         ` Thomas Gleixner
2022-04-28 15:38       ` [PATCH v5 02/10] x86/msr-index: Define INTEGRITY_CAPABILITIES MSR Tony Luck
2022-04-28 15:38       ` [PATCH v5 03/10] platform/x86/intel/ifs: Add stub driver for In-Field Scan Tony Luck
2022-05-04 10:35         ` Thomas Gleixner
2022-05-04 16:24           ` Luck, Tony
2022-05-04 16:28             ` Borislav Petkov
2022-04-28 15:38       ` [PATCH v5 04/10] platform/x86/intel/ifs: Read IFS firmware image Tony Luck
2022-05-04 10:37         ` Thomas Gleixner
2022-05-04 16:49           ` Luck, Tony
2022-04-28 15:38       ` [PATCH v5 05/10] platform/x86/intel/ifs: Check IFS Image sanity Tony Luck
2022-04-28 15:38       ` [PATCH v5 06/10] platform/x86/intel/ifs: Authenticate and copy to secured memory Tony Luck
2022-05-04 10:48         ` Thomas Gleixner
2022-04-28 15:38       ` [PATCH v5 07/10] platform/x86/intel/ifs: Add scan test support Tony Luck
2022-05-04 12:29         ` Thomas Gleixner
2022-05-04 18:52           ` Luck, Tony
2022-05-04 23:15             ` Thomas Gleixner
2022-05-05  8:28               ` Peter Zijlstra
2022-05-05  9:01                 ` Thomas Gleixner
2022-05-05 18:32                   ` Luck, Tony
2022-05-05 20:21                     ` Peter Zijlstra
2022-04-28 15:38       ` [PATCH v5 08/10] platform/x86/intel/ifs: Add IFS sysfs interface Tony Luck
2022-04-28 15:38       ` [PATCH v5 09/10] trace: platform/x86/intel/ifs: Add trace point to track Intel IFS operations Tony Luck
2022-04-28 15:38       ` [PATCH v5 10/10] platform/x86/intel/ifs: add ABI documentation for IFS Tony Luck
2022-04-28 15:58       ` [PATCH v5 00/10] Introduce In Field Scan driver Greg KH
2022-04-28 16:07         ` Luck, Tony
2022-05-02 15:15       ` Hans de Goede
2022-05-02 17:23         ` Luck, Tony
2022-05-03 15:32         ` Borislav Petkov
2022-05-03 16:04           ` Luck, Tony
2022-05-03 16:26             ` Luck, Tony
2022-05-06 14:19           ` Hans de Goede
2022-05-06 15:53             ` Luck, Tony
2022-05-06 18:41               ` Hans de Goede
2022-05-09 17:05                 ` Luck, Tony
2022-05-09 18:12                   ` Hans de Goede
2022-05-06  1:40       ` [PATCH v6 00/11] " Tony Luck
2022-05-06  1:40         ` [PATCH v6 01/11] x86/microcode/intel: Expose collect_cpu_info_early() for IFS Tony Luck
2022-05-06  1:40         ` [PATCH v6 02/11] x86/msr-index: Define INTEGRITY_CAPABILITIES MSR Tony Luck
2022-05-06  8:19           ` Thomas Gleixner
2022-05-06  1:40         ` [PATCH v6 03/11] stop_machine: Add stop_core_cpuslocked() for per-core operations Tony Luck
2022-05-06  8:20           ` Thomas Gleixner
2022-05-06  1:40         ` [PATCH v6 04/11] platform/x86/intel/ifs: Add stub driver for In-Field Scan Tony Luck
2022-05-06  8:23           ` Thomas Gleixner
2022-05-06  1:40         ` [PATCH v6 05/11] platform/x86/intel/ifs: Read IFS firmware image Tony Luck
2022-05-06  1:40         ` [PATCH v6 06/11] platform/x86/intel/ifs: Check IFS Image sanity Tony Luck
2022-05-06  1:40         ` [PATCH v6 07/11] platform/x86/intel/ifs: Authenticate and copy to secured memory Tony Luck
2022-05-06  1:40         ` [PATCH v6 08/11] platform/x86/intel/ifs: Add scan test support Tony Luck
2022-05-06 13:30           ` Thomas Gleixner
2022-05-06 18:49             ` Luck, Tony
2022-05-06 19:06               ` Thomas Gleixner
2022-05-06  1:40         ` [PATCH v6 09/11] platform/x86/intel/ifs: Add IFS sysfs interface Tony Luck
2022-05-06  1:40         ` [PATCH v6 10/11] trace: platform/x86/intel/ifs: Add trace point to track Intel IFS operations Tony Luck
2022-05-06  1:40         ` [PATCH v6 11/11] platform/x86/intel/ifs: add ABI documentation for IFS Tony Luck
2022-05-06 22:53         ` [PATCH v7 00/12] Introduce In Field Scan driver Tony Luck
2022-05-06 22:53           ` [PATCH v7 01/12] x86/microcode/intel: Expose collect_cpu_info_early() for IFS Tony Luck
2022-05-06 22:54           ` [PATCH v7 02/12] x86/msr-index: Define INTEGRITY_CAPABILITIES MSR Tony Luck
2022-05-06 22:54           ` [PATCH v7 03/12] stop_machine: Add stop_core_cpuslocked() for per-core operations Tony Luck
2022-05-06 22:54           ` [PATCH v7 04/12] platform/x86/intel/ifs: Add stub driver for In-Field Scan Tony Luck
2022-05-06 22:54           ` [PATCH v7 05/12] platform/x86/intel/ifs: Read IFS firmware image Tony Luck
2022-05-09 12:11             ` Thomas Gleixner
2022-05-06 22:54           ` [PATCH v7 06/12] platform/x86/intel/ifs: Check IFS Image sanity Tony Luck
2022-05-09 12:11             ` Thomas Gleixner
2022-05-09 16:31             ` Borislav Petkov
2022-05-09 16:51               ` Luck, Tony
2022-05-09 16:56                 ` Borislav Petkov
2022-05-06 22:54           ` [PATCH v7 07/12] platform/x86/intel/ifs: Authenticate and copy to secured memory Tony Luck
2022-05-09 12:11             ` Thomas Gleixner
2022-05-06 22:54           ` [PATCH v7 08/12] platform/x86/intel/ifs: Add scan test support Tony Luck
2022-05-09 12:11             ` Thomas Gleixner
2022-05-06 22:54           ` [PATCH v7 09/12] platform/x86/intel/ifs: Add IFS sysfs interface Tony Luck
2022-05-09 12:12             ` Thomas Gleixner
2022-05-06 22:54           ` [PATCH v7 10/12] trace: platform/x86/intel/ifs: Add trace point to track Intel IFS operations Tony Luck
2022-05-06 22:54           ` [PATCH v7 11/12] platform/x86/intel/ifs: add ABI documentation for IFS Tony Luck
2022-05-06 22:54           ` [PATCH v7 12/12] Documentation: In-Field Scan Tony Luck
2022-05-09 12:16             ` Thomas Gleixner
2022-05-11 15:51           ` [PATCH v7 00/12] Introduce In Field Scan driver Hans de Goede

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).