Skip to contentSkip to conversation

add tests to verify IFS (In Field Scan) driver functionality

PATCH Superseded Pengfei Xu 4 participants 9 messages Apr 30, 2024 – May 15, 2024

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Pengfei Xu

author
#0 lore raw

cover add tests to verify IFS (In Field Scan) driver functionality

To verify IFS (In Field Scan [1]) driver functionality, add the following 6 test cases:
1. Verify that IFS sysfs entries are created after loading the IFS module
2. Check if loading an invalid IFS test image fails and loading a valid one succeeds
3. Perform IFS scan test on each CPU using all the available image files
4. Perform IFS scan with first test image file on a random CPU for 3 rounds
5. Perform IFS ARRAY BIST(Board Integrated System Test) test on each CPU
6. Perform IFS ARRAY BIST test on a random CPU for 3 rounds

These are not exhaustive, but some minimal test runs to check various parts of the driver. Some negative tests are also included.

[1] https://docs.kernel.org/arch/x86/ifs.html

Pengfei Xu (4):
selftests: ifs: verify test interfaces are created by the driver
selftests: ifs: verify test image loading functionality
selftests: ifs: verify IFS scan test functionality
selftests: ifs: verify IFS ARRAY BIST functionality

 MAINTAINERS                                   |   1 +
 tools/testing/selftests/Makefile              |   1 +
 .../drivers/platform/x86/intel/ifs/Makefile   |   6 +
 .../platform/x86/intel/ifs/test_ifs.sh        | 496 ++++++++++++++++++
 4 files changed, 504 insertions(+)
 create mode 100644 tools/testing/selftests/drivers/platform/x86/intel/ifs/Makefile
 create mode 100755 tools/testing/selftests/drivers/platform/x86/intel/ifs/test_ifs.sh
Signature · 1 line
2.43.0
author
#1 lore raw

PATCH 1/4 selftests: ifs: verify test interfaces are created by the driver

IFS (In Field Scan) driver exposes its functionality via sysfs interfaces. Applications prepare and exercise the tests by interacting with the aforementioned sysfs files.

Verify that the necessary sysfs entries are created after loading the IFS driver.

Initialize test variables needed for building subsequent kself-test cases.

---
 MAINTAINERS                                   |   1 +
 tools/testing/selftests/Makefile              |   1 +
 .../drivers/platform/x86/intel/ifs/Makefile   |   6 +
 .../platform/x86/intel/ifs/test_ifs.sh        | 181 ++++++++++++++++++
 4 files changed, 189 insertions(+)
 create mode 100644 tools/testing/selftests/drivers/platform/x86/intel/ifs/Makefile
 create mode 100755 tools/testing/selftests/drivers/platform/x86/intel/ifs/test_ifs.sh
MAINTAINERS +1 -0
index f6dc90559341..2eb18207dfac 100644
@@ -10951,6 +10951,7 @@ R:	Tony Luck <[email protected]>
 S:	Maintained
 F:	drivers/platform/x86/intel/ifs
 F:	include/trace/events/intel_ifs.h
+F:	tools/testing/selftests/drivers/platform/x86/intel/ifs/
 
 INTEL INTEGRATED SENSOR HUB DRIVER
 M:	Srinivas Pandruvada <[email protected]>
tools/testing/selftests/Makefile +1 -0
index e1504833654d..adc023641502 100644
@@ -19,6 +19,7 @@ TARGETS += drivers/dma-buf
 TARGETS += drivers/s390x/uvdevice
 TARGETS += drivers/net/bonding
 TARGETS += drivers/net/team
+TARGETS += drivers/platform/x86/intel/ifs
 TARGETS += dt
 TARGETS += efivarfs
 TARGETS += exec
tools/testing/selftests/drivers/platform/x86/intel/ifs/Makefile new file +6 -0
new file mode 100644
index 000000000000..03d0449d307c
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0
+# Makefile for ifs(In Field Scan) selftests
+
+TEST_PROGS := test_ifs.sh
+
+include ../../../../../lib.mk
tools/testing/selftests/drivers/platform/x86/intel/ifs/test_ifs.sh new file +181 -0

