From 0987e9c4ac6d6ecfbe302341f873bb5de5c546b0 Mon Sep 17 00:00:00 2001 From: Pengfei Xu Date: Fri, 10 May 2024 15:33:33 +0800 Subject: [PATCH 1/2] runtests: improve the judgement of REASON filling If one feature "other warning" dependence checking is passed, and the REASON is filled with previous one, the REASON will use previous one and will not update, it's not correct, so improve the REASON filling judgement to fill the correct REASON for target feature. Signed-off-by: Pengfei Xu --- BM/runtests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BM/runtests b/BM/runtests index d52faa11..27cd2b56 100755 --- a/BM/runtests +++ b/BM/runtests @@ -209,7 +209,7 @@ check_dep_feature() { # warn_sta does not set the block, just NA to fail in some cases of this feature [[ "$ret" == "$BLOCK_CODE" ]] && warn_sta="$NA" - [[ -z "$REASON" ]] && REASON="No dependence for $subfolder" + [[ -z "$REASON" || "$ret" == "$PASS_CODE" ]] && REASON="No dependence for $subfolder" printf "%-16s%-13s%-16s%-13s%-20s\n" "$subfolder" "|$hw_sta" "|$other_sta" "|$warn_sta" \ "|$REASON" >> "$DEP_LOG" return 0 From 9ad64fbc6479e4a7c201fd8db8753445fa8fbbde Mon Sep 17 00:00:00 2001 From: Pengfei Xu Date: Fri, 10 May 2024 15:50:54 +0800 Subject: [PATCH 2/2] general_test: add the family model stepping check function Add the family model stepping check function, it could be used to get the test platform CPU family model stepping, and check if this type of family model is in the family model list for target feature. Signed-off-by: Pengfei Xu --- BM/common/common.sh | 37 +++++++++++++++++++++++++++++++++++++ BM/common/general_test.sh | 3 ++- BM/ifs/ifs_common.sh | 14 -------------- BM/ifs/ifs_fms_list | 3 +++ BM/ifs/tests | 2 +- 5 files changed, 43 insertions(+), 16 deletions(-) create mode 100755 BM/ifs/ifs_fms_list diff --git a/BM/common/common.sh b/BM/common/common.sh index dd4af6c5..e21a73d5 100755 --- a/BM/common/common.sh +++ b/BM/common/common.sh @@ -10,6 +10,10 @@ BIN_OUTPUT="" BIN_DMESG="" BIN_RET="" export LAST_DMESG_TIMESTAMP="" +export FML="" +export MODEL="" +export STEPPING="" +export CPU_MODEL="" readonly CPU_SYSFS_FOLDER="/sys/devices/system/cpu" @@ -537,6 +541,39 @@ online_all_cpu() fi } +# Get the cpu model info, like spr sample: 06-8f-06 +# Input: NA +# Output: 0 otherwise failure or die +get_cpu_model() { + FML=$(grep -m 1 "family" /proc/cpuinfo | awk -F ":" '{printf "%02x",$2;}') + [[ -n "$FML" ]] || block_test "No CPU family found:$FML" + MODEL=$(grep -m 1 "model" /proc/cpuinfo | awk -F ":" '{printf "%02x",$2;}') + [[ -n "$MODEL" ]] || block_test "No CPU model found:$MODEL" + STEPPING=$(grep -m 1 "stepping" /proc/cpuinfo | awk -F ":" '{printf "%02x",$2;}') + export CPU_MODEL="${FML}-${MODEL}-${STEPPING}" +} + +# From the family model stepping list, judge the test platform is in the list +# Input: family model stepping list file like "ifs_fms_list" under ifs folder +# Output: 0 otherwise failure or die +check_fms_list() { + local fms_list_file=$1 + local list_file="" + local check_fms="" + + get_cpu_model + list_file=$(which "$fms_list_file" 2>/dev/null) + [[ -n "$list_file" ]] || block_test "No family model stepping list file:$fms_list_file found" + check_fms=$(grep -v "^#" "$list_file" | grep "^$FML" \ + | awk -F "$FML:" '{print $2}' \ + | grep "$MODEL") + if [[ -n "$check_fms" ]]; then + test_print_trc "Find family:$FML model:$MODEL in $list_file" + else + block_test "No family:$FML model:$MODEL found in $list_file" + fi +} + # Check specified pattern in dmesg # Arguments: # $1: bin name diff --git a/BM/common/general_test.sh b/BM/common/general_test.sh index 37e2db9e..feb25b65 100755 --- a/BM/common/general_test.sh +++ b/BM/common/general_test.sh @@ -27,7 +27,8 @@ general_test() { ;; # family model stepping check fms) - #TODO, will add the fms check function + get_cpu_model + check_fms_list "$PARM" ;; dmesg) key1=$(echo "$KEYWORD" | awk -F '&' '{print $1}') diff --git a/BM/ifs/ifs_common.sh b/BM/ifs/ifs_common.sh index a74b83af..71e67a94 100755 --- a/BM/ifs/ifs_common.sh +++ b/BM/ifs/ifs_common.sh @@ -73,10 +73,6 @@ IFS_DMESG="" IFS_LOG="" WARN_LOG="" IFS_CSV="" -CPU_MODEL="" -FML="" -MODEL="" -STEPPING="" BATCH_FILE="" LOG_MAX_LINES="20" @@ -117,16 +113,6 @@ ifs_teardown() { fi } -# Get the cpu model info, like spr sample: 06-8f-06 -# Input: NA -# Output: 0 otherwise failure or die -get_cpu_model() { - 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;}') - export CPU_MODEL="${FML}-${MODEL}-${STEPPING}" -} - # CPUID check ATOM, IS_ATOM=true, if no IS_ATOM=false # CPUID EAX=0x1a, and then output EAX bit29 is 1:ATOM, bit29:0 not atom # Input: NA diff --git a/BM/ifs/ifs_fms_list b/BM/ifs/ifs_fms_list new file mode 100755 index 00000000..7eb40a35 --- /dev/null +++ b/BM/ifs/ifs_fms_list @@ -0,0 +1,3 @@ +# Family 06 CPUs from arch/x86/include/asm/intel-family.h +# SPR EMR GNR_X GNR_D SRF +06:8f cf ad ae af diff --git a/BM/ifs/tests b/BM/ifs/tests index 0298bf40..3482254e 100755 --- a/BM/ifs/tests +++ b/BM/ifs/tests @@ -1,6 +1,6 @@ # This file collects Intel IFS(In Field SCAN) tests on # IntelĀ® Architecture-based platforms. -# @hw_dep: +# @hw_dep: general_test.sh -t fms -p "ifs_fms_list" @ CPU doesn't support ifs, family model not in ifs/ifs_fms_list # @other_dep: general_test.sh -t kconfig -k "CONFIG_INTEL_IFS=m" # @other_warn: ifs_tests.sh -m 0 -p all -b 1 -n ifs_batch @ check if SGX init ok and DIMM proper set as IFS relies on enabled SGX # ifs_0 scan test cases, it works on SPR(Sapphire Rapids) platform and future server