diff options
author | Iru Cai <mytbk920423@gmail.com> | 2019-04-10 16:00:23 +0800 |
---|---|---|
committer | Iru Cai <mytbk920423@gmail.com> | 2019-05-31 16:03:18 +0800 |
commit | cd184d861f5702e0ec5855e7247584c799bd24a2 (patch) | |
tree | fa4dea6b6adf438dca6b023cd7b0cda14807fc0e /attack_test.sh | |
parent | 3fe13600a91d1eb8a353f1ac7455d9a1d977027a (diff) | |
download | gem5-cd184d861f5702e0ec5855e7247584c799bd24a2.tar.xz |
add attack code and attack test script
Diffstat (limited to 'attack_test.sh')
-rwxr-xr-x | attack_test.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/attack_test.sh b/attack_test.sh new file mode 100755 index 000000000..a50b3bc86 --- /dev/null +++ b/attack_test.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +GEM5="./build/X86_MESI_Two_Level/gem5.opt -q configs/example/se.py --cpu-type=DerivO3CPU --ruby --needsTSO=1 --output=stdout.txt" +SCMS=( +"--scheme=UnsafeBaseline" +"--scheme=SpectreSafeInvisibleSpec --useIFT=0" +"--scheme=SpectreSafeInvisibleSpec --useIFT=1 --trackBranch=0" +"--scheme=SpectreSafeInvisibleSpec --useIFT=1 --trackBranch=1" +"--scheme=SpectreSafeFence --useIFT=0" +"--scheme=SpectreSafeFence --useIFT=1 --trackBranch=0" +"--scheme=SpectreSafeFence --useIFT=1 --trackBranch=1" +) + +echo "Testing Spectre PoC victim function" +for scm in "${SCMS[@]}" +do + echo "$scm" + $GEM5 $scm -c attack + grep hit stdout.txt && echo unsafe || echo safe +done + +echo "Testing victim function v10" +for scm in "${SCMS[@]}" +do + echo "$scm" + $GEM5 $scm -c attack_v10 + grep '^[123]' stdout.txt && echo unsafe || echo safe +done |