181 lines not on this page · raw message

Signature · 1 line
2.43.0
author
#2 lore raw

PATCH 2/4 selftests: ifs: verify test image loading functionality

In reply to Pengfei Xu

Scan test image files have to be loaded before starting IFS test.

Verify that In Field scan driver is able to load valid test image files.

Also check if loading an invalid test image file fails.

---
 .../platform/x86/intel/ifs/test_ifs.sh        | 121 +++++++++++++++++-
 1 file changed, 120 insertions(+), 1 deletion(-)
tools/testing/selftests/drivers/platform/x86/intel/ifs/test_ifs.sh +120 -1
index 54466d452b2f..2a4df745bf6f 100755
@@ -10,6 +10,7 @@ readonly KSFT_FAIL=1
 readonly KSFT_XFAIL=2
 readonly KSFT_SKIP=4
 
+readonly IMG_PATH="/lib/firmware/intel/ifs_0"
 readonly IFS_SCAN_MODE="0"
 readonly IFS_PATH="/sys/devices/virtual/misc/intel_ifs"
 readonly IFS_SCAN_SYSFS_PATH="${IFS_PATH}_${IFS_SCAN_MODE}"
@@ -29,14 +30,18 @@ readonly INTEL_FAM6="06"
 
 FML=""
 MODEL=""
-
+STEPPING=""
+CPU_FMS=""
 TRUE="true"
 FALSE="false"
 RESULT=$KSFT_PASS
+IMAGE_NAME=""
 export INTERVAL_TIME=1
 # For IFS cleanup tags
 ORIGIN_IFS_LOADED=""
+IFS_IMAGE_NEED_RESTORE=$FALSE
 IFS_LOG="/tmp/ifs_logs.$$"
