├── KVM ├── docs │ └── .gitkeep ├── libvirt │ └── __init__.py └── qemu │ ├── __init__.py │ ├── tests │ ├── __init__.py │ ├── td_debug.py │ ├── tdx_disable.py │ ├── td_boot_multimes.py │ ├── tdx_seam_module.py │ └── host_cpu_offline_online.py │ ├── provider │ ├── __init__.py │ └── test_utils.py │ ├── vsock_test.cfg │ ├── tdx_max_guests.cfg │ ├── host_cpu_offline_online.cfg │ ├── td_huge_resource.cfg │ ├── tsc_freq.cfg │ ├── td_debug.cfg │ ├── deps │ └── run_cuda.sh │ ├── tdx_basic.cfg │ ├── tdx_seam_module.cfg │ ├── tdx_disable.cfg │ ├── smp.cfg │ ├── ept_5lp_basic.cfg │ ├── td_boot_multimes.cfg │ ├── cpu_pku.cfg │ ├── vfio_gpu_boot.cfg │ ├── vfio_net_boot.cfg │ └── boot_check.cfg ├── BM ├── .gitignore ├── amx │ ├── .gitignore │ ├── guest-tests │ ├── Makefile │ ├── CMakeLists.txt │ └── tests-stress ├── th │ ├── .gitignore │ ├── Makefile │ ├── README.md │ └── CMakeLists.txt ├── avx512vbmi │ ├── .gitignore │ ├── Makefile │ ├── README.md │ ├── CMakeLists.txt │ └── tests ├── splitlock │ ├── .gitignore │ ├── tests │ ├── Makefile │ ├── CMakeLists.txt │ └── README.md ├── tdx-compliance │ ├── tests │ ├── tests-trigger-cpuid.sh │ ├── Makefile │ ├── testallcase.sh │ └── config.json ├── tools │ ├── pcie │ │ ├── .gitignore │ │ ├── Makefile │ │ └── CMakeLists.txt │ ├── cpuid_check │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ └── CMakeLists.txt │ └── Makefile ├── tpm │ ├── .gitignore │ ├── test_smoke.sh │ ├── test_space.sh │ ├── test_async.sh │ └── tests ├── xsave │ ├── .gitignore │ ├── tests │ ├── xstate_helpers.h │ ├── Makefile │ ├── CMakeLists.txt │ └── README.md ├── tdx-guest │ ├── tdx_ebizzy_test_suite │ │ ├── .gitignore │ │ ├── ebizzy.h │ │ └── Makefile │ ├── tdx_halt_test_module │ │ ├── .gitignore │ │ ├── Makefile │ │ └── halt_test.c │ ├── tdx_attest_test_suite │ │ └── .gitignore │ └── tdx_test_module.sh ├── telemetry │ ├── .gitignore │ ├── Makefile │ ├── tests │ ├── CMakeLists.txt │ └── README.md ├── workload-xsave │ ├── .gitignore │ ├── work_PAUSE.c │ ├── work_RDTSC.c │ ├── work_UMWAIT.c │ ├── run_common.c │ ├── work_TPAUSE.c │ ├── worker_init_avx.c │ ├── worker_init_sse.c │ ├── work_GETCPU.c │ └── worker_init_avx2.c ├── fred │ ├── Makefile │ ├── tests │ └── README.md ├── nmis │ ├── Makefile │ ├── tests │ └── README.md ├── umip │ ├── .gitignore │ ├── tests │ ├── Makefile │ └── README.md ├── pt │ ├── .gitignore │ ├── Makefile │ ├── utils.h │ ├── README.md │ ├── CMakeLists.txt │ ├── negative_test.c │ └── sort_test.c ├── cmpccxadd │ ├── .vscode │ │ └── settings.json │ ├── Makefile │ ├── CMakeLists.txt │ └── tests ├── dsa │ ├── tests-bat │ ├── tests │ ├── tests-dsa2 │ └── configs │ │ └── 1d2g2q_user.conf ├── tpmi │ ├── tpmi_fms_list │ └── README.md ├── ufs │ ├── ufs_fms_list │ ├── README.md │ └── tests ├── sdsi │ ├── sdsi_fms_list │ ├── README.md │ └── tests ├── cet │ ├── cet_driver │ │ ├── .gitignore │ │ ├── Makefile │ │ └── cet_ioctl.h │ ├── .gitignore │ └── shstk_cpu_legacy.c ├── hotplug │ ├── tests │ └── README.md ├── idxd │ ├── common.json │ ├── guest_tests │ └── remove_iaa_crypto.sh ├── ifs │ ├── ifs_fms_list │ └── tests ├── instruction-check │ ├── setup.sh │ ├── instruction_check.py │ └── auto_gen_test.py ├── pmu │ ├── tests_3fix_counters │ ├── tests_arch_perfmon_v6 │ ├── README.md │ ├── tests │ ├── tests_arch_pebs │ ├── tests_gnr │ └── tests_cwf ├── adaptation │ ├── centos │ │ ├── install_local.sh │ │ ├── README.md │ │ ├── Dockerfile.build │ │ └── packages │ └── debian │ │ ├── install_local.sh │ │ ├── README.md │ │ ├── Dockerfile.build │ │ └── packages ├── edac │ ├── tests │ ├── README.md │ └── intel_edac.sh ├── lass │ ├── Makefile │ ├── tests │ └── README.md ├── lam │ ├── tests │ ├── Makefile │ └── README.md ├── thermal │ ├── tests │ └── README.md ├── tdx-osv-sanity │ ├── common.json │ ├── 2.1.1.4-tests │ └── tdx_host_tsc_check.sh ├── dma │ └── tests ├── .env ├── guest-test │ └── common.json ├── pcie │ ├── tests │ └── README.md ├── ras │ ├── Makefile │ └── README.md ├── topology │ ├── tests-client │ ├── tests-server │ └── README.md ├── CMakeLists.txt ├── common │ ├── check_perf.py │ └── uname ├── cstate │ ├── tests-client │ └── README.md ├── performance │ └── README.md ├── Dockerfile.build.ddt ├── Dockerfile.build ├── rapl │ ├── README.md │ └── tests-server ├── pstate │ └── README.md └── isst │ └── README.md ├── scenario ├── cwf-ov │ ├── tests-ifs │ ├── tests-tpm │ ├── tests-edac │ ├── tests-fred │ ├── tests-lass │ ├── tests-pcie │ ├── tests-pmu │ ├── tests-tpmi │ ├── tests-umip │ ├── tests-xsave │ ├── tests-pstate │ ├── tests-thermal │ ├── test-splitlock │ ├── test-telemetry │ ├── tests-cmpccxadd │ ├── tests-cstate │ ├── test-tdx-guest │ ├── tests-topology │ ├── tests-ufs │ └── tests-rapl ├── emr-oa │ ├── tests-cet │ ├── tests-umip │ ├── tests-xsave │ ├── tests-avx512vbmi │ ├── tests-telemetry │ ├── tests-cstate │ ├── tests_pmu │ ├── README.md │ └── tests-ifs ├── emr-oe │ ├── tests-cet │ ├── tests-umip │ ├── tests-xsave │ ├── tests-avx512vbmi │ ├── tests-telemetry │ ├── tests-topology │ ├── tests-rapl │ ├── tests-cstate │ ├── tests_pmu │ ├── tests-pmu │ ├── tests-dsa1 │ ├── tests-pstate │ └── tests-ifs ├── emr-ov │ ├── tests-dsa │ ├── tests-umip │ ├── tests-xsave │ ├── tests-pstate │ ├── tests-thermal │ ├── tests-cstate │ ├── tests-splitlock │ ├── tests-telemetry │ ├── tests-topology │ ├── tests-edac │ ├── tests-pmu │ ├── tests-rapl │ └── tests-avx512vbmi ├── gnr-oe │ ├── tests-cet │ ├── tests-edac │ ├── tests-iax │ ├── tests-umip │ ├── tests-xsave │ ├── tests-avx512vbmi │ ├── tests-telemetry │ ├── tests-topology │ ├── tests-cstate │ ├── tests-ufs │ ├── tests-rapl │ ├── tests-pstate │ └── tests-ifs ├── gnr-ov │ ├── tests-ifs │ ├── tests-ufs │ ├── tests-dsa │ ├── tests-tpmi │ ├── tests-umip │ ├── tests-xsave │ ├── tests-pstate │ ├── tests-thermal │ ├── tests-cstate │ ├── tests-splitlock │ ├── tests-telemetry │ ├── tests-edac │ ├── tests-pmu │ ├── tests-topology │ ├── tests-rapl │ └── tests-avx512vbmi ├── spr-oe │ ├── tests-cet │ ├── tests-umip │ ├── tests-xsave │ ├── tests-avx512vbmi │ ├── tests-telemetry │ ├── tests-topology │ ├── tests-rapl │ ├── tests-cstate │ ├── tests-pmu │ ├── tests-dsa1 │ ├── tests-pstate │ └── tests-ifs ├── srf-oe │ ├── tests-cet │ ├── tests-edac │ ├── tests-umip │ ├── tests-xsave │ ├── tests-thermal │ ├── tests-telemetry │ ├── tests-topology │ ├── tests-lam │ ├── tests-lass │ ├── tests-rapl │ ├── tests-pstate │ ├── tests-cstate │ └── tests-ifs ├── srf-ov │ ├── tests-cet │ ├── tests-ifs │ ├── tests-lam │ ├── tests-pt │ ├── tests-ufs │ ├── tests-dsa │ ├── tests-edac │ ├── tests-isst │ ├── tests-pmu │ ├── tests-tpmi │ ├── tests-pstate │ ├── tests-rapl │ ├── tests-cmpccxadd │ ├── tests-cstate │ └── tests-splitlock ├── cwf-oa │ ├── tests-edac │ ├── tests-pmu │ └── tests-topology └── README.md ├── .github └── scripts │ ├── requirements-ci.txt │ └── build_check ├── SECURITY.md └── .gitmodules /KVM/docs/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /KVM/libvirt/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /KVM/qemu/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /BM/.gitignore: -------------------------------------------------------------------------------- 1 | lkvs.log 2 | -------------------------------------------------------------------------------- /BM/amx/.gitignore: -------------------------------------------------------------------------------- 1 | tmul 2 | -------------------------------------------------------------------------------- /KVM/qemu/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /BM/th/.gitignore: -------------------------------------------------------------------------------- 1 | /th_test 2 | -------------------------------------------------------------------------------- /KVM/qemu/provider/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /BM/avx512vbmi/.gitignore: -------------------------------------------------------------------------------- 1 | vbmi_test 2 | -------------------------------------------------------------------------------- /BM/splitlock/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | sl_test 3 | -------------------------------------------------------------------------------- /BM/tdx-compliance/tests: -------------------------------------------------------------------------------- 1 | testallcase.sh 2 | -------------------------------------------------------------------------------- /BM/tools/pcie/.gitignore: -------------------------------------------------------------------------------- 1 | pcie_check 2 | -------------------------------------------------------------------------------- /BM/tpm/.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | *.log 3 | -------------------------------------------------------------------------------- /BM/xsave/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | xstate_64 3 | -------------------------------------------------------------------------------- /scenario/cwf-ov/tests-ifs: -------------------------------------------------------------------------------- 1 | ../../BM/ifs/tests -------------------------------------------------------------------------------- /scenario/cwf-ov/tests-tpm: -------------------------------------------------------------------------------- 1 | ../../BM/tpm/tests -------------------------------------------------------------------------------- /scenario/emr-oa/tests-cet: -------------------------------------------------------------------------------- 1 | ../../BM/cet/tests -------------------------------------------------------------------------------- /scenario/emr-oe/tests-cet: -------------------------------------------------------------------------------- 1 | ../../BM/cet/tests -------------------------------------------------------------------------------- /scenario/emr-ov/tests-dsa: -------------------------------------------------------------------------------- 1 | ../../BM/dsa/tests -------------------------------------------------------------------------------- /scenario/gnr-oe/tests-cet: -------------------------------------------------------------------------------- 1 | ../../BM/cet/tests -------------------------------------------------------------------------------- /scenario/gnr-ov/tests-ifs: -------------------------------------------------------------------------------- 1 | ../../BM/ifs/tests -------------------------------------------------------------------------------- /scenario/gnr-ov/tests-ufs: -------------------------------------------------------------------------------- 1 | ../../BM/ufs/tests -------------------------------------------------------------------------------- /scenario/spr-oe/tests-cet: -------------------------------------------------------------------------------- 1 | ../../BM/cet/tests -------------------------------------------------------------------------------- /scenario/srf-oe/tests-cet: -------------------------------------------------------------------------------- 1 | ../../BM/cet/tests -------------------------------------------------------------------------------- /scenario/srf-ov/tests-cet: -------------------------------------------------------------------------------- 1 | ../../BM/cet/tests -------------------------------------------------------------------------------- /scenario/srf-ov/tests-ifs: -------------------------------------------------------------------------------- 1 | ../../BM/ifs/tests -------------------------------------------------------------------------------- /scenario/srf-ov/tests-lam: -------------------------------------------------------------------------------- 1 | ../../BM/lam/tests -------------------------------------------------------------------------------- /scenario/srf-ov/tests-pt: -------------------------------------------------------------------------------- 1 | ../../BM/pt/tests -------------------------------------------------------------------------------- /scenario/srf-ov/tests-ufs: -------------------------------------------------------------------------------- 1 | ../../BM/ufs/tests -------------------------------------------------------------------------------- /BM/tools/cpuid_check/.gitignore: -------------------------------------------------------------------------------- 1 | cpuid_check 2 | -------------------------------------------------------------------------------- /scenario/cwf-ov/tests-edac: -------------------------------------------------------------------------------- 1 | ../../BM/edac/tests -------------------------------------------------------------------------------- /scenario/cwf-ov/tests-fred: -------------------------------------------------------------------------------- 1 | ../../BM/fred/tests -------------------------------------------------------------------------------- /scenario/cwf-ov/tests-lass: -------------------------------------------------------------------------------- 1 | ../../BM/lass/tests -------------------------------------------------------------------------------- /scenario/cwf-ov/tests-pcie: -------------------------------------------------------------------------------- 1 | ../../BM/pcie/tests -------------------------------------------------------------------------------- /scenario/cwf-ov/tests-pmu: -------------------------------------------------------------------------------- 1 | ../../BM/pmu/tests_cwf -------------------------------------------------------------------------------- /scenario/cwf-ov/tests-tpmi: -------------------------------------------------------------------------------- 1 | ../../BM/tpmi/tests -------------------------------------------------------------------------------- /scenario/cwf-ov/tests-umip: -------------------------------------------------------------------------------- 1 | ../../BM/umip/tests -------------------------------------------------------------------------------- /scenario/cwf-ov/tests-xsave: -------------------------------------------------------------------------------- 1 | ../../BM/xsave/tests -------------------------------------------------------------------------------- /scenario/emr-oa/tests-umip: -------------------------------------------------------------------------------- 1 | ../../BM/umip/tests -------------------------------------------------------------------------------- /scenario/emr-oa/tests-xsave: -------------------------------------------------------------------------------- 1 | ../../BM/xsave/tests -------------------------------------------------------------------------------- /scenario/emr-oe/tests-umip: -------------------------------------------------------------------------------- 1 | ../../BM/umip/tests -------------------------------------------------------------------------------- /scenario/emr-oe/tests-xsave: -------------------------------------------------------------------------------- 1 | ../../BM/xsave/tests -------------------------------------------------------------------------------- /scenario/emr-ov/tests-umip: -------------------------------------------------------------------------------- 1 | ../../BM/umip/tests -------------------------------------------------------------------------------- /scenario/emr-ov/tests-xsave: -------------------------------------------------------------------------------- 1 | ../../BM/xsave/tests -------------------------------------------------------------------------------- /scenario/gnr-oe/tests-edac: -------------------------------------------------------------------------------- 1 | ../../BM/edac/tests -------------------------------------------------------------------------------- /scenario/gnr-oe/tests-iax: -------------------------------------------------------------------------------- 1 | ../../BM/dsa/tests-iax -------------------------------------------------------------------------------- /scenario/gnr-oe/tests-umip: -------------------------------------------------------------------------------- 1 | ../../BM/umip/tests -------------------------------------------------------------------------------- /scenario/gnr-oe/tests-xsave: -------------------------------------------------------------------------------- 1 | ../../BM/xsave/tests -------------------------------------------------------------------------------- /scenario/gnr-ov/tests-dsa: -------------------------------------------------------------------------------- 1 | ../../BM/dsa/tests-dsa1 -------------------------------------------------------------------------------- /scenario/gnr-ov/tests-tpmi: -------------------------------------------------------------------------------- 1 | ../../BM/tpmi/tests -------------------------------------------------------------------------------- /scenario/gnr-ov/tests-umip: -------------------------------------------------------------------------------- 1 | ../../BM/umip/tests -------------------------------------------------------------------------------- /scenario/gnr-ov/tests-xsave: -------------------------------------------------------------------------------- 1 | ../../BM/xsave/tests -------------------------------------------------------------------------------- /scenario/spr-oe/tests-umip: -------------------------------------------------------------------------------- 1 | ../../BM/umip/tests -------------------------------------------------------------------------------- /scenario/spr-oe/tests-xsave: -------------------------------------------------------------------------------- 1 | ../../BM/xsave/tests -------------------------------------------------------------------------------- /scenario/srf-oe/tests-edac: -------------------------------------------------------------------------------- 1 | ../../BM/edac/tests -------------------------------------------------------------------------------- /scenario/srf-oe/tests-umip: -------------------------------------------------------------------------------- 1 | ../../BM/umip/tests -------------------------------------------------------------------------------- /scenario/srf-oe/tests-xsave: -------------------------------------------------------------------------------- 1 | ../../BM/xsave/tests -------------------------------------------------------------------------------- /scenario/srf-ov/tests-dsa: -------------------------------------------------------------------------------- 1 | ../../BM/dsa/tests-dsa1 -------------------------------------------------------------------------------- /scenario/srf-ov/tests-edac: -------------------------------------------------------------------------------- 1 | ../../BM/edac/tests -------------------------------------------------------------------------------- /scenario/srf-ov/tests-isst: -------------------------------------------------------------------------------- 1 | ../../BM/isst/tests -------------------------------------------------------------------------------- /scenario/srf-ov/tests-pmu: -------------------------------------------------------------------------------- 1 | ../../BM/pmu/tests_gnr -------------------------------------------------------------------------------- /scenario/srf-ov/tests-tpmi: -------------------------------------------------------------------------------- 1 | ../../BM/tpmi/tests -------------------------------------------------------------------------------- /BM/tdx-guest/tdx_ebizzy_test_suite/.gitignore: -------------------------------------------------------------------------------- 1 | ebizzy -------------------------------------------------------------------------------- /scenario/cwf-ov/tests-pstate: -------------------------------------------------------------------------------- 1 | ../../BM/pstate/tests -------------------------------------------------------------------------------- /scenario/cwf-ov/tests-thermal: -------------------------------------------------------------------------------- 1 | ../../BM/thermal/tests -------------------------------------------------------------------------------- /scenario/emr-ov/tests-pstate: -------------------------------------------------------------------------------- 1 | ../../BM/pstate/tests -------------------------------------------------------------------------------- /scenario/emr-ov/tests-thermal: -------------------------------------------------------------------------------- 1 | ../../BM/thermal/tests -------------------------------------------------------------------------------- /scenario/gnr-ov/tests-pstate: -------------------------------------------------------------------------------- 1 | ../../BM/pstate/tests -------------------------------------------------------------------------------- /scenario/gnr-ov/tests-thermal: -------------------------------------------------------------------------------- 1 | ../../BM/thermal/tests -------------------------------------------------------------------------------- /scenario/srf-oe/tests-thermal: -------------------------------------------------------------------------------- 1 | ../../BM/thermal/tests -------------------------------------------------------------------------------- /scenario/srf-ov/tests-pstate: -------------------------------------------------------------------------------- 1 | ../../BM/pstate/tests -------------------------------------------------------------------------------- /scenario/srf-ov/tests-rapl: -------------------------------------------------------------------------------- 1 | ../../BM/rapl/tests-server -------------------------------------------------------------------------------- /BM/tdx-guest/tdx_halt_test_module/.gitignore: -------------------------------------------------------------------------------- 1 | halt_test.ko -------------------------------------------------------------------------------- /scenario/cwf-ov/test-splitlock: -------------------------------------------------------------------------------- 1 | ../../BM/splitlock/tests -------------------------------------------------------------------------------- /scenario/cwf-ov/test-telemetry: -------------------------------------------------------------------------------- 1 | ../../BM/telemetry/tests -------------------------------------------------------------------------------- /scenario/cwf-ov/tests-cmpccxadd: -------------------------------------------------------------------------------- 1 | ../../BM/cmpccxadd/tests -------------------------------------------------------------------------------- /scenario/cwf-ov/tests-cstate: -------------------------------------------------------------------------------- 1 | ../../BM/cstate/tests-server -------------------------------------------------------------------------------- /scenario/emr-oa/tests-avx512vbmi: -------------------------------------------------------------------------------- 1 | ../../BM/avx512vbmi/tests -------------------------------------------------------------------------------- /scenario/emr-oe/tests-avx512vbmi: -------------------------------------------------------------------------------- 1 | ../../BM/avx512vbmi/tests -------------------------------------------------------------------------------- /scenario/emr-oe/tests-telemetry: -------------------------------------------------------------------------------- 1 | ../../BM/telemetry/tests -------------------------------------------------------------------------------- /scenario/emr-ov/tests-cstate: -------------------------------------------------------------------------------- 1 | ../../BM/cstate/tests-server -------------------------------------------------------------------------------- /scenario/emr-ov/tests-splitlock: -------------------------------------------------------------------------------- 1 | ../../BM/splitlock/tests -------------------------------------------------------------------------------- /scenario/emr-ov/tests-telemetry: -------------------------------------------------------------------------------- 1 | ../../BM/telemetry/tests -------------------------------------------------------------------------------- /scenario/gnr-oe/tests-avx512vbmi: -------------------------------------------------------------------------------- 1 | ../../BM/avx512vbmi/tests -------------------------------------------------------------------------------- /scenario/gnr-oe/tests-telemetry: -------------------------------------------------------------------------------- 1 | ../../BM/telemetry/tests -------------------------------------------------------------------------------- /scenario/gnr-ov/tests-cstate: -------------------------------------------------------------------------------- 1 | ../../BM/cstate/tests-server -------------------------------------------------------------------------------- /scenario/gnr-ov/tests-splitlock: -------------------------------------------------------------------------------- 1 | ../../BM/splitlock/tests -------------------------------------------------------------------------------- /scenario/gnr-ov/tests-telemetry: -------------------------------------------------------------------------------- 1 | ../../BM/telemetry/tests -------------------------------------------------------------------------------- /scenario/spr-oe/tests-avx512vbmi: -------------------------------------------------------------------------------- 1 | ../../BM/avx512vbmi/tests -------------------------------------------------------------------------------- /scenario/spr-oe/tests-telemetry: -------------------------------------------------------------------------------- 1 | ../../BM/telemetry/tests -------------------------------------------------------------------------------- /scenario/srf-oe/tests-telemetry: -------------------------------------------------------------------------------- 1 | ../../BM/telemetry/tests -------------------------------------------------------------------------------- /scenario/srf-ov/tests-cmpccxadd: -------------------------------------------------------------------------------- 1 | ../../BM/cmpccxadd/tests -------------------------------------------------------------------------------- /scenario/srf-ov/tests-cstate: -------------------------------------------------------------------------------- 1 | ../../BM/cstate/tests-server -------------------------------------------------------------------------------- /scenario/srf-ov/tests-splitlock: -------------------------------------------------------------------------------- 1 | ../../BM/splitlock/tests -------------------------------------------------------------------------------- /scenario/emr-ov/tests-topology: -------------------------------------------------------------------------------- 1 | ../../BM/topology/tests-server -------------------------------------------------------------------------------- /scenario/srf-oe/tests-topology: -------------------------------------------------------------------------------- 1 | ../../BM/topology/tests-server -------------------------------------------------------------------------------- /BM/tdx-guest/tdx_attest_test_suite/.gitignore: -------------------------------------------------------------------------------- 1 | tdx_guest_test 2 | -------------------------------------------------------------------------------- /BM/telemetry/.gitignore: -------------------------------------------------------------------------------- 1 | /telemetry_tests 2 | /telemetry_tests_32 3 | -------------------------------------------------------------------------------- /BM/workload-xsave/.gitignore: -------------------------------------------------------------------------------- 1 | yogini 2 | *.o 3 | *.S 4 | result 5 | -------------------------------------------------------------------------------- /scenario/cwf-ov/test-tdx-guest: -------------------------------------------------------------------------------- 1 | # Will add related tdx test cases if needed. -------------------------------------------------------------------------------- /.github/scripts/requirements-ci.txt: -------------------------------------------------------------------------------- 1 | pylint 2 | inspektor==0.5.3 3 | autopep8 4 | -------------------------------------------------------------------------------- /BM/fred/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all 2 | 3 | all: 4 | @echo "This Makefile does nothing." 5 | -------------------------------------------------------------------------------- /BM/nmis/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all 2 | 3 | all: 4 | @echo "This Makefile does nothing." 5 | -------------------------------------------------------------------------------- /BM/umip/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | umip_exceptions_32 3 | umip_exceptions_64 4 | umip_test_basic_64 5 | -------------------------------------------------------------------------------- /BM/pt/.gitignore: -------------------------------------------------------------------------------- 1 | cpl 2 | branch 3 | psb 4 | nonroot_test 5 | negative_test 6 | intel-pt.h 7 | libipt.so 8 | -------------------------------------------------------------------------------- /BM/cmpccxadd/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "limits.h": "c" 4 | } 5 | } -------------------------------------------------------------------------------- /BM/xsave/tests: -------------------------------------------------------------------------------- 1 | # This file collects the XSAVE feature tests on 2 | # Intel® Architecture-based platforms. 3 | 4 | xstate_64 5 | -------------------------------------------------------------------------------- /BM/dsa/tests-bat: -------------------------------------------------------------------------------- 1 | ./dsa_user.sh -t check_dsa_driver 2 | ./dsa_user.sh -t check_dsa0_device 3 | ./dsa_user.sh -t check_shared_mode 4 | -------------------------------------------------------------------------------- /BM/tpmi/tpmi_fms_list: -------------------------------------------------------------------------------- 1 | # Family 06 CPUs from arch/x86/include/asm/intel-family.h 2 | # GNR_X GNR_D SRF CWF 3 | 06: ad ae af dd 4 | -------------------------------------------------------------------------------- /BM/ufs/ufs_fms_list: -------------------------------------------------------------------------------- 1 | # Family 06 CPUs from arch/x86/include/asm/intel-family.h 2 | # GNR_X GNR_D SRF CWF 3 | 06: ad ae af dd 4 | -------------------------------------------------------------------------------- /BM/sdsi/sdsi_fms_list: -------------------------------------------------------------------------------- 1 | # Family 06 CPUs from arch/x86/include/asm/intel-family.h 2 | # SPR EMR GNR_X GNR_D 3 | 06:8f cf ad ae 4 | -------------------------------------------------------------------------------- /BM/cet/cet_driver/.gitignore: -------------------------------------------------------------------------------- 1 | *.cmd 2 | *.ko 3 | *.o 4 | .tmp_versions 5 | cet_ioctl.mod 6 | cet_ioctl.mod.c 7 | modules.order 8 | Module.symvers 9 | -------------------------------------------------------------------------------- /BM/hotplug/tests: -------------------------------------------------------------------------------- 1 | # This script performs CPU offline/online stress test for the specified number of cycles 2 | 3 | python3 cpu_off_on_stress.py 4 | -------------------------------------------------------------------------------- /BM/idxd/common.json: -------------------------------------------------------------------------------- 1 | { 2 | "qemu_img": "/usr/libexec/qemu-kvm", 3 | "boot_pattern": "*Kernel*on*an*x86_64*", 4 | "guest_root_passwd": "123456" 5 | } -------------------------------------------------------------------------------- /BM/ifs/ifs_fms_list: -------------------------------------------------------------------------------- 1 | # Family 06 CPUs from arch/x86/include/asm/intel-family.h 2 | # SPR EMR GNR_X GNR_D SRF CWF 3 | 06:8f cf ad ae af dd 4 | -------------------------------------------------------------------------------- /BM/instruction-check/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" 3 | PARENT_DIR="$(dirname "$SCRIPT_DIR")" 4 | cd "$PARENT_DIR/tools" || exit 1 5 | make -------------------------------------------------------------------------------- /BM/pmu/tests_3fix_counters: -------------------------------------------------------------------------------- 1 | # This file collects the CWF 3 new Fix counters test cases 2 | pmu_tests.sh -t counting 3 | pmu_tests.sh -t sampling 4 | pmu_tests.sh -t counting_multi 5 | -------------------------------------------------------------------------------- /BM/adaptation/centos/install_local.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" 4 | 5 | while read -r line; do yum install -y $line; done < ${SCRIPT_DIR}/packages 6 | -------------------------------------------------------------------------------- /BM/adaptation/debian/install_local.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" 4 | 5 | while read -r line; do apt-get install -y $line; done < ${SCRIPT_DIR}/packages 6 | -------------------------------------------------------------------------------- /BM/splitlock/tests: -------------------------------------------------------------------------------- 1 | # This file collects the split lock feature tests on 2 | # Intel® Architecture-based platforms. 3 | 4 | split_lock.sh -t sl_on_default 5 | split_lock.sh -t check_ac_dmesg 6 | -------------------------------------------------------------------------------- /BM/edac/tests: -------------------------------------------------------------------------------- 1 | # This file collects Intel EDAC driver testcases which can run against 2 | # on Intel 10nm series server 3 | 4 | intel_edac.sh -t check_edac_bus 5 | intel_edac.sh -t check_edac_driver 6 | -------------------------------------------------------------------------------- /BM/telemetry/Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # Copyright (c) 2022 Intel Corporation. 3 | 4 | all: 5 | gcc telemetry_tests.c -m64 -o telemetry_tests 6 | 7 | clean: 8 | rm -rf telemetry_tests 9 | -------------------------------------------------------------------------------- /BM/th/Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # Copyright (c) 2022 Intel Corporation. 3 | 4 | all: 5 | gcc -ggdb -Wall -fstack-protector-all th_test.c -o th_test 6 | 7 | clean: 8 | rm -rf th_test 9 | -------------------------------------------------------------------------------- /scenario/cwf-oa/tests-edac: -------------------------------------------------------------------------------- 1 | # This file collects Intel EDAC driver testcases which can run against 2 | # on Intel 10nm series server 3 | 4 | intel_edac.sh -t check_edac_bus 5 | intel_edac.sh -t check_edac_driver 6 | -------------------------------------------------------------------------------- /scenario/emr-ov/tests-edac: -------------------------------------------------------------------------------- 1 | # This file collects Intel EDAC driver testcases which can run against 2 | # on Intel 10nm series server 3 | 4 | intel_edac.sh -t check_edac_bus 5 | intel_edac.sh -t check_edac_driver 6 | -------------------------------------------------------------------------------- /scenario/gnr-ov/tests-edac: -------------------------------------------------------------------------------- 1 | # This file collects Intel EDAC driver testcases which can run against 2 | # on Intel 10nm series server 3 | 4 | intel_edac.sh -t check_edac_bus 5 | intel_edac.sh -t check_edac_driver 6 | -------------------------------------------------------------------------------- /BM/pmu/tests_arch_perfmon_v6: -------------------------------------------------------------------------------- 1 | # This file collects the ARCH PerfMon v6 test cases 2 | pmu_tests.sh -t bitmap_6 3 | pmu_tests.sh -t umask2_cpuid 4 | pmu_tests.sh -t zbit_cpuid 5 | pmu_tests.sh -t umask2 6 | pmu_tests.sh -t zbit 7 | -------------------------------------------------------------------------------- /scenario/cwf-oa/tests-pmu: -------------------------------------------------------------------------------- 1 | # This file collects the PMU cases for CWF platform 2 | # PMU core 3 | pmu_tests.sh -t basic 4 | # PMU uncore 5 | pmu_tests.sh -t uncore 6 | pmu_tests.sh -t uncore_dmesg 7 | pmu_tests.sh -t uncore_events 8 | -------------------------------------------------------------------------------- /BM/idxd/guest_tests: -------------------------------------------------------------------------------- 1 | ./intr.guest_test.sh -x INTR_PT_DSA_DWQ_1 -r /home/rex/gnr-bkc-centos-stream-9-coreserver-6.6-9.3-15.img 2 | ./intr.guest_test.sh -x INTR_PT_DSA_SWQ_1 -r /home/rex/gnr-bkc-centos-stream-9-coreserver-6.6-9.3-15.img 3 | -------------------------------------------------------------------------------- /BM/lass/Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # Copyright (c) 2024 Intel Corporation. 3 | 4 | CC = gcc 5 | TARGET = lass 6 | 7 | $(TARGET): lass.c 8 | $(CC) -o $@ $< 9 | 10 | clean: 11 | rm -f $(TARGET) 12 | -------------------------------------------------------------------------------- /BM/tools/pcie/Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # Copyright (c) 2023 Intel Corporation. 3 | 4 | BIN := pcie_check 5 | 6 | all: $(BIN) 7 | 8 | $(all): 9 | gcc $^ -o $@ 10 | 11 | clean: 12 | rm -rf $(BIN) 13 | -------------------------------------------------------------------------------- /BM/amx/guest-tests: -------------------------------------------------------------------------------- 1 | ./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t legacy -e amx -f amx -x TMUL_1 -c " " -p off 2 | ./guest-test/guest.test_launcher.sh -v 1 -s 1 -m 1 -d on -t tdx -e amx -f amx -x TMUL_1 -c "accept_memory=lazy" -p off -------------------------------------------------------------------------------- /BM/cet/.gitignore: -------------------------------------------------------------------------------- 1 | cet_app 2 | glibc_shstk_test 3 | glibc_supported_shstk_test 4 | quick_test 5 | shstk_alloc 6 | shstk_cp 7 | shstk_cpu 8 | shstk_cpu_legacy 9 | shstk_huge_page 10 | shstk_unlock_test 11 | test_shadow_stack 12 | wrss 13 | -------------------------------------------------------------------------------- /BM/splitlock/Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # Copyright (c) 2022 Intel Corporation. 3 | 4 | BIN := sl_test 5 | 6 | all: $(BIN) 7 | 8 | sl_test: sl_test.c 9 | gcc $^ -o $@ 10 | 11 | clean: 12 | rm -rf $(BIN) *.o 13 | -------------------------------------------------------------------------------- /BM/avx512vbmi/Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # Copyright (c) 2022 Intel Corporation. 3 | 4 | BIN := vbmi_test 5 | 6 | all: $(BIN) 7 | 8 | vbmi_test: vbmi_test.c 9 | $(CC) -o $@ $^ 10 | 11 | clean: 12 | rm -rf $(BIN) *.o 13 | -------------------------------------------------------------------------------- /BM/cmpccxadd/Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # Copyright (c) 2024 Intel Corporation. 3 | 4 | CC = gcc 5 | CFLAGS = -g -Wall 6 | TARGET = cmpccxadd 7 | 8 | $(TARGET): cmpccxadd.c 9 | $(CC) $(CFLAGS) -o $@ $< 10 | 11 | clean: 12 | rm -f $(TARGET) -------------------------------------------------------------------------------- /BM/lam/tests: -------------------------------------------------------------------------------- 1 | # This file collects the LAM cases 2 | lam -t 0x1 # malloc 3 | lam -t 0x2 # max_bits 4 | lam -t 0x4 # mmap 5 | lam -t 0x8 # syscall 6 | lam -t 0x10 # io_uring 7 | lam -t 0x20 # inherit 8 | lam -t 0x40 # pasid 9 | lam -t 0x80 # cpuid 10 | -------------------------------------------------------------------------------- /BM/telemetry/tests: -------------------------------------------------------------------------------- 1 | # This file collects the telemetry cases 2 | telemetry_tests.sh -t pci 3 | telemetry_tests.sh -t telem_driver 4 | telemetry_tests.sh -t telem_sysfs 5 | telemetry_tests.sh -t telem_dev 6 | telemetry_tests.sh -t telem_sysfs_common 7 | telemetry_tests.sh -t telem_data 8 | -------------------------------------------------------------------------------- /BM/lam/Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # Copyright (c) 2024 Intel Corporation. 3 | 4 | CC = gcc 5 | CFLAGS = -D_GNU_SOURCE -lpthread -m64 -O2 6 | TARGET = lam 7 | 8 | $(TARGET): lam.c 9 | $(CC) $(CFLAGS) -o $@ $< 10 | 11 | clean: 12 | rm -f $(TARGET) 13 | -------------------------------------------------------------------------------- /BM/dsa/tests: -------------------------------------------------------------------------------- 1 | # This file collects the DSA feature tests on 2 | # Intel® Architecture-based platforms. 3 | 4 | # DSA basic tests, it works on SPR(Sapphire Rapids) platform and future server 5 | dsa_user.sh -t check_dsa_driver 6 | dsa_user.sh -t check_dsa0_device 7 | dsa_user.sh -t check_shared_mode 8 | -------------------------------------------------------------------------------- /scenario/emr-oa/tests-telemetry: -------------------------------------------------------------------------------- 1 | # This file collects the telemetry cases 2 | telemetry_tests.sh -t pci 3 | telemetry_tests.sh -t telem_driver 4 | telemetry_tests.sh -t telem_sysfs 5 | telemetry_tests.sh -t telem_dev 6 | telemetry_tests.sh -t telem_sysfs_common 7 | telemetry_tests.sh -t telem_data 8 | -------------------------------------------------------------------------------- /BM/tdx-guest/tdx_halt_test_module/Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | 3 | MODULES = halt_test.ko 4 | 5 | obj-m += halt_test.o 6 | 7 | KDIR ?= /lib/modules/$(shell uname -r)/build 8 | 9 | all: 10 | make -C $(KDIR) M=$(PWD) modules 11 | clean: 12 | make -C $(KDIR) M=$(PWD) clean -------------------------------------------------------------------------------- /BM/thermal/tests: -------------------------------------------------------------------------------- 1 | # This file collects thermal throttling and interrupts for x86_pkg_temp 2 | # thermal zone which is supported on Intel® Architecture-based platforms. 3 | # @hw_dep: 4 | # @other_dep: 5 | # @other_warn: 6 | 7 | thermal_test.sh -t check_thermal_throttling 8 | thermal_test.sh -t check_pkg_interrupts 9 | -------------------------------------------------------------------------------- /BM/pmu/README.md: -------------------------------------------------------------------------------- 1 | # PMU and adaptive PEBS basic functional check 2 | 3 | ## Usage 4 | 5 | 1. Make sure latest perf is there. 6 | 2. Run case as 7 | ``` 8 | ./pmu_tests.sh -t 9 | ./apebs_tests.sh -t 10 | ``` 11 | 12 | ## Expected result 13 | 14 | All test results should show pass, no fail. 15 | -------------------------------------------------------------------------------- /BM/tools/cpuid_check/Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # Copyright (c) 2023 Intel Corporation. 3 | 4 | BIN := cpuid_check 5 | 6 | all: $(BIN) 7 | 8 | install: 9 | install cpuid_check /usr/local/bin/ 10 | 11 | cpuid_check: cpuid_check.c 12 | gcc $^ -o $@ 13 | 14 | clean: 15 | rm -rf $(BIN) 16 | -------------------------------------------------------------------------------- /BM/pmu/tests: -------------------------------------------------------------------------------- 1 | # This file collects the PMU cases 2 | pmu_tests.sh -t basic 3 | pmu_tests.sh -t uncore 4 | apebs_tests.sh -t lbr_1 -w 1 5 | apebs_tests.sh -t lbr_2 -w 1 6 | apebs_tests.sh -t xmm_1 -w 1 7 | apebs_tests.sh -t xmm_2 -w 1 8 | apebs_tests.sh -t ip_1 -w 1 9 | apebs_tests.sh -t ip_2 -w 1 10 | apebs_tests.sh -t data_src -w 1 11 | -------------------------------------------------------------------------------- /BM/dsa/tests-dsa2: -------------------------------------------------------------------------------- 1 | #DSA_XS_FUNC_USER_TRANSLFETCH_1D2G2Q 2 | dsa_user_test.sh -c 1d2g2q_user -o 0xa 3 | #DSA_XS_FUNC_USER_TRANSLFETCH_1D4G8Q 4 | dsa_user_test.sh -c 1d4g8q_user -o 0xa 5 | #DSA_XS_FUNC_USER_DIXGEN_1D2G2Q 6 | dsa_user_test.sh -c 1d2g2q_user -o 0x17 7 | #DSA_XS_FUNC_USER_DIXGEN_1D4G8Q 8 | dsa_user_test.sh -c 1d4g8q_user -o 0x17 9 | -------------------------------------------------------------------------------- /scenario/emr-ov/tests-pmu: -------------------------------------------------------------------------------- 1 | # This file collects the PMU cases 2 | pmu_tests.sh -t basic 3 | pmu_tests.sh -t uncore 4 | apebs_tests.sh -t lbr_1 -w 1 5 | apebs_tests.sh -t lbr_2 -w 1 6 | apebs_tests.sh -t xmm_1 -w 1 7 | apebs_tests.sh -t xmm_2 -w 1 8 | apebs_tests.sh -t ip_1 -w 1 9 | apebs_tests.sh -t ip_2 -w 1 10 | apebs_tests.sh -t data_src -w 1 11 | -------------------------------------------------------------------------------- /scenario/gnr-ov/tests-pmu: -------------------------------------------------------------------------------- 1 | # This file collects the PMU cases 2 | pmu_tests.sh -t basic 3 | pmu_tests.sh -t uncore 4 | apebs_tests.sh -t lbr_1 -w 1 5 | apebs_tests.sh -t lbr_2 -w 1 6 | apebs_tests.sh -t xmm_1 -w 1 7 | apebs_tests.sh -t xmm_2 -w 1 8 | apebs_tests.sh -t ip_1 -w 1 9 | apebs_tests.sh -t ip_2 -w 1 10 | apebs_tests.sh -t data_src -w 1 11 | -------------------------------------------------------------------------------- /BM/pmu/tests_arch_pebs: -------------------------------------------------------------------------------- 1 | # This file collects the ARCH PBES test cases 2 | pmu_tests.sh -t arch_pebs_cpuid 3 | pmu_tests.sh -t arch_pebs_gp_reg_group 4 | pmu_tests.sh -t arch_pebs_xer_group 5 | pmu_tests.sh -t arch_pebs_counter_group 6 | pmu_tests.sh -t arch_pebs_counter_group_stress 7 | pmu_tests.sh -t arch_pebs_gp_counter 8 | pmu_tests.sh -t arch_pebs_basic_group 9 | -------------------------------------------------------------------------------- /BM/idxd/remove_iaa_crypto.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | iaa_dev_id="0cfe" 4 | num_iaa=$(lspci -d:${iaa_dev_id} | wc -l) 5 | 6 | for ((i = 1; i < num_iaa * 2; i += 2)); do 7 | echo disable wq iax${i}/wq${i}.0 8 | accel-config disable-wq iax${i}/wq${i}.0 9 | echo disable iaa iax${i} 10 | accel-config disable-device iax${i} 11 | done 12 | 13 | rmmod iaa_crypto 14 | -------------------------------------------------------------------------------- /BM/amx/Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0 2 | CFLAG = -O2 -W -Wall -g -fno-strict-aliasing 3 | LIBS = -lpthread 4 | CC = gcc 5 | BIN_AMX = tmul 6 | CFILES_AMX = tmul.c 7 | 8 | all: 9 | $(CC) $(CFLAG) $(CFILES_AMX) -o $(BIN_AMX) $(LIBS) 10 | 11 | fp16: CFLAG += -g -DFP16 12 | fp16: all 13 | 14 | clean: 15 | -rm $(BIN_AMX) 16 | 17 | .PHONY: clean 18 | 19 | -------------------------------------------------------------------------------- /BM/fred/tests: -------------------------------------------------------------------------------- 1 | # This file collects the FRED cases 2 | # @hw_dep: cpuid_check 7 0 1 0 a 17 @ CPU doesn't support FRED CPUID.(EAX=07H,ECX=01H):EAX[bit 17] 3 | # @other_dep: general_test.sh -t kconfig -k "CONFIG_X86_FRED=y" @ No kconfig CONFIG_X86_FRED=y 4 | fred_test.sh -t cmdline 5 | fred_test.sh -t dmesg 6 | fred_test.sh -t cpuid 7 | fred_test.sh -t cpuinfo 8 | fred_test.sh -t lkgs 9 | -------------------------------------------------------------------------------- /BM/tdx-osv-sanity/common.json: -------------------------------------------------------------------------------- 1 | { 2 | "bios_img": "/path/to/EDKII/OVMF.fd or other virtual BIOS", 3 | "qemu_img": "/path/to/qemu-kvm with proper capabilty of VM test", 4 | "guest_img": "/path/to/prepared/guest_os_image, in qcow2 or raw image format", 5 | "guest_img_format": "raw or qcow2", 6 | "boot_pattern": "*Kernel*on*an*x86_64*", 7 | "guest_root_passwd": "123456" 8 | } -------------------------------------------------------------------------------- /BM/dma/tests: -------------------------------------------------------------------------------- 1 | # @name DMATEST 2 | # @desc DMATEST uses dmatest.ko module to runs tests on all available dma channels 3 | # @requires dmatest 4 | 5 | dma_test.sh -l 1 -p 1 -i 100 -b 32 -c "" 6 | dma_test.sh -l 1 -p 1 -i 100 -b 4096 -c "" 7 | dma_test.sh -l 10 -p 1 -i 1000 -b 32 -c "" 8 | dma_test.sh -l 10 -p 1 -i 1000 -b 4096 -c "" 9 | dma_test.sh -l 1 -p 1 -i 1000 -b 409600 -c "" 10 | -------------------------------------------------------------------------------- /BM/tpm/test_smoke.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) 3 | 4 | # Kselftest framework requirement - SKIP code is 4. 5 | ksft_skip=4 6 | 7 | [ -e /dev/tpm0 ] || exit $ksft_skip 8 | 9 | # shellcheck disable=SC3028,SC3054 10 | TPM_ROOT=$(realpath "$(dirname "${BASH_SOURCE[0]}")") 11 | export PYTHONPATH="$TPM_ROOT" 12 | python3 -m unittest -v tpm2_tests.SmokeTest 13 | -------------------------------------------------------------------------------- /BM/tpm/test_space.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) 3 | 4 | # Kselftest framework requirement - SKIP code is 4. 5 | ksft_skip=4 6 | 7 | [ -e /dev/tpmrm0 ] || exit $ksft_skip 8 | 9 | # shellcheck disable=SC3028,SC3054 10 | TPM_ROOT=$(realpath "$(dirname "${BASH_SOURCE[0]}")") 11 | export PYTHONPATH="$TPM_ROOT" 12 | python3 -m unittest -v tpm2_tests.SpaceTest 13 | -------------------------------------------------------------------------------- /BM/nmis/tests: -------------------------------------------------------------------------------- 1 | # This file collects the FRED cases 2 | # @hw_dep: cpuid_check 7 0 1 0 a 17 @ CPU doesn't support FRED CPUID.7.1.EAX[17] 3 | # @hw_dep: cpuid_check 7 0 1 0 a 20 @ CPU doesn't support NMI SOURCE CPUID.7.1.EAX[20] 4 | # @other_dep: general_test.sh -t kconfig -k "CONFIG_X86_FRED=y" @ No kconfig CONFIG_X86_FRED=y 5 | nmis_test.sh -t enabling 6 | nmis_test.sh -t ipi 7 | nmis_test.sh -t pmi 8 | nmis_test.sh -t ipi_bt 9 | -------------------------------------------------------------------------------- /BM/.env: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # SPDX-License-Identifier: GPL-2.0-only 3 | # Copyright (c) 2022 Intel Corporation. 4 | 5 | lkvs_root=$(realpath "$(dirname "${BASH_SOURCE[0]}")") 6 | 7 | if [[ -z "$path_exported" ]]; then 8 | NEW_PATH="$PATH":$(find "$lkvs_root" -type d -not -path '*.git*' | tr "\n" ":") 9 | NEW_PATH=${NEW_PATH%:} 10 | export PATH="$NEW_PATH" 11 | source common.sh 12 | path_exported=1 13 | fi 14 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | Intel is committed to rapidly addressing security vulnerabilities affecting our customers and providing clear guidance on the solution, impact, severity and mitigation. 3 | 4 | ## Reporting a Vulnerability 5 | Please report any security vulnerabilities in this project utilizing the guidelines [here](https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html). 6 | -------------------------------------------------------------------------------- /BM/tpm/test_async.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) 3 | 4 | # Kselftest framework requirement - SKIP code is 4. 5 | ksft_skip=4 6 | 7 | [ -e /dev/tpm0 ] || exit $ksft_skip 8 | [ -e /dev/tpmrm0 ] || exit $ksft_skip 9 | 10 | # shellcheck disable=SC3028,SC3054 11 | TPM_ROOT=$(realpath "$(dirname "${BASH_SOURCE[0]}")") 12 | export PYTHONPATH="$TPM_ROOT" 13 | python3 -m unittest -v tpm2_tests.AsyncTest 14 | -------------------------------------------------------------------------------- /scenario/srf-oe/tests-lam: -------------------------------------------------------------------------------- 1 | # This file collects the LAM(Linear Address Masking) tests on 2 | # Intel® Architecture-based platforms. 3 | # @hw_dep: cpuid_check 7 1 0 0 a 26 @ CPU support LAM 4 | 5 | # malloc 6 | lam -t 0x1 7 | # max_bits 8 | lam -t 0x2 9 | # mmap 10 | lam -t 0x4 11 | # syscall 12 | lam -t 0x8 13 | # io_uring 14 | lam -t 0x10 15 | # inherit 16 | lam -t 0x20 17 | # pasid 18 | lam -t 0x40 19 | # cpuid 20 | lam -t 0x80 21 | 22 | -------------------------------------------------------------------------------- /BM/guest-test/common.json: -------------------------------------------------------------------------------- 1 | { 2 | "kernel_img": "/boot/vmlinuz-xxx-yyy", 3 | "initrd_img": "/boot/initramfs-xxx-yyy", 4 | "bios_img": "/path/to/EDKII/OVMF.fd or other virtual BIOS", 5 | "qemu_img": "/path/to/qemu-kvm with proper capabilty of VM test", 6 | "guest_img": "/path/to/prepared/guest_os_image, in qcow2 or raw image format", 7 | "guest_img_format": "raw", 8 | "boot_pattern": "*Kernel*on*an*x86_64*", 9 | "guest_root_passwd": "123456" 10 | } -------------------------------------------------------------------------------- /BM/tdx-compliance/tests-trigger-cpuid.sh: -------------------------------------------------------------------------------- 1 | ##!/bin/bash 2 | # Some examples on how to trigger the cpuid and capture #VE. 3 | # Register the kretprobe. 4 | echo kretprobe > /sys/kernel/debug/tdx/tdx-tests 5 | 6 | # Trigger the cpuid and capture #VE. The captured information is printed in dmesg. 7 | echo trigger_cpuid 0x1f 0x0 0x0 0x0 > /sys/kernel/debug/tdx/tdx-tests 8 | 9 | # Unregister the kretprobe. 10 | echo unregister > /sys/kernel/debug/tdx/tdx-tests 11 | -------------------------------------------------------------------------------- /BM/pcie/tests: -------------------------------------------------------------------------------- 1 | # This file collects PCIe tests on Intel® Architecture-based platforms. 2 | # @other_dep: ls tools/pcie/pcie_check || ls ../tools/pcie/pcie_check @BM/tools/pcie/pcie_check binary not available, please compile it before test 3 | 4 | # case info: PCIe gen4 device capability check 5 | pcie_check.sh gen4 6 | # case info: PCIe gen5 device capability check 7 | pcie_check.sh gen5 8 | # case info: PCIe gen6 device capability check 9 | pcie_check.sh gen6 10 | -------------------------------------------------------------------------------- /BM/tpm/tests: -------------------------------------------------------------------------------- 1 | # This file collects Intel TPM(Trust Platform Module) tests on 2 | # Intel® Architecture-based platforms. 3 | # @hw_dep: [ -e "/dev/tpm0" ] @ No /dev/tpm0 device node to support TPM 4 | # @other_dep: general_test.sh -t kconfig -k "CONFIG_TCG_TPM=y" @ No TPM kconfig CONFIG_TCG_TPM=y 5 | # @other_warn: [ -e "/dev/tpmrm0" ] @ No /dev/tpmrm0 device node test_async.sh will skip with return 4 6 | 7 | test_smoke.sh 8 | test_space.sh 9 | test_async.sh 10 | -------------------------------------------------------------------------------- /BM/tools/cpuid_check/README.md: -------------------------------------------------------------------------------- 1 | # cpuid_check tool 2 | 3 | ``` 4 | CPUID is an instruction from Intel x86 CPU. 5 | For more details about CPUID, please check out the Intel SDM link below: 6 | Volume2 -> 3.3 INSTRUCTIONS (A-L) -> CPUID—CPU Identification 7 | ``` 8 | https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html 9 | 10 | ``` 11 | This tool follows SDM to determine the cpuid result so that it can be used 12 | by other apps. 13 | ``` 14 | -------------------------------------------------------------------------------- /.github/scripts/build_check: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # SPDX-License-Identifier: GPL-2.0-only 3 | 4 | set -oe pipefail 5 | 6 | wpattern=" warning: " 7 | logfile="build.log" 8 | 9 | docker run -v "$(pwd)"/BM:/src builder make test | tee "$logfile" 10 | 11 | if grep "$wpattern" "$logfile"; then 12 | echo "===========================================" 13 | echo "There are build warning(s), fix required!" 14 | echo "===========================================" 15 | false 16 | fi 17 | -------------------------------------------------------------------------------- /BM/xsave/xstate_helpers.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | // Copyright (c) 2022 Intel Corporation. 3 | 4 | #include 5 | 6 | extern void fill_fp_mxcsr_xstate_buf(void *buf, uint32_t xfeature_num, 7 | uint8_t ui8_fp); 8 | extern bool xstate_sig_handle(void *valid_xbuf, void *compared_xbuf, 9 | uint64_t mask, uint32_t xstate_size); 10 | extern bool xstate_fork(void *valid_xbuf, void *compared_xbuf, 11 | uint64_t mask, uint32_t xstate_size); 12 | -------------------------------------------------------------------------------- /BM/ras/Makefile: -------------------------------------------------------------------------------- 1 | SUBDIRS := mce-test ras-tools mcelog 2 | 3 | .PHONY: all 4 | all: $(SUBDIRS) 5 | 6 | .PHONY: $(SUBDIRS) 7 | $(SUBDIRS): 8 | $(MAKE) -C $@ 9 | 10 | .PHONY: install 11 | install: 12 | for dir in $(SUBDIRS); do \ 13 | if [ "$$dir" = "mce-test" ]; then \ 14 | $(MAKE) -C $$dir install; \ 15 | else \ 16 | echo "Skipping install in $$dir"; \ 17 | fi \ 18 | done 19 | 20 | .PHONY: clean 21 | clean: 22 | for dir in $(SUBDIRS); do \ 23 | $(MAKE) -C $$dir clean; \ 24 | done -------------------------------------------------------------------------------- /BM/tdx-compliance/Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | 3 | MODULES = tdx-compliance.ko 4 | 5 | obj-m += tdx-compliance.o 6 | 7 | # Add other source files if needed 8 | tdx-compliance-objs := tdx-compliance-main.o tdcall.o tdxcall.o 9 | 10 | ifeq ($(KERNEL_SRC),) 11 | KDIR ?= /lib/modules/$(shell uname -r)/build 12 | else 13 | KDIR ?= $(abspath $(KERNEL_SRC)) 14 | endif 15 | 16 | all: 17 | make -C $(KDIR) M=$(PWD) modules 18 | 19 | clean: 20 | @make -C $(KDIR) M=$(PWD) clean 21 | 22 | 23 | -------------------------------------------------------------------------------- /KVM/qemu/vsock_test.cfg: -------------------------------------------------------------------------------- 1 | - vsock_test: 2 | no Windows 3 | type = vsock_test 4 | vsocks = vhost_vsock0 5 | vsock_test_tool = ncat 6 | auto_cpu_model = "no" 7 | cpu_model = host 8 | RHEL.7, RHEL.8: 9 | vsock_test_tool = nc_vsock 10 | # TODO: Work out a python version nc-vsock and use the APIs directly 11 | variants: 12 | - vm: 13 | - tdvm: 14 | machine_type_extra_params = "kernel-irqchip=split" 15 | vm_secure_guest_type = tdx 16 | -------------------------------------------------------------------------------- /BM/xsave/Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # Copyright (c) 2022 Intel Corporation. 3 | 4 | BIN := xstate_64 5 | 6 | CFLAGS += -O2 -g -std=gnu99 -pthread -Wall -no-pie 7 | NO_FPU_FLAG += -mno-sse -mno-mmx -mno-sse2 -mno-avx -mno-pku 8 | 9 | all: $(BIN) 10 | 11 | xstate_64: xstate.c 12 | gcc $(CFLAGS) $(NO_FPU_FLAG) -c -o xstate_helpers.o xstate_helpers.c 13 | gcc -m64 -o $@ -O2 $(CFLAGS) -DCAN_BUILD_32 -DCAN_BUILD_64 $^ xstate_helpers.o -lrt -ldl 14 | 15 | clean: 16 | rm -rf $(BIN) *.o 17 | -------------------------------------------------------------------------------- /BM/umip/tests: -------------------------------------------------------------------------------- 1 | # This file collects the UMIP(User Mode Instruction Prevention) tests on 2 | # Intel® Architecture-based platforms. 3 | # @hw_dep: cpuid_check 7 0 0 0 c 2 4 | # @other_dep: general_test.sh -t kconfig -k "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y" 5 | # @other_warn: 6 | 7 | # Most of the Linux OS will not support 32bit, comment umip_exceptions_32 as default 8 | #umip_exceptions_32 a 9 | umip_exceptions_64 a 10 | # Test sgdt sidt sldt smsw str should trigger #GP in proper kernel 11 | umip_test_basic_64 a 12 | -------------------------------------------------------------------------------- /BM/lass/tests: -------------------------------------------------------------------------------- 1 | # This file collects the LASS cases 2 | # Test get vsyscall address maps.[negative] 3 | lass m 4 | # Test execute vsyscall addr 0xffffffffff600000.[negative] 5 | lass d 6 | # Test call vsyscall 7 | lass g 8 | # Test call vsyscall api gettimeofday 9 | lass t 10 | # Test read vsyscall 0xffffffffff600000.[negative] 11 | lass r 12 | # Test read random kernel space.[negative] 13 | lass i 14 | # Test process_vm_readv read address 0xffffffffff600000.[negative] 15 | lass v 16 | # Test vsyscall emulation. 17 | lass e 18 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "BM/tools/idxd-config"] 2 | path = BM/tools/idxd-config 3 | url = https://github.com/intel/idxd-config.git 4 | active = true 5 | branch = stable 6 | [submodule "BM/ras/mce-test"] 7 | path = BM/ras/mce-test 8 | url = https://github.com/laifryiee/mce-test.git 9 | [submodule "BM/ras/ras-tools"] 10 | path = BM/ras/ras-tools 11 | url = https://git.kernel.org/pub/scm/linux/kernel/git/aegl/ras-tools.git 12 | [submodule "BM/ras/mcelog"] 13 | path = BM/ras/mcelog 14 | url = https://github.com/andikleen/mcelog.git 15 | -------------------------------------------------------------------------------- /BM/adaptation/centos/README.md: -------------------------------------------------------------------------------- 1 | ## Build CentOS 9 Stream docker 2 | 3 | ```bash 4 | docker build --build-arg PROXY=$http_proxy -f Dockerfile.build -t centos9 5 | ``` 6 | 7 | PROXY is optional, if you are behind a proxy, you can pass it to the build command. 8 | 9 | 10 | ## Run the Debian 12 docker 11 | 12 | ```bash 13 | docker run -it --privileged -v /:/host_fs --mount type=bind,source=/dev,target=/dev localhost/centos:stream9 /bin/bash 14 | ``` 15 | 16 | ## Install dependencies locally 17 | 18 | ```bash 19 | ./install_local.sh 20 | 21 | ``` 22 | -------------------------------------------------------------------------------- /scenario/emr-oe/tests-topology: -------------------------------------------------------------------------------- 1 | # This file collects basic cases which verify CPU Topology 2 | # on Intel® Architecture-based server platforms. 3 | # @hw_dep: 4 | # @other_dep: 5 | # @other_warn: which cpuid 2>/dev/null @ cpuid tool is required 6 | # @other_warn: which lstopo 2>/dev/null @ Please install hwloc-gui.x86_64 package or hwloc.x86_64 to get lstopo tool 7 | 8 | cpu_topology.sh -t verify_thread_per_core 9 | cpu_topology.sh -t verify_cores_per_socket 10 | cpu_topology.sh -t verify_level_type 11 | cpu_topology.sh -t verify_sched_domain_names 12 | -------------------------------------------------------------------------------- /scenario/spr-oe/tests-topology: -------------------------------------------------------------------------------- 1 | # This file collects basic cases which verify CPU Topology 2 | # on Intel® Architecture-based server platforms. 3 | # @hw_dep: 4 | # @other_dep: 5 | # @other_warn: which cpuid 2>/dev/null @ cpuid tool is required 6 | # @other_warn: which lstopo 2>/dev/null @ Please install hwloc-gui.x86_64 package or hwloc.x86_64 to get lstopo tool 7 | 8 | cpu_topology.sh -t verify_thread_per_core 9 | cpu_topology.sh -t verify_cores_per_socket 10 | cpu_topology.sh -t verify_level_type 11 | cpu_topology.sh -t verify_sched_domain_names 12 | -------------------------------------------------------------------------------- /KVM/qemu/tdx_max_guests.cfg: -------------------------------------------------------------------------------- 1 | - tdx_max_guests: 2 | virt_test_type = qemu 3 | type = tdx_max_guests 4 | vm_accelerator = kvm 5 | machine_type_extra_params = "kernel-irqchip=split" 6 | vm_secure_guest_type = tdx 7 | image_snapshot = yes 8 | start_vm = no 9 | vga = std 10 | auto_cpu_model = "no" 11 | cpu_model = host 12 | msr_pkg = "msr-tools" 13 | rdmsr_cmd = "rdmsr 0x00000087" 14 | variants: 15 | - max: 16 | - out_max: 17 | overrange_tdx_kids = "yes" 18 | xfail = "yes" 19 | -------------------------------------------------------------------------------- /BM/adaptation/debian/README.md: -------------------------------------------------------------------------------- 1 | ## Build Debian 12 docker 2 | 3 | ```bash 4 | docker build --build-arg PROXY=$http_proxy -f /Dockerfile.build -t debian 5 | ``` 6 | 7 | PROXY is optional, if you are behind a proxy, you can pass it to the build command. 8 | 9 | 10 | ## Run the Debian 12 docker 11 | 12 | ```bash 13 | docker run -it --rm --privileged -v ~:/host_root --mount type=bind,source=/dev,target=/dev localhost/debian:latest /bin/bash 14 | ``` 15 | 16 | ## Install dependencies locally 17 | 18 | ```bash 19 | ./install_local.sh 20 | 21 | ``` 22 | -------------------------------------------------------------------------------- /BM/tdx-osv-sanity/2.1.1.4-tests: -------------------------------------------------------------------------------- 1 | # Create TDX guest with default qemu config and check TSC value on guest 2 | guest.test_launcher.sh -v 1 -s 1 -m 4 -d on -t tdx -e tdx-osv-sanity -f tdx_osv_sanity -x TD_TSC_DEFAULT -p off -i "../tdx-osv-sanity/common.json" -j "../tdx-osv-sanity/qemu.config.default.json" 3 | # Create TDX guest with tsc-freq specified qemu config and check TSC value on guest 4 | guest.test_launcher.sh -v 1 -s 1 -m 4 -d on -t tdx -e tdx-osv-sanity -f tdx_osv_sanity -x TD_TSC_CONFIG -p off -i "../tdx-osv-sanity/common.json" -j "../tdx-osv-sanity/qemu.config.tsc.json" -------------------------------------------------------------------------------- /BM/topology/tests-client: -------------------------------------------------------------------------------- 1 | # This file collects basic cases which verify CPU Topology 2 | # on Intel® Architecture-based client platforms. 3 | # @hw_dep: 4 | # @other_dep: 5 | # @other_warn: which cpuid 2>/dev/null @ cpuid tool is required 6 | # @other_warn: which lstopo 2>/dev/null @ Please install hwloc-gui.x86_64 package to get lstopo tool 7 | 8 | cpu_topology.sh -t verify_thread_per_core 9 | cpu_topology.sh -t verify_cores_per_socket 10 | cpu_topology.sh -t verify_socket_num 11 | cpu_topology.sh -t verify_level_type 12 | cpu_topology.sh -t verify_sched_domain_names 13 | -------------------------------------------------------------------------------- /BM/tdx-compliance/testallcase.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | case=("msr" "cr" "cpuid" "all") 3 | ver=("1.0" "1.5" "2.0") 4 | 5 | # store test results to a specified folder 6 | script_dir=$(dirname "$0") 7 | result_dir="$script_dir/result" 8 | 9 | if [ ! -d "$result_dir" ]; then 10 | mkdir "$result_dir" 11 | fi 12 | 13 | for c in "${case[@]}"; do 14 | for v in "${ver[@]}"; do 15 | echo $c $v > /sys/kernel/debug/tdx/tdx-tests 16 | OUTPUT="${c}_${v}" 17 | echo "CMD:${c} ${v}" 18 | 19 | cat "/sys/kernel/debug/tdx/tdx-tests" > "${result_dir}/$OUTPUT" 20 | done 21 | done 22 | -------------------------------------------------------------------------------- /scenario/gnr-oe/tests-topology: -------------------------------------------------------------------------------- 1 | # This file collects basic cases which verify CPU Topology 2 | # on Intel® Architecture-based server platforms. 3 | # @hw_dep: 4 | # @other_dep: 5 | # @other_warn: which cpuid 2>/dev/null @ cpuid tool is required 6 | # @other_warn: which lstopo 2>/dev/null @ Please install hwloc.x86_64 package to get lstopo tool 7 | 8 | cpu_topology.sh -t verify_thread_per_core 9 | cpu_topology.sh -t verify_cores_per_socket 10 | cpu_topology.sh -t verify_socket_num 11 | cpu_topology.sh -t verify_level_type 12 | cpu_topology.sh -t verify_sched_domain_names 13 | -------------------------------------------------------------------------------- /BM/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # 3 | # Copyright (c) 2024 Intel Corporation. 4 | # Haoliang Zhu 5 | 6 | cmake_minimum_required(VERSION 3.12) 7 | project(lkvs) 8 | 9 | set(SUBFOLDER amx avx512vbmi cet cmpccxadd pt 10 | splitlock telemetry th tools/cpuid_check 11 | tools/pcie umip workload-xsave xsave) 12 | 13 | foreach(subfolder ${SUBFOLDER}) 14 | message(STATUS "Start build ${subfolder}.") 15 | add_subdirectory(${subfolder}) 16 | message(STATUS "Finish build ${subfolder}.") 17 | endforeach() 18 | -------------------------------------------------------------------------------- /scenario/cwf-ov/tests-topology: -------------------------------------------------------------------------------- 1 | # This file collects basic cases which verify CPU Topology 2 | # on Intel® Architecture-based server platforms. 3 | # @hw_dep: 4 | # @other_dep: 5 | # @other_warn: which cpuid 2>/dev/null @ cpuid tool is required 6 | # @other_warn: which lstopo 2>/dev/null @ Please install hwloc-gui.x86_64 package or hwloc.x86_64 to get lstopo tool 7 | 8 | cpu_topology.sh -t verify_thread_per_core 9 | cpu_topology.sh -t verify_cores_per_socket 10 | cpu_topology.sh -t verify_socket_num 11 | cpu_topology.sh -t verify_level_type 12 | cpu_topology.sh -t verify_sched_domain_names -------------------------------------------------------------------------------- /BM/th/README.md: -------------------------------------------------------------------------------- 1 | TH is for Intel Trace Hub. Intel Trace Hub functional blocks include the Software Trace Hub 2 | (STH) block, the On-Die Logic Analyzer (ODLA)/VIS Event Recognition (VER) block, the 3 | System-on-Chip Performance Counters (SoCHAP) block, the Visualization of Internal Signals 4 | (VIS) Controller block, and the Global Trace Hub (GTH) block. 5 | 6 | This test will check policy set/get with ioctl for Intel trace hub. 7 | 8 | Precondition: 9 | Enable "0-sth.test" policy for TH. 10 | 11 | Cmds: 12 | th_test 1 : for policy set test 13 | th_test 2 : for policy get test 14 | 15 | -------------------------------------------------------------------------------- /scenario/cwf-oa/tests-topology: -------------------------------------------------------------------------------- 1 | # This file collects basic cases which verify CPU Topology 2 | # on Intel® Architecture-based server platforms. 3 | # @hw_dep: 4 | # @other_dep: 5 | # @other_warn: which cpuid 2>/dev/null @ cpuid tool is required 6 | # @other_warn: which lstopo 2>/dev/null @ Please install hwloc-gui.x86_64 package or hwloc.x86_64 to get lstopo tool 7 | 8 | cpu_topology.sh -t verify_thread_per_core 9 | cpu_topology.sh -t verify_cores_per_socket 10 | cpu_topology.sh -t verify_socket_num 11 | cpu_topology.sh -t verify_level_type 12 | cpu_topology.sh -t verify_sched_domain_names 13 | -------------------------------------------------------------------------------- /scenario/gnr-ov/tests-topology: -------------------------------------------------------------------------------- 1 | # This file collects basic cases which verify CPU Topology 2 | # on Intel® Architecture-based server platforms. 3 | # @hw_dep: 4 | # @other_dep: 5 | # @other_warn: which cpuid 2>/dev/null @ cpuid tool is required 6 | # @other_warn: which lstopo 2>/dev/null @ Please install hwloc-gui.x86_64 package or hwloc.x86_64 to get lstopo tool 7 | 8 | cpu_topology.sh -t verify_thread_per_core 9 | cpu_topology.sh -t verify_cores_per_socket 10 | cpu_topology.sh -t verify_socket_num 11 | cpu_topology.sh -t verify_level_type 12 | cpu_topology.sh -t verify_sched_domain_names 13 | -------------------------------------------------------------------------------- /BM/edac/README.md: -------------------------------------------------------------------------------- 1 | # EDAC 2 | 3 | EDAC (Error Detection and Correction) framework provides support for detecting and correcting memory errors on systems with ECC (Error-Correcting Code) memory or other error detection mechanism. 4 | 5 | Intel i10nm EDAC driver supports the Intel 10nm series server integrated memory controller. 6 | 7 | ## Usage 8 | 9 | You can run the cases one by one, e.g. command 10 | 11 | ``` 12 | ./intel_edac.sh -t check_edac_bus 13 | ``` 14 | You also can run the cases together with runtests command, e.g. 15 | 16 | ``` 17 | cd .. 18 | ./runtests -f edac/tests -o logfile 19 | ``` 20 | -------------------------------------------------------------------------------- /KVM/qemu/host_cpu_offline_online.cfg: -------------------------------------------------------------------------------- 1 | - host_cpu_offline_online: 2 | type = host_cpu_offline_online 3 | virt_test_type = qemu 4 | vm_accelerator = kvm 5 | # Don't create/remove guest images 6 | force_create_image = no 7 | remove_image = no 8 | # Automatically start VM 9 | start_vm = yes 10 | # Stop VM after testing 11 | kill_vm = yes 12 | variants: 13 | - vm: 14 | - tdvm: 15 | machine_type_extra_params = "kernel-irqchip=split" 16 | vm_secure_guest_type = tdx 17 | auto_cpu_model = "no" 18 | cpu_model = host 19 | -------------------------------------------------------------------------------- /KVM/qemu/td_huge_resource.cfg: -------------------------------------------------------------------------------- 1 | - td_huge_resource: 2 | virt_test_type = qemu 3 | type = td_huge_resource 4 | vm_accelerator = kvm 5 | machine_type_extra_params = "kernel-irqchip=split" 6 | vm_secure_guest_type = tdx 7 | start_vm = no 8 | vga = std 9 | auto_cpu_model = "no" 10 | cpu_model = host 11 | variants: 12 | - half: 13 | - max_vcpus: 14 | check_host_cpu = "yes" 15 | - out_max_vcpus: 16 | # TD can not boot up with vCPU number larger than host pCPU 17 | overrange_host_cpu = "yes" 18 | xfail = "yes" 19 | -------------------------------------------------------------------------------- /BM/splitlock/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # 3 | # Copyright (c) 2024 Intel Corporation. 4 | # Haoliang Zhu 5 | 6 | cmake_minimum_required(VERSION 3.12) 7 | project(sl_test) 8 | 9 | # Set the build output directory 10 | set(BUILD_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}) 11 | 12 | # Set the installation prefix 13 | set(CMAKE_INSTALL_PREFIX /usr/local/bin) 14 | 15 | # Set the source files 16 | set(SRC sl_test.c) 17 | 18 | # Add the executable 19 | add_executable(sl_test ${SRC}) 20 | 21 | # Install the program 22 | install(TARGETS sl_test DESTINATION ${CMAKE_INSTALL_PREFIX}) 23 | -------------------------------------------------------------------------------- /BM/topology/tests-server: -------------------------------------------------------------------------------- 1 | # This file collects basic cases which verify CPU Topology 2 | # on Intel® Architecture-based server platforms. 3 | # @hw_dep: 4 | # @other_dep: 5 | # @other_warn: which cpuid 2>/dev/null @ cpuid tool is required 6 | # @other_warn: which lstopo 2>/dev/null @ Please install hwloc-gui.x86_64 package or hwloc.x86_64 to get lstopo tool 7 | 8 | cpu_topology.sh -t numa_nodes_compare 9 | cpu_topology.sh -t verify_thread_per_core 10 | cpu_topology.sh -t verify_cores_per_socket 11 | cpu_topology.sh -t verify_socket_num 12 | cpu_topology.sh -t verify_level_type 13 | cpu_topology.sh -t verify_sched_domain_names 14 | -------------------------------------------------------------------------------- /BM/tdx-guest/tdx_halt_test_module/halt_test.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | #include 3 | #include 4 | #include 5 | 6 | static int __init test_tdx_hlt_init(void) 7 | { 8 | pr_info("[TD guest test] Start to trigger hlt instr.\n"); 9 | asm("cli"); 10 | asm("hlt"); 11 | return 0; 12 | } 13 | 14 | static void __exit test_tdx_hlt_exit(void) 15 | { 16 | pr_info("[TD guest test] Complete of hlt instr. test, test module exit\n"); 17 | } 18 | 19 | module_init(test_tdx_hlt_init); 20 | module_exit(test_tdx_hlt_exit); 21 | MODULE_INFO(intree, "Y"); 22 | MODULE_LICENSE("GPL"); 23 | -------------------------------------------------------------------------------- /BM/common/check_perf.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess 4 | 5 | def check_perf_installed(): 6 | try: 7 | result = subprocess.run(['perf', '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 8 | 9 | if result.returncode == 0: 10 | print("Version:", result.stdout.decode().strip()) 11 | return True 12 | else: 13 | print("Perf tool is not installed") 14 | return False 15 | except Exception as e: 16 | print("An error occurred:", str(e)) 17 | return False 18 | 19 | if __name__ == '__main__': 20 | check_perf_installed() 21 | -------------------------------------------------------------------------------- /BM/tools/pcie/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # 3 | # Copyright (c) 2024 Intel Corporation. 4 | # Haoliang Zhu 5 | 6 | cmake_minimum_required(VERSION 3.12) 7 | project(pcie_check) 8 | 9 | # Set the build output directory 10 | set(BUILD_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}) 11 | 12 | # Set the installation prefix 13 | set(CMAKE_INSTALL_PREFIX /usr/loacl/bin) 14 | 15 | # Set the source files 16 | set(SRC pcie_check.c) 17 | 18 | # Add the executable 19 | add_executable(pcie_check ${SRC}) 20 | 21 | # Install the program 22 | install(TARGETS pcie_check DESTINATION ${CMAKE_INSTALL_PREFIX}) 23 | -------------------------------------------------------------------------------- /BM/tools/cpuid_check/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # 3 | # Copyright (c) 2024 Intel Corporation. 4 | # Haoliang Zhu 5 | 6 | cmake_minimum_required(VERSION 3.12) 7 | project(cpuid_check) 8 | 9 | # Set the build output directory 10 | set(BUILD_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}) 11 | 12 | # Set the installation prefix 13 | set(CMAKE_INSTALL_PREFIX /usr/loacl/bin) 14 | 15 | # Set the source files 16 | set(SRC cpuid_check.c) 17 | 18 | # Add the executable 19 | add_executable(cpuid_check ${SRC}) 20 | 21 | # Install the program 22 | install(TARGETS cpuid_check DESTINATION ${CMAKE_INSTALL_PREFIX}) 23 | -------------------------------------------------------------------------------- /scenario/gnr-oe/tests-cstate: -------------------------------------------------------------------------------- 1 | # This file collects the CPU Core cstate cases which can run 2 | # on Intel® Architecture-based server platforms. 3 | # @hw_dep: 4 | # @other_dep: 5 | # @other_warn: which turbostat 2>/dev/null @ turbostat tool is required 6 | # @other_warn: which perf 2>/dev/null @ perf tool is required, please install perf.x86_64 package 7 | # @other_warn: which rdmsr 2>/dev/null @ rdmsr tool is required, please install msr-tools 8 | 9 | powermgr_cstate_tests.sh -t verify_server_perf_core_cstat_update 10 | powermgr_cstate_tests.sh -t verify_server_perf_pkg_cstat_update 11 | powermgr_cstate_tests.sh -t verify_ccstate_res_offline_online 12 | -------------------------------------------------------------------------------- /BM/common/uname: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This is a fake uname. 3 | # 4 | # It cheats the Makefile to locate ubuntu linux-header-5.15 5 | # but not the one one the host. 6 | 7 | while getopts ":armpios" arg; do 8 | case $arg in 9 | a) 10 | echo "Linux lkvs 5.19.0-41-generic #58-Ubuntu SMP Thu Oct 13 08:03:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux" 11 | ;; 12 | r) 13 | echo "5.19.0-41-generic" 14 | ;; 15 | m|p|i) 16 | echo "x86_64" 17 | ;; 18 | o) 19 | echo "GNU/Linux" 20 | ;; 21 | s) 22 | echo "Linux" 23 | ;; 24 | ?) 25 | uname -$OPTARG 26 | ;; 27 | esac 28 | done 29 | -------------------------------------------------------------------------------- /BM/telemetry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # 3 | # Copyright (c) 2024 Intel Corporation. 4 | # Haoliang Zhu 5 | 6 | cmake_minimum_required(VERSION 3.12) 7 | project(telemetry_tests) 8 | 9 | # Set the build output directory 10 | set(BUILD_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}) 11 | 12 | # Set the installation prefix 13 | set(CMAKE_INSTALL_PREFIX /usr/local/bin) 14 | 15 | # Set the source files 16 | set(SRC telemetry_tests.c) 17 | 18 | # Add the executable 19 | add_executable(telemetry_tests ${SRC}) 20 | 21 | # Install the program 22 | install(TARGETS telemetry_tests DESTINATION ${CMAKE_INSTALL_PREFIX}) 23 | -------------------------------------------------------------------------------- /KVM/qemu/tsc_freq.cfg: -------------------------------------------------------------------------------- 1 | - tsc_freq: 2 | type = tsc_freq 3 | only Linux 4 | start_vm = no 5 | kill_vm = yes 6 | machine_type_extra_params = "kernel-irqchip=split" 7 | vm_secure_guest_type = tdx 8 | vga = std 9 | auto_cpu_model = "no" 10 | cpu_model = "host" 11 | cpuid_pkg = "cpuid" 12 | cpuid_entry_cmd = "cpuid -rl 0x15 -1 | sed -n 2p" 13 | variants: 14 | - default: 15 | - settsc: 16 | cpu_model_flags = "tsc-frequency=3000000000" 17 | variants: 18 | - vm: 19 | - tdvm: 20 | machine_type_extra_params = "kernel-irqchip=split" 21 | vm_secure_guest_type = tdx 22 | -------------------------------------------------------------------------------- /KVM/qemu/td_debug.cfg: -------------------------------------------------------------------------------- 1 | - td_debug: 2 | virt_test_type = qemu 3 | type = td_debug 4 | vm_accelerator = kvm 5 | machine_type_extra_params = "kernel-irqchip=split" 6 | vm_secure_guest_type = tdx 7 | start_vm = yes 8 | kill_vm = yes 9 | vga = std 10 | auto_cpu_model = "no" 11 | cpu_model = host 12 | variants: 13 | - nmi: 14 | nmi = "yes" 15 | - idle: 16 | no default 17 | nmi = "no" 18 | variants: 19 | - default: 20 | - debugon: 21 | vm_secure_guest_object_options = debug=on 22 | - debugoff: 23 | vm_secure_guest_object_options = debug=off 24 | -------------------------------------------------------------------------------- /BM/avx512vbmi/README.md: -------------------------------------------------------------------------------- 1 | # avx512vbmi (avx512 Vector Byte Manipulation Instructions) 2 | 3 | avx512vbmi is a set of instructions for Intel Tiger Lake and subsequent 4 | platforms. Here is the test of some vbmi instructions. 5 | 6 | You can run the cases one by one, e.g. command 7 | 8 | ``` 9 | ./vbmi_func.sh -n vbmi_test -p "1 ff b" 10 | ./vbmi_func.sh -n vbmi_test -p random 11 | ``` 12 | 13 | You also can run the cases together with runtests command, e.g. 14 | ``` 15 | cd .. 16 | ./runtests -f avx512vbmi/tests -o logfile 17 | 18 | If the platform CPU you are testing does not support avx512vbmi, it will exit 19 | immediately and remind you to check the /tmp/lkvs_dependence log. 20 | ``` 21 | -------------------------------------------------------------------------------- /BM/tdx-compliance/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "cpuid":{ 3 | "csv_path": "hh1_0.csv", 4 | "header_path": "cpuid_case.h", 5 | "vdetail": ["Virtualization Details"], 6 | "vtype": ["Bit or Field Virtualization Type", "Virtualization Type"], 7 | "fname": "Field Name", 8 | "bias": "1", 9 | "version": "1.0" 10 | }, 11 | "cr":{ 12 | "csv_path": "", 13 | "header_path": "", 14 | "vdetail": "", 15 | "vtype": "", 16 | "bias": "2" 17 | }, 18 | "msr":{ 19 | "csv_path": "", 20 | "header_path": "msr_case.h", 21 | "vdetail": "", 22 | "vtype": "", 23 | "bias": "2" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /BM/cet/cet_driver/Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # Copyright (c) 2023 Intel Corporation. 3 | 4 | # If called directly from the command line, invoke the kernel build system. 5 | ifeq ($(KERNELRELEASE),) 6 | PWD = $(shell pwd) 7 | RPM_PKG := $(shell rpm -qa) 8 | KERNEL_SOURCE = /lib/modules/$(shell uname -r)/build 9 | 10 | BIN := cet_ioctl 11 | 12 | all: $(BIN) 13 | 14 | cet_ioctl: 15 | $(MAKE) -C $(KERNEL_SOURCE) M=$(PWD) modules 16 | 17 | clean: 18 | $(MAKE) -C $(KERNEL_SOURCE) M=$(PWD) clean 19 | ${RM} -rf $(BIN) 20 | 21 | # Otherwise KERNELRELEASE is defined; we've been invoked from the 22 | # kernel build system and can use its language. 23 | else 24 | obj-m := cet_ioctl.o 25 | endif 26 | -------------------------------------------------------------------------------- /KVM/qemu/deps/run_cuda.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ret=0 3 | cd /home/cuda-samples/Samples/0_Introduction || ret=1 4 | if [ $ret -ne 0 ]; then 5 | echo "Cuda samples not found, please make sure /home/cuda-samples/Samples/0_Introduction is installed and built " 6 | exit 1 7 | fi 8 | folder="matrixMul matrixMulDrv matrixMulDynlinkJIT vectorAdd vectorAddDrv vectorAddMMAP vectorAdd_nvrtc" 9 | echo "Start cuda test ----------------" 10 | for i in $folder; do 11 | echo "Start test $i ----------------" 12 | cd $i || ret=1 13 | ./$i || ret=1 14 | cd ../ 15 | if [ $ret -ne 0 ]; then 16 | echo "Cuda test $i fail" 17 | exit $ret 18 | else 19 | echo "Cuda test $i pass" 20 | fi 21 | done 22 | -------------------------------------------------------------------------------- /KVM/qemu/tdx_basic.cfg: -------------------------------------------------------------------------------- 1 | - tdx_basic: 2 | type = tdx_basic 3 | virt_test_type = qemu 4 | vm_accelerator = kvm 5 | machine_type_extra_params = "kernel-irqchip=split" 6 | vm_secure_guest_type = tdx 7 | # Don't create/remove guest images 8 | force_create_image = no 9 | remove_image = no 10 | start_vm = no 11 | # Stop VM after testing 12 | kill_vm = yes 13 | shell_prompt = "^\[.*\][\#\$]\s*$" 14 | vga = std 15 | auto_cpu_model = "no" 16 | cpu_model = host 17 | check_host_flags = yes 18 | flags = "tdx_host_platform" 19 | guest_flags = "tdx_guest" 20 | read_cmd = "cat /sys/module/kvm_intel/parameters/%s" 21 | rdmsr_cmd = "rdmsr 0xfe --bitfield 15:15" 22 | -------------------------------------------------------------------------------- /BM/cmpccxadd/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # 3 | # Copyright (c) 2024 Intel Corporation. 4 | # Haoliang Zhu 5 | 6 | cmake_minimum_required(VERSION 3.12) 7 | project(cmpccxadd) 8 | 9 | # Set the build output directory 10 | set(BUILD_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}) 11 | 12 | # Set the installation prefix 13 | set(CMAKE_INSTALL_PREFIX /usr/local/bin) 14 | 15 | # Set the source files 16 | set(SRC cmpccxadd.c) 17 | 18 | # Set the global compilation flags 19 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall") 20 | 21 | # Add the executable 22 | add_executable(cmpccxadd ${SRC}) 23 | 24 | # Install the program 25 | install(TARGETS cmpccxadd DESTINATION ${CMAKE_INSTALL_PREFIX}) 26 | -------------------------------------------------------------------------------- /BM/tdx-guest/tdx_ebizzy_test_suite/ebizzy.h: -------------------------------------------------------------------------------- 1 | /* Portability stuff */ 2 | 3 | #ifndef EBIZZY_H 4 | #define EBIZZY_H 5 | 6 | #ifndef _freebsd 7 | #include 8 | #endif 9 | 10 | /* 11 | * Solaris and FreeBSD compatibility stuff 12 | */ 13 | #if defined(_solaris) || defined(_freebsd) 14 | #define MAP_ANONYMOUS MAP_ANON 15 | #define M_MMAP_MAX (-4) 16 | #endif 17 | 18 | /* 19 | * FreeBSD compatibility stuff 20 | */ 21 | #if defined(_freebsd) || defined(__UCLIBC__) 22 | #define mallopt(arg1, arg2) do { } while (0); 23 | #endif 24 | 25 | /* 26 | * HP-UX compatibility stuff 27 | */ 28 | #ifdef _HPUX_SOURCE 29 | #define _SC_NPROCESSORS_ONLN pthread_num_processors_np() 30 | #endif 31 | 32 | 33 | 34 | #endif /* EBIZZY_H */ 35 | -------------------------------------------------------------------------------- /BM/th/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # 3 | # Copyright (c) 2024 Intel Corporation. 4 | # Haoliang Zhu 5 | 6 | cmake_minimum_required(VERSION 3.12) 7 | project(th_test) 8 | 9 | # Set the build output directory 10 | set(BUILD_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}) 11 | 12 | # Set the installation prefix 13 | set(CMAKE_INSTALL_PREFIX /usr/local/bin) 14 | 15 | # Set the global compilation flags 16 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ggdb -Wall -fstack-protector-all") 17 | 18 | # Set the source files 19 | set(SRC th_test.c) 20 | 21 | # Add the executable 22 | add_executable(th_test ${SRC}) 23 | 24 | # Install the program 25 | install(TARGETS th_test DESTINATION ${CMAKE_INSTALL_PREFIX}) 26 | -------------------------------------------------------------------------------- /scenario/srf-oe/tests-lass: -------------------------------------------------------------------------------- 1 | # This file collects the LASS (Linear Address Space Separation) tests on 2 | # Intel® Architecture-based platforms. 3 | # @other_dep: general_test.sh -t kconfig -k "CONFIG_X86_LASS|CONFIG_LEGACY_VSYSCALL_EMULATE|CONFIG_LEGACY_VSYSCALL_XONLY|CONFIG_LEGACY_VSYSCALL_NONE=y" 4 | # @other_warn: 5 | 6 | #Test get vsyscall address maps. 7 | lass m 8 | #Test execute vsyscall addr 0xffffffffff600000. 9 | lass d 10 | #Test call vsyscall 11 | lass g 12 | #Test call vsyscall api gettimeofday 13 | lass t 14 | #Test read vsyscall 0xffffffffff600000 15 | lass r 16 | #Test read random kernel space. 17 | lass i 18 | #Test process_vm_readv read address 0xffffffffff600000.[negative] 19 | lass v 20 | #Test vsyscall emulation. 21 | lass e 22 | -------------------------------------------------------------------------------- /BM/pt/Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # Copyright (c) 2022 Intel Corporation. 3 | 4 | CC ?= "${CC}" -g -Wall 5 | CFLAGS += -DMAINLINE -I./ 6 | BIN = cpl branch psb nonroot_test negative_test sort_test 7 | LFLAGS = -L./ -lipt 8 | 9 | 10 | all: $(BIN) 11 | 12 | 13 | cpl: 14 | $(CC) -o $@ $@.c utils.c ${CFLAGS} ${LFLAGS} 15 | 16 | branch: 17 | $(CC) -o $@ $@.c utils.c ${CFLAGS} ${LFLAGS} 18 | 19 | psb: 20 | $(CC) -o $@ $@.c utils.c ${CFLAGS} ${LFLAGS} 21 | 22 | nonroot_test: 23 | $(CC) -o $@ $@.c utils.c ${CFLAGS} ${LFLAGS} 24 | 25 | negative_test: 26 | $(CC) -o $@ $@.c utils.c ${CFLAGS} ${LFLAGS} 27 | 28 | sort_test: 29 | $(CC) -o $@ $@.c utils.c ${CFLAGS} ${LFLAGS} 30 | 31 | clean: 32 | rm -rf $(BIN) *.o 33 | -------------------------------------------------------------------------------- /KVM/qemu/tdx_seam_module.cfg: -------------------------------------------------------------------------------- 1 | - tdx_seam_module: 2 | type = tdx_seam_module 3 | virt_test_type = qemu 4 | vm_accelerator = kvm 5 | machine_type_extra_params = "kernel-irqchip=split" 6 | vm_secure_guest_type = tdx 7 | # Don't create/remove guest images 8 | force_create_image = no 9 | remove_image = no 10 | start_vm = no 11 | # Stop VM after testing 12 | kill_vm = yes 13 | shell_prompt = "^\[.*\][\#\$]\s*$" 14 | vga = std 15 | auto_cpu_model = "no" 16 | cpu_model = host 17 | read_cmd = "cat /sys/module/kvm_intel/parameters/%s" 18 | rdmsr_cmd = "rdmsr 0xfe --bitfield 15:15" 19 | tdx_module_pattern = "tdx: module initialized" 20 | tdx_negative_pattern = "No TDX module loaded by BIOS" 21 | -------------------------------------------------------------------------------- /BM/tdx-guest/tdx_ebizzy_test_suite/Makefile: -------------------------------------------------------------------------------- 1 | # MakeFile function :: MakeFile for tdx_ebizzy_test_suite 2 | 3 | CC := gcc 4 | 5 | VAR_CFLAGS := $(shell pkg-config --cflags libtracefs 2>/dev/null) 6 | VAR_LDLIBS := $(shell pkg-config --libs libtracefs 2>/dev/null) 7 | 8 | CFLAGS += -static -Wall -Wextra -g -O2 $(VAR_CFLAGS) 9 | LDFLAGS += -lpthread $(VAR_LDLIBS) 10 | INCLUDES = -I include 11 | 12 | #List of source files- Update this on adding a new C file 13 | SOURCES := \ 14 | ebizzy.c \ 15 | 16 | MAKE_TARGETS := ebizzy 17 | 18 | tdx_guest_test: 19 | $(CC) $(CFLAGS) $(LDFLAGS) -o ${MAKE_TARGETS} ${INCLUDES} ${SOURCES} 20 | 21 | clean: 22 | rm -rf ${MAKE_TARGETS} 23 | -------------------------------------------------------------------------------- /BM/cstate/tests-client: -------------------------------------------------------------------------------- 1 | # This file collects the CPU Core cstate cases which can run 2 | # on Intel® Architecture-based client platforms. 3 | # @hw_dep: 4 | # @other_dep: 5 | # @other_warn: which turbostat 2>/dev/null @ turbostat tool is required 6 | 7 | powermgr_cstate_tests.sh -t verify_cstate_name 8 | powermgr_cstate_tests.sh -t verify_cstate_switch 9 | powermgr_cstate_tests.sh -t verify_client_core_c7_residency_during_runtime 10 | powermgr_cstate_tests.sh -t verify_client_core_c7_residency_during_s2idle 11 | powermgr_cstate_tests.sh -t verify_client_pkg6_by_disabling_cc8 12 | powermgr_cstate_tests.sh -t verify_client_pkg8_by_disabling_cc10 13 | powermgr_cstate_tests.sh -t verify_cstate_list_by_perf 14 | powermgr_cstate_tests.sh -t verify_residency_latency_override 15 | -------------------------------------------------------------------------------- /BM/pcie/README.md: -------------------------------------------------------------------------------- 1 | # pcie related tests description 2 | # please compile the pcie_check test tool under BM/tools/pcie before test execution 3 | 4 | ## case implemented by pcie_check.sh and pcie_check.c for general PCIe capability check 5 | ### for simplicity, only check PCIe Cap Structure (7.5.3 in spec) Max Speed, Current Speed, Supported Speed, Target Speed 6 | - PCIe root port (PCI bridge) Gen4 capability test, apply for PCIe Gen4 platform 7 | ``` 8 | ./pcie_check.sh gen4 9 | ``` 10 | - PCIe root port (PCI bridge) Gen5 capability test, apply for PCIe Gen5 platform 11 | ``` 12 | ./pcie_check.sh gen5 13 | ``` 14 | - PCIe root port (PCI bridge) Gen6 capability test, apply for PCIe Gen4 platform 15 | ``` 16 | ./pcie_check.sh gen6 17 | ``` 18 | -------------------------------------------------------------------------------- /scenario/gnr-oe/tests-ufs: -------------------------------------------------------------------------------- 1 | # This file collects basic cases which can run against 2 | # TPMI UFS (Uncore Frequency Scaling) driver 3 | # on Intel® GRANITERAPIDS and further server platforms. 4 | # @hw_dep: general_test.sh -t fms -p "ufs_fms_list" @ CPU Model doesn't support tpmi_ufs 5 | # @other_dep: general_test.sh -t kconfig -k "CONFIG_INTEL_TPMI=m" 6 | # @other_warn: which stress 2>/dev/null @ stress tool is required, please install stress-ng.x86_64 and run command: ln -s /usr/bin/stress-ng /usr/bin/stress 7 | 8 | tpmi_ufs.sh -t check_ufs_unbind_bind 9 | tpmi_ufs.sh -t check_ufs_device 10 | tpmi_ufs.sh -t check_ufs_sysfs_attr 11 | tpmi_ufs.sh -t check_ufs_init_min_max_value 12 | tpmi_ufs.sh -t check_ufs_min_equals_to_max 13 | tpmi_ufs.sh -t check_ufs_max_equals_to_min 14 | -------------------------------------------------------------------------------- /BM/hotplug/README.md: -------------------------------------------------------------------------------- 1 | # Release Notes 2 | 3 | In the software solution, CPU hotplug and unplug refers to 4 | CPU offline and online operations using the '/sys/devices/system/cpu' interface. 5 | 6 | The python script utilizes the Avocade Test Framework, so it needs to be installed first 7 | 8 | ## The command to instlall the avocado from source code 9 | ``` 10 | git clone git://github.com/avocado-framework/avocado.git 11 | cd avocado 12 | pip install . 13 | ``` 14 | 15 | or 16 | 17 | ## Installing avocado vai pip: 18 | ``` 19 | pip3 install --user avocado-framework 20 | ``` 21 | 22 | ## The command to run the case 23 | ### Running with 'runtest.py' 24 | ``` 25 | cd .. 26 | ./runtests.py -f hotplug -t hotplug/tests 27 | ``` 28 | 29 | ### Running with avocado framework 30 | ``` 31 | avocado run cpu_off_on_stress.py 32 | ``` 33 | -------------------------------------------------------------------------------- /KVM/qemu/tdx_disable.cfg: -------------------------------------------------------------------------------- 1 | - tdx_disable: 2 | virt_test_type = qemu 3 | type = tdx_disable 4 | vm_accelerator = kvm 5 | machine_type_extra_params = "kernel-irqchip=split" 6 | vm_secure_guest_type = tdx 7 | start_vm = no 8 | vga = std 9 | auto_cpu_model = "no" 10 | cpu_model = host 11 | xfail = "yes" 12 | expected_status = 'N' 13 | default_status = 'Y' 14 | variants: 15 | - ept: 16 | parameter_name = 'ept' 17 | - tdx: 18 | parameter_name = 'tdx' 19 | pre_command = 'modprobe -r kvm_intel && modprobe kvm_intel ${parameter_name}=${expected_status}' 20 | post_command = 'modprobe -r kvm_intel && modprobe kvm_intel ${parameter_name}=${default_status}' 21 | check_status_cmd = 'cat /sys/module/kvm_intel/parameters/${parameter_name}' 22 | -------------------------------------------------------------------------------- /BM/tpmi/README.md: -------------------------------------------------------------------------------- 1 | # Release Notes for Topology Aware Register and PM Capsule Interface test cases 2 | 3 | The tpmi cases are designed to test the basic functionality of the intel_vsec 4 | and intel_tpmi driver modules on Intel® Architecture-based server platforms. 5 | These cases are supported on the GRANITERAPIDS and will be compatibale with 6 | subsequent platforms as well. 7 | 8 | 9 | You can run the cases one by one, e.g. command 10 | 11 | ``` 12 | ./intel_tpmi.sh -t pm_feature_list 13 | ``` 14 | You also can run the cases together with runtests command, e.g. 15 | 16 | ``` 17 | cd .. 18 | ./runtests -f tpmi/tests -o logfile 19 | ``` 20 | 21 | These are the basic cases for intel_vsec and intel_tpmi driver module, 22 | If you have good idea to improve cstate cases, you are welcomed to 23 | send us the patches, thanks! 24 | -------------------------------------------------------------------------------- /BM/workload-xsave/work_PAUSE.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | /* 3 | * offer the "PAUSE" workload to yogini 4 | * 5 | * Copyright (c) 2022 Intel Corporation. 6 | * Len Brown 7 | */ 8 | 9 | #define _GNU_SOURCE 10 | #include /* printf(3) */ 11 | #include /* random(3) */ 12 | #include /* CPU_SET */ 13 | #include 14 | #include "yogini.h" 15 | #include 16 | 17 | #define DATA_ENTRIES 1024 18 | 19 | static void work(void *arg) 20 | { 21 | int i; 22 | 23 | for (i = 0; i < DATA_ENTRIES; ++i) 24 | asm volatile ("pause"); 25 | } 26 | 27 | #include "run_common.c" 28 | 29 | static struct workload w = { 30 | "PAUSE", 31 | NULL, 32 | NULL, 33 | run, 34 | }; 35 | 36 | struct workload *register_PAUSE(void) 37 | { 38 | return &w; 39 | } 40 | -------------------------------------------------------------------------------- /KVM/qemu/smp.cfg: -------------------------------------------------------------------------------- 1 | - smp: 2 | no Windows 3 | type = smp 4 | virt_test_type = qemu 5 | vm_accelerator = kvm 6 | force_create_image = no 7 | remove_image = no 8 | start_vm = yes 9 | kill_vm = yes 10 | auto_cpu_model = "no" 11 | cpu_model = host 12 | variants: 13 | - cpuinfo_chk: 14 | test_tool = cpuinfo_chk.c 15 | - mem_coh: 16 | test_tool = mem_coh.c 17 | - affinity_getting: 18 | test_tool = affinity_getting.c 19 | - affinity_setting: 20 | test_tool = affinity_setting.c 21 | - affinity_inherit: 22 | test_tool = affinity_inherit.c 23 | variants: 24 | - vm: 25 | - tdvm: 26 | machine_type_extra_params = "kernel-irqchip=split" 27 | vm_secure_guest_type = tdx 28 | -------------------------------------------------------------------------------- /BM/pmu/tests_gnr: -------------------------------------------------------------------------------- 1 | # This file collects the PMU cases for GNR platform 2 | pmu_tests.sh -t basic 3 | pmu_tests.sh -t uncore 4 | pmu_tests.sh -t uncore_dmesg 5 | pmu_tests.sh -t uncore_events 6 | pmu_iommu_tests.sh -t iommu_clocks 7 | apebs_tests.sh -t data_src -w 0 8 | apebs_tests.sh -t ip_1 -w 0 9 | apebs_tests.sh -t ip_2 -w 0 10 | apebs_tests.sh -t lbr_1 -w 0 11 | apebs_tests.sh -t lbr_2 -w 0 12 | apebs_tests.sh -t large_pebs -w 0 13 | apebs_tests.sh -t large_pebs -w 1 14 | apebs_tests.sh -t xmm_1 -w 1 15 | apebs_tests.sh -t xmm_2 -w 1 16 | apebs_tests.sh -t ip_1 -w 1 17 | apebs_tests.sh -t ip_2 -w 1 18 | apebs_tests.sh -t data_src -w 1 19 | apebs_tests.sh -t lbr_1 -w 1 20 | apebs_tests.sh -t lbr_2 -w 1 21 | apebs_tests.sh -t ip_1 -w 1 22 | apebs_tests.sh -t ip_2 -w 1 23 | apebs_tests.sh -t data_src -w 1 24 | pmu_tests.sh -t timed_pebs_msr 25 | -------------------------------------------------------------------------------- /BM/ufs/README.md: -------------------------------------------------------------------------------- 1 | # Release Notes for Intel® TPMI (Topology Aware Register and PM Capsule 2 | # Interface) UFS (Uncore Frequency Scaling) driver test cases 3 | 4 | The cases are designed for Intel® TPMI (Topology Aware Register and PM Capsule 5 | Interface) UFS (Uncore Frequency Scaling) driver on 6 | Intel® GRANITERAPIDS and further server platforms. 7 | 8 | The prerequisites to run UFS cases: 9 | - User needs stress tool 10 | 11 | You can run the cases one by one, e.g. command 12 | 13 | ``` 14 | ./tpmi_ufs.sh -t check_ufs_unbind_bind 15 | ``` 16 | You also can run the cases together with runtests command, e.g. 17 | 18 | ``` 19 | cd .. 20 | ./runtests -f ufs/tests -o logfile 21 | ``` 22 | 23 | These are the basic cases for TPMI UFS driver, if you have good idea to 24 | improve UFS cases, you are welcomed to send us the patches, thanks! 25 | -------------------------------------------------------------------------------- /BM/performance/README.md: -------------------------------------------------------------------------------- 1 | # Release Notes 2 | 3 | The performance covers the predefined benchmarks testing via perf tool 4 | covers the CPU, Memory, I/O, Algorithm performance 5 | If failures are detected, consider reading the debug logs, then 6 | using perf top-down tool for additional analysis. 7 | 8 | The python script utilizes the Avocade Test Framework, so it needs to be installed first 9 | 10 | ## The command to install the avocado from source code 11 | ``` 12 | git clone git://github.com/avocado-framework/avocado.git 13 | cd avocado 14 | pip install . 15 | ``` 16 | 17 | or 18 | 19 | ## Installing avocado vai pip: 20 | ``` 21 | pip3 install --user avocado-framework 22 | ``` 23 | 24 | ## The command to run the case 25 | ### Running with 'runtest.py' 26 | ``` 27 | cd .. 28 | ./runtests.py -f performance -t performance/tests 29 | ``` 30 | 31 | -------------------------------------------------------------------------------- /BM/thermal/README.md: -------------------------------------------------------------------------------- 1 | # Release Notes for x86_pkg_temp_thermal test cases 2 | 3 | The thermal cases are designed for Intel® Architecture-based platforms 4 | to cover x86_pkg_temp_thermal throttling and interrupts cases by running 5 | stress workload. 6 | 7 | The prerequisites to run thermal cases: 8 | - User needs taskset and stress tools 9 | 10 | thermal-tests file collects two cases for x86_pkg_temp_thermal driver 11 | You can run the cases one by one, e.g. command 12 | 13 | ``` 14 | ./thermal_test.sh -t check_thermal_throttling 15 | ``` 16 | You also can run the cases together with runtests command, e.g. 17 | 18 | ``` 19 | cd .. 20 | ./runtests -f thermal/thermal-tests -o logfile 21 | ``` 22 | 23 | These are two basic cases for x86_pkg_temp_thermal driver, If you have good idea to 24 | improve the cases, you are welcomed to send us the patches, thanks! 25 | -------------------------------------------------------------------------------- /BM/workload-xsave/work_RDTSC.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | /* 3 | * offer the "RDTSC" workload to yogini 4 | * 5 | * Copyright (c) 2022 Intel Corporation. 6 | * Len Brown 7 | */ 8 | 9 | #define _GNU_SOURCE 10 | #include /* printf(3) */ 11 | #include /* random(3) */ 12 | #include /* CPU_SET */ 13 | #include "yogini.h" 14 | 15 | /* 16 | * This "workload" runs the worker infrastructure without any inner work. 17 | * As a result, it spends all of its time using RDTSC to end promptly. 18 | */ 19 | static inline void work(void *arg) 20 | { 21 | } 22 | 23 | #define DATA_ENTRIES 1 24 | 25 | #include "run_common.c" 26 | 27 | static struct workload w = { 28 | "RDTSC", 29 | NULL, 30 | NULL, 31 | run, 32 | }; 33 | 34 | struct workload *register_RDTSC(void) 35 | { 36 | return &w; 37 | } 38 | -------------------------------------------------------------------------------- /BM/cmpccxadd/tests: -------------------------------------------------------------------------------- 1 | # This file collects the CMPccXADD cases 2 | cmpccxadd -t 1 3 | cmpccxadd -t 2 4 | cmpccxadd -t 3 5 | cmpccxadd -t 4 6 | cmpccxadd -t 5 7 | cmpccxadd -t 6 8 | cmpccxadd -t 7 9 | cmpccxadd -t 8 10 | cmpccxadd -t 9 11 | cmpccxadd -t 10 12 | cmpccxadd -t 11 13 | cmpccxadd -t 12 14 | cmpccxadd -t 13 15 | cmpccxadd -t 14 16 | cmpccxadd -t 15 17 | cmpccxadd -t 16 18 | cmpccxadd -t 17 19 | cmpccxadd -t 18 20 | cmpccxadd -t 19 21 | cmpccxadd -t 20 22 | cmpccxadd -t 21 23 | cmpccxadd -t 22 24 | cmpccxadd -t 23 25 | cmpccxadd -t 24 26 | cmpccxadd -t 25 27 | cmpccxadd -t 26 28 | cmpccxadd -t 27 29 | cmpccxadd -t 28 30 | cmpccxadd -t 29 31 | cmpccxadd -t 30 32 | cmpccxadd -t 31 33 | cmpccxadd -t 32 34 | cmpccxadd -t 33 35 | cmpccxadd -t 34 36 | cmpccxadd -t 35 37 | cmpccxadd -t 36 38 | cmpccxadd -t 37 39 | cmpccxadd -t 38 40 | cmpccxadd -t 39 41 | cmpccxadd -t 40 42 | -------------------------------------------------------------------------------- /KVM/qemu/provider/test_utils.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | # SPDX-License-Identifier: GPL-2.0-only 4 | # Copyright (c) 2024 Intel Corporation 5 | 6 | # Author: Xudong Hao 7 | # 8 | # History: Sept. 2024 - Xudong Hao - creation 9 | 10 | import os 11 | from virttest import data_dir, asset 12 | 13 | 14 | def get_baremetal_dir(params): 15 | """ 16 | Get the test provider's BM absolute path. 17 | :param params: Dictionary with the test parameters 18 | """ 19 | provider = params["provider"] 20 | provider_info = asset.get_test_provider_info(provider) 21 | if provider_info["uri"].startswith("file://"): 22 | provider_dir = provider_info["uri"][7:] 23 | else: 24 | provider_dir = data_dir.get_test_provider_dir(provider) 25 | baremetal_dir = os.path.join(provider_dir, "BM") 26 | 27 | return baremetal_dir 28 | -------------------------------------------------------------------------------- /BM/lam/README.md: -------------------------------------------------------------------------------- 1 | # LAM 2 | 3 | ## Description 4 | Linear Address Masking (LAM) is a new feature in the latest Intel platform Sierra Forest. 5 | LAM modifies the checking that is applied to 64-bit linear addresses, allowing software 6 | to use of the untranslated address bits for metadata. 7 | This test suite provides basic functional check to ensure LAM works properly. 8 | 9 | ## Usage 10 | ``` 11 | make 12 | # To run a specific case 13 | ./lam -t 14 | (for example, cpuid) ./lam -t 0x80 15 | ``` 16 | Test results (PASS or FAIL) will be printed out. 17 | 18 | ## Testcase ID 19 | | Case ID | Case Name | 20 | | ------ | ---------------------------- | 21 | | 0x1 | malloc | 22 | | 0x2 | max_bits | 23 | | 0x4 | mmap | 24 | | 0x8 | syscall | 25 | | 0x10 | io_uring | 26 | | 0x20 | inherit | 27 | | 0x40 | pasid | 28 | | 0x80 | cpuid | 29 | -------------------------------------------------------------------------------- /BM/Dockerfile.build.ddt: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # Copyright (c) 2022 Intel Corporation. 3 | 4 | FROM ubuntu:24.04 5 | 6 | ARG PROXY 7 | ENV http_proxy=$PROXY 8 | ENV https_proxy=$PROXY 9 | 10 | COPY common/uname /usr/local/ 11 | 12 | RUN dpkg --add-architecture i386 13 | RUN dpkg --print-foreign-architectures 14 | RUN \ 15 | apt-get update && \ 16 | apt-get install gcc-13 make libelf1 gcc-multilib g++-multilib git cmake -y --no-install-recommends && \ 17 | apt-get clean && \ 18 | rm -rf /var/lib/apt/lists/* 19 | 20 | #RUN apt-get install linux-headers-`uname -r` -y 21 | RUN apt-get update && apt-get install linux-headers-generic -y 22 | 23 | RUN export GIT_SSL_NO_VERIFY=true && rm -rf libipt && git clone http://github.com/intel/libipt.git && \ 24 | cd libipt && cmake . && make install 25 | 26 | RUN mkdir -p /src 27 | WORKDIR /src 28 | 29 | CMD ["sh"] 30 | -------------------------------------------------------------------------------- /KVM/qemu/ept_5lp_basic.cfg: -------------------------------------------------------------------------------- 1 | - ept_5lp_basic: 2 | type = ept_5lp_basic 3 | virt_test_type = qemu 4 | vm_accelerator = kvm 5 | # Don't create/remove guest images 6 | force_create_image = no 7 | remove_image = no 8 | start_vm = no 9 | # Stop VM after testing 10 | kill_vm = yes 11 | shell_prompt = "^\[.*\][\#\$]\s*$" 12 | vga = std 13 | auto_cpu_model = "no" 14 | cpu_model = host 15 | check_host_flags = yes 16 | flags = "ept_5level" 17 | guest_flags = "ept_5level" 18 | read_cmd = "cat /sys/module/kvm_intel/parameters/%s" 19 | rdmsr_cmd = "rdmsr 0x48c --bitfield 7:7" 20 | variants: 21 | - vm: 22 | - tdvm: 23 | machine_type_extra_params = "kernel-irqchip=split" 24 | vm_secure_guest_type = tdx 25 | # TD nested not supported yet 26 | no_flags = "ept_5level" 27 | -------------------------------------------------------------------------------- /scenario/emr-oe/tests-rapl: -------------------------------------------------------------------------------- 1 | # This file collects RAPL cases which can run against intel_rapl driver 2 | # on Intel® Architecture-based server platforms. 3 | # @hw_dep: 4 | # @other_dep: 5 | # @other_warn: which turbostat 2>/dev/null @ turbostat tool is required 6 | # @other_warn: which stress 2>/dev/null @ stress tool is required, please install stress-ng.x86_64 and run command: ln -s /usr/bin/stress-ng /usr/bin/stress 7 | # @other_warn: which perf 2>/dev/null @ perf tool is required, please install perf.x86_64 package 8 | 9 | intel_rapl_test.sh -t check_sysfs 10 | intel_rapl_test.sh -t check_pkg_domain 11 | intel_rapl_test.sh -t check_dram_domain 12 | intel_rapl_test.sh -t check_rapl_control_after_power_limit_change 13 | intel_rapl_test.sh -t rapl_control_enable_disable_pl1 14 | intel_rapl_test.sh -t rapl_control_enable_disable_pl2 15 | intel_rapl_test.sh -t rapl_control_enable_disable_pl4 16 | -------------------------------------------------------------------------------- /scenario/spr-oe/tests-rapl: -------------------------------------------------------------------------------- 1 | # This file collects RAPL cases which can run against intel_rapl driver 2 | # on Intel® Architecture-based server platforms. 3 | # @hw_dep: 4 | # @other_dep: 5 | # @other_warn: which turbostat 2>/dev/null @ turbostat tool is required 6 | # @other_warn: which stress 2>/dev/null @ stress tool is required, please install stress-ng.x86_64 and run command: ln -s /usr/bin/stress-ng /usr/bin/stress 7 | # @other_warn: which perf 2>/dev/null @ perf tool is required, please install perf.x86_64 package 8 | 9 | intel_rapl_test.sh -t check_sysfs 10 | intel_rapl_test.sh -t check_pkg_domain 11 | intel_rapl_test.sh -t check_dram_domain 12 | intel_rapl_test.sh -t check_rapl_control_after_power_limit_change 13 | intel_rapl_test.sh -t rapl_control_enable_disable_pl1 14 | intel_rapl_test.sh -t rapl_control_enable_disable_pl2 15 | intel_rapl_test.sh -t rapl_control_enable_disable_pl4 16 | -------------------------------------------------------------------------------- /scenario/srf-oe/tests-rapl: -------------------------------------------------------------------------------- 1 | # This file collects RAPL cases which can run against intel_rapl driver 2 | # on Intel® Architecture-based server platforms. 3 | # @hw_dep: 4 | # @other_dep: 5 | # @other_warn: which turbostat 2>/dev/null @ turbostat tool is required 6 | # @other_warn: which stress 2>/dev/null @ stress tool is required, please install stress-ng.x86_64 and run command: ln -s /usr/bin/stress-ng /usr/bin/stress 7 | # @other_warn: which perf 2>/dev/null @ perf tool is required, please install perf.x86_64 package 8 | 9 | intel_rapl_test.sh -t check_sysfs 10 | intel_rapl_test.sh -t check_pkg_domain 11 | intel_rapl_test.sh -t check_dram_domain 12 | intel_rapl_test.sh -t check_rapl_control_after_power_limit_change 13 | intel_rapl_test.sh -t rapl_control_enable_disable_pl1 14 | intel_rapl_test.sh -t rapl_control_enable_disable_pl2 15 | intel_rapl_test.sh -t rapl_control_enable_disable_pl4 16 | -------------------------------------------------------------------------------- /KVM/qemu/td_boot_multimes.cfg: -------------------------------------------------------------------------------- 1 | - td_boot_multimes: 2 | virt_test_type = qemu 3 | type = td_boot_multimes 4 | vm_accelerator = kvm 5 | machine_type_extra_params = "kernel-irqchip=split" 6 | vm_secure_guest_type = tdx 7 | start_vm = no 8 | vga = std 9 | auto_cpu_model = "no" 10 | cpu_model = host 11 | iterations = 10 12 | variants: 13 | - one_cpu: 14 | smp = 1 15 | vcpu_maxcpus = 1 16 | - four_cpu: 17 | smp = 4 18 | vcpu_maxcpus = 4 19 | variants: 20 | - one_socket: 21 | vcpu_sockets = 1 22 | - two_socket: 23 | vcpu_sockets = 2 24 | no one_cpu 25 | - 4vm_20times: 26 | vms = "vm1 vm2 vm3 vm4" 27 | image_snapshot = yes 28 | mem = 16384 29 | iterations = 20 30 | only four_cpu 31 | -------------------------------------------------------------------------------- /BM/Dockerfile.build: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # Copyright (c) 2022 Intel Corporation. 3 | 4 | FROM ubuntu:22.04 5 | 6 | ARG PROXY 7 | ENV http_proxy=$PROXY 8 | ENV https_proxy=$PROXY 9 | 10 | COPY common/uname /usr/local/ 11 | 12 | RUN dpkg --add-architecture i386 13 | RUN dpkg --print-foreign-architectures 14 | RUN \ 15 | apt-get update && \ 16 | apt-get install gcc-11 make libelf1 gcc-multilib g++-multilib git cmake -y --no-install-recommends && \ 17 | apt-get clean && \ 18 | rm -rf /var/lib/apt/lists/* 19 | 20 | #RUN apt-get install linux-headers-`uname -r` -y 21 | RUN apt-get update && apt-get install linux-headers-generic linux-headers-5.19.0-41-generic -y 22 | 23 | RUN export GIT_SSL_NO_VERIFY=true && rm -rf libipt && git clone http://github.com/intel/libipt.git && \ 24 | cd libipt && cmake . && make install 25 | 26 | RUN mkdir -p /src 27 | WORKDIR /src 28 | 29 | CMD ["sh"] 30 | -------------------------------------------------------------------------------- /BM/umip/Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # Copyright (c) 2022 Intel Corporation. 3 | 4 | BIN := umip_exceptions_64 umip_test_basic_64 5 | SUPPORT_GCC_32BIT = $(shell gcc -no-pie -c umip_utils.c -m32 -o umip_utils_32.o 2>/dev/null || echo false) 6 | 7 | ifeq ($(SUPPORT_GCC_32BIT),false) 8 | $(info Skip 32-bit compilation or clean due to lack of GCC support for 32-bit architecture.) 9 | else 10 | BIN += umip_exceptions_32 11 | endif 12 | 13 | all: $(BIN) 14 | 15 | umip_exceptions_64: umip_exceptions.c 16 | $(CC) -no-pie -c umip_utils.c -o umip_utils_64.o 17 | $(CC) -o $@ umip_utils_64.o $^ 18 | 19 | umip_test_basic_64: umip_test_basic.c 20 | $(CC) -no-pie -o umip_test_basic_64 umip_utils_64.o $^ 21 | 22 | umip_exceptions_32: umip_exceptions.c 23 | $(CC) -no-pie -c umip_utils.c -m32 -o umip_utils_32.o 24 | $(CC) -m32 -o $@ umip_utils_32.o $^ 25 | 26 | clean: 27 | rm -rf $(BIN) *.o 28 | -------------------------------------------------------------------------------- /scenario/emr-oa/tests-cstate: -------------------------------------------------------------------------------- 1 | # This file collects the CPU Core cstate cases which can run 2 | # on Intel® Architecture-based server platforms. 3 | # @hw_dep: 4 | # @other_dep: general_test.sh -t turbostat @ The latest 2024 version turbostat tool is required 5 | # @other_warn: which perf 2>/dev/null @ perf tool is required, please install perf.x86_64 package 6 | 7 | powermgr_cstate_tests.sh -t verify_cstate_name 8 | powermgr_cstate_tests.sh -t verify_server_all_cores_cstate6 9 | powermgr_cstate_tests.sh -t verify_server_core_cstate6_residency 10 | powermgr_cstate_tests.sh -t verify_server_cstate_list 11 | powermgr_cstate_tests.sh -t verify_server_perf_core_cstat_update 12 | powermgr_cstate_tests.sh -t verify_server_perf_pkg_cstat_update 13 | powermgr_cstate_tests.sh -t verify_server_pc2_entry 14 | powermgr_cstate_tests.sh -t verify_server_pc6_entry 15 | powermgr_cstate_tests.sh -t verify_server_pc6_residency 16 | -------------------------------------------------------------------------------- /BM/pt/utils.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | // Copyright (c) 2022 Intel Corporation. 3 | 4 | #ifndef _UTILS_H_ 5 | #define _UTILS_H_ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include "intel-pt.h" 15 | 16 | #define PAGESIZE 4096 17 | 18 | #define USERMODE 1 19 | #define KERNELMODE 2 20 | int pt_pmu_type(void); 21 | void init_evt_attribute(struct perf_event_attr *attr); 22 | int seek_pck_w_lib(enum pt_packet_type pt_type, __u64 *buf_ev, long bufsize); 23 | __u64 **create_map(int fde, long bufsize, int sn_fu_sm, int *fdi); 24 | void del_map(__u64 **buf_ev, long bufsize, int sn_fu_sm, int fdi); 25 | int sys_perf_event_open(struct perf_event_attr *attr, pid_t pid, int cpu, 26 | int group_fd, unsigned long flags); 27 | #endif /* _UTILS_H_ */ 28 | -------------------------------------------------------------------------------- /BM/ras/README.md: -------------------------------------------------------------------------------- 1 | # RAS 2 | 3 | Intel Xeon processor Scalable family supports various Reliability, Availability, and Serviceability (RAS) features across the product lineup. 4 | 5 | Current BM/ras covers following features: 6 | * basic error injection 7 | 8 | ## Usage 9 | Before test case execution: 10 | 1. make sure git submodules are initialized and updated: 11 | ``` 12 | git submodule update --init --recursive 13 | ``` 14 | 2. make sure required packages are installed: 15 | ``` 16 | yum install msr-tools cpuid mcelog screen # for CentOS 17 | apt install msr-tools cpuid mcelog screen # for Debian/Ubuntu 18 | ``` 19 | 20 | You can run the cases one by one, e.g. command 21 | 22 | ``` 23 | ./mce_test.sh -t apei-inj 24 | ./lmce_test.sh -t sameaddr_samecore_instr/instr 25 | ``` 26 | You also can run the cases together with runtests command, e.g. 27 | 28 | ``` 29 | cd .. 30 | ./runtests -f ras/tests -o logfile 31 | ``` 32 | -------------------------------------------------------------------------------- /scenario/gnr-oe/tests-rapl: -------------------------------------------------------------------------------- 1 | # This file collects RAPL cases which can run against intel_rapl driver 2 | # on Intel® Architecture-based server platforms. 3 | # @hw_dep: 4 | # @other_dep: 5 | # @other_warn: which turbostat 2>/dev/null @ turbostat tool is required 6 | # @other_warn: which stress 2>/dev/null @ stress tool is required, please install stress-ng.x86_64 and run command: ln -s /usr/bin/stress-ng /usr/bin/stress 7 | # @other_warn: which perf 2>/dev/null @ perf tool is required, please install perf.x86_64 package 8 | 9 | intel_rapl_test.sh -t check_sysfs 10 | intel_rapl_test.sh -t check_pkg_domain 11 | intel_rapl_test.sh -t check_psys_domain 12 | intel_rapl_test.sh -t check_dram_domain 13 | intel_rapl_test.sh -t check_rapl_control_after_power_limit_change 14 | intel_rapl_test.sh -t rapl_control_enable_disable_pl1 15 | intel_rapl_test.sh -t rapl_control_enable_disable_pl2 16 | intel_rapl_test.sh -t rapl_control_enable_disable_pl4 17 | -------------------------------------------------------------------------------- /BM/tools/Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # Copyright (c) 2022 Intel Corporation. 3 | 4 | TOOLSDIRS = $(shell ls -d */) 5 | MAKE_TOOLS_LOG = /tmp/make_tools.log 6 | 7 | all: 8 | @cat /dev/null > ${MAKE_TOOLS_LOG}; 9 | @for tooldir in $(TOOLSDIRS); do \ 10 | if [ -f "$$tooldir/Makefile" ]; then \ 11 | cd $$tooldir && \ 12 | make || { \ 13 | cd ..; \ 14 | echo " - Make tools $${tooldir} failed." >> ${MAKE_TOOLS_LOG}; \ 15 | continue; \ 16 | }; \ 17 | cd ..; \ 18 | fi \ 19 | done 20 | @cat ${MAKE_TOOLS_LOG} 21 | @if [ -s ${MAKE_TOOLS_LOG} ]; then \ 22 | echo "Some tools failed to build"; \ 23 | exit 2; \ 24 | else \ 25 | echo "All tools built successfully"; \ 26 | exit 0; \ 27 | fi 28 | 29 | clean: 30 | @for tooldir in $(TOOLSDIRS); do \ 31 | if [ -f "$$tooldir/Makefile" ]; then \ 32 | make -C $$tooldir clean || continue; \ 33 | fi \ 34 | done 35 | -------------------------------------------------------------------------------- /BM/cstate/README.md: -------------------------------------------------------------------------------- 1 | # Release Notes for CPU Core Cstate cases 2 | 3 | The CPU Core and Package cstate cases are designed for Intel® Architecture-based 4 | platforms. The cases are designed for intel_idle driver, not legacy acpi_idle driver. 5 | Considering Intel® Server and Client platforms have different Core C-states behavior. 6 | So created two tests files to distinguish the cases running on different test units: 7 | 8 | tests-client file collects the cases for Intel® client platforms 9 | You can run the cases one by one, e.g. command 10 | 11 | ``` 12 | ./powermgr_cstate_tests.sh -t verify_cstate_name 13 | ``` 14 | You also can run the cases together with runtests command, e.g. 15 | 16 | ``` 17 | cd .. 18 | ./runtests -f cstate/tests-client -o logfile 19 | ``` 20 | 21 | tests-server file collects the cases for Intel® server platforms. 22 | 23 | These are the basic cases for CPU Core C-states, If you have good idea to 24 | improve cstate cases, you are welcomed to send us the patches, thanks! 25 | -------------------------------------------------------------------------------- /scenario/emr-oe/tests-cstate: -------------------------------------------------------------------------------- 1 | # This file collects the CPU Core cstate cases which can run 2 | # on Intel® Architecture-based server platforms. 3 | # @hw_dep: 4 | # @other_dep: 5 | # @other_warn: which turbostat 2>/dev/null @ turbostat tool is required 6 | # @other_warn: which perf 2>/dev/null @ perf tool is required, please install perf.x86_64 package 7 | # @other_warn: which rdmsr 2>/dev/null @ rdmsr tool is required, please install msr-tools 8 | 9 | powermgr_cstate_tests.sh -t verify_cstate_name 10 | powermgr_cstate_tests.sh -t verify_server_all_cores_cstate6 11 | powermgr_cstate_tests.sh -t verify_server_core_cstate6_residency 12 | powermgr_cstate_tests.sh -t verify_server_cstate_list 13 | powermgr_cstate_tests.sh -t verify_server_perf_core_cstat_update 14 | powermgr_cstate_tests.sh -t verify_server_perf_pkg_cstat_update 15 | powermgr_cstate_tests.sh -t verify_server_pc2_entry 16 | powermgr_cstate_tests.sh -t verify_server_pc6_entry 17 | powermgr_cstate_tests.sh -t verify_ccstate_res_offline_online 18 | -------------------------------------------------------------------------------- /scenario/spr-oe/tests-cstate: -------------------------------------------------------------------------------- 1 | # This file collects the CPU Core cstate cases which can run 2 | # on Intel® Architecture-based server platforms. 3 | # @hw_dep: 4 | # @other_dep: 5 | # @other_warn: which turbostat 2>/dev/null @ turbostat tool is required 6 | # @other_warn: which perf 2>/dev/null @ perf tool is required, please install perf.x86_64 package 7 | # @other_warn: which rdmsr 2>/dev/null @ rdmsr tool is required, please install msr-tools 8 | 9 | powermgr_cstate_tests.sh -t verify_cstate_name 10 | powermgr_cstate_tests.sh -t verify_server_all_cores_cstate6 11 | powermgr_cstate_tests.sh -t verify_server_core_cstate6_residency 12 | powermgr_cstate_tests.sh -t verify_server_cstate_list 13 | powermgr_cstate_tests.sh -t verify_server_perf_core_cstat_update 14 | powermgr_cstate_tests.sh -t verify_server_perf_pkg_cstat_update 15 | powermgr_cstate_tests.sh -t verify_server_pc2_entry 16 | powermgr_cstate_tests.sh -t verify_server_pc6_entry 17 | powermgr_cstate_tests.sh -t verify_ccstate_res_offline_online 18 | -------------------------------------------------------------------------------- /BM/rapl/README.md: -------------------------------------------------------------------------------- 1 | # Release Notes for Running Average Power Limiting test cases 2 | 3 | The RAPL cases are designed for intel_rapl driver on Intel® Architecture-based platforms. 4 | Considering Intel® Server and Client platforms have different rapl domains. 5 | So created two tests files to distinguish the cases running on different test units. 6 | 7 | The prerequisites to run the RAPL cases: 8 | - User needs turbostat, stress, perf tools 9 | 10 | tests-client file collects the cases for Intel® client platforms 11 | You can run the cases one by one, e.g. command 12 | 13 | ``` 14 | ./intel_rapl_test.sh -t check_sysfs 15 | ``` 16 | You also can run the cases together with runtests command, e.g. 17 | 18 | ``` 19 | cd .. 20 | ./runtests -f rapl/tests-client -o logfile 21 | ``` 22 | 23 | tests-server file collects the cases for Intel® server platforms. 24 | 25 | These are the basic cases for Intel_RAPL driver, If you have good idea to 26 | improve cstate cases, you are welcomed to send us the patches, thanks! 27 | -------------------------------------------------------------------------------- /BM/ufs/tests: -------------------------------------------------------------------------------- 1 | # This file collects basic cases which can run against 2 | # TPMI UFS (Uncore Frequency Scaling) driver 3 | # on Intel® GRANITERAPIDS and further server platforms. 4 | # @hw_dep: general_test.sh -t fms -p "ufs_fms_list" @ CPU Model doesn't support tpmi_ufs 5 | # @other_dep: general_test.sh -t kconfig -k "CONFIG_INTEL_TPMI=m" 6 | # @other_warn: which stress 2>/dev/null @ stress tool is required, please install stress-ng.x86_64 and run command: ln -s /usr/bin/stress-ng /usr/bin/stress 7 | 8 | tpmi_ufs.sh -t check_ufs_unbind_bind 9 | tpmi_ufs.sh -t check_ufs_device 10 | tpmi_ufs.sh -t check_ufs_sysfs_attr 11 | tpmi_ufs.sh -t check_ufs_init_min_max_value 12 | tpmi_ufs.sh -t check_ufs_min_equals_to_max 13 | tpmi_ufs.sh -t check_ufs_max_equals_to_min 14 | tpmi_ufs.sh -t check_ufs_current_dynamic 15 | # Below two cases verify the efficiency latency control 16 | # with low threshhold, high threshold, elc floor frequency 17 | tpmi_ufs.sh -t check_ufs_elc_low_threshold 18 | tpmi_ufs.sh -t check_ufs_elc_high_threshold 19 | -------------------------------------------------------------------------------- /BM/sdsi/README.md: -------------------------------------------------------------------------------- 1 | # Release Notes for Intel® on Demand feature test cases 2 | 3 | The cases are designed for Intel® on Demand(former name is: 4 | Software Defined Silicon, aka SoftSKU) driver on 5 | Intel® Architecture-based server platforms. 6 | 7 | The prerequisites to run Intel® on Demand cases: 8 | - intel_sdsi tool, which can be built from 9 | upstream kernel: tools/arch/x86/intel_sdsi/intel_sdsi.c 10 | 11 | The cases do not cover AKC and CAP provisioning considering 12 | each unique processor has dedicated CAP file. 13 | AKC: Authentication Key Certificate 14 | CAP: Capability Activation Payload 15 | 16 | You can run the cases one by one, e.g. command 17 | 18 | ``` 19 | ./intel_sdsi.sh -t sdsi_unbind_bind 20 | ``` 21 | You also can run the cases together with runtests command, e.g. 22 | 23 | ``` 24 | cd .. 25 | ./runtests -f sdsi/tests -o logfile 26 | ``` 27 | 28 | These are the basic cases for Intel® on Demand driver, If you have good idea to 29 | improve sdsi cases, you are welcomed to send us the patches, thanks! 30 | -------------------------------------------------------------------------------- /BM/topology/README.md: -------------------------------------------------------------------------------- 1 | # Release Notes for Intel® CPU Topology test cases 2 | 3 | The cases are designed for Intel® CPU Topology on 4 | Intel® Architecture-based server and client platforms. 5 | 6 | The prerequisites to run CPU Topology cases: 7 | - cpuid tool, which can be installed by command below: 8 | For Ubuntu or Debian-based systems: 9 | sudo apt install cpuid 10 | For CentOS or Fedora-based systems: 11 | sudo dnf install cpuid 12 | 13 | You can run the cases one by one, e.g. command 14 | 15 | ``` 16 | ./cpu_topology.sh -t verify_thread_per_core 17 | ``` 18 | You also can run the cases together with runtests command, e.g. 19 | 20 | ``` 21 | cd .. 22 | ./runtests -f topology/tests-server -o logfile 23 | ``` 24 | Note: 25 | For numa_nodes_compare case, it is designed based on SNC-disabled, so if your env 26 | is SNC-enabled, this case should not be executed. 27 | 28 | These are the basic cases for Intel® CPU Topology, If you have good idea to 29 | improve CPU Topology cases, you are welcomed to send us the patches, thanks! 30 | -------------------------------------------------------------------------------- /KVM/qemu/cpu_pku.cfg: -------------------------------------------------------------------------------- 1 | - cpu_pku: 2 | type = cpu_pku 3 | only i386 x86_64 4 | no RHEL.6 RHEL.7 RHEL.8.0 RHEL.8.1 RHEL.8.2 RHEL.8.3 RHEL.8.4 RHEL.8.5 RHEL.8.6 5 | start_vm = no 6 | image_snapshot = yes 7 | timeout = 120 8 | unsupported_models = "EPYC-Rome EPYC EPYC-IBPB Opteron_G5 Opteron_G4 Opteron_G3 Opteron_G2 Opteron_G1" 9 | guest_dir = '/home/pku_test/' 10 | test_dir = '/tools/testing/selftests/mm/' 11 | kernel_repo = 'https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git' 12 | compile_cmd = gcc -o protection_keys -O2 -g -std=gnu99 -pthread -Wall protection_keys.c -lrt -ldl -lm -march=x86-64 -mxsave 13 | run_cmd = ./protection_keys 14 | tool_pre_compile = yes 15 | tool_pre_path = '/usr/libexec/kselftest/protection_keys_64' 16 | variants: 17 | - vm: 18 | - tdvm: 19 | machine_type_extra_params = "kernel-irqchip=split" 20 | vm_secure_guest_type = tdx 21 | auto_cpu_model = "no" 22 | cpu_model = host 23 | -------------------------------------------------------------------------------- /scenario/emr-oe/tests_pmu: -------------------------------------------------------------------------------- 1 | # This file collects the basic Performance Monitoring Unit(PMU) cases on Intel® Architecture-based platforms. 2 | # @hw_dep: 3 | # @other_dep: yum install perf 4 | # @other_warn: Disable watchdog when running with vPMU. $echo 0 > /proc/sys/kernel/nmi_watchdog 5 | pmu_tests.sh -t benchmark -w 0 6 | pmu_tests.sh -t benchmark -w 1 7 | pmu_tests.sh -t uncore 8 | pmu_tests.sh -t uncore_events 9 | pmu_iommu_tests.sh -t iommu_clocks 10 | apebs_tests.sh -t data_src -w 0 11 | apebs_tests.sh -t ip_1 -w 0 12 | apebs_tests.sh -t ip_2 -w 0 13 | apebs_tests.sh -t lbr_1 -w 0 14 | apebs_tests.sh -t lbr_2 -w 0 15 | apebs_tests.sh -t large_pebs -w 0 16 | apebs_tests.sh -t large_pebs -w 1 17 | apebs_tests.sh -t xmm_1 -w 1 18 | apebs_tests.sh -t xmm_2 -w 1 19 | apebs_tests.sh -t ip_1 -w 1 20 | apebs_tests.sh -t ip_2 -w 1 21 | apebs_tests.sh -t data_src -w 1 22 | apebs_tests.sh -t lbr_1 -w 1 23 | apebs_tests.sh -t lbr_2 -w 1 24 | apebs_tests.sh -t ip_1 -w 1 25 | apebs_tests.sh -t ip_2 -w 1 26 | apebs_tests.sh -t data_src -w 1 27 | -------------------------------------------------------------------------------- /scenario/cwf-ov/tests-ufs: -------------------------------------------------------------------------------- 1 | # This file collects basic cases which can run against 2 | # TPMI UFS (Uncore Frequency Scaling) driver 3 | # on Intel® GRANITERAPIDS and further server platforms. 4 | # @hw_dep: general_test.sh -t fms -p "ufs_fms_list" @ CPU Model doesn't support tpmi_ufs 5 | # @other_dep: general_test.sh -t kconfig -k "CONFIG_INTEL_TPMI=m" 6 | # @other_warn: which stress 2>/dev/null @ stress tool is required, please install stress-ng.x86_64 and run command: ln -s /usr/bin/stress-ng /usr/bin/stress 7 | 8 | tpmi_ufs.sh -t check_ufs_unbind_bind 9 | tpmi_ufs.sh -t check_ufs_device 10 | tpmi_ufs.sh -t check_ufs_sysfs_attr 11 | tpmi_ufs.sh -t check_ufs_init_min_max_value 12 | tpmi_ufs.sh -t check_ufs_min_equals_to_max 13 | tpmi_ufs.sh -t check_ufs_max_equals_to_min 14 | tpmi_ufs.sh -t check_ufs_current_dynamic 15 | # Below two cases verify the efficiency latency control 16 | # with low threshhold, high threshold, elc floor frequency 17 | # 18 | tpmi_ufs.sh -t check_ufs_elc_low_threshold 19 | # tpmi_ufs.sh -t check_ufs_elc_high_threshold 20 | -------------------------------------------------------------------------------- /BM/fred/README.md: -------------------------------------------------------------------------------- 1 | # FRED(Flexible Return and Event Delivery) Test Cases 2 | 3 | ## Description 4 | ``` 5 | FRED architecture defines simple new transitions that change privilege level (ring transitions). It was designed with the following goals: 6 | 7 | • Improve overall performance and response time by replacing event delivery through the interrupt descriptor table (IDT event delivery) and event return by the IRET instruction with lower latency transitions. 8 | 9 | • Improve software robustness by ensuring that event delivery establishes the full supervisor context and that event return establishes the full user context. 10 | 11 | ``` 12 | 13 | ## Usage 14 | Before executing the case, make the BM folder 15 | ``` 16 | cd ../ 17 | make 18 | ``` 19 | Then run case as 20 | 21 | ``` 22 | ./fred_test.sh -t 23 | ``` 24 | You also can run the cases together with runtests command, e.g. 25 | 26 | ``` 27 | cd .. 28 | ./runtests -f fred/tests -o logfile 29 | ``` 30 | 31 | ## Expected result 32 | 33 | All test results should show pass, no fail. 34 | -------------------------------------------------------------------------------- /scenario/emr-oa/tests_pmu: -------------------------------------------------------------------------------- 1 | # This file collects the basic Performance Monitoring Unit(PMU) cases on Intel® Architecture-based platforms. 2 | # @hw_dep: 3 | # @other_dep: yum install perf 4 | # @other_warn: Disable watchdog when running with vPMU. $echo 0 > /proc/sys/kernel/nmi_watchdog 5 | pmu_tests.sh -t benchmark -w 0 6 | pmu_tests.sh -t benchmark -w 1 7 | pmu_tests.sh -t basic 8 | pmu_tests.sh -t uncore 9 | pmu_tests.sh -t uncore_events 10 | pmu_iommu_tests.sh -t iommu_clocks 11 | apebs_tests.sh -t data_src -w 0 12 | apebs_tests.sh -t ip_1 -w 0 13 | apebs_tests.sh -t ip_2 -w 0 14 | apebs_tests.sh -t lbr_1 -w 0 15 | apebs_tests.sh -t lbr_2 -w 0 16 | apebs_tests.sh -t large_pebs -w 0 17 | apebs_tests.sh -t large_pebs -w 1 18 | apebs_tests.sh -t xmm_1 -w 1 19 | apebs_tests.sh -t xmm_2 -w 1 20 | apebs_tests.sh -t ip_1 -w 1 21 | apebs_tests.sh -t ip_2 -w 1 22 | apebs_tests.sh -t data_src -w 1 23 | apebs_tests.sh -t lbr_1 -w 1 24 | apebs_tests.sh -t lbr_2 -w 1 25 | apebs_tests.sh -t ip_1 -w 1 26 | apebs_tests.sh -t ip_2 -w 1 27 | apebs_tests.sh -t data_src -w 1 28 | -------------------------------------------------------------------------------- /scenario/emr-oe/tests-pmu: -------------------------------------------------------------------------------- 1 | # This file collects the basic Performance Monitoring Unit(PMU) cases on Intel® Architecture-based platforms. 2 | # @hw_dep: 3 | # @other_dep: which perf @no perf tool, please install perf 4 | # @other_warn: Disable watchdog when running with vPMU. $echo 0 > /proc/sys/kernel/nmi_watchdog 5 | pmu_tests.sh -t benchmark -w 0 6 | pmu_tests.sh -t benchmark -w 1 7 | pmu_tests.sh -t uncore 8 | pmu_tests.sh -t uncore_events 9 | pmu_iommu_tests.sh -t iommu_clocks 10 | apebs_tests.sh -t data_src -w 0 11 | apebs_tests.sh -t ip_1 -w 0 12 | apebs_tests.sh -t ip_2 -w 0 13 | apebs_tests.sh -t lbr_1 -w 0 14 | apebs_tests.sh -t lbr_2 -w 0 15 | apebs_tests.sh -t large_pebs -w 0 16 | apebs_tests.sh -t large_pebs -w 1 17 | apebs_tests.sh -t xmm_1 -w 1 18 | apebs_tests.sh -t xmm_2 -w 1 19 | apebs_tests.sh -t ip_1 -w 1 20 | apebs_tests.sh -t ip_2 -w 1 21 | apebs_tests.sh -t data_src -w 1 22 | apebs_tests.sh -t lbr_1 -w 1 23 | apebs_tests.sh -t lbr_2 -w 1 24 | apebs_tests.sh -t ip_1 -w 1 25 | apebs_tests.sh -t ip_2 -w 1 26 | apebs_tests.sh -t data_src -w 1 27 | -------------------------------------------------------------------------------- /scenario/spr-oe/tests-pmu: -------------------------------------------------------------------------------- 1 | # This file collects the basic Performance Monitoring Unit(PMU) cases on Intel® Architecture-based platforms. 2 | # @hw_dep: 3 | # @other_dep: which perf @no perf tool, please install perf 4 | # @other_warn: Disable watchdog when running with vPMU. $echo 0 > /proc/sys/kernel/nmi_watchdog 5 | pmu_tests.sh -t benchmark -w 0 6 | pmu_tests.sh -t benchmark -w 1 7 | pmu_tests.sh -t uncore 8 | pmu_tests.sh -t uncore_events 9 | pmu_iommu_tests.sh -t iommu_clocks 10 | apebs_tests.sh -t data_src -w 0 11 | apebs_tests.sh -t ip_1 -w 0 12 | apebs_tests.sh -t ip_2 -w 0 13 | apebs_tests.sh -t lbr_1 -w 0 14 | apebs_tests.sh -t lbr_2 -w 0 15 | apebs_tests.sh -t large_pebs -w 0 16 | apebs_tests.sh -t large_pebs -w 1 17 | apebs_tests.sh -t xmm_1 -w 1 18 | apebs_tests.sh -t xmm_2 -w 1 19 | apebs_tests.sh -t ip_1 -w 1 20 | apebs_tests.sh -t ip_2 -w 1 21 | apebs_tests.sh -t data_src -w 1 22 | apebs_tests.sh -t lbr_1 -w 1 23 | apebs_tests.sh -t lbr_2 -w 1 24 | apebs_tests.sh -t ip_1 -w 1 25 | apebs_tests.sh -t ip_2 -w 1 26 | apebs_tests.sh -t data_src -w 1 27 | -------------------------------------------------------------------------------- /BM/xsave/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # 3 | # Copyright (c) 2024 Intel Corporation. 4 | # Haoliang Zhu 5 | 6 | cmake_minimum_required(VERSION 3.12) 7 | project(xstate_64) 8 | 9 | # Set the build output directory 10 | set(BUILD_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}) 11 | 12 | # Set the installation prefix 13 | set(CMAKE_INSTALL_PREFIX /usr/local/bin) 14 | 15 | # Set the global compilation flags 16 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -g -std=gnu99 -pthread -Wall -no-pie") 17 | 18 | # Set the source files 19 | set(SRC xstate.c) 20 | 21 | # Build xstate_helpers.o from xstate_helpers.c 22 | add_library(xstate_helpers OBJECT xstate_helpers.c) 23 | target_compile_options(xstate_helpers PRIVATE -mno-sse -mno-mmx -mno-sse2 -mno-avx -mno-pku) 24 | 25 | add_executable(xstate_64 ${SRC}) 26 | 27 | # Link libraries 28 | target_link_libraries(xstate_64 PRIVATE xstate_helpers) 29 | target_link_libraries(xstate_64 PRIVATE rt dl) 30 | 31 | # Install the program 32 | install(TARGETS xstate_64 DESTINATION ${CMAKE_INSTALL_PREFIX}) 33 | -------------------------------------------------------------------------------- /BM/workload-xsave/work_UMWAIT.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | /* 3 | * offer the "UMWAIT" workload to yogini 4 | * 5 | * Copyright (c) 2023 Intel Corporation. 6 | * Len Brown 7 | */ 8 | 9 | #define _GNU_SOURCE 10 | #include /* printf(3) */ 11 | #include /* random(3) */ 12 | #include /* CPU_SET */ 13 | #include 14 | #include "yogini.h" 15 | #include 16 | 17 | #if __GNUC__ >= 9 18 | 19 | #pragma GCC target("waitpkg") 20 | 21 | #define WORKLOAD_NAME "UMWAIT" 22 | 23 | #define DATA_ENTRIES 1 24 | 25 | static void work(void *arg) 26 | { 27 | char dummy; 28 | 29 | _umonitor(&dummy); 30 | _umwait(0, (unsigned long long)-1); 31 | } 32 | 33 | #include "run_common.c" 34 | 35 | static struct workload w = { 36 | "UMWAIT", 37 | NULL, 38 | NULL, 39 | run, 40 | }; 41 | 42 | struct workload *register_UMWAIT(void) 43 | { 44 | if (cpuid.tpause) 45 | return &w; 46 | 47 | return NULL; 48 | } 49 | #else 50 | 51 | #warning GCC < 9 can not build work_UMWAIT.c 52 | 53 | #endif /* GCC < 9 */ 54 | -------------------------------------------------------------------------------- /scenario/README.md: -------------------------------------------------------------------------------- 1 | # Scenario 2 | 3 | The scenario folder contains specific test files selected for particular scenarios. For example, tests designed for the GraniteRapid + OpenEuler OS platform. These test files can be either plain text files or symbolic links that point to the test files in the feature directory. 4 | 5 | ## Contents 6 | 7 | * Text Files: 8 | Some of the tests are included as plain text files. These files contain the partial of some feature tests. 9 | 10 | * Symbolic Links: 11 | Some tests are included as symbolic links. These links point to the relevant test files located in the feature directory, ensuring that the scenario folder remains organized and that tests are not duplicated unnecessarily. 12 | 13 | ## Purpose 14 | The purpose of this folder is to organize and provide easy access to tests tailored for specific platforms and scenarios. 15 | By having dedicated folders for each scenario, it becomes easier to manage and execute the appropriate tests for different environments. 16 | 17 | ## How to Use 18 | ``` 19 | ./runtests -f 20 | ``` 21 | -------------------------------------------------------------------------------- /BM/telemetry/README.md: -------------------------------------------------------------------------------- 1 | Telemetry is collected and returned regardless of its type. For example, telemetry will include counters, sampled data (such as voltages) and more complex data (such as histograms). 2 | Collecting and reporting telemetry allows for a more detailed understanding of the operation of the system from which the telemetry is obtained. 3 | 4 | Current test cases are focusing on telemetry Aggregator 5 | 6 | Detailed cases: 7 | #check if telemetry sysfs is generated 8 | telemetry_tests.sh -t telem_sysfs 9 | #check if telemetry device is generated 10 | telemetry_tests.sh -t telem_dev 11 | #check if detailed telemetry sysfs value is correct 12 | telemetry_tests.sh -t telem_sysfs_common 13 | #check if telemetry data is readable 14 | telemetry_tests.sh -t telem_data 15 | #check if pci drvier loaded 16 | telemetry_tests.sh -t pci 17 | #check load/unload telemetry drvier 18 | telemetry_tests.sh -t telem_driver 19 | #check load/unload telemetry pci drvier with 32bit binary 20 | telemetry_tests.sh -t telem_data_32 21 | #check load/unload telemetry pci drvier 22 | telemetry_tests.sh -t pci_driver 23 | -------------------------------------------------------------------------------- /KVM/qemu/vfio_gpu_boot.cfg: -------------------------------------------------------------------------------- 1 | - vfio_gpu_boot: 2 | virt_test_type = qemu 3 | type = vfio_gpu_boot 4 | start_vm = no 5 | # Special host pci slots to be configured 6 | # setup_hostdev_slots = 0000:00:00.1 7 | hostdev_bind_driver = vfio-pci 8 | vm_hostdev_driver = vfio-pci 9 | vms = "vm1" 10 | vm_hostdevs = hostdev1 11 | hostdev_assignment_type = pf 12 | guest_operation = run_cuda_sample 13 | variants: 14 | - nvidia: 15 | gpu_device_check_cmd = "lspci -k -s `lspci|grep NV|awk '{print $1}'`|grep 'Kernel driver in use'|grep nvidia" 16 | gpu_status_check_cmd = "nvidia-smi|grep `lspci|grep NV|awk '{print $1}'`" 17 | variants: 18 | - @default: 19 | dma_cmd = "echo 0x200000 > /sys/module/vfio_iommu_type1/parameters/dma_entry_limit" 20 | - iommufd: 21 | vm_hostdev_iommufd = iommufd0 22 | variants: 23 | - vm: 24 | - tdvm: 25 | vm_secure_guest_type = tdx 26 | machine_type_extra_params = "kernel-irqchip=split" 27 | auto_cpu_model = "no" 28 | cpu_model = "host" 29 | -------------------------------------------------------------------------------- /scenario/emr-oe/tests-dsa1: -------------------------------------------------------------------------------- 1 | #DSA_XS_FUNC_USER_MEMMOVE_1D2G2Q 2 | dsa_user_test.sh -c 1d2g2q_user -o 0x03 3 | #DSA_XS_FUNC_USER_MEMFILL_1D2G2Q 4 | dsa_user_test.sh -c 1d2g2q_user -o 0x04 5 | #DSA_XS_FUNC_USER_COMPARE_1D2G2Q 6 | dsa_user_test.sh -c 1d2g2q_user -o 0x05 7 | #DSA_XS_FUNC_USER_COMPVAL_1D2G2Q 8 | dsa_user_test.sh -c 1d2g2q_user -o 0x06 9 | #DSA_XS_FUNC_USER_DUALCAST_1D2G2Q 10 | dsa_user_test.sh -c 1d2g2q_user -o 0x09 11 | #DSA_XS_FUNC_USER_NOOP_1D2G2Q 12 | dsa_user_test.sh -c 1d2g2q_user -o 0x0 13 | #DSA_XS_FUNC_USER_DRAIN_1D2G2Q 14 | dsa_user_test.sh -c 1d2g2q_user -o 0x2 15 | #DSA_XS_FUNC_USER_CRCGEN_1D2G2Q 16 | dsa_user_test.sh -c 1d2g2q_user -o 0x10 17 | #DSA_XS_FUNC_USER_COPYCRC_1D2G2Q 18 | dsa_user_test.sh -c 1d2g2q_user -o 0x11 19 | #DSA_XS_FUNC_USER_CFLUSH_1D2G2Q 20 | dsa_user_test.sh -c 1d2g2q_user -o 0x20 21 | #DSA_XS_FUNC_USER_DIFCHECK_1D2G2Q 22 | dsa_user_test.sh -c 1d2g2q_user -o 0x12 23 | #DSA_XS_FUNC_USER_DIFINS_1D2G2Q 24 | dsa_user_test.sh -c 1d2g2q_user -o 0x13 25 | #DSA_XS_FUNC_USER_DIFSTRP_1D2G2Q 26 | dsa_user_test.sh -c 1d2g2q_user -o 0x14 27 | #DSA_XS_FUNC_USER_DIFUPDT_1D2G2Q 28 | dsa_user_test.sh -c 1d2g2q_user -o 0x15 29 | -------------------------------------------------------------------------------- /scenario/spr-oe/tests-dsa1: -------------------------------------------------------------------------------- 1 | #DSA_XS_FUNC_USER_MEMMOVE_1D2G2Q 2 | dsa_user_test.sh -c 1d2g2q_user -o 0x03 3 | #DSA_XS_FUNC_USER_MEMFILL_1D2G2Q 4 | dsa_user_test.sh -c 1d2g2q_user -o 0x04 5 | #DSA_XS_FUNC_USER_COMPARE_1D2G2Q 6 | dsa_user_test.sh -c 1d2g2q_user -o 0x05 7 | #DSA_XS_FUNC_USER_COMPVAL_1D2G2Q 8 | dsa_user_test.sh -c 1d2g2q_user -o 0x06 9 | #DSA_XS_FUNC_USER_DUALCAST_1D2G2Q 10 | dsa_user_test.sh -c 1d2g2q_user -o 0x09 11 | #DSA_XS_FUNC_USER_NOOP_1D2G2Q 12 | dsa_user_test.sh -c 1d2g2q_user -o 0x0 13 | #DSA_XS_FUNC_USER_DRAIN_1D2G2Q 14 | dsa_user_test.sh -c 1d2g2q_user -o 0x2 15 | #DSA_XS_FUNC_USER_CRCGEN_1D2G2Q 16 | dsa_user_test.sh -c 1d2g2q_user -o 0x10 17 | #DSA_XS_FUNC_USER_COPYCRC_1D2G2Q 18 | dsa_user_test.sh -c 1d2g2q_user -o 0x11 19 | #DSA_XS_FUNC_USER_CFLUSH_1D2G2Q 20 | dsa_user_test.sh -c 1d2g2q_user -o 0x20 21 | #DSA_XS_FUNC_USER_DIFCHECK_1D2G2Q 22 | dsa_user_test.sh -c 1d2g2q_user -o 0x12 23 | #DSA_XS_FUNC_USER_DIFINS_1D2G2Q 24 | dsa_user_test.sh -c 1d2g2q_user -o 0x13 25 | #DSA_XS_FUNC_USER_DIFSTRP_1D2G2Q 26 | dsa_user_test.sh -c 1d2g2q_user -o 0x14 27 | #DSA_XS_FUNC_USER_DIFUPDT_1D2G2Q 28 | dsa_user_test.sh -c 1d2g2q_user -o 0x15 29 | -------------------------------------------------------------------------------- /KVM/qemu/vfio_net_boot.cfg: -------------------------------------------------------------------------------- 1 | - vfio_net_boot: 2 | virt_test_type = qemu 3 | type = vfio_net_boot 4 | start_vm = no 5 | nics = "" 6 | # Special host pci slots to be configured 7 | # setup_hostdev_slots = 0000:00:00.1 8 | hostdev_bind_driver = vfio-pci 9 | vm_hostdev_driver = vfio-pci 10 | ext_host = kernel.org 11 | vms = "vm1" 12 | vm_hostdevs = hostdev1 13 | hostdev_assignment_type = pf 14 | variants ip_version: 15 | - ipv4: 16 | variants: 17 | - @default: 18 | dma_cmd = "echo 0x200000 > /sys/module/vfio_iommu_type1/parameters/dma_entry_limit" 19 | - iommufd: 20 | vm_hostdev_iommufd = iommufd0 21 | variants: 22 | - @default: 23 | - virtio_iommu: 24 | required_qemu= [7.0.0,) 25 | only x86_64 26 | only q35 27 | enable_guest_iommu = yes 28 | virtio_iommu = yes 29 | variants: 30 | - vm: 31 | - tdvm: 32 | vm_secure_guest_type = tdx 33 | machine_type_extra_params = "kernel-irqchip=split" 34 | auto_cpu_model = "no" 35 | cpu_model = "host" 36 | -------------------------------------------------------------------------------- /BM/instruction-check/instruction_check.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | import sys 3 | import os 4 | 5 | from avocado.core.job import Job 6 | from avocado.core.nrunner.runnable import Runnable 7 | from avocado.core.suite import TestSuite 8 | from feature_list import feature_list 9 | from feature_list import get_platform 10 | 11 | current_dir = os.path.dirname(os.path.realpath(__file__)) 12 | BM_dir = os.path.dirname(current_dir) 13 | source_dir = f"{BM_dir}/tools/cpuid_check" 14 | 15 | def main(): 16 | feature_name_list = feature_list.keys() 17 | platform = get_platform() 18 | 19 | tests = [] 20 | for feature_name in feature_name_list: 21 | if platform in feature_list[feature_name]["platforms"]: 22 | args = feature_list[feature_name]["cpuid"] 23 | runnable = Runnable("exec-test", f"{source_dir}/cpuid_check", *args, identifier=feature_name) 24 | tests.append(runnable) 25 | else: 26 | continue 27 | 28 | suite = TestSuite(name="Check", tests=tests) 29 | 30 | # Run the test suites 31 | with Job(test_suites=[suite]) as j: 32 | sys.exit(j.run()) 33 | 34 | if __name__=="__main__": 35 | main() -------------------------------------------------------------------------------- /BM/sdsi/tests: -------------------------------------------------------------------------------- 1 | # This file collects basic cases which can run against sdsi driver 2 | # on Intel® Architecture-based server platforms. 3 | # @hw_dep: general_test.sh -t fms -p "sdsi_fms_list" @ CPU Model doesn't support sdsi 4 | # @other_dep: general_test.sh -t kconfig -k "CONFIG_INTEL_SDSI=m" 5 | # @other_warn: which intel_sdsi 2>/dev/null @ intel_sdsi tool is required, please get it from the latest upstream kernel tools: tools/arch/x86/intel_sdsi/intel_sdsi.c 6 | 7 | intel_sdsi.sh -t driver_unbind_bind 8 | intel_sdsi.sh -t sdsi_sysfs 9 | intel_sdsi.sh -t sdsi_per_socket 10 | intel_sdsi.sh -t sysfs_register_attri 11 | intel_sdsi.sh -t sysfs_certificate_attri 12 | intel_sdsi.sh -t sysfs_telemetry_attri 13 | intel_sdsi.sh -t sysfs_current_meter_attri 14 | intel_sdsi.sh -t sdsi_devices 15 | intel_sdsi.sh -t sdsi_ppin 16 | intel_sdsi.sh -t nvram_content_err_check 17 | intel_sdsi.sh -t enable_status 18 | intel_sdsi.sh -t read_meter_telemetry 19 | intel_sdsi.sh -t verify_meter_current_update 20 | intel_sdsi.sh -t read_meter_current 21 | intel_sdsi.sh -t stress_reading_reg 22 | intel_sdsi.sh -t stress_reading_lic 23 | intel_sdsi.sh -t stress_reading_tele 24 | intel_sdsi.sh -t stress_reading_cur_meter -------------------------------------------------------------------------------- /BM/adaptation/centos/Dockerfile.build: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # Copyright (c) 2022 Intel Corporation. 3 | 4 | #docker pull quay.io/centos/centos:stream9 5 | 6 | # docker run -it --rm --privileged -v $HOME:/home_host --mount type=bind,source=/dev,target=/dev localhost/centos:stream9 /bin/bash 7 | 8 | FROM quay.io/centos/centos:stream9 9 | 10 | ARG PROXY="http://127.0.0.1" 11 | 12 | ENV http_proxy=$PROXY 13 | ENV https_proxy=$PROXY 14 | 15 | RUN export http_proxy=${PROXY} https_proxy=${PROXY} && \ 16 | yum -y groupinstall "Development Tools" && \ 17 | yum -y install vim python3-pip && \ 18 | pip install --user avocado-framework \ 19 | yum -y clean all && \ 20 | rm -rf /var/cache/yum 21 | 22 | #RUN export GIT_SSL_NO_VERIFY=true && rm -rf libipt && git clone http://github.com/intel/libipt.git && \ 23 | # cd libipt && cmake . && make install 24 | 25 | RUN mkdir -p /home_host 26 | WORKDIR /home_host 27 | 28 | RUN git clone https://github.com/intel/lkvs.git 29 | 30 | 31 | # #RUN apt-get install linux-headers-`uname -r` -y 32 | # #RUN apt-get update && apt-get install linux-headers-generic linux-headers-5.19.0-41-generic -y 33 | 34 | CMD ["bash"] 35 | 36 | 37 | -------------------------------------------------------------------------------- /BM/amx/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # 3 | # Copyright (c) 2024 Intel Corporation. 4 | # Haoliang Zhu 5 | 6 | cmake_minimum_required(VERSION 3.12) 7 | project(tmul) 8 | 9 | # Set the build output directory 10 | set(BUILD_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}) 11 | 12 | # Set the installation prefix 13 | set(CMAKE_INSTALL_PREFIX /usr/local/bin) 14 | 15 | # Set the source files 16 | set(SRC tmul.c) 17 | 18 | # Get target CPU information 19 | execute_process( 20 | COMMAND ${CMAKE_C_COMPILER} -march=native -Q --help=target 21 | OUTPUT_VARIABLE TARGET_CPU 22 | ERROR_QUIET 23 | ) 24 | 25 | # Check if the target CPU supports AMX 26 | string(REGEX MATCH "-mamx-tile[ \t]+\\[enabled\\]" AMX_SUPPORTED "${TARGET_CPU}") 27 | 28 | if(AMX_SUPPORTED) 29 | message(STATUS "AMX supported by the CPU.") 30 | else() 31 | message(WARNING "AMX not supported by the CPU - skipping tmul build.") 32 | return() 33 | endif() 34 | 35 | # Add the executable 36 | add_executable(tmul ${SRC}) 37 | 38 | # Link libraries 39 | target_link_libraries(tmul m pthread) 40 | 41 | # Install the program 42 | install(TARGETS tmul DESTINATION ${CMAKE_INSTALL_PREFIX}) 43 | -------------------------------------------------------------------------------- /BM/avx512vbmi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # 3 | # Copyright (c) 2024 Intel Corporation. 4 | # Haoliang Zhu 5 | 6 | cmake_minimum_required(VERSION 3.12) 7 | project(vbmi_test) 8 | 9 | # Set the build output directory 10 | set(BUILD_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}) 11 | 12 | # Set the installation prefix 13 | set(CMAKE_INSTALL_PREFIX /usr/local/bin) 14 | 15 | # Set the source files 16 | set(SRC vbmi_test.c) 17 | 18 | # Get target CPU information 19 | execute_process( 20 | COMMAND ${CMAKE_C_COMPILER} -march=native -Q --help=target 21 | OUTPUT_VARIABLE TARGET_CPU 22 | ERROR_QUIET 23 | ) 24 | 25 | # Check if the target CPU supports AVX-512VBMI 26 | string(REGEX MATCH "-mavx512vbmi[ \t]+\\[enabled\\]" AVX512VBMI_SUPPORTED "${TARGET_CPU}") 27 | 28 | if(AVX512VBMI_SUPPORTED) 29 | message(STATUS "AVX-512VBMI supported by the CPU.") 30 | else() 31 | message(WARNING "AVX-512VBMI not supported by the CPU - skipping vbmi_test build.") 32 | return() 33 | endif() 34 | 35 | # Add the executable 36 | add_executable(vbmi_test ${SRC}) 37 | 38 | # Install the program 39 | install(TARGETS vbmi_test DESTINATION ${CMAKE_INSTALL_PREFIX}) 40 | -------------------------------------------------------------------------------- /KVM/qemu/tests/td_debug.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | # SPDX-License-Identifier: GPL-2.0-only 4 | # Copyright (c) 2024 Intel Corporation 5 | 6 | # Author: Xudong Hao 7 | # 8 | # History: Jun. 2024 - Xudong Hao - creation 9 | from virttest import error_context 10 | 11 | 12 | # This decorator makes the test function aware of context strings 13 | @error_context.context_aware 14 | def run(test, params, env): 15 | """ 16 | Boot TD with debug on/off: 17 | 1) Boot up one TDVM with "debug=off" or "debug=on" 18 | 2) Inject NMI to TDVM 19 | 3) The TD works well 20 | 4) Shutdown TDVM and close session 21 | 22 | :param test: QEMU test object 23 | :param params: Dictionary with the test parameters 24 | :param env: Dictionary with test environment 25 | """ 26 | 27 | vm = env.get_vm(params["main_vm"]) 28 | vm.verify_alive() 29 | timeout = params.get_numeric("login_timeout", 240) 30 | session = vm.wait_for_login(timeout=timeout) 31 | if (params.get("nmi") == "yes"): 32 | error_context.context("Inject NMI to TDVM", test.log.info) 33 | vm.monitor.cmd("inject-nmi") 34 | vm.verify_alive() 35 | session.close() 36 | -------------------------------------------------------------------------------- /BM/pstate/README.md: -------------------------------------------------------------------------------- 1 | # Release Notes for Intel Pstate cases 2 | 3 | The cpufreq driver is a generic CPU frequency scaling driver that provides a framework 4 | for managing the CPU frequency, while Intel_Pstate driver is a specific CPU frequency 5 | for Intel® Architecture-based processors. These drivers are specifically optimized for 6 | Intel_pstate and rely on the cpufreq sysfs attributes for configuration. 7 | 8 | The tests file contains the cases that are applicable to both Intel® client and Server platforms. 9 | At present, the tests do not cover non-HWP mode, but are exclusively designed for Hardware P-state mode. 10 | HWP stands for Hardware-controlled Performance States, For more information on the HWP specifiction, 11 | please consult the Intel® Software Developer's Manual. 12 | 13 | You can run the cases one by one, e.g. command 14 | 15 | ``` 16 | ./intel_pstate_tests.sh -t verify_sysfs_atts 17 | ``` 18 | You also can run the cases together with runtests command, e.g. 19 | 20 | ``` 21 | cd .. 22 | ./runtests -f pstate/tests -o logfile 23 | ``` 24 | 25 | These are the basic cases for CPU pstates, If you have good idea to 26 | improve pstate cases, you are welcomed to send us the patches, thanks! 27 | -------------------------------------------------------------------------------- /BM/workload-xsave/run_common.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | /* 3 | * generic worker code for re-use via inclusion 4 | * 5 | * Copyright (c) 2022 Intel Corporation. 6 | * Len Brown 7 | * Yi Sun 8 | * Dongcheng Yan 9 | * 10 | */ 11 | 12 | #include 13 | #include 14 | #include "yogini.h" 15 | 16 | void thread_break(int32_t reason, uint32_t thread_idx); 17 | /* 18 | * run() 19 | * complete work in chunks of "data_entries" operations 20 | * between each chunk, check the time 21 | * return when requested operations complete, or out of time 22 | * 23 | * return operationds completed 24 | */ 25 | static unsigned long long run(struct work_instance *wi) 26 | { 27 | unsigned int count; 28 | unsigned int operations = wi->repeat; 29 | struct thread_data *dp = wi->worker_data; 30 | 31 | if (operations == 0) 32 | operations = (~0U); 33 | 34 | for (count = 0; count < operations; count++) { 35 | thread_break(wi->break_reason, wi->thread_number); 36 | /* each invocation of work() does "entries" operations */ 37 | work(dp); 38 | } 39 | unsigned long long tsc_now = rdtsc(); 40 | return tsc_now; 41 | } 42 | -------------------------------------------------------------------------------- /BM/workload-xsave/work_TPAUSE.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | /* 3 | * offer the "TPAUSE" workload to yogini 4 | * 5 | * Copyright (c) 2022 Intel Corporation. 6 | * Len Brown 7 | */ 8 | 9 | #define _GNU_SOURCE 10 | #include /* printf(3) */ 11 | #include /* random(3) */ 12 | #include /* CPU_SET */ 13 | #include 14 | #include "yogini.h" 15 | #include 16 | 17 | #if __GNUC__ >= 9 18 | 19 | #pragma GCC target("waitpkg") 20 | 21 | #define WORKLOAD_NAME "TPAUSE" 22 | #define TPAUSE_TSC_CYCLES ((unsigned long long)(1000 * 1000)) 23 | 24 | #define DATA_ENTRIES 1 25 | 26 | static void work(void *arg) 27 | { 28 | unsigned int ctrl; 29 | unsigned long long tsc; 30 | 31 | ctrl = 0; 32 | tsc = _rdtsc(); 33 | tsc += TPAUSE_TSC_CYCLES; 34 | 35 | _tpause(ctrl, tsc); 36 | } 37 | 38 | #include "run_common.c" 39 | 40 | static struct workload w = { 41 | "TPAUSE", 42 | NULL, 43 | NULL, 44 | run, 45 | }; 46 | 47 | struct workload *register_TPAUSE(void) 48 | { 49 | if (cpuid.tpause) 50 | return &w; 51 | 52 | return NULL; 53 | } 54 | #else 55 | 56 | #warning GCC < 9 can not build work_TPAUSE.c 57 | 58 | #endif /* GCC < 9 */ 59 | -------------------------------------------------------------------------------- /scenario/emr-oa/README.md: -------------------------------------------------------------------------------- 1 | ## Features Supported 2 | 3 | Below are the test cases for new features on the Intel EMR platform in OpenAnolis (referred to as OA) OS. Please note that the specific test content for each feature can be found in the relevant content under the BM directory, which will not be repeated here. We believe that these test cases are a subset of all related feature tests there. 4 | 5 | [TODO tests list] 6 | * tests-dsa 7 | 8 | Tested with [Anolis OS 23.1 LTS](https://mirrors.openanolis.cn/anolis/23/isos/GA/x86_64/AnolisOS-23.1-x86_64-dvd.iso) 9 | 10 | ## Dependencies 11 | ### tests-topology 12 | * hwloc.x86_64 package 13 | ``` 14 | yum install hwloc 15 | ``` 16 | 17 | * cpuid tool 18 | 19 | ### tests-cstate 20 | perf.x86_64 package 21 | ``` 22 | yum install perf 23 | ``` 24 | ### tests-pstate and tests-rapl 25 | * turbostat tool version 2024.xx.xx is required, 26 | recompile from the latest mainline kernel source code: `tools/power/x86/turbostat/turbostat.c` 27 | 28 | * stress-ng.x86_64 29 | ``` 30 | yum install stress-ng 31 | ln -s /usr/bin/stress-ng /usr/bin/stress 32 | ``` 33 | 34 | ## Known Issues 35 | ### Tools Missing 36 | * cpuid 37 | (workaround: copy from CentOS 9) 38 | 39 | * rdmsr-tool 40 | -------------------------------------------------------------------------------- /BM/pt/README.md: -------------------------------------------------------------------------------- 1 | # PT 2 | 3 | Intel Processor Trace (Intel PT) is an extension of Intel Architecture that 4 | captures information about software execution using dedicated hardware facilities 5 | that cause only minimal performance perturbation to the software being traced. 6 | 7 | ## Build Tips 8 | 9 | Need prepare intel-pt.h and libipt.so for building PT related cases. 10 | You can get them in https://github.com/intel/libipt. 11 | 12 | 1. git clone https://github.com/intel/libipt 13 | 2. cd libipt 14 | 3. mkdir build && cd build 15 | 4. cmake ../ 16 | 5. make 17 | 6. make install 18 | 19 | ``` 20 | # Disable branch and check no TIP/FUP/TNT. 21 | ./branch 22 | 23 | # User mode trace check 24 | ./cpl 1 25 | 26 | # Kernel mode trace check 27 | ./cpl 2 28 | 29 | # Check if psb package there. 30 | ./psb 31 | 32 | # Check reserved bit cannot be set. 33 | ./negative_test 34 | 35 | # Non root user do full trace check. 36 | ./nonroot_test 1 37 | 38 | # Non root user do snapshot trace check. 39 | ./nonroot_test 2 40 | ``` 41 | 42 | ## Expected result 43 | 44 | All test results should show pass, no fail. 45 | Usage for perf_tests.sh: 46 | 47 | 1. Make sure latest perf is there. 48 | 2. Run case as 49 | ``` 50 | ./perf_tests.sh -t 51 | ``` 52 | -------------------------------------------------------------------------------- /scenario/spr-oe/tests-pstate: -------------------------------------------------------------------------------- 1 | # This file contains basic test cases designed to 2 | # evaluate the performance of Intel_pstate and cpufreq 3 | # scaling drivers on Intel® Architecture-based platforms 4 | # For a deeper understanding of HW P-state related MSRs, 5 | # Users may refer to the Intel® Software Developer Manual. 6 | # @hw_dep: 7 | # @other_dep: general_test.sh -t turbostat @ The latest 2024 version turbostat tool is required 8 | # @other_warn: which stress 2>/dev/null @ stress tool is required, please install stress-ng.x86_64 and run command: ln -s /usr/bin/stress-ng /usr/bin/stress 9 | 10 | intel_pstate_tests.sh -t verify_default_gov_epp 11 | intel_pstate_tests.sh -t verify_gov_perf_epp_perf 12 | intel_pstate_tests.sh -t verify_gov_powersave_epp_perf 13 | intel_pstate_tests.sh -t verify_gov_powersave_epp_balance_perf 14 | intel_pstate_tests.sh -t verify_gov_powersave_epp_balance_power 15 | intel_pstate_tests.sh -t verify_gov_powersave_epp_power 16 | intel_pstate_tests.sh -t verify_cpufreq_with_governor_perf 17 | intel_pstate_tests.sh -t verify_cpufreq_with_governor_powersave 18 | intel_pstate_tests.sh -t verify_max_cpufreq_perf_turbo 19 | intel_pstate_tests.sh -t verify_max_cpufreq_passive_perf_turbo 20 | intel_pstate_tests.sh -t verify_max_cpufreq_perf_non_turbo 21 | -------------------------------------------------------------------------------- /scenario/emr-oe/tests-pstate: -------------------------------------------------------------------------------- 1 | # This file contains basic test cases designed to 2 | # evaluate the performance of Intel_pstate and cpufreq 3 | # scaling drivers on Intel® Architecture-based platforms 4 | # For a deeper understanding of HW P-state related MSRs, 5 | # Users may refer to the Intel® Software Developer Manual. 6 | # @hw_dep: 7 | # @other_dep: general_test.sh -t turbostat @ The latest 2024 version turbostat tool is required 8 | # @other_warn: which stress 2>/dev/null @ stress tool is required, please install stress-ng.x86_64 and run command: ln -s /usr/bin/stress-ng /usr/bin/stress 9 | 10 | intel_pstate_tests.sh -t verify_default_gov_epp 11 | intel_pstate_tests.sh -t verify_gov_perf_epp_perf 12 | intel_pstate_tests.sh -t verify_gov_powersave_epp_perf 13 | intel_pstate_tests.sh -t verify_gov_powersave_epp_balance_perf 14 | intel_pstate_tests.sh -t verify_gov_powersave_epp_balance_power 15 | intel_pstate_tests.sh -t verify_gov_powersave_epp_power 16 | intel_pstate_tests.sh -t verify_cpufreq_with_governor_perf 17 | intel_pstate_tests.sh -t verify_cpufreq_with_governor_powersave 18 | intel_pstate_tests.sh -t verify_max_cpufreq_perf_turbo 19 | intel_pstate_tests.sh -t verify_max_cpufreq_passive_perf_turbo 20 | intel_pstate_tests.sh -t verify_max_cpufreq_perf_non_turbo 21 | -------------------------------------------------------------------------------- /scenario/srf-oe/tests-pstate: -------------------------------------------------------------------------------- 1 | # This file contains basic test cases designed to 2 | # evaluate the performance of Intel_pstate and cpufreq 3 | # scaling drivers on Intel® Architecture-based platforms 4 | # For a deeper understanding of HW P-state related MSRs, 5 | # Users may refer to the Intel® Software Developer Manual. 6 | # @hw_dep: 7 | # @other_dep: general_test.sh -t turbostat @ The latest 2024 version turbostat tool is required 8 | # @other_warn: which stress 2>/dev/null @ stress tool is required, please install stress-ng.x86_64 and run command: ln -s /usr/bin/stress-ng /usr/bin/stress 9 | 10 | intel_pstate_tests.sh -t verify_default_gov_epp 11 | intel_pstate_tests.sh -t verify_gov_perf_epp_perf 12 | intel_pstate_tests.sh -t verify_gov_powersave_epp_perf 13 | intel_pstate_tests.sh -t verify_gov_powersave_epp_balance_perf 14 | intel_pstate_tests.sh -t verify_gov_powersave_epp_balance_power 15 | intel_pstate_tests.sh -t verify_gov_powersave_epp_power 16 | intel_pstate_tests.sh -t verify_cpufreq_with_governor_perf 17 | intel_pstate_tests.sh -t verify_cpufreq_with_governor_powersave 18 | intel_pstate_tests.sh -t verify_max_cpufreq_perf_turbo 19 | intel_pstate_tests.sh -t verify_max_cpufreq_passive_perf_turbo 20 | intel_pstate_tests.sh -t verify_max_cpufreq_perf_non_turbo 21 | -------------------------------------------------------------------------------- /BM/isst/README.md: -------------------------------------------------------------------------------- 1 | # Release Notes for Intel® Speed Select Technology test cases 2 | 3 | Intel® Speed Select Technology: a collection of features improve performance 4 | and optimizes the total cost of ownership (TCO) by proving more control 5 | over the CPU performance. 6 | 7 | The isst cases are designed for Intel® Architecture-based server platforms, 8 | supported beginning from Cascade lake, then Cooper lake, Icelake and future platforms 9 | 10 | The prerequisites to run the ISST cases: 11 | - The server CPU supports the ISST feature 12 | - BIOS enabled Dynamic SST-PP setting 13 | - User needs intel-speed-select, turbostat, stress tools 14 | 15 | tests file collects the cases for Intel® server platforms where assume SUT supports 16 | SST perf profile level 0,3,4, users can add other SST-PP level cases 17 | for the futhur platforms who may support full SST-PP levels 0,1,2,3,4 18 | 19 | You can run the cases one by one, e.g. command 20 | 21 | ``` 22 | ./intel_sst.sh -t isst_info 23 | ``` 24 | You also can run the cases together with runtests command, e.g. 25 | 26 | ``` 27 | cd .. 28 | ./runtests -f isst/tests -o logfile 29 | ``` 30 | 31 | These are the basic cases for ISST testing, If you have good idea to 32 | improve cases, you are welcomed to send us the patches, thanks! 33 | -------------------------------------------------------------------------------- /KVM/qemu/boot_check.cfg: -------------------------------------------------------------------------------- 1 | - boot_check: 2 | type = boot_check 3 | virt_test_type = qemu 4 | vm_accelerator = kvm 5 | # Don't create/remove guest images 6 | force_create_image = no 7 | remove_image = no 8 | start_vm = no 9 | # Stop VM after testing 10 | kill_vm = yes 11 | shell_prompt = "^\[.*\][\#\$]\s*$" 12 | vga = std 13 | variants: 14 | - 1_cpu: 15 | smp = 1 16 | - 2_cpu: 17 | smp = 2 18 | - 4_cpu: 19 | smp = 4 20 | - 8_cpu: 21 | smp = 8 22 | - 16_cpu: 23 | smp = 16 24 | - 208_cpu: 25 | smp = 208 26 | - 256_cpu: 27 | smp = 256 28 | - 288_cpu: 29 | only q35 30 | machine_type_extra_params = "kernel-irqchip=split" 31 | smp = 288 32 | variants: 33 | - 1G: 34 | no 208_cpu, 256_cpu, 288_cpu 35 | mem = 1024 36 | - 4G: 37 | mem = 4096 38 | - 16G: 39 | mem = 16384 40 | variants: 41 | - vm: 42 | - tdvm: 43 | machine_type_extra_params = "kernel-irqchip=split" 44 | vm_secure_guest_type = tdx 45 | auto_cpu_model = "no" 46 | cpu_model = host 47 | -------------------------------------------------------------------------------- /scenario/emr-ov/tests-rapl: -------------------------------------------------------------------------------- 1 | # This file collects RAPL cases which can run against intel_rapl driver 2 | # on Intel® Architecture-based server platforms. 3 | # @hw_dep: 4 | # @other_dep: general_test.sh -t turbostat @ The latest 2024 version turbostat tool is required 5 | # @other_warn: which stress 2>/dev/null @ stress tool is required, please install stress-ng.x86_64 and run command: ln -s /usr/bin/stress-ng /usr/bin/stress 6 | # @other_warn: which perf 2>/dev/null @ perf tool is required, please install perf.x86_64 package 7 | # @other_warn: which rdmsr 2>/dev/null @ rdmsr tool is required, please install msr-tools package 8 | 9 | intel_rapl_test.sh -t check_sysfs 10 | intel_rapl_test.sh -t check_pkg_domain 11 | intel_rapl_test.sh -t check_dram_domain 12 | intel_rapl_test.sh -t check_pkg_domain_msr 13 | intel_rapl_test.sh -t check_pkg_power_limit_msr 14 | intel_rapl_test.sh -t check_pkg_energy_status 15 | intel_rapl_test.sh -t check_dram_energy_status 16 | intel_rapl_test.sh -t check_rapl_control_after_power_limit_change 17 | intel_rapl_test.sh -t sysfs_perf_name_compare 18 | intel_rapl_test.sh -t sysfs_turbostat_energy_compare_workload_server 19 | intel_rapl_test.sh -t rapl_control_enable_disable_pl1 20 | intel_rapl_test.sh -t rapl_control_enable_disable_pl2 21 | intel_rapl_test.sh -t rapl_control_enable_disable_pl4 22 | -------------------------------------------------------------------------------- /scenario/gnr-ov/tests-rapl: -------------------------------------------------------------------------------- 1 | # This file collects RAPL cases which can run against intel_rapl driver 2 | # on Intel® Architecture-based server platforms. 3 | # @hw_dep: 4 | # @other_dep: general_test.sh -t turbostat @ The latest 2024 version turbostat tool is required 5 | # @other_warn: which stress 2>/dev/null @ stress tool is required, please install stress-ng.x86_64 and run command: ln -s /usr/bin/stress-ng /usr/bin/stress 6 | # @other_warn: which perf 2>/dev/null @ perf tool is required, please install perf.x86_64 package 7 | # @other_warn: which rdmsr 2>/dev/null @ rdmsr tool is required, please install msr-tools package 8 | 9 | intel_rapl_test.sh -t check_sysfs 10 | intel_rapl_test.sh -t check_pkg_domain 11 | intel_rapl_test.sh -t check_dram_domain 12 | intel_rapl_test.sh -t check_pkg_domain_msr 13 | intel_rapl_test.sh -t check_pkg_power_limit_msr 14 | intel_rapl_test.sh -t check_pkg_energy_status 15 | intel_rapl_test.sh -t check_dram_energy_status 16 | intel_rapl_test.sh -t check_rapl_control_after_power_limit_change 17 | intel_rapl_test.sh -t sysfs_perf_name_compare 18 | intel_rapl_test.sh -t sysfs_turbostat_energy_compare_workload_server 19 | intel_rapl_test.sh -t rapl_control_enable_disable_pl1 20 | intel_rapl_test.sh -t rapl_control_enable_disable_pl2 21 | intel_rapl_test.sh -t rapl_control_enable_disable_pl4 22 | -------------------------------------------------------------------------------- /BM/pt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # 3 | # Copyright (c) 2024 Intel Corporation. 4 | # Haoliang Zhu 5 | 6 | cmake_minimum_required(VERSION 3.12) 7 | project(pt) 8 | 9 | # Set the build output directory 10 | set(BUILD_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}) 11 | 12 | # Set the installation prefix 13 | set(CMAKE_INSTALL_PREFIX /usr/local/bin) 14 | 15 | # Check if the header file "intel-pt.h" exists 16 | include(CheckIncludeFile) 17 | check_include_file("intel-pt.h" HAVE_INTEL_PT_H) 18 | if(NOT HAVE_INTEL_PT_H) 19 | message(WARNING "Skipping the build of pt, please install libipt first. 20 | You can read BM/pt/README.md for more information.") 21 | return() 22 | endif() 23 | # Set the global compilation flags 24 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall -DMAINLINE -I./") 25 | 26 | # Set the source files 27 | set(SRC utils.c) 28 | 29 | # Set the binary files 30 | set(BIN cpl branch psb nonroot_test negative_test sort_test) 31 | 32 | # Set the libraries 33 | set(LFLAGS -L./ -lipt) 34 | 35 | foreach(target ${BIN}) 36 | add_executable(${target} ${target}.c ${SRC}) 37 | # Link libraries 38 | target_link_libraries(${target} ${LFLAGS}) 39 | endforeach() 40 | 41 | # Install the program 42 | install(TARGETS ${BIN} DESTINATION ${CMAKE_INSTALL_PREFIX}) 43 | -------------------------------------------------------------------------------- /BM/ifs/tests: -------------------------------------------------------------------------------- 1 | # This file collects Intel IFS(In Field SCAN) tests on 2 | # Intel® Architecture-based platforms. 3 | # @hw_dep: general_test.sh -t fms -p "ifs_fms_list" @ CPU doesn't support ifs, family model not in ifs/ifs_fms_list 4 | # @other_dep: general_test.sh -t kconfig -k "CONFIG_INTEL_IFS=m" 5 | # @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 6 | # ifs_0 scan test cases, it works on SPR(Sapphire Rapids) platform and future server 7 | ifs_tests.sh -m 0 -p all -n load_ifs 8 | ifs_tests.sh -m 0 -p all -b 1 -n ifs_batch 9 | ifs_tests.sh -m 0 -p all -b 1 -n legacy_twice_run 10 | ifs_tests.sh -m 0 -p all -b 2 -n legacy_twice_run 11 | ifs_tests.sh -m 0 -p all -b 3 -n legacy_twice_run 12 | ifs_tests.sh -m 0 -p all -b 1 -n img_version 13 | ifs_tests.sh -m 0 -p all -b 1 -n reload_ifs_scan_image 14 | 15 | # ifs_1 array BIST(Board Integrated System Test), it works on EMR(Emerald Rapids) and future server 16 | ifs_tests.sh -m 1 -p all -n ifs_array_scan 17 | ifs_tests.sh -m 1 -p ran -n ifs_array_off_sib -t 10 18 | ifs_tests.sh -m 1 -p ran -n ifs_array_offran -t 5 19 | ifs_tests.sh -m 1 -p ran -n ifs_array_cpuran_fullload -t 10 20 | ifs_tests.sh -m 1 -p ran -b 1 -n ifs_loop -t 500 21 | 22 | # Test ifs_0 all available image scan and ifs_1 scan 23 | test_ifs.sh 24 | -------------------------------------------------------------------------------- /BM/tdx-guest/tdx_test_module.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | # SPDX-License-Identifier: GPL-2.0-only 3 | # Copyright (c) 2023 Intel Corporation 4 | 5 | # Author: Hongyu Ning 6 | # 7 | # History: 13, Dec., 2023 - Hongyu Ning - creation 8 | 9 | 10 | # @desc This script do test by kernel test module in TDX Guest VM 11 | 12 | ###################### Variables ###################### 13 | SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" 14 | echo "$SCRIPT_DIR" 15 | source common.sh 16 | test_module=$1 17 | 18 | ###################### Functions ###################### 19 | module_check() { 20 | lsmod | grep "$test_module" || \ 21 | die "test module $test_module not found in lsmod" 22 | test_print_trc "test module loaded and test should be completed now" 23 | } 24 | 25 | ###################### Do Works ###################### 26 | if [[ -f "$test_module".ko ]]; then 27 | test_print_trc "Kernel test module: $test_module.ko is ready for test" 28 | insmod "$test_module".ko || \ 29 | { die "Fail to insmod test module $test_module.ko"; exit 1; } 30 | test_print_trc "$test_module.ko inserted and hlt instruction triggered" 31 | module_check 32 | sleep 3 33 | rmmod "$test_module" || \ 34 | { die "Fail to rmmod test module $test_module.ko"; exit 1; } 35 | else 36 | die "Kernel test module $test_module.ko not found" 37 | exit 1 38 | fi -------------------------------------------------------------------------------- /scenario/srf-oe/tests-cstate: -------------------------------------------------------------------------------- 1 | # This file collects the CPU Core cstate cases which can run 2 | # on Intel® Architecture-based server platforms. 3 | # @hw_dep: 4 | # @other_dep: 5 | # @other_warn: which turbostat 2>/dev/null @ turbostat tool is required 6 | # @other_warn: which perf 2>/dev/null @ perf tool is required, please install perf.x86_64 package 7 | # @other_warn: which rdmsr 2>/dev/null @ rdmsr tool is required, please install msr-tools 8 | 9 | powermgr_cstate_tests.sh -t verify_cstate_name 10 | powermgr_cstate_tests.sh -t verify_server_all_cores_cstate6 11 | powermgr_cstate_tests.sh -t verify_server_core_cstate6_residency 12 | powermgr_cstate_tests.sh -t verify_server_all_cpus_mc6 13 | powermgr_cstate_tests.sh -t verify_server_cstate_list 14 | powermgr_cstate_tests.sh -t verify_server_perf_core_cstat_update 15 | powermgr_cstate_tests.sh -t verify_server_perf_pkg_cstat_update 16 | powermgr_cstate_tests.sh -t verify_server_perf_module_cstat_update 17 | powermgr_cstate_tests.sh -t verify_server_pc2_entry 18 | powermgr_cstate_tests.sh -t verify_server_pc6_entry 19 | powermgr_cstate_tests.sh -t verify_turbo_freq_in_default 20 | powermgr_cstate_tests.sh -t verify_turbo_freq_in_poll 21 | powermgr_cstate_tests.sh -t verify_turbo_freq_in_c1 22 | powermgr_cstate_tests.sh -t verify_turbo_freq_in_c1e 23 | powermgr_cstate_tests.sh -t verify_ccstate_res_offline_online 24 | -------------------------------------------------------------------------------- /BM/lass/README.md: -------------------------------------------------------------------------------- 1 | #LASS 2 | 3 | ## Description 4 | Linear Address Space Separation (LASS) aims to prevent side-channel attacks based that rely on timing memory accesses (cache hits will have shorter access times). 5 | 6 | LASS achieves this by preventing memory loads/stores to user space memory in supervisor mode and vice versa (access to kernel memory in user mode). 7 | 8 | ## Usage 9 | ``` 10 | make 11 | # To run a specific case 12 | ./lass 13 | (for example, add maps) ./lass m 14 | ``` 15 | Test results (PASS or FAIL) will be printed out. 16 | 17 | ## Testcase ID 18 | | Case ID | Case Name | 19 | | ------ | ------------------------------------------------------------------- | 20 | | m | Test get vsyscall address maps.[negative] | 21 | | d | Test execute vsyscall addr 0xffffffffff600000.[negative] | 22 | | g | Test call vsyscall | 23 | | t | Test call vsyscall api gettimeofday | 24 | | r | Test read vsyscall 0xffffffffff600000.[negative] | 25 | | i | Test read random kernel space.[negative] | 26 | | v | Test process_vm_readv read address 0xffffffffff600000.[negative] | 27 | | e | Test vsyscall emulation. | 28 | -------------------------------------------------------------------------------- /BM/adaptation/debian/Dockerfile.build: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: GPL-2.0-only 2 | # Copyright (c) 2022 Intel Corporation. 3 | 4 | FROM debian 5 | 6 | ARG PROXY 7 | ENV http_proxy=$PROXY 8 | ENV https_proxy=$PROXY 9 | 10 | # Copy the packages list file into the image 11 | COPY packages /src/packages 12 | 13 | RUN apt-get update 14 | RUN while read line; do apt-get install -y $line; done < /src/packages 15 | RUN apt-get clean 16 | RUN rm -rf /var/lib/apt/lists/* 17 | RUN pip3 install --break-system-packages avocado-framework 18 | 19 | RUN export GIT_SSL_NO_VERIFY=true && rm -rf libipt && git clone http://github.com/intel/libipt.git && \ 20 | cd libipt && cmake . && make install 21 | 22 | RUN mkdir -p /src 23 | WORKDIR /src 24 | 25 | RUN git clone https://github.com/intel/lkvs.git 26 | RUN cd lkvs/BM/tools/cpuid_check && make && make install 27 | 28 | RUN git clone --depth=1 https://github.com/torvalds/linux.git 29 | RUN cd linux/tools/power/x86/turbostat/ && make && make install 30 | 31 | RUN git clone https://github.com/intel/idxd-config.git 32 | RUN cd idxd-config && ./autogen.sh && ./configure CFLAGS='-g -O2' --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64 --enable-test=yes && make && make install 33 | RUN export PATH=$PATH:/usr/libexec/accel-config/test 34 | 35 | RUN cd /src/linux/tools/power/x86/intel-speed-select/ && make && make install 36 | CMD ["bash"] 37 | -------------------------------------------------------------------------------- /KVM/qemu/tests/tdx_disable.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | # SPDX-License-Identifier: GPL-2.0-only 4 | # Copyright (c) 2024 Intel Corporation 5 | 6 | # Author: Xudong Hao 7 | # 8 | # History: Jun. 2024 - Xudong Hao - creation 9 | from avocado.utils import process 10 | 11 | from virttest import env_process 12 | 13 | 14 | def run(test, params, env): 15 | """ 16 | Boot TD after disable ept or tdx: 17 | 1) Disable ept or tdx 18 | 2) Boot up TDVM 19 | 3) TDVM can not be lanuch as expect 20 | 21 | :param test: QEMU test object 22 | :param params: Dictionary with the test parameters 23 | :param env: Dictionary with test environment 24 | """ 25 | xfail = False 26 | if (params.get("xfail") is not None) and (params.get("xfail") == "yes"): 27 | xfail = True 28 | 29 | output = process.getoutput(params["check_status_cmd"]) 30 | if output != params["expected_status"]: 31 | test.fail("Disable %s failed" % params["parameter_name"]) 32 | 33 | params["start_vm"] = 'yes' 34 | has_error = False 35 | try: 36 | env_process.preprocess_vm(test, params, env, params["main_vm"]) 37 | except: 38 | has_error = True 39 | if xfail is False: 40 | raise 41 | 42 | if (has_error is False) and (xfail is True): 43 | test.fail("Test was expected to fail, but it didn't") 44 | -------------------------------------------------------------------------------- /scenario/gnr-oe/tests-pstate: -------------------------------------------------------------------------------- 1 | # This file contains basic test cases designed to 2 | # evaluate the performance of Intel_pstate and cpufreq 3 | # scaling drivers on Intel® Architecture-based platforms 4 | # For a deeper understanding of HW P-state related MSRs, 5 | # Users may refer to the Intel® Software Developer Manual. 6 | # @hw_dep: 7 | # @other_dep: general_test.sh -t turbostat @ The latest 2024 version turbostat tool is required 8 | # @other_warn: which stress 2>/dev/null @ stress tool is required, please install stress-ng.x86_64 and run command: ln -s /usr/bin/stress-ng /usr/bin/stress 9 | 10 | intel_pstate_tests.sh -t verify_default_gov_epp 11 | intel_pstate_tests.sh -t verify_gov_perf_epp_perf 12 | intel_pstate_tests.sh -t verify_gov_powersave_epp_perf 13 | intel_pstate_tests.sh -t verify_gov_powersave_epp_balance_perf 14 | intel_pstate_tests.sh -t verify_gov_powersave_epp_balance_power 15 | intel_pstate_tests.sh -t verify_gov_powersave_epp_power 16 | intel_pstate_tests.sh -t verify_cpufreq_with_governor_perf 17 | intel_pstate_tests.sh -t verify_cpufreq_with_governor_powersave 18 | intel_pstate_tests.sh -t verify_cpufreq_with_maxperfpct_50 19 | intel_pstate_tests.sh -t verify_cpufreq_with_minperfpct_50 20 | intel_pstate_tests.sh -t verify_max_cpufreq_perf_turbo 21 | intel_pstate_tests.sh -t verify_max_cpufreq_passive_perf_turbo 22 | intel_pstate_tests.sh -t verify_max_cpufreq_perf_non_turbo 23 | -------------------------------------------------------------------------------- /scenario/emr-oa/tests-ifs: -------------------------------------------------------------------------------- 1 | # This file collects Intel IFS(In Field SCAN) tests on 2 | # Intel® Architecture-based platforms. 3 | # @hw_dep: general_test.sh -t fms -p "ifs_fms_list" @ CPU doesn't support ifs, family model not in ifs/ifs_fms_list 4 | # @other_dep: general_test.sh -t kconfig -k "CONFIG_INTEL_IFS=m" 5 | # @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 6 | # ifs_0 scan test cases, it works on SPR(Sapphire Rapids) platform and future server 7 | ifs_tests.sh -m 0 -p all -n load_ifs 8 | # Need to set the IFS BIOS and put IFS scan blob image, please check BM/ifs/README.md 9 | #ifs_tests.sh -m 0 -p all -b 1 -n ifs_batch 10 | #ifs_tests.sh -m 0 -p all -b 1 -n legacy_twice_run 11 | #ifs_tests.sh -m 0 -p all -b 2 -n legacy_twice_run 12 | #ifs_tests.sh -m 0 -p all -b 3 -n legacy_twice_run 13 | #ifs_tests.sh -m 0 -p all -b 1 -n img_version 14 | #ifs_tests.sh -m 0 -p all -b 1 -n reload_ifs_scan_image 15 | 16 | # ifs_1 array BIST(Board Integrated System Test), it works on EMR(Emerald Rapids) and future server 17 | ifs_tests.sh -m 1 -p all -n ifs_array_scan 18 | ifs_tests.sh -m 1 -p ran -n ifs_array_off_sib -t 10 19 | ifs_tests.sh -m 1 -p ran -n ifs_array_offran -t 5 20 | ifs_tests.sh -m 1 -p ran -n ifs_array_cpuran_fullload -t 10 21 | ifs_tests.sh -m 1 -p ran -b 1 -n ifs_loop -t 500 22 | 23 | # Test ifs_0 all available image scan and ifs_1 scan 24 | test_ifs.sh 25 | -------------------------------------------------------------------------------- /scenario/emr-oe/tests-ifs: -------------------------------------------------------------------------------- 1 | # This file collects Intel IFS(In Field SCAN) tests on 2 | # Intel® Architecture-based platforms. 3 | # @hw_dep: general_test.sh -t fms -p "ifs_fms_list" @ CPU doesn't support ifs, family model not in ifs/ifs_fms_list 4 | # @other_dep: general_test.sh -t kconfig -k "CONFIG_INTEL_IFS=m" 5 | # @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 6 | # ifs_0 scan test cases, it works on SPR(Sapphire Rapids) platform and future server 7 | ifs_tests.sh -m 0 -p all -n load_ifs 8 | # Need to set the IFS BIOS and put IFS scan blob image, please check BM/ifs/README.md 9 | #ifs_tests.sh -m 0 -p all -b 1 -n ifs_batch 10 | #ifs_tests.sh -m 0 -p all -b 1 -n legacy_twice_run 11 | #ifs_tests.sh -m 0 -p all -b 2 -n legacy_twice_run 12 | #ifs_tests.sh -m 0 -p all -b 3 -n legacy_twice_run 13 | #ifs_tests.sh -m 0 -p all -b 1 -n img_version 14 | #ifs_tests.sh -m 0 -p all -b 1 -n reload_ifs_scan_image 15 | 16 | # ifs_1 array BIST(Board Integrated System Test), it works on EMR(Emerald Rapids) and future server 17 | ifs_tests.sh -m 1 -p all -n ifs_array_scan 18 | ifs_tests.sh -m 1 -p ran -n ifs_array_off_sib -t 10 19 | ifs_tests.sh -m 1 -p ran -n ifs_array_offran -t 5 20 | ifs_tests.sh -m 1 -p ran -n ifs_array_cpuran_fullload -t 10 21 | ifs_tests.sh -m 1 -p ran -b 1 -n ifs_loop -t 500 22 | 23 | # Test ifs_0 all available image scan and ifs_1 scan 24 | test_ifs.sh 25 | -------------------------------------------------------------------------------- /scenario/gnr-oe/tests-ifs: -------------------------------------------------------------------------------- 1 | # This file collects Intel IFS(In Field SCAN) tests on 2 | # Intel® Architecture-based platforms. 3 | # @hw_dep: general_test.sh -t fms -p "ifs_fms_list" @ CPU doesn't support ifs, family model not in ifs/ifs_fms_list 4 | # @other_dep: general_test.sh -t kconfig -k "CONFIG_INTEL_IFS=m" 5 | # @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 6 | # ifs_0 scan test cases, it works on SPR(Sapphire Rapids) platform and future server 7 | ifs_tests.sh -m 0 -p all -n load_ifs 8 | # Need to set the IFS BIOS and put IFS scan blob image, please check BM/ifs/README.md 9 | #ifs_tests.sh -m 0 -p all -b 1 -n ifs_batch 10 | #ifs_tests.sh -m 0 -p all -b 1 -n legacy_twice_run 11 | #ifs_tests.sh -m 0 -p all -b 2 -n legacy_twice_run 12 | #ifs_tests.sh -m 0 -p all -b 3 -n legacy_twice_run 13 | #ifs_tests.sh -m 0 -p all -b 1 -n img_version 14 | #ifs_tests.sh -m 0 -p all -b 1 -n reload_ifs_scan_image 15 | 16 | # ifs_1 array BIST(Board Integrated System Test), it works on EMR(Emerald Rapids) and future server 17 | ifs_tests.sh -m 1 -p all -n ifs_array_scan 18 | ifs_tests.sh -m 1 -p ran -n ifs_array_off_sib -t 10 19 | ifs_tests.sh -m 1 -p ran -n ifs_array_offran -t 5 20 | ifs_tests.sh -m 1 -p ran -n ifs_array_cpuran_fullload -t 10 21 | ifs_tests.sh -m 1 -p ran -b 1 -n ifs_loop -t 500 22 | 23 | # Test ifs_0 all available image scan and ifs_1 scan 24 | test_ifs.sh 25 | -------------------------------------------------------------------------------- /scenario/srf-oe/tests-ifs: -------------------------------------------------------------------------------- 1 | # This file collects Intel IFS(In Field SCAN) tests on 2 | # Intel® Architecture-based platforms. 3 | # @hw_dep: general_test.sh -t fms -p "ifs_fms_list" @ CPU doesn't support ifs, family model not in ifs/ifs_fms_list 4 | # @other_dep: general_test.sh -t kconfig -k "CONFIG_INTEL_IFS=m" 5 | # @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 6 | # ifs_0 scan test cases, it works on SPR(Sapphire Rapids) platform and future server 7 | ifs_tests.sh -m 0 -p all -n load_ifs 8 | # Need to set the IFS BIOS and put IFS scan blob image, please check BM/ifs/README.md 9 | #ifs_tests.sh -m 0 -p all -b 1 -n ifs_batch 10 | #ifs_tests.sh -m 0 -p all -b 1 -n legacy_twice_run 11 | #ifs_tests.sh -m 0 -p all -b 2 -n legacy_twice_run 12 | #ifs_tests.sh -m 0 -p all -b 3 -n legacy_twice_run 13 | #ifs_tests.sh -m 0 -p all -b 1 -n img_version 14 | #ifs_tests.sh -m 0 -p all -b 1 -n reload_ifs_scan_image 15 | 16 | # ifs_1 array BIST(Board Integrated System Test), it works on EMR(Emerald Rapids) and future server 17 | ifs_tests.sh -m 1 -p all -n ifs_array_scan 18 | ifs_tests.sh -m 1 -p ran -n ifs_array_off_sib -t 10 19 | ifs_tests.sh -m 1 -p ran -n ifs_array_offran -t 5 20 | ifs_tests.sh -m 1 -p ran -n ifs_array_cpuran_fullload -t 10 21 | ifs_tests.sh -m 1 -p ran -b 1 -n ifs_loop -t 500 22 | 23 | # Test ifs_0 all available image scan and ifs_1 scan 24 | test_ifs.sh 25 | -------------------------------------------------------------------------------- /BM/tdx-osv-sanity/tdx_host_tsc_check.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | # SPDX-License-Identifier: GPL-2.0-only 3 | # Copyright (c) 2023 Intel Corporation 4 | 5 | # Author: Hongyu Ning 6 | # 7 | # History: 30, Oct., 2023 - Hongyu Ning - creation 8 | 9 | 10 | # @desc This script do basic can provide basic TDX host check 11 | 12 | ###################### Variables ###################### 13 | SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" 14 | echo "$SCRIPT_DIR" 15 | 16 | # host machine tsc clock freq 17 | HOST_TSC=0 18 | 19 | ###################### Functions ###################### 20 | tdx_flag_check(){ 21 | dmesg | grep -i "tdx" | grep -i "initialized" || \ 22 | die "host machine TDX enabling failed, please check" 23 | } 24 | 25 | tdx_tsc_check(){ 26 | HOST_TSC_INFO=$(dmesg | grep -i "tsc" | grep -i "detected") 27 | test_print_trc "TSC value info: $HOST_TSC_INFO" 28 | TSC_RAW=$(cpuid -rl 0x15 -1) 29 | TSC_EAX=${TSC_RAW#*eax=} 30 | TSC_EAX=${TSC_EAX%% *} 31 | TSC_EBX=${TSC_RAW#*ebx=} 32 | TSC_EBX=${TSC_EBX%% *} 33 | TSC_ECX=${TSC_RAW#*ecx=} 34 | TSC_ECX=${TSC_ECX%% *} 35 | TSC_EDX=${TSC_RAW#*edx=} 36 | TSC_EDX=${TSC_EDX%% *} 37 | HOST_TSC=$((TSC_ECX * TSC_EBX / TSC_EAX)) 38 | } 39 | 40 | ###################### Do Works ###################### 41 | cd "$(dirname "$0")" 2>/dev/null || exit 1 42 | source ../.env 43 | 44 | # check TDX flag 45 | tdx_flag_check 46 | # check TSC value on host 47 | tdx_tsc_check -------------------------------------------------------------------------------- /KVM/qemu/tests/td_boot_multimes.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | # SPDX-License-Identifier: GPL-2.0-only 4 | # Copyright (c) 2024 Intel Corporation 5 | 6 | # Author: Xudong Hao 7 | # 8 | # History: Jun. 2024 - Xudong Hao - creation 9 | from virttest import error_context 10 | 11 | 12 | # This decorator makes the test function aware of context strings 13 | @error_context.context_aware 14 | def run(test, params, env): 15 | """ 16 | Boot TD by multiple times: 17 | 1) Boot up TDVM 18 | 2) Shutdown TDVM 19 | 3) repeat step1 and step2 multiple times 20 | 21 | :param test: QEMU test object 22 | :param params: Dictionary with the test parameters 23 | :param env: Dictionary with test environment 24 | """ 25 | 26 | timeout = params.get_numeric("login_timeout", 240) 27 | serial_login = params.get("serial_login", "no") == "yes" 28 | iterations = params.get_numeric("iterations") 29 | for i in range(iterations): 30 | error_context.context("The iteration %s of booting TDVM(s)" % i, test.log.info) 31 | vms = env.get_all_vms() 32 | for vm in vms: 33 | vm.create() 34 | for vm in vms: 35 | vm.verify_alive() 36 | if serial_login: 37 | session = vm.wait_for_serial_login(timeout=timeout) 38 | else: 39 | session = vm.wait_for_login(timeout=timeout) 40 | session.close() 41 | vm.destroy() 42 | -------------------------------------------------------------------------------- /scenario/spr-oe/tests-ifs: -------------------------------------------------------------------------------- 1 | # This file collects Intel IFS(In Field SCAN) tests on 2 | # Intel® Architecture-based platforms. 3 | # @hw_dep: general_test.sh -t fms -p "ifs_fms_list" @ CPU doesn't support ifs, family model not in ifs/ifs_fms_list 4 | # @other_dep: general_test.sh -t kconfig -k "CONFIG_INTEL_IFS=m" 5 | # @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 6 | # ifs_0 scan test cases, it works on SPR(Sapphire Rapids) platform and future server 7 | ifs_tests.sh -m 0 -p all -n load_ifs 8 | # Need to set the IFS BIOS and put IFS scan blob image, please check BM/ifs/README.md 9 | #ifs_tests.sh -m 0 -p all -b 1 -n ifs_batch 10 | #ifs_tests.sh -m 0 -p all -b 1 -n legacy_twice_run 11 | #ifs_tests.sh -m 0 -p all -b 2 -n legacy_twice_run 12 | #ifs_tests.sh -m 0 -p all -b 3 -n legacy_twice_run 13 | #ifs_tests.sh -m 0 -p all -b 1 -n img_version 14 | #ifs_tests.sh -m 0 -p all -b 1 -n reload_ifs_scan_image 15 | 16 | # ifs_1 array BIST(Board Integrated System Test), it works on EMR(Emerald Rapids) and future server 17 | #ifs_tests.sh -m 1 -p all -n ifs_array_scan 18 | #ifs_tests.sh -m 1 -p ran -n ifs_array_off_sib -t 10 19 | #ifs_tests.sh -m 1 -p ran -n ifs_array_offran -t 5 20 | #ifs_tests.sh -m 1 -p ran -n ifs_array_cpuran_fullload -t 10 21 | #ifs_tests.sh -m 1 -p ran -b 1 -n ifs_loop -t 500 22 | 23 | # Test ifs_0 all available image scan and ifs_1 scan, will skip ifs_1 scan on SPR 24 | #test_ifs.sh 25 | -------------------------------------------------------------------------------- /BM/adaptation/debian/packages: -------------------------------------------------------------------------------- 1 | debhelper 2 | pahole 3 | exfatprogs 4 | libglut3.12 5 | fuse3 6 | gcc-12 7 | lib32gcc-11-dev 8 | lib64asan6 9 | lib64gcc-11-dev 10 | lib64gcc-s1 11 | libarchive13 12 | libasan6 13 | libevent-openssl-2.1-7 14 | libevent-2.1-7 15 | libgcc-11-dev 16 | libglut3.12 17 | libgsl27 18 | libhugetlbfs0 19 | libhwloc15 20 | libicu72 21 | libipsec-mb1 22 | libisl23 23 | libjson-c5 24 | libldap-2.5-0 25 | libllvm14 26 | default-libmysqlclient-dev 27 | libnfs13 28 | libntfs-3g89 29 | libperl5.36 30 | libpolly-14-dev 31 | libproc2-dev 32 | libproc2-0 33 | libpython3.11 34 | readline-common 35 | libssl3 36 | libstdc++-11-dev 37 | libtiff6 38 | libtirpc-common 39 | liburcu8 40 | liburing2 41 | libwebp7 42 | libx32asan6 43 | libx32gcc-11-dev 44 | libx32gcc-s1 45 | rasdaemon 46 | openjdk-17-jdk 47 | perl-modules-5.36 48 | python3-setuptools 49 | python3-pycryptodome 50 | tox 51 | python3 52 | qtbase5-dev 53 | 54 | asciidoc 55 | bison 56 | build-essential 57 | cmake 58 | cpuid 59 | dmidecode 60 | flex 61 | g++-multilib 62 | gcc-multilib 63 | gettext 64 | git 65 | hwloc 66 | libcap-dev 67 | libelf-dev 68 | libelf1 69 | libhwloc-dev 70 | libjson-c-dev 71 | libnl-genl-3-dev 72 | libpci-dev 73 | libssl-dev 74 | libtool 75 | linux-perf 76 | m4 77 | mcelog 78 | mesa-utils 79 | msr-tools 80 | screen 81 | sshpass 82 | stress 83 | sudo 84 | trace-cmd 85 | uuid-dev 86 | xmlto 87 | zlib1g-dev 88 | bc 89 | libpfm4-dev 90 | libtraceevent-dev 91 | pkg-config 92 | kmod 93 | python3-pip 94 | -------------------------------------------------------------------------------- /BM/umip/README.md: -------------------------------------------------------------------------------- 1 | # User-Mode Instruction Prevention 2 | 3 | ## Description 4 | User-Mode Instruction Prevention(UMIP) is a security feature in Intel 5 | Processors. The 8th generation and later Intel CPUs will support 6 | the UMIP feature. If UMIP is enabled and in CPL(Current Privilege Level) > 0 7 | environment, it verifies that execution of the instructions(SGDT, SIDT, 8 | SLDT, SMSW, STR) with mapped fault page should return the signal 9 | SIGSEGV(Segmentation Violation); above instructions with locked prefix 10 | opcode should return signal SIGILL(Illegal); SIDT and SGDT with illegal 11 | opcode should return signal SIGILL. 12 | 13 | Below instructions are protected by UMIP feature: 14 | * SGDT - Store Global Descriptor Table 15 | * SIDT - Store Interrupt Descriptor Table 16 | * SLDT - Store Local Descriptor Table 17 | * SMSW - Store Machine Status Word 18 | * STR - Store Task Register 19 | 20 | ## Usage 21 | make 22 | ./umip_exceptions_64 a 23 | and 24 | ./umip_exceptions_32 a 25 | It tests all 3 types of cases: 26 | 1. Execution of the instructions(SGDT, SIDT, SLDT, SMSW, STR) with mapped fault 27 | page should return the signal SIGSEGV. 28 | 2. Execution of the instructions(SGDT, SIDT, SLDT, SMSW, STR) with locked prefix 29 | opcode should return the signal SIGILL(Illegal). 30 | 3. Execution of the instructions SGDT and SIDT with illegal opcode should return 31 | the signal SIGILL. 32 | 33 | ## Expected result 34 | All test results should show pass without fail. 35 | -------------------------------------------------------------------------------- /BM/adaptation/centos/packages: -------------------------------------------------------------------------------- 1 | debhelper 2 | pahole 3 | exfatprogs 4 | libglut3.12 5 | fuse3 6 | gcc-12 7 | lib32gcc-11-dev 8 | lib64asan6 9 | lib64gcc-11-dev 10 | lib64gcc-s1 11 | libarchive13 12 | libasan6 13 | libevent-openssl-2.1-7 14 | libevent-2.1-7 15 | libgcc-11-dev 16 | libglut3.12 17 | libgsl27 18 | libhugetlbfs0 19 | libhwloc15 20 | libicu72 21 | libipsec-mb1 22 | libisl23 23 | libjson-c5 24 | libldap-2.5-0 25 | libllvm14 26 | default-libmysqlclient-dev 27 | libnfs13 28 | libntfs-3g89 29 | libperl5.36 30 | libpolly-14-dev 31 | libproc2-dev 32 | libproc2-0 33 | libpython3.11 34 | readline-common 35 | libssl3 36 | libstdc++-11-dev 37 | libtiff6 38 | libtirpc-common 39 | liburcu8 40 | liburing2 41 | libwebp7 42 | libx32asan6 43 | libx32gcc-11-dev 44 | libx32gcc-s1 45 | rasdaemon 46 | openjdk-17-jdk 47 | perl-modules-5.36 48 | python3-setuptools 49 | python3-pycryptodome 50 | tox 51 | python3 52 | qtbase5-dev 53 | 54 | psacct 55 | cryptsetup 56 | python3-cython 57 | exfatprogs 58 | freeglut-devel 59 | grub2-common 60 | libbabeltrace-devel 61 | libbabeltrace 62 | libbpf-devel 63 | clang-devel 64 | CUnit-devel 65 | libdwarves1 66 | libfdt 67 | mesa-libGL-devel 68 | mesa-libGLES 69 | mesa-libGL 70 | Judy-devel 71 | Judy 72 | pcre-devel 73 | libusb-devel 74 | libusb 75 | llvm-devel 76 | python3-cherrypy 77 | python3-devel 78 | python3-hidapi 79 | python-pyramid-mako 80 | python34-markupsafe 81 | python3 82 | python3-pyOpenSSL 83 | python3-pillow 84 | python3-virtualenv 85 | python3 86 | busybox 87 | -------------------------------------------------------------------------------- /BM/pt/negative_test.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | // Copyright (c) 2022 Intel Corporation. 3 | 4 | #include "utils.h" 5 | 6 | /** 7 | * reserved bit check : 8 | * ./negative_test 9 | * will check to set reserved bit. if set successful, case should be fail. 10 | * PASS will return 0 and FAIL will return 1 11 | */ 12 | int reserved_check(void) 13 | { 14 | unsigned int cond = 0, stp = 0, END = 0xFFFF, FAIL = 0, result = 0; 15 | struct perf_event_attr attr; 16 | struct perf_event_mmap_page *pmp; 17 | int fde = -1; 18 | long buf_size; 19 | __u64 **buf_m, head; 20 | pid_t pid; 21 | char *en_trace = "en.trace"; 22 | char *de_trace = "de.trace"; 23 | // Set buffersize as 2 pagesize 24 | buf_size = 2 * PAGESIZE; 25 | // initial attribute for PT 26 | init_evt_attribute(&attr); 27 | 28 | attr.__reserved_1 = 1; 29 | attr.__reserved_2 = 1; 30 | pid = getpid(); 31 | 32 | // only get trace for own pid 33 | fde = sys_perf_event_open(&attr, pid, -1, -1, 0); 34 | if (fde < 0) { 35 | perror("perf_event_open"); 36 | printf("reserved set not successfully!\n"); 37 | } else { 38 | printf("reserved set successfully, so case is failed! fde=%d\n", fde); 39 | FAIL = 1; 40 | } 41 | close(fde); 42 | return FAIL; 43 | } 44 | 45 | int main(void) 46 | { 47 | int result = 0; 48 | 49 | result = reserved_check(); 50 | printf("reserved set check %s\n", result ? "[FAIL] reserved set check: FAIL.\n" 51 | : "[PASS] reserved set check: PASS.\n"); 52 | return result; 53 | } 54 | -------------------------------------------------------------------------------- /BM/splitlock/README.md: -------------------------------------------------------------------------------- 1 | # SPLIT LOCK 2 | 3 | ## Description 4 | A split lock is any atomic operation whose operand crosses two cache lines. 5 | Since the operand spans two cache lines and the operation must be atomic, 6 | the system locks the bus while the CPU accesses the two cache lines. 7 | 8 | A bus lock is acquired through either split locked access to writeback (WB) 9 | memory or any locked access to non-WB memory. This is typically thousands of 10 | cycles slower than an atomic operation within a cache line. It also disrupts 11 | performance on other cores and brings the whole system to its knees. 12 | 13 | ## Usage 14 | make 15 | ./sl_test 16 | 1. Linux kernel driver will export the split_lock_detect flag to /proc/cpuinfo 17 | if hardware supports this feature. 18 | 2. Test if the locked instruction will trigger #AC. If no split_lock_detect is 19 | not set by default or it is split_lock_detect=warn, #AC will be triggered. 20 | The boot parameter could also be set as fatal or ratelimit(ratelimit:1 max 21 | ratelimit:1000). If split_lock_detect=fatal, split lock test will output 22 | "Caught SIGBUS/#AC" in console. 23 | For more, please refer to handle_bus_lock in arch/x86/kernel/cpu/intel.c. 24 | Examples of exception in dmesg: 25 | x86/split lock detection: #AC: sl_test/4354 took a split_lock trap at address: 0x401231 26 | x86/split lock detection: #DB: sl_test/5137 took a bus_lock trap at address: 0x4011f5 27 | 28 | ## Expected result 29 | All test results should show pass, no fail. 30 | -------------------------------------------------------------------------------- /BM/pmu/tests_cwf: -------------------------------------------------------------------------------- 1 | # This file collects the PMU cases for CWF platform 2 | pmu_tests.sh -t basic 3 | pmu_tests.sh -t uncore 4 | pmu_tests.sh -t uncore_dmesg 5 | pmu_tests.sh -t uncore_events 6 | pmu_iommu_tests.sh -t iommu_clocks 7 | pmu_iommu_tests.sh -t iommu_all_basic 8 | apebs_tests.sh -t data_src -w 0 9 | apebs_tests.sh -t ip_1 -w 0 10 | apebs_tests.sh -t ip_2 -w 0 11 | apebs_tests.sh -t lbr_1 -w 0 12 | apebs_tests.sh -t lbr_2 -w 0 13 | apebs_tests.sh -t large_pebs -w 0 14 | apebs_tests.sh -t large_pebs -w 1 15 | apebs_tests.sh -t xmm_1 -w 1 16 | apebs_tests.sh -t xmm_2 -w 1 17 | apebs_tests.sh -t ip_1 -w 1 18 | apebs_tests.sh -t ip_2 -w 1 19 | apebs_tests.sh -t data_src -w 1 20 | apebs_tests.sh -t lbr_1 -w 1 21 | apebs_tests.sh -t lbr_2 -w 1 22 | apebs_tests.sh -t ip_1 -w 1 23 | apebs_tests.sh -t ip_2 -w 1 24 | apebs_tests.sh -t data_src -w 1 25 | pmu_tests.sh -t timed_pebs_msr 26 | pmu_tests.sh -t lbr_events_cpuid 27 | pmu_tests.sh -t lbr_events_s 28 | pmu_tests.sh -t lbr_events_all 29 | pmu_tests.sh -t arch_pebs_cpuid 30 | pmu_tests.sh -t arch_pebs_gp_reg_group 31 | pmu_tests.sh -t arch_pebs_xer_group 32 | pmu_tests.sh -t arch_pebs_counter_group 33 | pmu_tests.sh -t arch_pebs_counter_group_stress 34 | pmu_tests.sh -t arch_pebs_gp_counter 35 | pmu_tests.sh -t arch_pebs_basic_group 36 | pmu_tests.sh -t bitmap_6 37 | pmu_tests.sh -t umask2_cpuid 38 | pmu_tests.sh -t zbit_cpuid 39 | pmu_tests.sh -t umask2 40 | pmu_tests.sh -t zbit 41 | pmu_tests.sh -t counting 42 | pmu_tests.sh -t sampling 43 | pmu_tests.sh -t counting_multi 44 | -------------------------------------------------------------------------------- /KVM/qemu/tests/tdx_seam_module.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | # SPDX-License-Identifier: GPL-2.0-only 4 | # Copyright (c) 2024 Intel Corporation 5 | 6 | # Author: Xudong Hao 7 | # 8 | # History: Dec. 2024 - Xudong Hao - creation 9 | 10 | import re 11 | 12 | from avocado.utils import process, cpu 13 | 14 | 15 | def run(test, params, env): 16 | """ 17 | TDX module test: 18 | 1. Check host TDX capability 19 | 2. Check TDX module load status 20 | 21 | :param test: QEMU test object 22 | :param params: Dictionary with the test parameters 23 | :param env: Dictionary with test environment. 24 | """ 25 | if cpu.get_cpu_vendor_name() != 'intel': 26 | test.cancel("This test is supposed to run on Intel host") 27 | 28 | rdmsr_cmd = params["rdmsr_cmd"] 29 | if process.getoutput(rdmsr_cmd) != "1": 30 | test.fail("Platform does not support TDX-SEAM") 31 | 32 | read_cmd = params["read_cmd"] 33 | tdx_value = process.getoutput(read_cmd % "tdx") 34 | if tdx_value != "Y": 35 | test.fail("TDX is not supported in KVM") 36 | 37 | module_pattern = params["tdx_module_pattern"] 38 | negative_pattern = params["tdx_negative_pattern"] 39 | dmesg = process.system_output("dmesg") 40 | module_str = re.findall(r'%s' % module_pattern, dmesg.decode('utf-8')) 41 | negative_str = re.findall(r'%s' % negative_pattern, dmesg.decode('utf-8')) 42 | if negative_str or not module_str: 43 | test.fail("TDX module isn't initialized") 44 | -------------------------------------------------------------------------------- /BM/cet/shstk_cpu_legacy.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0 2 | /* 3 | *Verify Shadow Stack performance impact on specific CPU 4 | * 5 | * Author: Pengfei Xu 6 | */ 7 | 8 | #define _GNU_SOURCE 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | void shstk2(void) 17 | { 18 | unsigned long *j; 19 | 20 | #ifdef __x86_64__ 21 | asm("movq %%rbx,%0" : "=r"(j)); 22 | #else 23 | 24 | asm("mov %%ebp,%0" : "=r"(j)); 25 | #endif 26 | } 27 | 28 | void shstk1(void) 29 | { 30 | unsigned long *i; 31 | 32 | #ifdef __x86_64__ 33 | asm("movq %%rbx,%0" : "=r"(i)); 34 | #else 35 | asm("mov %%ebp,%0" : "=r"(i)); 36 | #endif 37 | shstk2(); 38 | } 39 | 40 | int main(int argc, char *argv[]) 41 | { 42 | int x = 100000000, a, cpu; 43 | clock_t tstart, tend; 44 | cpu_set_t set; 45 | 46 | if (argc >= 2) { 47 | cpu = atoi(argv[1]); 48 | } else { 49 | cpu = 0; 50 | printf("There is no cpu setting, set as cpu0 by default\n"); 51 | } 52 | printf("testing on cpu %d\n", cpu); 53 | CPU_ZERO(&set); 54 | CPU_SET(cpu, &set); 55 | if (sched_setaffinity(getpid(), sizeof(set), &set) == -1) { 56 | printf("set affinity failed\n"); 57 | return -1; 58 | } 59 | 60 | tstart = clock(); 61 | for (a = 1; a <= x; a++) { 62 | shstk1(); 63 | shstk2(); 64 | } 65 | tend = clock(); 66 | printf("RESULTS %dloop,start:%ld,end:%ld, used CLOCK:%ld: CLOCK/SEC:%ld\n", 67 | x, tstart, tend, (long)(tend - tstart), CLOCKS_PER_SEC); 68 | } 69 | -------------------------------------------------------------------------------- /BM/nmis/README.md: -------------------------------------------------------------------------------- 1 | # FRED(Flexible Return and Event Delivery) Test Cases 2 | 3 | ## Description 4 | ``` 5 | Different event sources can generate a non maskable (NMI) interrupt to exception vector 2. Traditionally, the software NMI handler must query all the possible NMI sources to decide which NMI software handler to call. NMI source allows the software NMI exception handler to identify the source of the NMI reliably and efficiently without checking all sources. 6 | Normal interrupts carry a vector which identifies the exception vector the interrupt is delivered on. The vector is programmed at the source. NMIs carry the same vector, but it was ignored. With NMI source the NMI vector is repurposed to identify the originator (source) of the NMI. Software is responsible to program unique values into the NMI vector at the originating site. 7 | When the NMI is delivered the NMI source vector is reported as a bitmask in the exception event data field code pushed on the stack for a FRED exception. NMI source is only delivered when CR4.FRED is enabled. 8 | When multiple NMIs are pending they are all collapsed into single exception delivered on vector 2. 9 | ``` 10 | 11 | ## Usage 12 | Before executing the case, make the BM folder 13 | ``` 14 | cd ../ 15 | make 16 | ``` 17 | Then run case as 18 | 19 | ``` 20 | ./nmis_test.sh -t 21 | ``` 22 | You also can run the cases together with runtests command, e.g. 23 | 24 | ``` 25 | cd .. 26 | ./runtests -f nmis/tests -o logfile 27 | ``` 28 | 29 | ## Expected result 30 | 31 | All test results should show pass, no fail. 32 | -------------------------------------------------------------------------------- /BM/workload-xsave/worker_init_avx.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | /* 3 | * Copyright (c) 2022 Intel Corporation. 4 | * Len Brown 5 | */ 6 | 7 | static int init(struct work_instance *wi) 8 | { 9 | int i; 10 | struct thread_data *dp; 11 | int bytes_per_entry = BYTES_PER_VECTOR * 3; /* x[], y[], output[] */ 12 | int entries; 13 | 14 | entries = wi->wi_bytes / bytes_per_entry; 15 | 16 | dp = (struct thread_data *)calloc(1, sizeof(struct thread_data)); 17 | if (!dp) 18 | err(1, "thread_data"); 19 | 20 | dp->input_x = (float *)calloc(entries, BYTES_PER_VECTOR); 21 | if (!dp->input_x) 22 | err(1, "calloc input_x"); 23 | 24 | dp->input_y = (float *)calloc(entries, BYTES_PER_VECTOR); 25 | if (!dp->input_y) 26 | err(1, "calloc input_y"); 27 | 28 | /* initialize input -- make every iteration the same for now */ 29 | for (i = 0; i < entries; ++i) { 30 | int j; 31 | 32 | for (j = 0; j < DWORD_PER_VECTOR; j++) { 33 | int index = i * DWORD_PER_VECTOR + j; 34 | 35 | dp->input_x[index] = j; 36 | dp->input_y[index] = j; 37 | } 38 | } 39 | 40 | dp->output = (float *)calloc(entries, BYTES_PER_VECTOR); 41 | if (!dp->output) 42 | err(1, "calloc output"); 43 | dp->data_entries = entries; 44 | 45 | wi->worker_data = dp; 46 | 47 | return 0; 48 | } 49 | 50 | static int cleanup(struct work_instance *wi) 51 | { 52 | struct thread_data *dp = wi->worker_data; 53 | 54 | free(dp->input_x); 55 | free(dp->input_y); 56 | free(dp->output); 57 | free(dp); 58 | wi->worker_data = NULL; 59 | 60 | return 0; 61 | } 62 | -------------------------------------------------------------------------------- /BM/edac/intel_edac.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # SPDX-License-Identifier: GPL-2.0-only 3 | # Copyright (c) 2022 Intel Corporation 4 | # Description: Test script for Intel i10nm EDAC driver, which supports 10nm series server 5 | # EDAC: Error Detection and Correction 6 | # @Author Yi Lai yi1.lai@intel.com 7 | 8 | 9 | cd "$(dirname "$0")" 2>/dev/null || exit 1 10 | source ../.env 11 | 12 | EDAC_BUS="/sys/bus/edac" 13 | EDAC_DRIVER=i10nm_edac 14 | 15 | : "${CASE_NAME:=""}" 16 | 17 | usage() { 18 | cat <<__EOF 19 | usage: ./${0##*/} [-t TESTCASE_ID] [-H] 20 | -t TEST CASE ID 21 | -H show this 22 | __EOF 23 | } 24 | 25 | edac_test() { 26 | case $TEST_SCENARIO in 27 | check_edac_bus) 28 | edac_bus=$(ls $EDAC_BUS) 29 | if [ -n "$edac_bus" ]; then 30 | test_print_trc "EDAC bus is found" 31 | else 32 | die "EDAC bus is not found" 33 | fi 34 | ;; 35 | check_edac_driver) 36 | test_print_trc "Check Intel i10nm edac driver" 37 | lsmod | grep -q $EDAC_DRIVER 38 | if ! lsmod | grep -q $EDAC_DRIVER; then 39 | die "Intel i10nm edac driver is not loaded" 40 | else 41 | test_print_trc "Intel i10nm edac driver is loaded" 42 | fi 43 | ;; 44 | esac 45 | } 46 | 47 | while getopts :t:H arg; do 48 | case $arg in 49 | t) 50 | TEST_SCENARIO=$OPTARG 51 | ;; 52 | H) 53 | usage && exit 0 54 | ;; 55 | \?) 56 | usage 57 | die "Invalid Option -$OPTARG" 58 | ;; 59 | :) 60 | usage 61 | die "Option -$OPTARG requires an argument." 62 | ;; 63 | esac 64 | done 65 | 66 | edac_test 67 | -------------------------------------------------------------------------------- /BM/workload-xsave/worker_init_sse.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | /* 3 | * Copyright (c) 2022 Intel Corporation. 4 | * Len Brown 5 | */ 6 | 7 | static int init(struct work_instance *wi) 8 | { 9 | int i; 10 | struct thread_data *dp; 11 | int bytes_per_entry = BYTES_PER_VECTOR * 3; /* x[], y[], output[] */ 12 | int entries; 13 | 14 | entries = wi->wi_bytes / bytes_per_entry; 15 | 16 | dp = (struct thread_data *)calloc(1, sizeof(struct thread_data)); 17 | if (!dp) 18 | err(1, "thread_data"); 19 | 20 | dp->input_x = (int32_t *)calloc(entries, BYTES_PER_VECTOR); 21 | if (!dp->input_x) 22 | err(1, "calloc input_x"); 23 | 24 | dp->input_y = (int32_t *)calloc(entries, BYTES_PER_VECTOR); 25 | if (!dp->input_y) 26 | err(1, "calloc input_y"); 27 | 28 | /* initialize input -- make every iteration the same for now */ 29 | for (i = 0; i < entries; ++i) { 30 | int j; 31 | 32 | for (j = 0; j < DWORD_PER_VECTOR; j++) { 33 | int index = i * DWORD_PER_VECTOR + j; 34 | 35 | dp->input_x[index] = j; 36 | dp->input_y[index] = j; 37 | } 38 | } 39 | 40 | dp->output = (int32_t *)calloc(entries, BYTES_PER_VECTOR); 41 | if (!dp->output) 42 | err(1, "calloc output"); 43 | dp->data_entries = entries; 44 | 45 | wi->worker_data = dp; 46 | 47 | return 0; 48 | } 49 | 50 | static int cleanup(struct work_instance *wi) 51 | { 52 | struct thread_data *dp = wi->worker_data; 53 | 54 | free(dp->input_x); 55 | free(dp->input_y); 56 | free(dp->output); 57 | free(dp); 58 | wi->worker_data = NULL; 59 | 60 | return 0; 61 | } 62 | -------------------------------------------------------------------------------- /BM/workload-xsave/work_GETCPU.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | /* 3 | * see yogini.8 4 | * 5 | * Initial implementation is specific to Intel hardware. 6 | * 7 | * Copyright (c) 2022 Intel Corporation. 8 | * Len Brown 9 | * Yi Sun 10 | * Dongcheng Yan 11 | * 12 | */ 13 | 14 | #define _GNU_SOURCE 15 | #include /* printf(3) */ 16 | #include /* random(3) */ 17 | #include /* CPU_SET */ 18 | #include "yogini.h" 19 | 20 | extern unsigned int tsc_to_msec_from_start(unsigned long long tsc); 21 | 22 | /* 23 | * GETCPU_run() 24 | * Run the GETCPU spin loop either "loops" times, or until tsc_end 25 | * return loops completed 26 | */ 27 | static unsigned long long GETCPU_run(struct work_instance *wi, 28 | unsigned long long loops, unsigned long long tsc_end) 29 | { 30 | unsigned long long count; 31 | 32 | if (loops == 0) 33 | loops = (unsigned int)-1; 34 | 35 | if (tsc_end == 0) 36 | tsc_end = (unsigned long long)-1; 37 | 38 | for (count = 0; count < loops; count++) { 39 | unsigned long long tsc_now = rdtsc(); 40 | int cpu; 41 | 42 | if (tsc_now >= tsc_end) 43 | break; 44 | 45 | cpu = record_cpu_residency(wi, tsc_to_msec_from_start(tsc_now)); 46 | record_wi_duration(wi, tsc_now); 47 | record_cpu_work(wi, cpu, 1); 48 | } 49 | 50 | return (count); 51 | } 52 | 53 | static struct workload w = { 54 | "GETCPU", 55 | NULL, 56 | NULL, 57 | GETCPU_run, 58 | }; 59 | 60 | struct workload *register_GETCPU(void) 61 | { 62 | return &w; 63 | } 64 | -------------------------------------------------------------------------------- /BM/cet/cet_driver/cet_ioctl.h: -------------------------------------------------------------------------------- 1 | /* SPDX-License-Identifier: GPL-2.0-only */ 2 | /* Copyright (c) 2022 Intel Corporation. */ 3 | 4 | /* 5 | * cet_ioctl.h: 6 | * This file is cet driver head 7 | * - cet driver head file 8 | */ 9 | 10 | #ifndef QUERY_IOCTL_H 11 | #define QUERY_IOCTL_H 12 | #include 13 | 14 | #define CET_SHSTK1 _IO('q', 4) 15 | #define CET_IBT1 _IO('q', 5) 16 | #define CET_IBT2 _IO('q', 6) 17 | #define CET_SHSTK_XSAVES _IO('q', 7) 18 | 19 | #endif 20 | 21 | #ifndef __cpuid_count 22 | #define __cpuid_count(level, count, a, b, c, d) ({ \ 23 | __asm__ __volatile__ ("cpuid\n\t" \ 24 | : "=a" (a), "=b" (b), "=c" (c), "=d" (d) \ 25 | : "0" (level), "2" (count)); \ 26 | }) 27 | #endif 28 | 29 | #define CPUID_LEAF_XSTATE 0xd 30 | #define CPUID_SUBLEAF_XSTATE_USER 0x0 31 | 32 | #define MSR_IA32_PL3_SSP 0x000006a7 /* user shadow stack pointer */ 33 | 34 | /* The following definition is from arch/x86/include/asm/fpu/types.h */ 35 | #define XFEATURE_MASK_FP (1 << XFEATURE_FP) 36 | #define XFEATURE_MASK_SSE (1 << XFEATURE_SSE) 37 | #define XFEATURE_MASK_CET_USER (1 << XFEATURE_CET_USER) 38 | 39 | #define XFEATURE_CET_USER 11 40 | 41 | static uint32_t get_xstate_size(void) 42 | { 43 | uint32_t eax, ebx, ecx, edx; 44 | 45 | __cpuid_count(CPUID_LEAF_XSTATE, CPUID_SUBLEAF_XSTATE_USER, eax, ebx, 46 | ecx, edx); 47 | /* 48 | * EBX enumerates the size (in bytes) required by the XSAVE 49 | * instruction for an XSAVE area containing all the user state 50 | * components corresponding to bits currently set in XCR0. 51 | */ 52 | return ebx; 53 | } 54 | -------------------------------------------------------------------------------- /KVM/qemu/tests/host_cpu_offline_online.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | # SPDX-License-Identifier: GPL-2.0-only 4 | # Copyright (c) 2024 Intel Corporation 5 | 6 | # Author: Xudong Hao 7 | # 8 | # History: Dec. 2024 - Xudong Hao - creation 9 | 10 | import random 11 | from avocado.utils import cpu 12 | 13 | from virttest.cpu import check_if_vm_vcpu_match 14 | 15 | 16 | def run(test, params, env): 17 | """ 18 | pCPU offline/online test: 19 | 1) Launch a guest with many CPU. 20 | 2) Offline 3 random online pCPU. 21 | 3) Check guest's status 22 | 4) Online the offlined pCPU again. 23 | 24 | :param test: QEMU test object 25 | :param params: Dictionary with the test parameters 26 | :param env: Dictionary with test environment. 27 | """ 28 | vm = env.get_vm(params["main_vm"]) 29 | vcpus = params["smp"] 30 | vm.verify_alive() 31 | timeout = params.get_numeric("login_timeout", 240) 32 | session = vm.wait_for_login(timeout=timeout) 33 | 34 | host_cpu_list = cpu.online_list() 35 | processor_list = random.sample(host_cpu_list, 3) 36 | for processor in processor_list: 37 | cpu.offline(processor) 38 | test.log.info("CPUs {} have been offline.".format(processor_list)) 39 | vm.verify_dmesg() 40 | if not check_if_vm_vcpu_match(vcpus, vm): 41 | test.fail("vCPU quantity on guest mismatch after offline") 42 | 43 | for processor in processor_list: 44 | cpu.online(processor) 45 | test.log.info("CPUs {} have been online.".format(processor_list)) 46 | vm.verify_dmesg() 47 | session.close() 48 | -------------------------------------------------------------------------------- /BM/pt/sort_test.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | // Copyright (c) 2024 Intel Corporation. 3 | #include 4 | #include 5 | #include 6 | 7 | #define ARRAY_LEN 3000 8 | 9 | void swap(int *a, int *b) 10 | { 11 | int temp = *a; 12 | *a = *b; 13 | *b = temp; 14 | } 15 | 16 | size_t partition(int *a, size_t low, size_t high) 17 | { 18 | int pivot = a[high]; 19 | size_t i = low - 1; 20 | 21 | for (size_t j = low; j <= high - 1; j++) { 22 | if (a[j] < pivot) { 23 | i++; 24 | swap(&a[i], &a[j]); 25 | } 26 | } 27 | swap(&a[i + 1], &a[high]); 28 | return (i + 1); 29 | } 30 | 31 | static inline void start(struct timeval *tm) 32 | { 33 | gettimeofday(tm, NULL); 34 | } 35 | 36 | static inline void stop(struct timeval *tm1, struct timeval *tm2) 37 | { 38 | unsigned long long t = 1000 * (tm2->tv_sec - tm1->tv_sec) + 39 | (tm2->tv_usec - tm1->tv_usec) / 1000; 40 | printf("%llu ms\n", t); 41 | } 42 | 43 | void quick_sort(int *a, size_t low, size_t high) 44 | { 45 | if (low < high) { 46 | size_t pivot = partition(a, low, high); 47 | 48 | quick_sort(a, low, pivot - 1); 49 | quick_sort(a, pivot + 1, high); 50 | } 51 | } 52 | 53 | void sort_array(void) 54 | { 55 | printf("Quick sorting array of %zu elements\n", ARRAY_LEN); 56 | int data[ARRAY_LEN]; 57 | 58 | for (size_t i = 0; i < ARRAY_LEN; ++i) 59 | data[i] = rand(); 60 | 61 | quick_sort(data, 0, ARRAY_LEN - 1); 62 | } 63 | 64 | int main(void) 65 | { 66 | struct timeval tm1, tm2; 67 | 68 | start(&tm1); 69 | sort_array(); 70 | gettimeofday(&tm2, NULL); 71 | stop(&tm1, &tm2); 72 | return 0; 73 | } 74 | -------------------------------------------------------------------------------- /BM/xsave/README.md: -------------------------------------------------------------------------------- 1 | # XSAVE 2 | 3 | ## Description 4 | The XSAVE feature set supports the saving and restoring of xstate components. 5 | XSAVE feature has been used for process context switching. Xstate components 6 | include x87 state for FP execution environment, SSE state, AVX state and so on. 7 | 8 | In order to ensure that XSAVE works correctly, add XSAVE most basic test for 9 | XSAVE architecture functionality. 10 | 11 | From page 21 of ABI(Application Binary Interface) specification: 12 | https://refspecs.linuxbase.org/elf/x86_64-abi-0.99.pdf 13 | Xstate like XMM is not preserved across function calls, so fork() function 14 | which provided from libc could not be used in the xsave test, and the libc 15 | function is replaced with an inline function of the assembly code only. 16 | 17 | To prevent GCC from generating any FP/SSE(XMM)/AVX/PKRU code by mistake, add 18 | "-mno-sse -mno-mmx -mno-sse2 -mno-avx -mno-pku" compiler arguments. stdlib.h 19 | can not be used because of the "-mno-sse" option. 20 | 21 | ## Usage 22 | make 23 | ./xstate_64 24 | It tests "FP, SSE(XMM), AVX2(YMM), AVX512_OPMASK/AVX512_ZMM_Hi256/ 25 | AVX512_Hi16_ZMM and PKRU parts" xstates with the following cases: 26 | 1. The contents of these xstates in the process should not change after the 27 | signal handling. 28 | 2. The contents of these xstates in the child process should be the same as 29 | the contents of the xstate in the parent process after the fork syscall. 30 | 3. The contents of xstates in the parent process should not change after 31 | the context switch. 32 | 33 | ## Expected result 34 | All test results should show pass, no fail. 35 | -------------------------------------------------------------------------------- /BM/avx512vbmi/tests: -------------------------------------------------------------------------------- 1 | # This file collects the VBMI(Vector Byte Manipulation Instructions) tests on 2 | # Intel® Architecture-based platforms. 3 | # @hw_dep: cpuid_check 7 0 0 0 c 1 @ CPU doesn't support VBMI CPUID.(EAX=07H,ECX=0H):ECX[bit 1] 4 | # @other_dep: 5 | # @other_warn: 6 | 7 | vbmi_func.sh -n vbmi_test -p "0 ff b" 8 | vbmi_func.sh -n vbmi_test -p "1 ff b" 9 | vbmi_func.sh -n vbmi_test -p "2 ff b" 10 | vbmi_func.sh -n vbmi_test -p "3 ff b" 11 | vbmi_func.sh -n vbmi_test -p "4 ff b" 12 | vbmi_func.sh -n vbmi_test -p "5 ff b" 13 | vbmi_func.sh -n vbmi_test -p "6 ff b" 14 | vbmi_func.sh -n vbmi_test -p "7 ff b" 15 | vbmi_func.sh -n vbmi_test -p "18 ff b" 16 | vbmi_func.sh -n vbmi_test -p "19 ff b" 17 | vbmi_func.sh -n vbmi_test -p "1F ff b" 18 | vbmi_func.sh -n vbmi_test -p "20 ff b" 19 | vbmi_func.sh -n vbmi_test -p "21 ff b" 20 | vbmi_func.sh -n vbmi_test -p "30 ff b" 21 | vbmi_func.sh -n vbmi_test -p "3A ff b" 22 | vbmi_func.sh -n vbmi_test -p "3F ff b" 23 | vbmi_func.sh -n vbmi_test -p "40 ff b" 24 | vbmi_func.sh -n vbmi_test -p "41 ff b" 25 | vbmi_func.sh -n vbmi_test -p "42 ff b" 26 | vbmi_func.sh -n vbmi_test -p "43 ff b" 27 | vbmi_func.sh -n vbmi_test -p "50 ff b" 28 | vbmi_func.sh -n vbmi_test -p "60 ff b" 29 | vbmi_func.sh -n vbmi_test -p "ff ff b" 30 | vbmi_func.sh -n vbmi_test -p "0 0 b" 31 | vbmi_func.sh -n vbmi_test -p "0 1 b" 32 | vbmi_func.sh -n vbmi_test -p "0 5 b" 33 | vbmi_func.sh -n vbmi_test -p "0 A b" 34 | vbmi_func.sh -n vbmi_test -p "0 F b" 35 | vbmi_func.sh -n vbmi_test -p "0 1FF b" 36 | vbmi_func.sh -n vbmi_test -p "0 FFFF b" 37 | vbmi_func.sh -n vbmi_test -p "0 1FFFF b" 38 | vbmi_func.sh -n vbmi_test -p random 39 | -------------------------------------------------------------------------------- /BM/dsa/configs/1d2g2q_user.conf: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "dev":"dsa0", 4 | "groups":[ 5 | { 6 | "dev":"group0.0", 7 | "grouped_workqueues":[ 8 | { 9 | "dev":"wq0.0", 10 | "mode":"shared", 11 | "size":16, 12 | "group_id":0, 13 | "priority":10, 14 | "block_on_fault":1, 15 | "type":"user", 16 | "name":"app1", 17 | "driver_name":"user", 18 | "threshold":15 19 | } 20 | ], 21 | "grouped_engines":[ 22 | { 23 | "dev":"engine0.0", 24 | "group_id":0 25 | }, 26 | { 27 | "dev":"engine0.1", 28 | "group_id":0 29 | } 30 | ] 31 | }, 32 | { 33 | "dev":"group0.1", 34 | "grouped_workqueues":[ 35 | { 36 | "dev":"wq0.1", 37 | "mode":"dedicated", 38 | "size":16, 39 | "group_id":1, 40 | "priority":10, 41 | "block_on_fault":1, 42 | "type":"user", 43 | "name":"app2", 44 | "driver_name":"user", 45 | "threshold":0 46 | } 47 | ], 48 | "grouped_engines":[ 49 | { 50 | "dev":"engine0.2", 51 | "group_id":1 52 | }, 53 | { 54 | "dev":"engine0.3", 55 | "group_id":1 56 | } 57 | ] 58 | }, 59 | { 60 | "dev":"group0.2", 61 | }, 62 | { 63 | "dev":"group0.3", 64 | } 65 | ] 66 | } 67 | ] 68 | -------------------------------------------------------------------------------- /scenario/emr-ov/tests-avx512vbmi: -------------------------------------------------------------------------------- 1 | # This file collects the VBMI(Vector Byte Manipulation Instructions) tests on 2 | # Intel® Architecture-based platforms. 3 | # @hw_dep: cpuid_check 7 0 0 0 c 1 @ CPU doesn't support VBMI CPUID.(EAX=07H,ECX=0H):ECX[bit 1] 4 | # @other_dep: 5 | # @other_warn: 6 | 7 | vbmi_func.sh -n vbmi_test -p "0 ff b" 8 | vbmi_func.sh -n vbmi_test -p "1 ff b" 9 | vbmi_func.sh -n vbmi_test -p "2 ff b" 10 | vbmi_func.sh -n vbmi_test -p "3 ff b" 11 | vbmi_func.sh -n vbmi_test -p "4 ff b" 12 | vbmi_func.sh -n vbmi_test -p "5 ff b" 13 | vbmi_func.sh -n vbmi_test -p "6 ff b" 14 | vbmi_func.sh -n vbmi_test -p "7 ff b" 15 | vbmi_func.sh -n vbmi_test -p "18 ff b" 16 | vbmi_func.sh -n vbmi_test -p "19 ff b" 17 | vbmi_func.sh -n vbmi_test -p "1F ff b" 18 | vbmi_func.sh -n vbmi_test -p "20 ff b" 19 | vbmi_func.sh -n vbmi_test -p "21 ff b" 20 | vbmi_func.sh -n vbmi_test -p "30 ff b" 21 | vbmi_func.sh -n vbmi_test -p "3A ff b" 22 | vbmi_func.sh -n vbmi_test -p "3F ff b" 23 | vbmi_func.sh -n vbmi_test -p "40 ff b" 24 | vbmi_func.sh -n vbmi_test -p "41 ff b" 25 | vbmi_func.sh -n vbmi_test -p "42 ff b" 26 | vbmi_func.sh -n vbmi_test -p "43 ff b" 27 | vbmi_func.sh -n vbmi_test -p "50 ff b" 28 | vbmi_func.sh -n vbmi_test -p "60 ff b" 29 | vbmi_func.sh -n vbmi_test -p "ff ff b" 30 | vbmi_func.sh -n vbmi_test -p "0 0 b" 31 | vbmi_func.sh -n vbmi_test -p "0 1 b" 32 | vbmi_func.sh -n vbmi_test -p "0 5 b" 33 | vbmi_func.sh -n vbmi_test -p "0 A b" 34 | vbmi_func.sh -n vbmi_test -p "0 F b" 35 | vbmi_func.sh -n vbmi_test -p "0 1FF b" 36 | vbmi_func.sh -n vbmi_test -p "0 FFFF b" 37 | vbmi_func.sh -n vbmi_test -p "0 1FFFF b" 38 | vbmi_func.sh -n vbmi_test -p random 39 | -------------------------------------------------------------------------------- /scenario/gnr-ov/tests-avx512vbmi: -------------------------------------------------------------------------------- 1 | # This file collects the VBMI(Vector Byte Manipulation Instructions) tests on 2 | # Intel® Architecture-based platforms. 3 | # @hw_dep: cpuid_check 7 0 0 0 c 1 @ CPU doesn't support VBMI CPUID.(EAX=07H,ECX=0H):ECX[bit 1] 4 | # @other_dep: 5 | # @other_warn: 6 | 7 | vbmi_func.sh -n vbmi_test -p "0 ff b" 8 | vbmi_func.sh -n vbmi_test -p "1 ff b" 9 | vbmi_func.sh -n vbmi_test -p "2 ff b" 10 | vbmi_func.sh -n vbmi_test -p "3 ff b" 11 | vbmi_func.sh -n vbmi_test -p "4 ff b" 12 | vbmi_func.sh -n vbmi_test -p "5 ff b" 13 | vbmi_func.sh -n vbmi_test -p "6 ff b" 14 | vbmi_func.sh -n vbmi_test -p "7 ff b" 15 | vbmi_func.sh -n vbmi_test -p "18 ff b" 16 | vbmi_func.sh -n vbmi_test -p "19 ff b" 17 | vbmi_func.sh -n vbmi_test -p "1F ff b" 18 | vbmi_func.sh -n vbmi_test -p "20 ff b" 19 | vbmi_func.sh -n vbmi_test -p "21 ff b" 20 | vbmi_func.sh -n vbmi_test -p "30 ff b" 21 | vbmi_func.sh -n vbmi_test -p "3A ff b" 22 | vbmi_func.sh -n vbmi_test -p "3F ff b" 23 | vbmi_func.sh -n vbmi_test -p "40 ff b" 24 | vbmi_func.sh -n vbmi_test -p "41 ff b" 25 | vbmi_func.sh -n vbmi_test -p "42 ff b" 26 | vbmi_func.sh -n vbmi_test -p "43 ff b" 27 | vbmi_func.sh -n vbmi_test -p "50 ff b" 28 | vbmi_func.sh -n vbmi_test -p "60 ff b" 29 | vbmi_func.sh -n vbmi_test -p "ff ff b" 30 | vbmi_func.sh -n vbmi_test -p "0 0 b" 31 | vbmi_func.sh -n vbmi_test -p "0 1 b" 32 | vbmi_func.sh -n vbmi_test -p "0 5 b" 33 | vbmi_func.sh -n vbmi_test -p "0 A b" 34 | vbmi_func.sh -n vbmi_test -p "0 F b" 35 | vbmi_func.sh -n vbmi_test -p "0 1FF b" 36 | vbmi_func.sh -n vbmi_test -p "0 FFFF b" 37 | vbmi_func.sh -n vbmi_test -p "0 1FFFF b" 38 | vbmi_func.sh -n vbmi_test -p random 39 | -------------------------------------------------------------------------------- /BM/workload-xsave/worker_init_avx2.c: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-2.0-only 2 | /* 3 | * Copyright (c) 2022 Intel Corporation. 4 | * Len Brown 5 | */ 6 | #include 7 | #include 8 | #include 9 | static int init(struct work_instance *wi) 10 | { 11 | int i; 12 | struct thread_data *dp; 13 | int bytes_per_entry = BYTES_PER_VECTOR * 3; /* x[], y[], output[] */ 14 | int entries; 15 | 16 | entries = wi->wi_bytes / bytes_per_entry; 17 | 18 | dp = (struct thread_data *)calloc(1, sizeof(struct thread_data)); 19 | if (!dp) 20 | err(1, "thread_data"); 21 | 22 | dp->input_x = (uint8_t *)calloc(entries, BYTES_PER_VECTOR); 23 | if (!dp->input_x) 24 | err(1, "calloc input_x"); 25 | 26 | dp->input_y = (int8_t *)calloc(entries, BYTES_PER_VECTOR); 27 | if (!dp->input_y) 28 | err(1, "calloc input_y"); 29 | 30 | /* initialize input -- make every iteration the same for now */ 31 | for (i = 0; i < entries; ++i) { 32 | int j; 33 | 34 | for (j = 0; j < BYTES_PER_VECTOR; j++) { 35 | int index = i * BYTES_PER_VECTOR + j; 36 | 37 | dp->input_x[index] = j; 38 | dp->input_y[index] = BYTES_PER_VECTOR + j; 39 | } 40 | } 41 | 42 | dp->output = (int16_t *) calloc(entries, BYTES_PER_VECTOR); 43 | if (dp->output == NULL) 44 | err(1, "calloc output"); 45 | dp->data_entries = entries; 46 | 47 | wi->worker_data = dp; 48 | 49 | return 0; 50 | } 51 | 52 | static int cleanup(struct work_instance *wi) 53 | { 54 | struct thread_data *dp = wi->worker_data; 55 | 56 | free(dp->input_x); 57 | free(dp->input_y); 58 | free(dp->output); 59 | free(dp); 60 | wi->worker_data = NULL; 61 | 62 | return 0; 63 | } 64 | -------------------------------------------------------------------------------- /BM/instruction-check/auto_gen_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | import os 3 | from feature_list import feature_list 4 | from feature_list import get_platform 5 | 6 | # Template string, used to generate code for each test class 7 | class_template = """ 8 | class {class_name}(Test): 9 | def test(self): 10 | cmd = os.path.join(source_dir, file_name + ' ' + ' '.join({args})) 11 | cmd_result = process.run(cmd, ignore_status=True) 12 | self.assertEqual(cmd_result.exit_status, expected_result) 13 | """ 14 | 15 | def generate_cpuid_tests(): 16 | with open('cpuid_test.py', 'w') as f: 17 | script_dir = os.path.dirname(__file__) 18 | parent_dir = os.path.dirname(script_dir) 19 | grandparent_dir = os.path.dirname(parent_dir) 20 | source_dir = f"{grandparent_dir}/tools/cpuid_check" 21 | # Write the necessary imports and variable definitions 22 | f.write(f'''#!/usr/bin/python 23 | 24 | import os 25 | from avocado import Test 26 | from avocado.utils import process 27 | 28 | source_dir = "{source_dir}" 29 | file_name = "cpuid_check" 30 | expected_result = 0 31 | ''') 32 | # For each feature in feature_list.py generates a test class 33 | feature_name_list = feature_list.keys() 34 | platform = get_platform() 35 | for feature_name in feature_name_list: 36 | if platform in feature_list[feature_name]["platforms"]: 37 | args = feature_list[feature_name]["cpuid"] 38 | class_code = class_template.format(class_name=feature_name, args=args) 39 | f.write(class_code) 40 | else: 41 | continue 42 | 43 | generate_cpuid_tests() -------------------------------------------------------------------------------- /BM/amx/tests-stress: -------------------------------------------------------------------------------- 1 | # This file collects the AMX(Advanced Matrix eXtension) related instruction tests on 2 | # Intel® Architecture-based platforms. 3 | # @hw_dep: cpuid_check 7 0 0 0 d 24 @ CPU doesn't support AMX-TILE - CPUID.(7.0).EDX[24] 4 | # @hw_dep: cpuid_check 7 0 0 0 d 25 @ CPU doesn't support AMX-INT8 - CPUID.(7.0).EDX[25] 5 | # @hw_dep: cpuid_check 7 0 0 0 d 22 @ CPU doesn't support AMX-BF16 - CPUID.(7.0).EDX[22] 6 | # @hw_dep: cpuid_check 7 0 1 0 a 21 @ CPU doesn't support AMX-FP16 - CPUID.(7.1).EAX[21] 7 | # @hw_dep: cpuid_check d 0 1 0 a 4 @ CPU doesn't support AMX XFD - CPUID.(d.1).EAX[4] 8 | # @other_warn: echo 'int main() { asm volatile("tdpfp16ps %tmm2, %tmm1, %tmm0"); return 0; }' | gcc -x c -o /dev/null - \ 9 | # @ gcc no support AMX_FP16 ins., refer to README for compile option, amx_fp16 related tests can't be executed 10 | 11 | # Usage:./tmul [OPTIONS] 12 | # -b, --break-reason [1 - 5] 13 | # 0: break by nothing 14 | # 1: break by yield 15 | # 2: break by sleep 16 | # 3: break by trap 17 | # 4: break by signal 18 | # 5: break by futex 19 | # -t, --thread-count [Should not be less than 1] 20 | # -c, --cycle-number [Should not be less than 1] 21 | # -i, --instruction-type [0:TDPBF16PS 1:TDPBSSD 2:TDPBSUD 3:TDPBUSD 4:TDPBUUD] 22 | 23 | # stress tests on cycles 24 | tmul -b 4 -t 10 -c 100000 -i 0 25 | tmul -b 4 -t 10 -c 100000 -i 1 26 | tmul -b 4 -t 10 -c 100000 -i 2 27 | tmul -b 4 -t 10 -c 100000 -i 3 28 | tmul -b 4 -t 10 -c 100000 -i 4 29 | 30 | # stress tests on threads 31 | tmul -b 1 -t 10000 -c 10 -i 0 32 | tmul -b 1 -t 10000 -c 10 -i 1 33 | tmul -b 1 -t 10000 -c 10 -i 2 34 | tmul -b 1 -t 10000 -c 10 -i 3 35 | tmul -b 1 -t 10000 -c 10 -i 4 36 | -------------------------------------------------------------------------------- /BM/rapl/tests-server: -------------------------------------------------------------------------------- 1 | # This file collects RAPL cases which can run against intel_rapl driver 2 | # on Intel® Architecture-based server platforms. 3 | # @hw_dep: 4 | # @other_dep: general_test.sh -t turbostat @ The latest 2024 version turbostat tool is required 5 | # @other_warn: which stress 2>/dev/null @ stress tool is required, please install stress-ng.x86_64 and run command: ln -s /usr/bin/stress-ng /usr/bin/stress 6 | # @other_warn: which perf 2>/dev/null @ perf tool is required, please install perf.x86_64 package 7 | # @other_warn: which rdmsr 2>/dev/null @ rdmsr tool is required, please install msr-tools package 8 | 9 | intel_rapl_test.sh -t check_sysfs 10 | intel_rapl_test.sh -t check_pkg_domain 11 | intel_rapl_test.sh -t check_psys_domain 12 | intel_rapl_test.sh -t check_dram_domain 13 | intel_rapl_test.sh -t check_psys_domain_msr 14 | intel_rapl_test.sh -t check_pkg_domain_msr 15 | intel_rapl_test.sh -t check_pkg_power_limit_msr 16 | intel_rapl_test.sh -t check_pkg_energy_status 17 | intel_rapl_test.sh -t check_pkg_energy_status_with_workload 18 | intel_rapl_test.sh -t check_pkg_power_limit_75 19 | intel_rapl_test.sh -t check_pkg_power_limit_50 20 | intel_rapl_test.sh -t check_dram_energy_status 21 | intel_rapl_test.sh -t check_dram_energy_status_with_workload 22 | intel_rapl_test.sh -t check_rapl_control_after_power_limit_change 23 | intel_rapl_test.sh -t sysfs_perf_name_compare 24 | intel_rapl_test.sh -t sysfs_perf_energy_compare_workload_server 25 | intel_rapl_test.sh -t sysfs_turbostat_energy_compare_workload_server 26 | intel_rapl_test.sh -t rapl_control_enable_disable_pl1 27 | intel_rapl_test.sh -t rapl_control_enable_disable_pl2 28 | intel_rapl_test.sh -t rapl_control_enable_disable_pl4 29 | -------------------------------------------------------------------------------- /scenario/cwf-ov/tests-rapl: -------------------------------------------------------------------------------- 1 | # This file collects RAPL cases which can run against intel_rapl driver 2 | # on Intel® Architecture-based server platforms. 3 | # @hw_dep: 4 | # @other_dep: general_test.sh -t turbostat @ The latest 2024 version turbostat tool is required 5 | # @other_warn: which stress 2>/dev/null @ stress tool is required, please install stress-ng.x86_64 and run command: ln -s /usr/bin/stress-ng /usr/bin/stress 6 | # @other_warn: which perf 2>/dev/null @ perf tool is required, please install perf.x86_64 package 7 | # @other_warn: which rdmsr 2>/dev/null @ rdmsr tool is required, please install msr-tools package 8 | 9 | intel_rapl_test.sh -t check_sysfs 10 | intel_rapl_test.sh -t check_pkg_domain 11 | # intel_rapl_test.sh -t check_psys_domain 12 | intel_rapl_test.sh -t check_dram_domain 13 | intel_rapl_test.sh -t check_psys_domain_msr 14 | intel_rapl_test.sh -t check_pkg_domain_msr 15 | intel_rapl_test.sh -t check_pkg_power_limit_msr 16 | intel_rapl_test.sh -t check_pkg_energy_status 17 | intel_rapl_test.sh -t check_pkg_energy_status_with_workload 18 | intel_rapl_test.sh -t check_pkg_power_limit_75 19 | intel_rapl_test.sh -t check_pkg_power_limit_50 20 | intel_rapl_test.sh -t check_dram_energy_status 21 | intel_rapl_test.sh -t check_dram_energy_status_with_workload 22 | intel_rapl_test.sh -t check_rapl_control_after_power_limit_change 23 | intel_rapl_test.sh -t sysfs_perf_name_compare 24 | intel_rapl_test.sh -t sysfs_perf_energy_compare_workload_server 25 | intel_rapl_test.sh -t sysfs_turbostat_energy_compare_workload_server 26 | intel_rapl_test.sh -t rapl_control_enable_disable_pl1 27 | intel_rapl_test.sh -t rapl_control_enable_disable_pl2 28 | intel_rapl_test.sh -t rapl_control_enable_disable_pl4 --------------------------------------------------------------------------------