Unverified Commit e74aedc9 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!13280 [OLK-5.10]Intel: Backport to fix In Field Scan(IFS) Scan At Field(SAF)

Merge Pull Request from: @allen-shi 
 
Intel 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.

IFS Scan At Field(SAF) and ArrayBIST supported in [PR471](https://gitee.com/openeuler/kernel/pulls/471), [PR580](https://gitee.com/openeuler/kernel/pulls/580) and [PR787](https://gitee.com/openeuler/kernel/pulls/787)


This PR is to fix In Field Scan(IFS) Scan At Field(SAF) for SPR/EMR platforms.

**Upstream commit from v6.4 to v6.11:**
3114f77e9453daa292ec0906f313a715c69b5943 platform/x86/intel/ifs: Initialize union ifs_status to zero
2545deba platform/x86/intel/ifs: release cpus_read_lock()
3279decb platform/x86/intel/ifs: Annotate work queue on stack so object debug does not complain
34e82891 tools arch x86: Sync the msr-index.h copy with the kernel sources
 
 **Intel-Kernel Issue** 
[#IB4HZ4](https://gitee.com/openeuler/intel-kernel/issues/IB4HZ4)

 **Test** 
Built and run the kernel successfully.
Test is PASS on EMR platform.

 **Known Issue** 
N/A

 **Default config change** 
N/A 
 
Link:https://gitee.com/openeuler/kernel/pulls/13280

 

Reviewed-by: default avatarJason Zeng <jason.zeng@intel.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parents 1d5beee4 8cad22dc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -208,7 +208,7 @@ static int scan_chunks_sanity_check(struct device *dev)
			continue;
		reinit_completion(&ifs_done);
		local_work.dev = dev;
		INIT_WORK(&local_work.w, copy_hashes_authenticate_chunks);
		INIT_WORK_ONSTACK(&local_work.w, copy_hashes_authenticate_chunks);
		schedule_work_on(cpu, &local_work.w);
		wait_for_completion(&ifs_done);
		if (ifsd->loading_error) {
+5 −4
Original line number Diff line number Diff line
@@ -167,8 +167,8 @@ static int doscan(void *data)
 */
static void ifs_test_core(int cpu, struct device *dev)
{
	union ifs_status status = {};
	union ifs_scan activate;
	union ifs_status status;
	unsigned long timeout;
	struct ifs_data *ifsd;
	u64 msrvals[2];
@@ -331,14 +331,15 @@ int do_core_test(int cpu, struct device *dev)
	switch (test->test_num) {
	case IFS_TYPE_SAF:
		if (!ifsd->loaded)
			return -EPERM;
			ret = -EPERM;
		else
			ifs_test_core(cpu, dev);
		break;
	case IFS_TYPE_ARRAY_BIST:
		ifs_array_test_core(cpu, dev);
		break;
	default:
		return -EINVAL;
		ret = -EINVAL;
	}
out:
	cpus_read_unlock();
+5 −0
Original line number Diff line number Diff line
@@ -192,6 +192,11 @@
#define MSR_IA32_POWER_CTL		0x000001fc
#define MSR_IA32_POWER_CTL_BIT_EE	19

/* 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_LBR_NHM_FROM		0x00000680
#define MSR_LBR_NHM_TO			0x000006c0
#define MSR_LBR_CORE_FROM		0x00000040