+DEFAULT_IMG_ID=""
 
 append_log()
 {
@@ -68,6 +73,13 @@ ifs_scan_result_summary()
 
 ifs_cleanup()
 {
+	echo "[$INFO] Restore environment after IFS test"
+
+	# Restore ifs origin image if origin image backup step is needed
+	[[ "$IFS_IMAGE_NEED_RESTORE" == "$TRUE" ]] && {
+		mv -f "$IMG_PATH"/"$IMAGE_NAME"_origin "$IMG_PATH"/"$IMAGE_NAME"
+	}
+
 	lsmod | grep -q "$IFS_NAME" && [[ "$ORIGIN_IFS_LOADED" == "$FALSE" ]] && {
 		echo "[$INFO] modprobe -r $IFS_NAME"
 		modprobe -r "$IFS_NAME"
@@ -80,6 +92,21 @@ ifs_cleanup()
 	exit "$RESULT"
 }
 
+do_cmd()
+{
+	local cmd=$*
+	local ret=""
+
+	append_log "[$INFO] $cmd"
+	eval "$cmd"
+	ret=$?
+	if [[ $ret -ne 0 ]]; then
+		append_log "[$FAIL] $cmd failed. Return code is $ret"
+		RESULT=$KSFT_XFAIL
+		ifs_cleanup
+	fi
+}
+
 test_exit()
 {
 	local info=$1
@@ -99,6 +126,8 @@ get_cpu_fms()
 {
 	FML=$(grep -m 1 "family" /proc/cpuinfo | awk -F ":" '{printf "%02x",$2;}')
 	MODEL=$(grep -m 1 "model" /proc/cpuinfo | awk -F ":" '{printf "%02x",$2;}')
+	STEPPING=$(grep -m 1 "stepping" /proc/cpuinfo | awk -F ":" '{printf "%02x",$2;}')
+	CPU_FMS="${FML}-${MODEL}-${STEPPING}"
 }
 
 check_cpu_ifs_support_interval_time()
@@ -164,9 +193,93 @@ test_ifs_scan_entry()
 	fi
 }
 
+load_image()
+{
+	local image_id=$1
+	local image_info=""
+	local ret=""
+
+	check_ifs_loaded
+	if [[ -e "${IMG_PATH}/${IMAGE_NAME}" ]]; then
+		append_log "[$INFO] echo 0x$image_id > ${IFS_SCAN_SYSFS_PATH}/current_batch"
+		echo "0x$image_id" > "$IFS_SCAN_SYSFS_PATH"/current_batch 2>/dev/null
+		ret=$?
+		[[ "$ret" -eq 0 ]] || {
+			append_log "[$FAIL] Load ifs image $image_id failed with ret:$ret\n"
+			return "$ret"
+		}
+		image_info=$(cat ${IFS_SCAN_SYSFS_PATH}/current_batch)
+		if [[ "$image_info" == 0x"$image_id" ]]; then
+			append_log "[$PASS] load IFS current_batch:$image_info"
+		else
+			append_log "[$FAIL] current_batch:$image_info is not expected:$image_id"
+			return "$KSFT_FAIL"
+		fi
+	else
+		append_log "[$FAIL] No IFS image file ${IMG_PATH}/${IMAGE_NAME}"\
+		return "$KSFT_FAIL"
+	fi
+	return 0
+}
+
+test_load_origin_ifs_image()
+{
+	local image_id=$1
+
+	IMAGE_NAME="${CPU_FMS}-${image_id}.scan"
+
+	load_image "$image_id" || return $?
+	return 0
+}
+
+test_load_bad_ifs_image()
+{
+	local image_id=$1
+
+	IMAGE_NAME="${CPU_FMS}-${image_id}.scan"
+
+	do_cmd "mv -f ${IMG_PATH}/${IMAGE_NAME} ${IMG_PATH}/${IMAGE_NAME}_origin"
+
+	# Set IFS_IMAGE_NEED_RESTORE to true before corrupt the origin ifs image file
+	IFS_IMAGE_NEED_RESTORE=$TRUE
+	do_cmd "dd if=/dev/urandom of=${IMG_PATH}/${IMAGE_NAME} bs=1K count=6 2>/dev/null"
+
+	# Use the specified judgment for negative testing
+	append_log "[$INFO] echo 0x$image_id > ${IFS_SCAN_SYSFS_PATH}/current_batch"
+	echo "0x$image_id" > "$IFS_SCAN_SYSFS_PATH"/current_batch 2>/dev/null
+	ret=$?
+	if [[ "$ret" -ne 0 ]]; then
+		append_log "[$PASS] Load invalid ifs image failed with ret:$ret not 0 as expected"
+	else
+		append_log "[$FAIL] Load invalid ifs image ret:$ret unexpectedly"
+	fi
+
+	do_cmd "mv -f ${IMG_PATH}/${IMAGE_NAME}_origin ${IMG_PATH}/${IMAGE_NAME}"
+	IFS_IMAGE_NEED_RESTORE=$FALSE
+}
+
+test_bad_and_origin_ifs_image()
+{
+	local image_id=$1
+
+	append_log "[$INFO] Test loading bad and then loading original IFS image:"
+	test_load_origin_ifs_image "$image_id" || return $?
+	test_load_bad_ifs_image "$image_id"
+	# Load origin image again and make sure it's worked
+	test_load_origin_ifs_image "$image_id" || return $?
+	append_log "[$INFO] Loading invalid IFS image and then loading initial image passed.\n"
+}
+
 prepare_ifs_test_env()
 {
 	check_cpu_ifs_support_interval_time
+
+	DEFAULT_IMG_ID=$(find $IMG_PATH -maxdepth 1 -name "${CPU_FMS}-[0-9a-fA-F][0-9a-fA-F].scan" \
+			 2>/dev/null \
+			 | sort \
+			 | head -n 1 \
+			 | awk -F "-" '{print $NF}' \
+			 | cut -d "." -f 1)
 }
 
 test_ifs()
@@ -174,6 +287,12 @@ test_ifs()
 	prepare_ifs_test_env
 
 	test_ifs_scan_entry
+
+	if [[ -z "$DEFAULT_IMG_ID" ]]; then
+		append_log "[$SKIP] No proper ${IMG_PATH}/${CPU_FMS}-*.scan, skip ifs_0 scan"
+	else
+		test_bad_and_origin_ifs_image "$DEFAULT_IMG_ID"
+	fi
 }
 
 trap ifs_cleanup SIGTERM SIGINT
Signature · 1 line
2.43.0
author
#3 lore raw

PATCH 3/4 selftests: ifs: verify IFS scan test functionality

In reply to Pengfei Xu

Two selftests are added to verify IFS scan test feature:

1. Perform IFS scan test once on each CPU using all the available image files.
2. Perform IFS scan test with the default image on a random cpu for 3 rounds.

---
 .../platform/x86/intel/ifs/test_ifs.sh        | 190 +++++++++++++++++-
 1 file changed, 189 insertions(+), 1 deletion(-)
tools/testing/selftests/drivers/platform/x86/intel/ifs/test_ifs.sh +189 -1
index 2a4df745bf6f..63d13400af4f 100755
@@ -10,16 +10,25 @@ readonly KSFT_FAIL=1
 readonly KSFT_XFAIL=2
 readonly KSFT_SKIP=4
 
+readonly CPU_SYSFS="/sys/devices/system/cpu"
+readonly CPU_OFFLINE_SYSFS="${CPU_SYSFS}/offline"
 readonly IMG_PATH="/lib/firmware/intel/ifs_0"
 readonly IFS_SCAN_MODE="0"
+readonly IFS_ARRAY_BIST_SCAN_MODE="1"
 readonly IFS_PATH="/sys/devices/virtual/misc/intel_ifs"
 readonly IFS_SCAN_SYSFS_PATH="${IFS_PATH}_${IFS_SCAN_MODE}"
+readonly RUN_TEST="run_test"
+readonly STATUS="status"
+readonly DETAILS="details"
+readonly STATUS_PASS="pass"
 readonly PASS="PASS"
 readonly FAIL="FAIL"
 readonly INFO="INFO"
 readonly XFAIL="XFAIL"
 readonly SKIP="SKIP"
 readonly IFS_NAME="intel_ifs"
+readonly ALL="all"
+readonly SIBLINGS="siblings"
 
 # Matches arch/x86/include/asm/intel-family.h and
 # drivers/platform/x86/intel/ifs/core.c requirement as follows
@@ -28,6 +37,7 @@ readonly EMERALDRAPIDS_X="cf"
 
 readonly INTEL_FAM6="06"
 
+LOOP_TIMES=3
 FML=""
 MODEL=""
 STEPPING=""
@@ -36,11 +46,13 @@ TRUE="true"
 FALSE="false"
 RESULT=$KSFT_PASS
 IMAGE_NAME=""
-export INTERVAL_TIME=1
+INTERVAL_TIME=1
+OFFLINE_CPUS=""
 # For IFS cleanup tags
 ORIGIN_IFS_LOADED=""
 IFS_IMAGE_NEED_RESTORE=$FALSE
 IFS_LOG="/tmp/ifs_logs.$$"
+RANDOM_CPU=""
 DEFAULT_IMG_ID=""
 
 append_log()
@@ -48,6 +60,35 @@ append_log()
 	echo -e "$1" | tee -a "$IFS_LOG"
 }
 
