diff --git a/BM/ifs/ifs_common.sh b/BM/ifs/ifs_common.sh index 88214a9..965e9d8 100755 --- a/BM/ifs/ifs_common.sh +++ b/BM/ifs/ifs_common.sh @@ -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="" @@ -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" @@ -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 diff --git a/BM/ifs/ifs_tests.sh b/BM/ifs/ifs_tests.sh index e5d7fa8..a504147 100755 --- a/BM/ifs/ifs_tests.sh +++ b/BM/ifs/ifs_tests.sh @@ -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" ]] && { @@ -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}" @@ -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 diff --git a/scenario/spr-oe/tests-avx512vbmi b/scenario/spr-oe/tests-avx512vbmi new file mode 120000 index 0000000..e10c43e --- /dev/null +++ b/scenario/spr-oe/tests-avx512vbmi @@ -0,0 +1 @@ +../../BM/avx512vbmi/tests \ No newline at end of file diff --git a/scenario/spr-oe/tests-cet b/scenario/spr-oe/tests-cet new file mode 120000 index 0000000..2c9aaf7 --- /dev/null +++ b/scenario/spr-oe/tests-cet @@ -0,0 +1 @@ +../../BM/cet/tests \ No newline at end of file diff --git a/scenario/spr-oe/tests-ifs b/scenario/spr-oe/tests-ifs new file mode 100644 index 0000000..6a9d43b --- /dev/null +++ b/scenario/spr-oe/tests-ifs @@ -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 diff --git a/scenario/spr-oe/tests-umip b/scenario/spr-oe/tests-umip new file mode 120000 index 0000000..15f64ea --- /dev/null +++ b/scenario/spr-oe/tests-umip @@ -0,0 +1 @@ +../../BM/umip/tests \ No newline at end of file diff --git a/scenario/spr-oe/tests-xsave b/scenario/spr-oe/tests-xsave new file mode 120000 index 0000000..56ee92b --- /dev/null +++ b/scenario/spr-oe/tests-xsave @@ -0,0 +1 @@ +../../BM/xsave/tests \ No newline at end of file