diff options
author | Iru Cai <mytbk920423@gmail.com> | 2019-05-17 11:21:29 +0800 |
---|---|---|
committer | Iru Cai <mytbk920423@gmail.com> | 2019-05-17 11:21:29 +0800 |
commit | 8f7058d77051ee65b724114d3f64585e56b11ec9 (patch) | |
tree | fdce349a6c4f8c1d7854ef7a89dc9b8e42b555a7 /chap/chap5.tex | |
parent | b760658a92b9a237c65416aeafb07eadd361dca6 (diff) | |
download | dissertation-8f7058d77051ee65b724114d3f64585e56b11ec9.tar.xz |
upd
Diffstat (limited to 'chap/chap5.tex')
-rw-r--r-- | chap/chap5.tex | 148 |
1 files changed, 80 insertions, 68 deletions
diff --git a/chap/chap5.tex b/chap/chap5.tex index e16fe51..2c83fe3 100644 --- a/chap/chap5.tex +++ b/chap/chap5.tex @@ -64,14 +64,12 @@ L2 Cache & 2MB, 16路组相联, 8周期延迟\tabularnewline \section{评测指标} -本文评测每种微体系结构设计的安全性和性能。安全性表现为是否受 Spectre 攻击的 -影响,本文构造测试程序测试微体系结构的安全性。性能指标使用每个微体系结构设计运 -行基准程序,和 Baseline 的运行时间的比值,平均性能取这些比值的几何平均 -数。 +本文评测每种微体系结构设计的安全性和性能。安全性表现为是否受 Spectre +攻击的影响,本文构造测试程序测试微体系结构的安全性。性能指标使用每个微 +体系结构设计运行基准程序,和 Baseline 的运行时间的比值,平均性能取这些 +比值的几何平均数。 -\section{评测结果与分析} - -\subsection{微体系结构安全性测试} +\subsection{功能验证} 本文构造一个测试程序对每种配置的处理器进行安全性的测试,用于验证实现的 方案可以防御 Spectre 攻击。 @@ -91,7 +89,7 @@ L2 Cache & 2MB, 16路组相联, 8周期延迟\tabularnewline 攻击得到 X 的值 123. 而在其他配置中,array2 的所有位置都发生缓存缺失, 从而攻击者无法得出 X 的值,说明这些配置都能防御 Spectre 攻击。 -\subsection{SPEC CPU2006的性能评测} +\section{SPEC CPU2006 的性能评测与分析} 本文对 21 个 SPEC CPU2006 基准测试进行评测,基准测试的数据集使用 ref 集。所有的基准程序均用 GCC 8.3.0 编译,编译优化选项为 -O2,并且和 @@ -159,7 +157,8 @@ Glibc 2.24 静态链接。 %% \end{table} 图\ref{fig:is_spec06_result}是每种配置的处理器运行 SPEC CPU2006 相对于 -Baseline 的运行时间。 +Baseline 的运行时间。其中 cactusADM 和 lbm 由于每种配置的相对运行时间 +都接近 1,故未列入图中。 \begin{figure}[htbp] \centering @@ -175,74 +174,87 @@ Baseline 的运行时间。 6 个在 10\% 至 20\%. 性能开销最大的是 omnetpp, 所有安全的方案都会造成 94\% 以上的性能开销。 +\begin{figure}[htbp] + \centering + \includegraphics[width=\textwidth]{specload_ratio.eps} + \caption{SPEC CPU2006 中 SpecLoad 在所有操作中的比例} + \label{fig:specload} +\end{figure} + +%% \begin{table}[htbp] +%% \begin{tabular}{|c|c|c|c|} +%% \hline +%% 基准测试 & IS & IS+DIFT & SpecLoad 减少量\tabularnewline +%% \hline +%% \hline +%% astar & 34.80\% & 19.79\% & 43.13\%\tabularnewline +%% \hline +%% bwaves & 10.75\% & 0.23\% & 97.89\%\tabularnewline +%% \hline +%% bzip2 & 12.12\% & 5.49\% & 54.74\%\tabularnewline +%% \hline +%% cactusADM & 0.51\% & 0.13\% & 74.51\%\tabularnewline +%% \hline +%% calculix & 9.89\% & 3.06\% & 69.04\%\tabularnewline +%% \hline +%% GemsFDTD & 6.29\% & 0.13\% & 97.91\%\tabularnewline +%% \hline +%% gobmk & 12.61\% & 2.60\% & 79.38\%\tabularnewline +%% \hline +%% gromacs & 0.76\% & 0.06\% & 92.74\%\tabularnewline +%% \hline +%% h264ref & 5.43\% & 0.94\% & 82.68\%\tabularnewline +%% \hline +%% hmmer & 9.52\% & 4.82\% & 49.35\%\tabularnewline +%% \hline +%% lbm & 1.39\% & 0.00\% & 100.00\%\tabularnewline +%% \hline +%% leslie3d & 5.98\% & 0.11\% & 98.23\%\tabularnewline +%% \hline +%% libquantum & 1.99\% & 0.00\% & 99.99\%\tabularnewline +%% \hline +%% mcf & 10.56\% & 2.11\% & 79.99\%\tabularnewline +%% \hline +%% milc & 3.22\% & 0.10\% & 97.04\%\tabularnewline +%% \hline +%% namd & 2.67\% & 0.84\% & 68.73\%\tabularnewline +%% \hline +%% omnetpp & 5.94\% & 1.94\% & 67.37\%\tabularnewline +%% \hline +%% sjeng & 13.19\% & 2.72\% & 79.35\%\tabularnewline +%% \hline +%% soplex & 9.68\% & 4.63\% & 52.22\%\tabularnewline +%% \hline +%% sphinx3 & 6.63\% & 1.41\% & 78.68\%\tabularnewline +%% \hline +%% zeusmp & 6.70\% & 0.03\% & 99.58\%\tabularnewline +%% \hline +%% \end{tabular} +%% \centering +%% \caption{SPEC CPU2006 中 SpecLoad 在所有操作中的比例} +%% \label{tab:specload} +%% \end{table} +%% 为了观察使用基于信息流追踪的检测机制的效果,可以统计 IS 和 IS+DIFT 方 -案中 SpecLoad 请求的数量。表\ref{tab:specload}列出两种方案中,SpecLoad +案中 SpecLoad 请求的数量。图\ref{fig:specload}列出两种方案中,SpecLoad 请求的数量和程序的总操作数(gem5 模拟后得出的 sim\_ops 结果)的比例。 -\begin{table} -\centering -\begin{tabular}{|c|c|c|c|} -\hline -基准测试 & IS & IS+DIFT & SpecLoad 减少量\tabularnewline -\hline -\hline -astar & 34.80\% & 19.79\% & 43.13\%\tabularnewline -\hline -bwaves & 10.75\% & 0.23\% & 97.89\%\tabularnewline -\hline -bzip2 & 12.12\% & 5.49\% & 54.74\%\tabularnewline -\hline -cactusADM & 0.51\% & 0.13\% & 74.51\%\tabularnewline -\hline -calculix & 9.89\% & 3.06\% & 69.04\%\tabularnewline -\hline -GemsFDTD & 6.29\% & 0.13\% & 97.91\%\tabularnewline -\hline -gobmk & 12.61\% & 2.60\% & 79.38\%\tabularnewline -\hline -gromacs & 0.76\% & 0.06\% & 92.74\%\tabularnewline -\hline -h264ref & 5.43\% & 0.94\% & 82.68\%\tabularnewline -\hline -hmmer & 9.52\% & 4.82\% & 49.35\%\tabularnewline -\hline -lbm & 1.39\% & 0.00\% & 100.00\%\tabularnewline -\hline -leslie3d & 5.98\% & 0.11\% & 98.23\%\tabularnewline -\hline -libquantum & 1.99\% & 0.00\% & 99.99\%\tabularnewline -\hline -mcf & 10.56\% & 2.11\% & 79.99\%\tabularnewline -\hline -milc & 3.22\% & 0.10\% & 97.04\%\tabularnewline -\hline -namd & 2.67\% & 0.84\% & 68.73\%\tabularnewline -\hline -omnetpp & 5.94\% & 1.94\% & 67.37\%\tabularnewline -\hline -sjeng & 13.19\% & 2.72\% & 79.35\%\tabularnewline -\hline -soplex & 9.68\% & 4.63\% & 52.22\%\tabularnewline -\hline -sphinx3 & 6.63\% & 1.41\% & 78.68\%\tabularnewline -\hline -zeusmp & 6.70\% & 0.03\% & 99.58\%\tabularnewline -\hline -\end{tabular} -\caption{SPEC CPU2006 中 SpecLoad 在所有操作中的比例} -\label{tab:specload} -\end{table} - 可以看出,几乎所有的基准程序中,DIFT 可以过滤一半以上被认为不安全的装 载操作,其中 bwaves, GemsFDTD, libquantum, milc 中,推测式执行中的装载 指令只有 3\% 以下需要用安全的方式执行,因此使用 Fence+DIFT 即可以获得 -与 Baseline 几乎同等的性能。在 IS+DIFT 性能开销最大的 omnetpp 中, -SpecLoad 的数量只减少了 67\%,而性能开销接近 20\% 的 calculix 和 astar, -SpecLoad 减少的数量也在 70\% 以下。 +与 Baseline 几乎同等的性能。 + +在 IS+DIFT 性能开销最大的 omnetpp 中,SpecLoad 的数量只减少了 67\%,而 +性能开销接近 20\% 的 calculix 和 astar,SpecLoad 减少的数量也在 70\% +以下。而在 calculix 和 astar 中,对不安全的装载指令,用 InvisiSpec 策 +略执行,比阻止这些指令的执行,有明显的性能提升。 %\Todo: 评测结果的分析 \section{小结} 本章先介绍了评测环境,列出了各个处理器配置的基本参数。其后给出了评测指 标,包括安全性的测试和性能测试的指标。最后给出了安全测试的方法和结果, -以及用 SPEC CPU2006 进行性能评测得出的性能结果与分析。 +以及用 SPEC CPU2006 进行性能评测得出的性能结果与分析。功能验证表明,本 +文使用的基于 DIFT 的检测方法和 InvisiSpec 装载指令执行策略,都能阻止 +Spectre 攻击泄露内存中的数据。通过将这两种方法结合,防御 Spectre 攻击 +的性能开销为 8.5\%. |