+online_offline_cpu_list()
+{
+	local on_off=$1
+	local target_cpus=$2
+	local cpu=""
+	local cpu_start=""
+	local cpu_end=""
+	local i=""
+
+	if [[ -n "$target_cpus" ]]; then
+		for cpu in $(echo "$target_cpus" | tr ',' ' '); do
+			if [[ "$cpu" == *"-"* ]]; then
+				cpu_start=""
+				cpu_end=""
+				i=""
+				cpu_start=$(echo "$cpu" | cut -d "-" -f 1)
+				cpu_end=$(echo "$cpu" | cut -d "-" -f 2)
+				for((i=cpu_start;i<=cpu_end;i++)); do
+					append_log "[$INFO] echo $on_off > \
+${CPU_SYSFS}/cpu${i}/online"
+					echo "$on_off" > "$CPU_SYSFS"/cpu"$i"/online
+				done
+			else
+				set_target_cpu "$on_off" "$cpu"
+			fi
+		done
+	fi
+}
+
 ifs_scan_result_summary()
 {
 	local failed_info pass_num skip_num fail_num
@@ -80,6 +121,9 @@ ifs_cleanup()
 		mv -f "$IMG_PATH"/"$IMAGE_NAME"_origin "$IMG_PATH"/"$IMAGE_NAME"
 	}
 
