Skip to content

Commit 67896ef

Browse files
aegljwrdegoede
authored andcommitted
platform/x86/intel/ifs: Add stub driver for In-Field Scan
Cloud Service Providers that operate fleets of servers have reported [1] occasions where they can detect that a CPU has gone bad due to effects like electromigration, or isolated manufacturing defects. However, that detection method is A/B testing seemingly random application failures looking for a pattern. In-Field Scan (IFS) is a driver for a platform capability to load a crafted 'scan image' to run targeted low level diagnostics outside of the CPU's architectural error detection capabilities. Stub version of driver just does initial part of check for the IFS feature. MSR_IA32_CORE_CAPS must enumerate the presence of the MSR_INTEGRITY_CAPS MSR. [1]: https://www.youtube.com/watch?v=QMF3rqhjYuM Reviewed-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Tony Luck <tony.luck@intel.com> Acked-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20220506225410.1652287-5-tony.luck@intel.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 parent 2760f5a commit 67896ef

6 files changed

Lines changed: 73 additions & 0 deletions

File tree

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9859,6 +9859,13 @@ B: https://bugzilla.kernel.org
98599859
T: git git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux.git
98609860
F: drivers/idle/intel_idle.c
98619861

9862+
INTEL IN FIELD SCAN (IFS) DEVICE
9863+
M: Jithu Joseph <jithu.joseph@intel.com>
9864+
R: Ashok Raj <ashok.raj@intel.com>
9865+
R: Tony Luck <tony.luck@intel.com>
9866+
S: Maintained
9867+
F: drivers/platform/x86/intel/ifs
9868+
98629869
INTEL INTEGRATED SENSOR HUB DRIVER
98639870
M: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
98649871
M: Jiri Kosina <jikos@kernel.org>

drivers/platform/x86/intel/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#
55

66
source "drivers/platform/x86/intel/atomisp2/Kconfig"
7+
source "drivers/platform/x86/intel/ifs/Kconfig"
78
source "drivers/platform/x86/intel/int1092/Kconfig"
89
source "drivers/platform/x86/intel/int3472/Kconfig"
910
source "drivers/platform/x86/intel/pmc/Kconfig"

drivers/platform/x86/intel/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#
66

77
obj-$(CONFIG_INTEL_ATOMISP2_PDX86) += atomisp2/
8+
obj-$(CONFIG_INTEL_IFS) += ifs/
89
obj-$(CONFIG_INTEL_SAR_INT1092) += int1092/
910
obj-$(CONFIG_INTEL_SKL_INT3472) += int3472/
1011
obj-$(CONFIG_INTEL_PMC_CORE) += pmc/
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
config INTEL_IFS
2+
tristate "Intel In Field Scan"
3+
depends on X86 && 64BIT && SMP
4+
select INTEL_IFS_DEVICE
5+
help
6+
Enable support for the In Field Scan capability in select
7+
CPUs. The capability allows for running low level tests via
8+
a scan image distributed by Intel via Github to validate CPU
9+
operation beyond baseline RAS capabilities. To compile this
10+
support as a module, choose M here. The module will be called
11+
intel_ifs.
12+
13+
If unsure, say N.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
obj-$(CONFIG_INTEL_IFS) += intel_ifs.o
2+
3+
intel_ifs-objs := core.o
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
/* Copyright(c) 2022 Intel Corporation. */
3+
4+
#include <linux/module.h>
5+
#include <linux/kdev_t.h>
6+
7+
#include <asm/cpu_device_id.h>
8+
9+
#define X86_MATCH(model) \
10+
X86_MATCH_VENDOR_FAM_MODEL_FEATURE(INTEL, 6, \
11+
INTEL_FAM6_##model, X86_FEATURE_CORE_CAPABILITIES, NULL)
12+
13+
static const struct x86_cpu_id ifs_cpu_ids[] __initconst = {
14+
X86_MATCH(SAPPHIRERAPIDS_X),
15+
{}
16+
};
17+
MODULE_DEVICE_TABLE(x86cpu, ifs_cpu_ids);
18+
19+
static int __init ifs_init(void)
20+
{
21+
const struct x86_cpu_id *m;
22+
u64 msrval;
23+
24+
m = x86_match_cpu(ifs_cpu_ids);
25+
if (!m)
26+
return -ENODEV;
27+
28+
if (rdmsrl_safe(MSR_IA32_CORE_CAPS, &msrval))
29+
return -ENODEV;
30+
31+
if (!(msrval & MSR_IA32_CORE_CAPS_INTEGRITY_CAPS))
32+
return -ENODEV;
33+
34+
if (rdmsrl_safe(MSR_INTEGRITY_CAPS, &msrval))
35+
return -ENODEV;
36+
37+
return 0;
38+
}
39+
40+
static void __exit ifs_exit(void)
41+
{
42+
}
43+
44+
module_init(ifs_init);
45+
module_exit(ifs_exit);
46+
47+
MODULE_LICENSE("GPL");
48+
MODULE_DESCRIPTION("Intel In Field Scan (IFS) device");

0 commit comments

Comments
 (0)