From d56c3ba3201201fd691bd5a45b2474fe6060a8f9 Mon Sep 17 00:00:00 2001 From: Muminul Islam Date: Tue, 5 May 2026 15:40:20 -0700 Subject: [PATCH] scripts: Support confidential VM in run_metrics.sh Use the VM_TYPE environment variable to conditionally enable igvm and sev_snp features when building for confidential VMs. Pass --vm-type confidential to the performance-metrics binary so it can select the appropriate test configuration. Signed-off-by: Muminul Islam --- scripts/run_metrics.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/run_metrics.sh b/scripts/run_metrics.sh index 88c207b32..c84f5b994 100755 --- a/scripts/run_metrics.sh +++ b/scripts/run_metrics.sh @@ -28,6 +28,13 @@ build_fio() { process_common_args "$@" +build_features="mshv" +vm_type_arg="" +if [ "$VM_TYPE" = "confidential" ]; then + build_features="mshv,igvm,sev_snp" + vm_type_arg="--vm-type confidential" +fi + cp scripts/sha1sums-"${TEST_ARCH}"-common "$WORKLOADS_DIR" if [ "${TEST_ARCH}" == "aarch64" ]; then @@ -96,7 +103,7 @@ if [[ "${BUILD_TARGET}" == "${TEST_ARCH}-unknown-linux-musl" ]]; then CFLAGS="-I /usr/include/${TEST_ARCH}-linux-musl/ -idirafter /usr/include/" fi -cargo build --features mshv --all --release --target "$BUILD_TARGET" +cargo build --features "$build_features" --all --release --target "$BUILD_TARGET" # setup hugepages HUGEPAGESIZE=$(grep Hugepagesize /proc/meminfo | awk '{print $2}') @@ -122,7 +129,7 @@ else echo "RUST_BACKTRACE is set to: $RUST_BACKTRACE_VALUE" fi # shellcheck disable=SC2048,SC2086 -time target/"$BUILD_TARGET"/release/performance-metrics ${test_binary_args[*]} +time target/"$BUILD_TARGET"/release/performance-metrics $vm_type_arg ${test_binary_args[*]} RES=$? exit $RES