+	# Restore the CPUs to the state before testing
+	[[ -z "$OFFLINE_CPUS" ]] || online_offline_cpu_list "0" "$OFFLINE_CPUS"
+
 	lsmod | grep -q "$IFS_NAME" && [[ "$ORIGIN_IFS_LOADED" == "$FALSE" ]] && {
 		echo "[$INFO] modprobe -r $IFS_NAME"
 		modprobe -r "$IFS_NAME"
@@ -122,6 +166,23 @@ test_exit()
 	ifs_cleanup
 }
 
+online_all_cpus()
+{
+	local off_cpus=""
+
+	OFFLINE_CPUS=$(cat "$CPU_OFFLINE_SYSFS")
+	online_offline_cpu_list "1" "$OFFLINE_CPUS"
+
+	off_cpus=$(cat "$CPU_OFFLINE_SYSFS")
+	if [[ -z "$off_cpus" ]]; then
+		append_log "[$INFO] All CPUs are online."
+	else
+		append_log "[$XFAIL] There is offline cpu:$off_cpus after online all cpu!"
+		RESULT=$KSFT_XFAIL
+		ifs_cleanup
+	fi
+}
+
 get_cpu_fms()
 {
 	FML=$(grep -m 1 "family" /proc/cpuinfo | awk -F ":" '{printf "%02x",$2;}')
@@ -270,10 +331,135 @@ test_bad_and_origin_ifs_image()
 	append_log "[$INFO] Loading invalid IFS image and then loading initial image passed.\n"
 }
 
