-
Notifications
You must be signed in to change notification settings - Fork 1
/
Fig10.sh
92 lines (76 loc) · 1.91 KB
/
Fig10.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/bash
. ./functions
# Output files
OUT=figures/Fig10.dat
> $OUT
# Parameters for the victim workload
vsize=64
viters=(10000)
vtype=read
vtypestr="${vtype^}"
# Parameters for the attacker workloads
ctypes=(write)
csizes=(64)
asizes=(64)
# Bandwidth budgets to test
budgets=(50 100 200 300 400 500 600 700 800 900 1000)
# Array to track slowdowns and LLC missrates across victim WSS
slowdowns=()
missrates=()
index=0
for budget in ${budgets[@]}; do
slowdowns+=(); slowdowns[$index]+="$budget "
missrates+=(); missrates[$index]+="$budget "
# Update the budgets for the attacking cores
echo mb 50000 $budget $budget $budget > /sys/kernel/debug/memguard/limit
echo "Bw${vtypestr}($vsize) Victim"
echo "Corun, Bandwidth, Latency, Slowdown, LLC_miss, LLC_access, LLC_missrate"
# SOLO CASE
BwReadVictimSolo $vsize ${viters[$index]}
slowdowns[$index]+="1.00 "
missrates[$index]+="$l2missrate "
# VS CACHE BANK OBLIVIOUS DOS ATTACKS
for csize in ${csizes[@]}; do
# BW
for ctype in ${ctypes[@]}; do
ctypestr="${ctype^}"
BwWriteCorun $csize
sleep 3
BwReadVictimCorun $vsize $viter
slowdowns[$index]+="$slowdown "
missrates[$index]+="$l2missrate "
killall $corun
wait &> /dev/null
done
#PLL
for ctype in ${ctypes[@]}; do
ctypestr="${ctype^}"
PLLWriteCorun $csize
sleep 3
BwReadVictimCorun $vsize $viter
slowdowns[$index]+="$slowdown "
missrates[$index]+="$l2missrate "
killall $corun
done
done
# VS CACHE BANK AWARE DOS ATTACKS
for asize in ${asizes[@]}; do
for ctype in ${ctypes[@]}; do
ctypestr="${ctype^}"
BkPLLWriteCorun $asize 1
sleep 3
BwReadVictimCorun $vsize $viter
slowdowns[$index]+="$slowdown "
missrates[$index]+="$l2missrate "
killall $corun
wait &> /dev/null
done
done
index=$((index+1))
echo ""
sleep 3
done
# Output the slowdowns
for ((i=0;i<${#slowdowns[@]}; i++)); do
echo ${slowdowns[$i]} >> $OUT
done