From 93e78b1288b918c581926468fa3d2d00f44700a0 Mon Sep 17 00:00:00 2001 From: Pengfei Xu Date: Wed, 21 Aug 2024 11:27:05 +0800 Subject: [PATCH 1/2] ifs: correct the ifs scan interval time for SPR and EMR Signed-off-by: Pengfei Xu --- BM/ifs/ifs_common.sh | 45 +++++++++++++++++++++++++++++++++++++++++++- BM/ifs/ifs_tests.sh | 22 ++++------------------ 2 files changed, 48 insertions(+), 19 deletions(-) diff --git a/BM/ifs/ifs_common.sh b/BM/ifs/ifs_common.sh index 88214a98..965e9d81 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 e5d7fa83..a5041477 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 From 01e346f8f3a18c4f57ba1e2021c180cba2ffd8ba Mon Sep 17 00:00:00 2001 From: Pengfei Xu Date: Wed, 21 Aug 2024 11:31:13 +0800 Subject: [PATCH 2/2] spr-oe: add cet,ifs,umip,xsave and vbmi cases for spr-oe Signed-off-by: Pengfei Xu --- scenario/spr-oe/tests-avx512vbmi | 1 + scenario/spr-oe/tests-cet | 1 + scenario/spr-oe/tests-ifs | 24 ++++++++++++++++++++++++ scenario/spr-oe/tests-umip | 1 + scenario/spr-oe/tests-xsave | 1 + 5 files changed, 28 insertions(+) create mode 120000 scenario/spr-oe/tests-avx512vbmi create mode 120000 scenario/spr-oe/tests-cet create mode 100644 scenario/spr-oe/tests-ifs create mode 120000 scenario/spr-oe/tests-umip create mode 120000 scenario/spr-oe/tests-xsave diff --git a/scenario/spr-oe/tests-avx512vbmi b/scenario/spr-oe/tests-avx512vbmi new file mode 120000 index 00000000..e10c43e9 --- /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 00000000..2c9aaf70 --- /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 00000000..6a9d43be --- /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 00000000..15f64eab --- /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 00000000..56ee92b5 --- /dev/null +++ b/scenario/spr-oe/tests-xsave @@ -0,0 +1 @@ +../../BM/xsave/tests \ No newline at end of file