+ifs_test_cpu()
+{
+	local ifs_mode=$1
+	local cpu_num=$2
+	local image_id status details ret result result_info
+
+	echo "$cpu_num" > "$IFS_PATH"_"$ifs_mode"/"$RUN_TEST"
+	ret=$?
+
+	status=$(cat "${IFS_PATH}_${ifs_mode}/${STATUS}")
+	details=$(cat "${IFS_PATH}_${ifs_mode}/${DETAILS}")
+
+	if [[ "$ret" -eq 0 && "$status" == "$STATUS_PASS" ]]; then
+		result="$PASS"
+	else
+		result="$FAIL"
+	fi
+
+	cpu_num=$(cat "${CPU_SYSFS}/cpu${cpu_num}/topology/thread_siblings_list")
+
+	# There is no image file for IFS ARRAY BIST scan
+	if [[ -e "${IFS_PATH}_${ifs_mode}/current_batch" ]]; then
+		image_id=$(cat "${IFS_PATH}_${ifs_mode}/current_batch")
+		result_info=$(printf "[%s] ifs_%1d cpu(s):%s, current_batch:0x%02x, \
+ret:%2d, status:%s, details:0x%016x" \
+			     "$result" "$ifs_mode" "$cpu_num" "$image_id" "$ret" \
+			     "$status" "$details")
+	else
+		result_info=$(printf "[%s] ifs_%1d cpu(s):%s, ret:%2d, status:%s, details:0x%016x" \
+			     "$result" "$ifs_mode" "$cpu_num" "$ret" "$status" "$details")
+	fi
+
+	append_log "$result_info"
+}
+
+ifs_test_cpus()
+{
+	local cpus_type=$1
+	local ifs_mode=$2
+	local image_id=$3
+	local cpu_max_num=""
+	local cpu_num=""
+
+	case "$cpus_type" in
+		"$ALL")
+			cpu_max_num=$(($(nproc) - 1))
+			cpus=$(seq 0 $cpu_max_num)
+			;;
+		"$SIBLINGS")
+			cpus=$(cat ${CPU_SYSFS}/cpu*/topology/thread_siblings_list \
+				| sed -e 's/,.*//' \
+				| sed -e 's/-.*//' \
+				| sort -n \
+				| uniq)
+			;;
+		*)
+			test_exit "Invalid cpus_type:$cpus_type" "$KSFT_XFAIL"
+			;;
+	esac
+
+	for cpu_num in $cpus; do
+		ifs_test_cpu "$ifs_mode" "$cpu_num"
+	done
+
+	if [[ -z "$image_id" ]]; then
+		append_log "[$INFO] ifs_$ifs_mode test $cpus_type cpus completed\n"
+	else
+		append_log "[$INFO] ifs_$ifs_mode $cpus_type cpus with $CPU_FMS-$image_id.scan \
+completed\n"
+	fi
+}
+
+test_ifs_same_cpu_loop()
+{
+	local ifs_mode=$1
+	local cpu_num=$2
+	local loop_times=$3
+
+	append_log "[$INFO] Test ifs mode $ifs_mode on CPU:$cpu_num for $loop_times rounds:"
+	[[ "$ifs_mode" == "$IFS_SCAN_MODE" ]] && {
+		load_image "$DEFAULT_IMG_ID" ||	return $?
+	}
+	for (( i=1; i<=loop_times; i++ )); do
+		append_log "[$INFO] Loop iteration: $i in total of $loop_times"
+		# Only IFS scan needs the interval time
+		if [[ "$ifs_mode" == "$IFS_SCAN_MODE" ]]; then
+			do_cmd "sleep $INTERVAL_TIME"
+		elif [[ "$ifs_mode" == "$IFS_ARRAY_BIST_SCAN_MODE" ]]; then
+			true
+		else
+			test_exit "Invalid ifs_mode:$ifs_mode" "$KSFT_XFAIL"
+		fi
+
+		ifs_test_cpu "$ifs_mode" "$cpu_num"
+	done
+	append_log "[$INFO] $loop_times rounds of ifs_$ifs_mode test on CPU:$cpu_num completed.\n"
+}
+
+test_ifs_scan_available_imgs()
+{
+	local image_ids=""
+	local image_id=""
+
+	append_log "[$INFO] Test ifs scan with available images:"
+	image_ids=$(find "$IMG_PATH" -maxdepth 1 -name "${CPU_FMS}-[0-9a-fA-F][0-9a-fA-F].scan" \
+		    2>/dev/null \
+		    | sort \
+		    | awk -F "-" '{print $NF}' \
+		    | cut -d "." -f 1)
+
+	for image_id in $image_ids; do
+		load_image "$image_id" || return $?
+
+		ifs_test_cpus "$SIBLINGS" "$IFS_SCAN_MODE" "$image_id"
+		# IFS scan requires time interval for the scan on the same CPU
+		do_cmd "sleep $INTERVAL_TIME"
+	done
+}
+
 prepare_ifs_test_env()
 {
+	local max_cpu=""
+
 	check_cpu_ifs_support_interval_time
 
+	online_all_cpus
+	max_cpu=$(($(nproc) - 1))
+	RANDOM_CPU=$(shuf -i 0-$max_cpu -n 1)
+
 	DEFAULT_IMG_ID=$(find $IMG_PATH -maxdepth 1 -name "${CPU_FMS}-[0-9a-fA-F][0-9a-fA-F].scan" \
 			 2>/dev/null \
 			 | sort \
@@ -292,6 +478,8 @@ test_ifs()
 		append_log "[$SKIP] No proper ${IMG_PATH}/${CPU_FMS}-*.scan, skip ifs_0 scan"
 	else
 		test_bad_and_origin_ifs_image "$DEFAULT_IMG_ID"
+		test_ifs_scan_available_imgs
+		test_ifs_same_cpu_loop "$IFS_SCAN_MODE" "$RANDOM_CPU" "$LOOP_TIMES"
 	fi
 }
 
Signature · 1 line
2.43.0
author
#4 lore raw

PATCH 4/4 selftests: ifs: verify IFS ARRAY BIST functionality

In reply to Pengfei Xu

There are two selftest scenarios for ARRAY BIST(Board Integrated System Test) tests:

1. Perform IFS ARRAY BIST tests once on each CPU.
2. Perform IFS ARRAY BIST tests on a random CPU with 3 rounds.

These are not meant to be exhaustive, but are some minimal tests for for checking IFS ARRAY BIST.

---
 .../selftests/drivers/platform/x86/intel/ifs/test_ifs.sh  | 8 ++++++++
 1 file changed, 8 insertions(+)
tools/testing/selftests/drivers/platform/x86/intel/ifs/test_ifs.sh +8 -0
index 63d13400af4f..2ab310c4aaff 100755
@@ -481,6 +481,14 @@ test_ifs()
 		test_ifs_scan_available_imgs
 		test_ifs_same_cpu_loop "$IFS_SCAN_MODE" "$RANDOM_CPU" "$LOOP_TIMES"
 	fi
+
+	# SAPPHIRERAPID CPU could not support IFS ARRAY BIST scan
+	if [[ "$MODEL" == "$SAPPHIRERAPIDS_X" ]]; then
+		append_log "[$SKIP] SAPPHIRERAPID CPU, skip IFS ARRAY BIST scan"
+	else
+		ifs_test_cpus "$SIBLINGS" "$IFS_ARRAY_BIST_SCAN_MODE"
+		test_ifs_same_cpu_loop "$IFS_ARRAY_BIST_SCAN_MODE" "$RANDOM_CPU" "$LOOP_TIMES"
+	fi
 }
 
 trap ifs_cleanup SIGTERM SIGINT
