Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0510 fms 2 #222

Merged
merged 2 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions BM/common/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion BM/common/general_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}')
Expand Down
14 changes: 0 additions & 14 deletions BM/ifs/ifs_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ IFS_DMESG=""
IFS_LOG=""
WARN_LOG=""
IFS_CSV=""
CPU_MODEL=""
FML=""
MODEL=""
STEPPING=""
BATCH_FILE=""

LOG_MAX_LINES="20"
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions BM/ifs/ifs_fms_list
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion BM/ifs/tests
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion BM/runtests
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading