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

0821 ifs2 #362

Closed
wants to merge 2 commits into from
Closed
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
45 changes: 44 additions & 1 deletion BM/ifs/ifs_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ export BATCH_NUM=""
export ERR_ARRAYS="failed error segfault"
IFS_DMESG_OFFLINE="Other thread could not join"

# Matches arch/x86/include/asm/intel-family.h and
# drivers/platform/x86/intel/ifs/core.c requirement as follows
readonly SAPPHIRERAPIDS_X="8f"
readonly EMERALDRAPIDS_X="cf"

readonly INTEL_FAM6="06"

# CPU_LIST and REMOVE_LIST should be all cpu lists
ALL_CPUS=""
CPU_LIST=""
Expand All @@ -59,7 +66,11 @@ SIBLINGS="/tmp/siblings"
TIME_FILE="/tmp/time_ifs"
export LAST_TIME_FILE="/tmp/time_ifs_bak"
TIME_FILE_RECORD="/tmp/time_ifs_record"
INTERVAL_TIME=1860
FML=""
MODEL=""
STEPPING=""
export CPU_FMS=""
INTERVAL_TIME=1800
ERR_NUM=0
export TRUE="true"
export FALSE="false"
Expand Down Expand Up @@ -159,6 +170,38 @@ is_atom() {
}
}

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()
{
get_cpu_fms

if [[ "$FML" != "$INTEL_FAM6" ]]; then
test_exit "CPU family:$FML does not support IFS" "$KSFT_SKIP"
fi

# Ucode has time interval requirement for IFS scan on same CPU as follows:
case $MODEL in
"$SAPPHIRERAPIDS_X")
export INTERVAL_TIME=1800;
;;
"$EMERALDRAPIDS_X")
export INTERVAL_TIME=30;
;;
*)
# Set default interval time for other platforms
export INTERVAL_TIME=1;
append_log "[$INFO] CPU FML:$FML model:0x$MODEL, default: 1s interval time"
;;
esac
}

# Check file content should exist or not
# Input:$1 file name
# $2 expected keyword
Expand Down
22 changes: 4 additions & 18 deletions BM/ifs/ifs_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,7 @@ run_ifs_tests() {
local err=""

[[ -z "$NAME" ]] && block_test "There is no ifs test name:$NAME"

is_spr
if [[ "$IS_SPR" == "$TRUE" ]]; then
test_print_trc "it's SPR CPU, interval time:1860."
export INTERVAL_TIME=1860
elif [[ "$IS_SPR" == "$FALSE" ]]; then
test_print_trc "CPU is not SPR, interval time:2."
export INTERVAL_TIME=2
else
test_print_wrg "IS_SPR is not true or false!!! Set interval time:1860! DDT BUG!"
export INTERVAL_TIME=1860
fi
check_cpu_ifs_support_interval_time

is_atom
[[ "$IS_ATOM" == "$TRUE" ]] && {
Expand Down Expand Up @@ -96,10 +85,8 @@ run_ifs_tests() {
modprobe -r "$IFS_NAME"
enable_ifs_trace
do_cmd "echo $BATCH_NUM > ${IFS_PATH}/${BATCH}"
# Need to wait after boot up 1800s, then could test ifs
wait_up_time
# At least sleep 2 for common situation
do_cmd "sleep 2"
# Make sure the interval time before ifs scan
do_cmd "sleep $INTERVAL_TIME"
# Execute normal scan test in first round and need to wait cooling time
test_print_trc "***** Will run 1st round normal scan: *****"
init_log "${CASE_NORM}_${BATCH_NUM}"
Expand All @@ -115,8 +102,7 @@ run_ifs_tests() {

# Execute the second round scan test in short time
test_print_trc "***** Will run 2nd round scan in short time: *****"
do_cmd "sleep 2"
sleep 2
do_cmd "sleep $INTERVAL_TIME"
init_log "$CASE_TWICE"
dump_ifs_test "$NAME"
# Record the end time after test which is the real correct end time record
Expand Down
1 change: 1 addition & 0 deletions scenario/spr-oe/tests-avx512vbmi
1 change: 1 addition & 0 deletions scenario/spr-oe/tests-cet
24 changes: 24 additions & 0 deletions scenario/spr-oe/tests-ifs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This file collects Intel IFS(In Field SCAN) tests on
# Intel® Architecture-based platforms.
# @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
ifs_tests.sh -m 0 -p all -n load_ifs
# Need to set the IFS BIOS and put IFS scan blob image, please check BM/ifs/README.md
ifs_tests.sh -m 0 -p all -b 1 -n ifs_batch
ifs_tests.sh -m 0 -p all -b 1 -n legacy_twice_run
#ifs_tests.sh -m 0 -p all -b 2 -n legacy_twice_run
#ifs_tests.sh -m 0 -p all -b 3 -n legacy_twice_run
ifs_tests.sh -m 0 -p all -b 1 -n img_version
ifs_tests.sh -m 0 -p all -b 1 -n reload_ifs_scan_image

# ifs_1 array BIST(Board Integrated System Test), it works on EMR(Emerald Rapids) and future server
#ifs_tests.sh -m 1 -p all -n ifs_array_scan
#ifs_tests.sh -m 1 -p ran -n ifs_array_off_sib -t 10
#ifs_tests.sh -m 1 -p ran -n ifs_array_offran -t 5
#ifs_tests.sh -m 1 -p ran -n ifs_array_cpuran_fullload -t 10
#ifs_tests.sh -m 1 -p ran -b 1 -n ifs_loop -t 500

# Test ifs_0 all available image scan and ifs_1 scan, will skip ifs_1 scan on SPR
test_ifs.sh
1 change: 1 addition & 0 deletions scenario/spr-oe/tests-umip
1 change: 1 addition & 0 deletions scenario/spr-oe/tests-xsave
Loading