Signature · 1 line
2.43.0
maintainer
#5 lore raw
In reply to Pengfei Xu
Quoted 22 lines · Pengfei Xu

To verify IFS (In Field Scan [1]) driver functionality, add the following 6 test cases:
1. Verify that IFS sysfs entries are created after loading the IFS module
2. Check if loading an invalid IFS test image fails and loading a valid one succeeds
3. Perform IFS scan test on each CPU using all the available image files
4. Perform IFS scan with first test image file on a random CPU for 3 rounds
5. Perform IFS ARRAY BIST(Board Integrated System Test) test on each CPU
6. Perform IFS ARRAY BIST test on a random CPU for 3 rounds

These are not exhaustive, but some minimal test runs to check various parts of the driver. Some negative tests are also included.

[1] https://docs.kernel.org/arch/x86/ifs.html

Pengfei Xu (4):
selftests: ifs: verify test interfaces are created by the driver
selftests: ifs: verify test image loading functionality
selftests: ifs: verify IFS scan test functionality
selftests: ifs: verify IFS ARRAY BIST functionality

Quoted 8 lines
  MAINTAINERS                                   |   1 +
  tools/testing/selftests/Makefile              |   1 +
  .../drivers/platform/x86/intel/ifs/Makefile   |   6 +
  .../platform/x86/intel/ifs/test_ifs.sh        | 496 ++++++++++++++++++
  4 files changed, 504 insertions(+)

create mode 100644 tools/testing/selftests/drivers/platform/x86/intel/ifs/Makefile create mode 100755 tools/testing/selftests/drivers/platform/x86/intel/ifs/test_ifs.sh

I am fine with adding a test. I would need ifs ack or reviewed-by. I don't see ifs maintainer on on this thread.

thanks,
-- Shuah

#6 lore raw

Hi Shuah,

Quoted 3 lines · Shuah Khan
Quoted 2 lines · Pengfei Xu

To verify IFS (In Field Scan [1]) driver functionality, add the following 6 test cases:

...

Quoted 4 lines
Quoted 1 line

