-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompile_and_check.py
50 lines (37 loc) · 1.75 KB
/
compile_and_check.py
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
import os
import sys
if os.geteuid() != 0:
print("please run this script as root!")
quit()
try:
import matplotlib.pyplot as plt
print("Matplotlib seems ok!")
except:
print("Matplotlib is not installed!")
def compile_and_check(directory, files):
os.system(f"cd {directory};AUTO_TOOL_FLAGS=-DEVAL make >/dev/null")
for f in files:
if not os.path.exists(os.path.join(directory, f)):
print(f"directory {directory} is missing {f}!", file=sys.stderr)
quit()
print(f"directory {directory} seems ok!")
# Simple FetchProbe
compile_and_check("00_fetch_probe/intel", ["fetchprobe_cf", "fetchprobe_off"])
compile_and_check("00_fetch_probe/intel/kernel_module", ["fetchprobe_module.ko"])
compile_and_check("00_fetch_probe/amd", ["fetchprobe_cf", "fetchprobe_off"])
compile_and_check("00_fetch_probe/amd/kernel_module", ["fetchprobe_module.ko"])
# Simple Shadowload
compile_and_check("01_shadowload", ["shadowload", "shadowload_kernel"])
compile_and_check("01_shadowload/kernel_module", ["shadowload_module.ko"])
# StrideRE
compile_and_check("02_stride_re", ["tests/test_prefetch_simple", "tests/test_prefetch_memory_collision", "tests/test_prefetch_pc_collision", "tests/test_prefetch_both_collisions", "tests/test_shadow_load"])
# Base64
compile_and_check("03_base64", ["sidechannel_base64"])
# Meltdown
compile_and_check("04_meltdown", ["meltdown_shadowload_single"])
compile_and_check("04_meltdown/kernel_module", ["meltdown_module.ko"])
# Spectre
compile_and_check("05_spectre/intel", ["sidechannel"])
compile_and_check("05_spectre/intel/kernel_module", ["fetch_probe_module.ko"])
compile_and_check("05_spectre/amd", ["sidechannel"])
compile_and_check("05_spectre/amd/kernel_module", ["fetch_probe_module.ko"])