I am fine with adding a test. I would need ifs ack or reviewed-by. I don't see ifs maintainer on on this thread.

I am the IFS driver maintainer, and I have reviewed the series and Pengfei has my reviewed-by tags added in all the 4 patches.

Thanks
Jithu

Reviewed-by Kuppuswamy Sathyanarayanan on the v1 series
#7 lore raw
In reply to Pengfei Xu
Quoted 11 lines · Pengfei Xu

To verify IFS (In Field Scan [1]) driver functionality, add the following 6 test cases:
1. Verify that IFS sysfs entries are created after loading the IFS module
2. Check if loading an invalid IFS test image fails and loading a valid one succeeds
3. Perform IFS scan test on each CPU using all the available image files
4. Perform IFS scan with first test image file on a random CPU for 3 rounds
5. Perform IFS ARRAY BIST(Board Integrated System Test) test on each CPU
6. Perform IFS ARRAY BIST test on a random CPU for 3 rounds

Quoted 4 lines

These are not exhaustive, but some minimal test runs to check various parts of the driver. Some negative tests are also included.

[1] https://docs.kernel.org/arch/x86/ifs.html

Looks good to me.

Quoted 14 lines

Pengfei Xu (4):
selftests: ifs: verify test interfaces are created by the driver
selftests: ifs: verify test image loading functionality
selftests: ifs: verify IFS scan test functionality
selftests: ifs: verify IFS ARRAY BIST functionality

 MAINTAINERS                                   |   1 +
 tools/testing/selftests/Makefile              |   1 +
 .../drivers/platform/x86/intel/ifs/Makefile   |   6 +
 .../platform/x86/intel/ifs/test_ifs.sh        | 496 ++++++++++++++++++
 4 files changed, 504 insertions(+)
 create mode 100644 tools/testing/selftests/drivers/platform/x86/intel/ifs/Makefile
 create mode 100755 tools/testing/selftests/drivers/platform/x86/intel/ifs/test_ifs.sh
Signature · 2 lines
Sathyanarayanan Kuppuswamy
Linux Kernel Developer
author
#8 lore raw
Quoted 13 lines · Sathyanarayanan
Quoted 11 lines · Pengfei Xu

To verify IFS (In Field Scan [1]) driver functionality, add the following 6 test cases:
1. Verify that IFS sysfs entries are created after loading the IFS module
2. Check if loading an invalid IFS test image fails and loading a valid one succeeds
3. Perform IFS scan test on each CPU using all the available image files
4. Perform IFS scan with first test image file on a random CPU for 3 rounds
5. Perform IFS ARRAY BIST(Board Integrated System Test) test on each CPU
6. Perform IFS ARRAY BIST test on a random CPU for 3 rounds

Quoted 8 lines
Quoted 4 lines

These are not exhaustive, but some minimal test runs to check various parts of the driver. Some negative tests are also included.

[1] https://docs.kernel.org/arch/x86/ifs.html

Looks good to me.

Thanks for Sathya's tag, and thanks Shuah and Jithu also.

Best Regards,
Thanks!

Quoted 19 lines
Quoted 15 lines

Pengfei Xu (4):
selftests: ifs: verify test interfaces are created by the driver
selftests: ifs: verify test image loading functionality
selftests: ifs: verify IFS scan test functionality
selftests: ifs: verify IFS ARRAY BIST functionality

 MAINTAINERS                                   |   1 +
 tools/testing/selftests/Makefile              |   1 +
 .../drivers/platform/x86/intel/ifs/Makefile   |   6 +
 .../platform/x86/intel/ifs/test_ifs.sh        | 496 ++++++++++++++++++
 4 files changed, 504 insertions(+)
 create mode 100644 tools/testing/selftests/drivers/platform/x86/intel/ifs/Makefile
 create mode 100755 tools/testing/selftests/drivers/platform/x86/intel/ifs/test_ifs.sh
Signature · 2 lines
Sathyanarayanan Kuppuswamy
Linux Kernel Developer