Submitted:
24 December 2024
Posted:
26 December 2024
You are already at the latest version
Abstract
Spectre variants 1 and 2 pose grave security threats to the dynamic branch predictors in CPUs. This study examines experimentally the impact of mitigating those threats on energy and power consumption. The research obtained empirical data from an HPC-class CPU via embedded sensors with fine-grained energy readings. This approach black-boxed otherwise complex behaviors in and around the CPU. It was crucial to the concrete energy estimates reported here. The study identified factors that impacted the energy behaviors of branching (the attack vector for Spectre). It focused on compiler-based mitigation strategies vs. a no-mitigation baseline on three main compilers in wide use. It utilized a standard suite of microbenchmarks to gauge the consumption likely due to branch prediction under mixed branch and mitigation conditions. Results showed that the energy consumption varied significantly across the compilers, depending on the tasks. Loop unrolling affected the power consumption as it altered the number and distribution of branches. Speculative execution had a role in conserving energy. Reducing execution time was accompanied by an increase in instantaneous power. Since Spectre mitigations limit that feature, they should be applied selectively to the code patterns vulnerable to attacks. This work hopes to create an awareness of the energy costs of securing CPUs against Spectre attacks. It suggests directions for better energy-aware mitigation strategies. It highlights the importance of fitting compiler and optimization settings to application needs to balance security, performance, and power. The study provides compiler writers with recommendations that help build secure and power-efficient software.
Keywords:
1. Introduction
2. Literature Review
3. Research Design
4. Experement Methodology and Setup
4.1. Methodology
- Averaging multiple RAPL measurements generally improves accuracy. However, beyond a certain point, increasing the number of readings does not enhance accuracy.
- Averaging RAPL readings taken with a single thread tends to be more accurate than those taken with multiple threads.
- To measure the energy consumption of a workload without the unpredictable effects typically introduced by compiler optimizations, it is good practice to use minimal compiler optimization.
- Dedicating one core to the workload minimizes CPU context switching by ensuring the workload runs exclusively on that core, free from interruptions by other processes. This approach enhances RAPL accuracy.
- Enabling the Power Management Unit (PMU) negatively impacted the accuracy of RAPL readings because the PMU’s dynamic control over CPU power varied from one run to another.
- Turning off hyper-threading reduces RAPL noise because it prevents multiple threads from sharing the same physical core, thereby eliminating the interference and variability introduced by simultaneous multi-threading. This results in more consistent and accurate power measurements.
- Measuring only one RAPL metric at a time increases its accuracy because it reduces the potential for measurement interference and contention between multiple metrics. This focused approach allows for more precise and reliable readings by minimizing the complexity and overhead associated with tracking multiple metrics simultaneously.
- Running software inside a container appears to reduce environmental noise levels, making it more suitable for experimental studies.
4.2. Experemental Setup
- Turning off the Hyper-Threading Technology.
- Making the compiler optimization on the lowest possible level. However, to enable the unrolling feature, the optimization must be at least at level one (-O1).
- Turning off the Power Management Unit (PMU)
- Running each benchmark inside a docker container.
- The benchmark is run on a dedicated core.
- Disabling non-maskable interrupt.
- Running every benchmark many times until the average of every measurement converges.
- Measuring only one RAPL metric at a time (energy, time, number of instructions, branch instructions percentage, miss-prediction percentage, and cache misses)
5. Results and Discussion
5.1. No-Mitigation Case
5.2. Spectre Mitigations Data Exploration
5.2.1. Spectre Variant 1 Mitigations
5.2.2. Spectre Variant 2 Mitigations
- IBIT and IBET strategies that mitigate vulnerabilities in indirect branches.
- FCIT and FCET strategies that are designed to secure direct function calls.
- FRIT strategy that focuses on securing function returns.
- RT and RTET strategies that offer broader protection against speculative execution through multiple aspects of function handling.
5.3. Mitigation Data Discussion
5.4. Summary of Findings
- Generally, there is a correlation between energy consumption and execution time. Benchmarks that take longer to execute also tend to consume more energy.
- Even though disabling loop unrolling engages additional components such as DBP, enabling loop unrolling generally results in higher energy consumption because it demands more immediate CPU resources, leading to bursts of intensive computation that temporarily raise power usage. Furthermore, the larger code size from unrolled loops can lead to increased cache usage and more cache misses, which are costly in terms of energy consumption.
- The cumulative data indicates that the IC Compiler yields the highest total time and energy consumption, Clang delivers the lowest total execution time, while GCC achieves the lowest total energy consumption.
- The cumulative data, also, indicates that enabling loop unrolling generally results in higher energy consumption but reduces the overall execution time. This suggests that while loop unrolling can optimize performance by decreasing runtime, it may also increase the energy demands of the processes.
- Different benchmarks exhibit varying responses to loop unrolling.
- Different compilers and loop unrolling settings can lead to significant variations in energy consumption, highlighting the importance of selecting the appropriate compiler and optimization settings tailored to the specific computational tasks of an application to ensure optimal performance and energy efficiency.
- There are only slight differences in the number of instructions executed among the three compilers and shows minimal differences between cases with and without loop unrolling, generally favoring the scenario where unrolling is enabled.
- Typically, a higher number of instructions correlates with increased computation time and energy usage. However, a compiler may generate fewer but more complex instructions which could require more cycles per instruction or involve more resource-intensive operations.
- Developers should consider not only the compiler optimization level but also how different compilers interpret and execute the code of specific algorithms because load characteristics can significantly impact the binary code generated by different compilers.
- Loop unrolling affects the branch instructions percentage depending on the compiler type behavior and workload characteristics.
- During the unrolling process, compilers may introduce additional conditional logic to handle edge cases which can increase the total percentage of branch instructions.
- When a loop contains branch instructions, unrolling it multiple times increases the total percentage of branch instructions due to the repetition of these branches.
- Even minimal loop unrolling can alter the number of branch instructions and their distribution within the code which in turn affects power consumption.
- In most cases, loop unrolling increases the miss-prediction rate.
- When Spectre V1 mitigation is applied, the CCBM strategy, which applies the mitigation to all conditional branches, results in the highest increase in energy consumption and execution times compared to SLD and TPM.
- The TPM strategy results in the lowest energy consumption and execution times among the three Spectre V1 mitigation strategies, as it specifically targets only the code patterns vulnerable to Spectre V1 attacks, making it highly effective for known patterns.
- The number of instructions generally increases with the three Spectre V1 strategies. However, TPM and SLD result in a reduction in the number of instructions for some benchmarks, indicating potential optimization is applied under these strategies.
- Spectre V2 mitigations are less aggressive than Spectre V1 mitigations in terms of energy consumption and execution times because they are more contained and selectively applied, compared to the broader and more invasive mitigations required for Spectre V1.
- Loop unrolling increases energy consumption in most cases, regardless of whether Spectre V1 and V2 mitigations are applied or not, highlighting its inherent impact on energy usage independent of security measures.
- When Spectre V1 and V2 mitigations are applied together, they generally exhibit additive behavior.
- Even though applying Spectre mitigations increases energy consumption and execution time, it reduces the average power in about half of the cases. This is because Spectre mitigations limit speculative execution in various ways. This finding underscores the significance of speculative execution in conserving energy, as the increase in instantaneous power that accompanies speculative execution is offset by the reduction in execution time.
6. Conclusions
Funding
Conflicts of Interest
Abbreviations
| CCBM | Comprehensive Conditional Branch Mitigation |
| DBP | Dynamic Branch Predictor |
| FCET | Function Calls External Thunk |
| FCIT | Function Calls Inline Thunk |
| FRIT | Function Returns Inline Thunk |
| GCC | GNU Compiler Collection |
| HPC | High-Performance Computing |
| IBET | Indirect Branches External Thunk |
| IBIT | Indirect Branches Inline Thunk |
| IC | Intel Compiler |
| O0, O1, O2, O3 | Compiler Optimization Levels |
| PMU | Power Management Unit |
| RAPL | Running Average Power Limit |
| RT | Return Trampoline |
| RTET | Return Trampolines External Thunk |
Appendix A. Data Tables
| Variant | Mitig. Strategies | Compiler | unroll | Barnes | Canneal | Cholesky | Dedup | Ferret | FMM | Freqmine | Oceancp | Raytrace | X264 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| No mitigation | IC | OFF | 161 | 106 | 1 | 573 | 241 | 127 | 1232 | 178 | 230 | 243 | |
| ON | 162 | 106 | 1 | 573 | 241 | 127 | 1232 | 178 | 230 | 244 | |||
| GCC | OFF | 164 | 90 | 1 | 591 | 246 | 134 | 390 | 170 | 235 | 248 | ||
| ON | 164 | 90 | 1 | 591 | 246 | 129 | 413 | 170 | 233 | 248 | |||
| Clang | OFF | 145 | 81 | 1 | 600 | 260 | 129 | 345 | 169 | 346 | 249 | ||
| ON | 145 | 81 | 1 | 600 | 261 | 128 | 345 | 170 | 346 | 248 | |||
| Spectre V1 | CCBM | IC | OFF | 485 | 151 | 2 | 826 | 341 | 522 | 5504 | 653 | 583 | 613 |
| ON | 482 | 152 | 2 | 838 | 346 | 520 | 5424 | 651 | 586 | 611 | |||
| TPM | IC | OFF | 172 | 123 | 1 | 676 | 256 | 132 | 1998 | 179 | 234 | 244 | |
| ON | 166 | 126 | 1 | 694 | 248 | 134 | 1984 | 180 | 231 | 244 | |||
| SLD | Clang | OFF | 286 | 160 | 1 | 1053 | 642 | 171 | 683 | 184 | 685 | 398 | |
| ON | 286 | 159 | 1 | 1054 | 636 | 172 | 696 | 183 | 687 | 400 | |||
| Spectre V2 | IBIT | IC | OFF | 164 | 109 | 1 | 594 | 245 | 126 | 1226 | 178 | 432 | 259 |
| ON | 167 | 108 | 1 | 604 | 249 | 127 | 1228 | 178 | 431 | 252 | |||
| GCC | OFF | 166 | 91 | 1 | 593 | 258 | 134 | 387 | 174 | 435 | 324 | ||
| ON | 165 | 90 | 1 | 599 | 254 | 131 | 416 | 175 | 440 | 327 | |||
| IBET | IC | OFF | 163 | 108 | 1 | 595 | 243 | 129 | 1232 | 178 | 233 | 245 | |
| ON | 162 | 108 | 1 | 593 | 244 | 129 | 1231 | 178 | 231 | 246 | |||
| GCC | OFF | 164 | 90 | 1 | 604 | 248 | 134 | 385 | 175 | 236 | 249 | ||
| ON | 165 | 91 | 1 | 604 | 246 | 130 | 412 | 176 | 235 | 250 | |||
| FCIT | IC | OFF | 162 | 107 | 1 | 591 | 242 | 129 | 1234 | 180 | 232 | 247 | |
| ON | 164 | 106 | 1 | 590 | 241 | 125 | 1234 | 180 | 232 | 249 | |||
| FCET | IC | OFF | 166 | 108 | 1 | 594 | 244 | 124 | 1239 | 180 | 229 | 250 | |
| ON | 163 | 109 | 1 | 592 | 247 | 125 | 1231 | 179 | 228 | 247 | |||
| FRIT | IC | OFF | 299 | 115 | 1 | 630 | 260 | 130 | 1825 | 180 | 290 | 450 | |
| ON | 303 | 115 | 1 | 632 | 262 | 131 | 1828 | 179 | 294 | 459 | |||
| GCC | OFF | 288 | 95 | 1 | 602 | 260 | 142 | 668 | 175 | 287 | 266 | ||
| ON | 297 | 96 | 1 | 603 | 256 | 135 | 684 | 174 | 296 | 272 | |||
| RT | Clang | OFF | 147 | 128 | 1 | 604 | 264 | 144 | 351 | 171 | 438 | 317 | |
| ON | 145 | 129 | 1 | 605 | 262 | 132 | 354 | 172 | 429 | 314 | |||
| RTET | Clang | OFF | 146 | 82 | 1 | 602 | 263 | 130 | 348 | 171 | 349 | 291 | |
| ON | 147 | 82 | 1 | 602 | 263 | 130 | 348 | 171 | 354 | 292 | |||
| Variant | Mitig. Strategies | Compiler | unroll | Barnes | Canneal | Cholesky | Dedup | Ferret | FMM | Freqmine | Oceancp | Raytrace | X264 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| No mitigation | IC | OFF | 3.74 | 2.55 | 0.02 | 13.60 | 5.43 | 2.88 | 28.08 | 3.90 | 5.01 | 5.51 | |
| ON | 3.71 | 2.54 | 0.02 | 13.56 | 5.44 | 2.91 | 27.90 | 3.91 | 5.07 | 5.52 | |||
| GCC | OFF | 3.75 | 2.11 | 0.02 | 13.51 | 5.34 | 3.10 | 5.17 | 3.91 | 5.18 | 5.61 | ||
| ON | 3.73 | 2.14 | 0.02 | 13.44 | 5.40 | 3.04 | 5.44 | 3.92 | 5.16 | 5.65 | |||
| Clang | OFF | 3.21 | 2.13 | 0.02 | 13.44 | 5.29 | 3.22 | 5.14 | 3.91 | 5.17 | 5.62 | ||
| ON | 3.15 | 2.11 | 0.02 | 13.41 | 5.39 | 3.06 | 5.28 | 3.93 | 5.14 | 5.62 | |||
| Spectre V1 | CCBM | IC | OFF | 11.55 | 3.56 | 0.03 | 44.44 | 17.74 | 12.72 | 131.68 | 15.58 | 13.76 | 18.00 |
| ON | 11.52 | 3.60 | 0.04 | 44.24 | 17.75 | 12.67 | 131.50 | 15.57 | 13.80 | 18.01 | |||
| TPM | IC | OFF | 3.92 | 2.93 | 0.03 | 15.77 | 6.30 | 3.07 | 46.77 | 3.96 | 5.15 | 6.39 | |
| ON | 3.77 | 2.99 | 0.02 | 15.73 | 6.31 | 3.11 | 46.54 | 3.96 | 5.09 | 6.40 | |||
| SLD | Clang | OFF | 6.70 | 3.72 | 0.02 | 26.20 | 14.61 | 4.00 | 10.02 | 4.14 | 16.00 | 9.21 | |
| ON | 6.72 | 3.69 | 0.02 | 26.14 | 14.40 | 4.02 | 10.29 | 4.11 | 15.99 | 9.21 | |||
| Spectre V2 | IBIT | IC | OFF | 3.75 | 2.55 | 0.02 | 15.77 | 6.29 | 2.93 | 27.60 | 3.89 | 9.78 | 6.39 |
| ON | 3.77 | 2.56 | 0.02 | 15.72 | 6.31 | 2.95 | 27.59 | 3.93 | 9.81 | 6.40 | |||
| GCC | OFF | 3.76 | 2.14 | 0.02 | 13.32 | 5.64 | 3.12 | 5.13 | 3.94 | 9.83 | 7.38 | ||
| ON | 3.74 | 2.13 | 0.02 | 13.44 | 5.53 | 3.06 | 5.56 | 3.93 | 9.93 | 7.43 | |||
| IBET | IC | OFF | 3.67 | 2.55 | 0.02 | 13.55 | 12.07 | 6.40 | 62.44 | 8.67 | 11.14 | 12.25 | |
| ON | 3.68 | 2.55 | 0.02 | 13.56 | 12.10 | 6.47 | 62.04 | 8.69 | 11.27 | 12.27 | |||
| GCC | OFF | 3.74 | 2.13 | 0.02 | 13.60 | 5.36 | 3.21 | 5.11 | 3.93 | 5.20 | 5.81 | ||
| ON | 3.75 | 2.16 | 0.02 | 13.62 | 5.39 | 3.14 | 5.48 | 3.94 | 5.17 | 5.74 | |||
| FCIT | IC | OFF | 3.70 | 2.53 | 0.02 | 13.59 | 5.41 | 2.96 | 27.76 | 3.94 | 5.07 | 5.53 | |
| ON | 3.72 | 2.52 | 0.02 | 13.58 | 5.45 | 2.87 | 27.75 | 3.95 | 4.95 | 5.55 | |||
| FCET | IC | OFF | 3.80 | 2.57 | 0.02 | 14.46 | 5.39 | 2.89 | 27.91 | 3.94 | 5.00 | 5.63 | |
| ON | 3.70 | 2.55 | 0.02 | 13.60 | 5.42 | 2.86 | 27.72 | 3.93 | 4.98 | 5.68 | |||
| FRIT | IC | OFF | 6.91 | 2.72 | 0.02 | 15.66 | 6.25 | 3.01 | 41.65 | 3.95 | 6.40 | 6.35 | |
| ON | 6.97 | 2.69 | 0.02 | 15.62 | 6.23 | 3.03 | 41.66 | 3.90 | 6.50 | 6.36 | |||
| GCC | OFF | 6.66 | 2.25 | 0.02 | 13.58 | 5.56 | 3.31 | 9.46 | 3.94 | 6.39 | 6.07 | ||
| ON | 6.91 | 2.25 | 0.02 | 13.31 | 5.50 | 3.12 | 9.63 | 3.92 | 6.51 | 6.17 | |||
| RT | Clang | OFF | 3.34 | 3.04 | 0.02 | 15.53 | 5.75 | 3.38 | 5.94 | 3.87 | 9.88 | 7.23 | |
| ON | 3.32 | 3.03 | 0.02 | 15.50 | 5.68 | 3.10 | 6.10 | 3.88 | 9.70 | 7.19 | |||
| RTET | Clang | OFF | 3.32 | 2.56 | 0.02 | 14.41 | 5.39 | 3.17 | 5.57 | 3.88 | 9.27 | 6.78 | |
| ON | 3.33 | 2.45 | 0.02 | 14.38 | 5.33 | 2.91 | 5.72 | 3.88 | 9.10 | 6.75 | |||
| Variant | Mitig. Strategies | Compiler | unroll | arnes | Canneal | Cholesky | Dedup | Ferret | FMM | Freqmine | Oceancp | Raytrace | X264 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| No mitigation | IC | OFF | 40.4 | 5.7 | 1.8 | 81 | 41 | 37.2 | 206.8 | 24.4 | 23.1 | 34.8 | |
| ON | 40.6 | 5.7 | 1.8 | 81 | 40 | 37.1 | 206.7 | 24.4 | 23.1 | 34.8 | |||
| GCC | OFF | 39.5 | 5.6 | 1.7 | 80 | 40 | 41.3 | 216.5 | 19.5 | 24.2 | 34.7 | ||
| ON | 39.5 | 5.6 | 1.6 | 80 | 40 | 41.4 | 216.5 | 19.5 | 24.2 | 34.7 | |||
| Clang | OFF | 38.5 | 5.7 | 1.6 | 79 | 40 | 39.3 | 222.5 | 20.5 | 23.2 | 33.6 | ||
| ON | 40.5 | 5.7 | 1.8 | 78 | 40 | 40.4 | 223.4 | 21.4 | 23.3 | 33.7 | |||
| Spectre V1 | CCBM | IC | OFF | 84.7 | 6.0 | 2.0 | 81 | 41 | 92.2 | 233.3 | 25.6 | 24.9 | 34.2 |
| ON | 84.8 | 6.0 | 1.8 | 81 | 41 | 92.2 | 233.3 | 25.5 | 24.9 | 34.7 | |||
| SLD | Clang | OFF | 63.2 | 13.6 | 1.9 | 81 | 41 | 67.6 | 52.8 | 28.0 | 35.5 | 47.5 | |
| ON | 62.8 | 13.6 | 1.8 | 81 | 41 | 61.9 | 52.6 | 27.8 | 35.4 | 47.2 | |||
| TPM | IC | OFF | 40.7 | 5.7 | 1.9 | 81 | 41 | 38.2 | 209.5 | 24.4 | 23.1 | 34.8 | |
| ON | 40.7 | 5.7 | 1.8 | 81 | 41 | 38.1 | 209.6 | 24.4 | 23.1 | 34.9 | |||
| Spectre V2 | IBIT | IC | OFF | 40.4 | 5.7 | 1.7 | 81 | 41 | 37.4 | 206.7 | 24.4 | 25.1 | 35.9 |
| ON | 40.3 | 5.7 | 1.8 | 81 | 41 | 37.4 | 206.8 | 24.4 | 25.1 | 36.0 | |||
| GCC | OFF | 39.6 | 5.6 | 1.6 | 80 | 40 | 41.5 | 216.5 | 19.5 | 26.3 | 35.7 | ||
| ON | 39.5 | 5.6 | 1.6 | 79 | 38 | 40 | 220.5 | 17.1 | 26.2 | 35.5 | |||
| IBET | IC | OFF | 40.3 | 5.7 | 1.9 | 81 | 40 | 39.8 | 222.0 | 24.5 | 23.1 | 35.4 | |
| ON | 40.4 | 5.7 | 1.8 | 81 | 39 | 40.5 | 223.1 | 24.5 | 23.1 | 35.6 | |||
| GCC | OFF | 39.5 | 4.7 | 1.8 | 79 | 40 | 39.6 | 216.5 | 19.5 | 24.2 | 31.4 | ||
| ON | 39.5 | 4.2 | 1.7 | 79 | 37 | 40.5 | 220.5 | 17.1 | 23.1 | 30.2 | |||
| FCIT | IC | OFF | 40.5 | 5.7 | 2.1 | 81 | 40 | 37.0 | 245.1 | 24.4 | 23.1 | 34.3 | |
| ON | 41.6 | 5.7 | 1.7 | 81 | 37 | 37.1 | 301.7 | 24.4 | 23.1 | 34.8 | |||
| FCET | IC | OFF | 40.4 | 5.7 | 1.8 | 81 | 41 | 37.1 | 206.8 | 24.4 | 23.1 | 34.7 | |
| ON | 40.5 | 5.7 | 2.0 | 81 | 38 | 37.1 | 206.8 | 24.4 | 23.1 | 34.8 | |||
| FRIT | IC | OFF | 59.0 | 5.7 | 1.9 | 81 | 40 | 37.7 | 290.6 | 24.4 | 23.9 | 34.6 | |
| ON | 59.2 | 5.7 | 2.0 | 81 | 39 | 37.8 | 210.7 | 24.4 | 23.9 | 34.8 | |||
| GCC | OFF | 56.1 | 5.7 | 1.7 | 79 | 40 | 42.5 | 222 | 19.5 | 25.1 | 35 | ||
| ON | 57.5 | 5.7 | 1.6 | 79 | 39 | 40.0 | 225.8 | 17.1 | 25.0 | 34.5 | |||
| RT | Clang | OFF | 51 | 26 | 2 | 87 | 47 | 39.4 | 42.8 | 17.9 | 24.9 | 39 | |
| ON | 41.2 | 26.1 | 1.9 | 87 | 42 | 37.9 | 41.2 | 17.8 | 24.9 | 38.7 | |||
| RTET | Clang | OFF | 51.0 | 26 | 2.1 | 87 | 48 | 40.5 | 42.9 | 17.9 | 25.1 | 39 | |
| ON | 53.4 | 26.2 | 1.9 | 87 | 47 | 43.1 | 43.5 | 17.8 | 24.9 | 38.8 | |||
| Variant | Mitig. Strategies | Compiler | unroll | Barnes | Canneal | Cholesky | Dedup | Ferret | FMM | Freqmine | Oceancp | Raytrace | X264 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| No mitigation | IC | OFF | 16.6 | 24.3 | 18.3 | 7.3 | 16.0 | 14.7 | 12.8 | 11.4 | 13.1 | 7.0 | |
| ON | 16.5 | 24.3 | 20.2 | 8.0 | 15.3 | 14.7 | 12.8 | 11.4 | 13.1 | 6.9 | |||
| GCC | OFF | 15.7 | 26.2 | 18.5 | 8.0 | 16.3 | 13.2 | 14.1 | 4.9 | 12.6 | 6.9 | ||
| ON | 15.7 | 26.3 | 20.0 | 7.9 | 16.2 | 12.8 | 14.4 | 2.8 | 12.6 | 7.0 | |||
| Clang | OFF | 15.6 | 25.4 | 18.3 | 8.0 | 15.3 | 13.2 | 14.1 | 5.9 | 12.6 | 6.9 | ||
| ON | 15.6 | 25.5 | 20.2 | 7.9 | 16.2 | 12.8 | 14.4 | 5.7 | 12.6 | 7.0 | |||
| Spectre V1 | CCBM | IC | OFF | 18.1 | 24.9 | 16.6 | 7.9 | 16.4 | 17.9 | 13.9 | 11.3 | 13.9 | 8.1 |
| ON | 18.0 | 25.1 | 19.1 | 8.0 | 17.0 | 17.9 | 13.9 | 11.3 | 14.0 | 7.8 | |||
| TPM | IC | OFF | 16.6 | 24.1 | 19.7 | 8.1 | 17.3 | 14.8 | 12.7 | 11.4 | 13.1 | 7.0 | |
| ON | 16.6 | 24.1 | 22.9 | 7.4 | 15.4 | 14.9 | 12.7 | 11.4 | 13.1 | 7.1 | |||
| SLD | Clang | OFF | 14.7 | 22.1 | 20.0 | 9.1 | 17.3 | 11.0 | 13.8 | 4.1 | 12.1 | 6.6 | |
| ON | 14.6 | 22.1 | 23.3 | 8.4 | 16.9 | 11.3 | 13.9 | 4.0 | 12.1 | 6.6 | |||
| Spectre V2 | IBIT | IC | OFF | 16.5 | 24.2 | 19.3 | 7.3 | 15.4 | 14.8 | 12.8 | 11.4 | 17.0 | 7.0 |
| ON | 16.6 | 24.3 | 19.6 | 7.3 | 15.3 | 14.8 | 12.8 | 11.4 | 16.9 | 7.0 | |||
| GCC | OFF | 15.8 | 26.2 | 20.6 | 8.1 | 17.8 | 13.2 | 14.1 | 4.9 | 16.2 | 8.4 | ||
| ON | 15.7 | 26.2 | 17.4 | 7.9 | 16.3 | 12.8 | 14.4 | 2.8 | 16.2 | 8.5 | |||
| IBET | IC | OFF | 16.5 | 24.3 | 16.7 | 6.8 | 16.2 | 11.6 | 12.3 | 11.4 | 13.1 | 7.1 | |
| ON | 16.6 | 24.4 | 21.2 | 6.6 | 15.7 | 10.8 | 11.8 | 11.3 | 13.1 | 7.0 | |||
| GCC | OFF | 15.7 | 24.1 | 18.1 | 7.3 | 15.2 | 10.6 | 14.1 | 4.8 | 12.1 | 6.3 | ||
| ON | 15.8 | 24.2 | 17.8 | 7.1 | 15.0 | 10.4 | 14.4 | 2.8 | 12.6 | 5.3 | |||
| FCIT | IC | OFF | 16.6 | 24.3 | 16.9 | 6.6 | 14.9 | 14.7 | 15.0 | 11.4 | 13.1 | 8.7 | |
| ON | 16.5 | 24.4 | 22.3 | 7.6 | 16.3 | 14.7 | 15.2 | 11.4 | 13.1 | 8.2 | |||
| FCET | IC | OFF | 16.6 | 24.4 | 17.6 | 6.1 | 15.2 | 14.7 | 12.8 | 11.4 | 13.1 | 7.2 | |
| ON | 16.5 | 24.3 | 19.0 | 7.6 | 16.0 | 14.7 | 12.8 | 11.4 | 13.2 | 6.7 | |||
| FRIT | IC | OFF | 18.4 | 24.5 | 19.9 | 7.8 | 16.7 | 14.9 | 16.2 | 11.4 | 14.5 | 6.7 | |
| ON | 18.3 | 24.5 | 17.9 | 6.0 | 15.2 | 14.8 | 14.0 | 11.4 | 14.5 | 7.0 | |||
| GCC | OFF | 17.4 | 26.3 | 19.7 | 8.1 | 17.8 | 13.4 | 15.0 | 4.9 | 13.8 | 7.1 | ||
| ON | 17.3 | 26.3 | 18.7 | 7.8 | 16.3 | 12.8 | 15.3 | 2.8 | 13.8 | 7.2 | |||
| RT | Clang | OFF | 17.4 | 23.6 | 20.1 | 8.2 | 18.4 | 17.1 | 14.6 | 6.4 | 15.4 | 7.4 | |
| ON | 16.8 | 23.4 | 25.6 | 7.6 | 18.1 | 16.5 | 14.5 | 6.3 | 15.5 | 7.3 | |||
| RTET | Clang | OFF | 17.5 | 25.6 | 17.3 | 8.3 | 18.2 | 17.1 | 14.8 | 6.4 | 15.5 | 8.0 | |
| ON | 17.9 | 25.2 | 19.3 | 7.7 | 18.3 | 16.5 | 14.2 | 6.2 | 15.3 | 7.6 | |||
| Variant | Mitig. Strategies | Compiler | unroll | Barnes | Canneal | Cholesky | Dedup | Ferret | FMM | Freqmine | Oceancp | Raytrace | X264 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| No mitigation | IC | OFF | 0.8 | 1.9 | 4.1 | 4.0 | 4.1 | 0.6 | 2.0 | 0.1 | 0.3 | 5.3 | |
| ON | 0.8 | 1.9 | 3.7 | 4.2 | 4.1 | 0.7 | 2.0 | 0.1 | 0.3 | 5.2 | |||
| GCC | OFF | 0.6 | 2.8 | 4.0 | 3.7 | 4.1 | 0.3 | 1.7 | 0.4 | 0.3 | 5.3 | ||
| ON | 0.5 | 1.7 | 4.1 | 3.8 | 4.7 | 0.3 | 1.7 | 0.6 | 0.3 | 5.7 | |||
| Clang | OFF | 0.5 | 1.6 | 3.8 | 3.2 | 3.6 | 0.2 | 1.7 | 0.4 | 0.6 | 5.4 | ||
| ON | 0.6 | 2.8 | 3.3 | 3.3 | 3.3 | 0.2 | 1.5 | 0.4 | 0.5 | 5.6 | |||
| Spectre V1 | CCBM | IC | OFF | 0.5 | 1.9 | 4.2 | 3.9 | 4.1 | 0.2 | 1.7 | 0.2 | 0.3 | 5.0 |
| ON | 0.5 | 1.9 | 4.7 | 3.5 | 4.0 | 0.2 | 1.6 | 0.2 | 0.3 | 4.8 | |||
| TPM | IC | OFF | 0.8 | 1.9 | 4.5 | 3.7 | 4.0 | 0.6 | 1.9 | 0.1 | 0.3 | 5.3 | |
| ON | 0.8 | 1.9 | 3.4 | 3.8 | 4.0 | 0.5 | 1.9 | 0.1 | 0.3 | 5.2 | |||
| SLD | Clang | OFF | 0.5 | 1.6 | 3.9 | 10.3 | 8.0 | 4.5 | 0.3 | 0.3 | 9.7 | 8.7 | |
| ON | 0.5 | 1.7 | 3.4 | 10.3 | 7.8 | 4.5 | 0.3 | 0.3 | 9.7 | 8.6 | |||
| Spectre V2 | IBIT | IC | OFF | 0.8 | 1.9 | 4.1 | 3.9 | 4.1 | 0.8 | 1.9 | 0.1 | 9.7 | 5.3 |
| ON | 0.8 | 1.9 | 4.2 | 3.8 | 4.1 | 0.8 | 1.9 | 0.1 | 9.7 | 5.3 | |||
| GCC | OFF | 0.6 | 2.8 | 3.7 | 3.7 | 4.5 | 0.3 | 1.8 | 0.4 | 9.7 | 10.6 | ||
| ON | 0.6 | 2.8 | 4.8 | 3.8 | 5.0 | 0.3 | 1.7 | 0.6 | 9.7 | 10.8 | |||
| IBET | IC | OFF | 0.8 | 1.9 | 4.3 | 4.0 | 4.0 | 0.4 | 1.9 | 0.6 | 9.1 | 10.3 | |
| ON | 0.8 | 1.9 | 3.7 | 4.1 | 3.9 | 0.4 | 1.9 | 0.5 | 9.0 | 10.4 | |||
| GCC | OFF | 0.6 | 1.7 | 3.9 | 3.8 | 4.0 | 0.4 | 1.8 | 0.4 | 0.3 | 11.3 | ||
| ON | 0.6 | 1.7 | 4.2 | 4.0 | 4.2 | 0.3 | 1.7 | 0.6 | 0.3 | 11.2 | |||
| FCIT | IC | OFF | 0.8 | 1.9 | 3.9 | 3.6 | 3.5 | 0.6 | 1.7 | 0.1 | 0.3 | 5.5 | |
| ON | 0.8 | 1.9 | 3.4 | 3.8 | 3.5 | 0.6 | 1.5 | 0.1 | 0.3 | 5.3 | |||
| FCET | IC | OFF | 0.8 | 1.9 | 4.3 | 4.2 | 5.3 | 0.6 | 2.0 | 0.1 | 0.3 | 5.0 | |
| ON | 0.8 | 1.9 | 4.0 | 4.1 | 5.2 | 0.6 | 2.0 | 0.1 | 0.3 | 4.9 | |||
| FRIT | IC | OFF | 4.9 | 3.4 | 3.9 | 4.0 | 4.2 | 0.6 | 5.4 | 0.1 | 12.3 | 10.6 | |
| ON | 4.9 | 3.5 | 3.9 | 3.9 | 4.3 | 0.6 | 8.1 | 0.1 | 12.3 | 10.4 | |||
| GCC | OFF | 5.7 | 3.6 | 3.6 | 3.9 | 5.7 | 0.6 | 9.6 | 0.4 | 12.3 | 7.7 | ||
| ON | 5.7 | 3.6 | 4.6 | 3.9 | 6.3 | 0.6 | 9.1 | 0.6 | 12.3 | 7.9 | |||
| RT | Clang | OFF | 0.8 | 0.8 | 3.7 | 2.5 | 5.0 | 5.3 | 0.8 | 0.3 | 10.9 | 9.6 | |
| ON | 0.6 | 0.8 | 2.9 | 2.1 | 5.1 | 5.5 | 0.4 | 0.3 | 10.8 | 9.6 | |||
| RTET | Clang | OFF | 0.8 | 0.7 | 4.2 | 4.1 | 2.5 | 2.0 | 1.1 | 0.3 | 1.1 | 6.3 | |
| ON | 0.6 | 0.6 | 3.9 | 4.0 | 3.0 | 2.2 | 1.1 | 0.3 | 1.0 | 6.3 | |||
| Variant | Mitig. Strategies | Compiler | unroll | Barnes | Canneal | Cholesky | Dedup | Ferret | FMM | Freqmine | Oceancp | Raytrace | X264 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| No mitigation | IC | OFF | 42.9 | 41.2 | 26.5 | 42.1 | 44.2 | 44.1 | 43.9 | 45.5 | 45.9 | 44.0 | |
| ON | 43.6 | 41.4 | 25.5 | 42.2 | 44.3 | 43.3 | 44.1 | 45.5 | 45.3 | 44.2 | |||
| GCC | OFF | 43.5 | 42.4 | 27.5 | 43.7 | 46.1 | 43.0 | 75.3 | 43.4 | 45.2 | 44.1 | ||
| ON | 43.9 | 41.9 | 26.5 | 43.9 | 45.4 | 42.4 | 75.8 | 43.3 | 45.0 | 43.8 | |||
| Clang | OFF | 44.9 | 37.8 | 27.0 | 44.6 | 49.1 | 39.8 | 67.0 | 43.2 | 66.8 | 50.6 | ||
| ON | 46.0 | 38.3 | 27.5 | 44.7 | 48.3 | 41.6 | 65.3 | 43.2 | 67.2 | 50.6 | |||
| Spectre V1 | CCBM | IC | OFF | 42.0 | 42.2 | 37.3 | 18.6 | 19.2 | 41.0 | 41.8 | 41.9 | 42.4 | 11.2 |
| ON | 41.8 | 42.1 | 30.5 | 18.9 | 19.4 | 41.0 | 41.2 | 41.8 | 42.5 | 33.9 | |||
| TPM | IC | OFF | 43.7 | 42.0 | 27.7 | 42.8 | 40.6 | 42.9 | 42.7 | 45.2 | 45.3 | 95.8 | |
| ON | 43.9 | 42.0 | 41.0 | 44.1 | 39.2 | 42.8 | 42.6 | 45.5 | 45.3 | 95.4 | |||
| SLD | Clang | OFF | 42.6 | 42.9 | 39.5 | 40.2 | 44.0 | 42.8 | 68.1 | 44.4 | 42.8 | 43.2 | |
| ON | 42.5 | 43.0 | 38.5 | 40.3 | 44.1 | 42.7 | 67.6 | 44.5 | 43.0 | 43.4 | |||
| Spectre V2 | IBIT | IC | OFF | 43.7 | 42.4 | 28.0 | 37.6 | 38.9 | 42.9 | 44.4 | 45.7 | 44.2 | 40.4 |
| ON | 44.0 | 42.2 | 26.0 | 38.4 | 39.4 | 42.8 | 44.5 | 45.2 | 43.9 | 39.3 | |||
| GCC | OFF | 44.0 | 42.2 | 31.0 | 44.5 | 45.7 | 42.7 | 75.3 | 44.0 | 44.2 | 43.9 | ||
| ON | 43.9 | 42.1 | 31.0 | 44.6 | 45.8 | 42.8 | 74.8 | 44.5 | 44.2 | 44.0 | |||
| IBET | IC | OFF | 44.2 | 42.1 | 27.0 | 43.9 | 20.1 | 20.1 | 19.7 | 20.5 | 20.9 | 19.9 | |
| ON | 44.0 | 42.1 | 27.5 | 43.7 | 20.2 | 19.9 | 19.8 | 20.4 | 20.5 | 20.0 | |||
| GCC | OFF | 43.8 | 42.2 | 28.0 | 44.4 | 46.1 | 41.7 | 75.3 | 44.4 | 45.2 | 42.8 | ||
| ON | 44.0 | 41.8 | 28.5 | 44.3 | 45.6 | 41.4 | 75.1 | 44.5 | 45.3 | 43.4 | |||
| FCIT | IC | OFF | 43.8 | 42.2 | 26.5 | 43.5 | 44.6 | 43.3 | 44.4 | 45.6 | 45.6 | 44.6 | |
| ON | 44.0 | 42.0 | 29.0 | 43.4 | 44.1 | 43.2 | 44.4 | 45.6 | 46.8 | 44.7 | |||
| FCET | IC | OFF | 43.6 | 41.9 | 29.0 | 41.0 | 45.2 | 42.8 | 44.4 | 45.6 | 45.6 | 44.4 | |
| ON | 43.9 | 42.7 | 29.5 | 43.5 | 45.6 | 43.6 | 44.4 | 45.5 | 45.8 | 43.5 | |||
| FRIT | IC | OFF | 43.2 | 42.2 | 30.0 | 40.2 | 41.5 | 43.0 | 43.8 | 45.5 | 45.2 | 70.8 | |
| ON | 43.4 | 42.8 | 31.0 | 40.4 | 41.9 | 43.2 | 43.9 | 45.8 | 45.2 | 72.1 | |||
| GCC | OFF | 43.2 | 42.0 | 30.0 | 44.3 | 46.6 | 42.9 | 70.6 | 44.3 | 44.9 | 43.8 | ||
| ON | 43.0 | 42.5 | 31.5 | 45.3 | 46.5 | 43.1 | 70.9 | 44.3 | 45.4 | 44.0 | |||
| RT | Clang | OFF | 43.9 | 42.1 | 29.0 | 38.8 | 45.8 | 42.6 | 59.0 | 44.2 | 44.3 | 43.8 | |
| ON | 43.6 | 42.3 | 28.0 | 39.0 | 46.1 | 42.5 | 58.0 | 44.2 | 44.1 | 43.6 | |||
| RTET | Clang | OFF | 43.8 | 31.7 | 28.0 | 41.7 | 48.6 | 40.7 | 62.4 | 44.0 | 37.6 | 42.9 | |
| ON | 44.1 | 33.3 | 27.5 | 41.9 | 49.3 | 44.4 | 60.8 | 44.0 | 38.8 | 43.1 | |||
References
- Kocher, P.; Horn, J.; Fogh, A.; Genkin, D.; Gruss, D.; Haas, W.; Hamburg, M.; Lipp, M.; Mangard, S.; Prescher, T.; et al. Spectre attacks: Exploiting speculative execution. Communications of the ACM 2020, 63, 93–101. [Google Scholar] [CrossRef]
- Canella, C.; Van Bulck, J.; Schwarz, M.; Lipp, M.; Von Berg, B.; Ortner, P.; Piessens, F.; Evtyushkin, D.; Gruss, D. A systematic evaluation of transient execution attacks and defenses. In Proceedings of the 28th USENIX Security Symposium (USENIX Security 19); 2019; pp. 249–266. [Google Scholar]
- Herzog, B.; Reif, S.; Preis, J.; Schröder-Preikschat, W.; Hönig, T. The price of Meltdown and Spectre: Energy overhead of mitigations at operating system level. In Proceedings of the Proceedings of the 14th European Workshop on Systems Security, 2021; pp. 8–14.
- Spreitzer, R.; Moonsamy, V.; Korak, T.; Mangard, S. Systematic classification of side-channel attacks: A case study for mobile devices. IEEE communications surveys & tutorials 2017, 20, 465–488. [Google Scholar]
- Kocher, P.C. Timing attacks on implementations of Diffie-Hellman, RSA, DSS, and other systems. In Proceedings of the Advances in Cryptology—CRYPTO’96: 16th Annual International Cryptology Conference Santa Barbara, California, 1996 Proceedings 16. Springer, 1996, USA August 18–22; pp. 104–113.
- Tromer, E.; Osvik, D.A.; Shamir, A. Efficient cache attacks on AES, and countermeasures. Journal of Cryptology 2010, 23, 37–71. [Google Scholar] [CrossRef]
- Götzfried, J.; Eckert, M.; Schinzel, S.; Müller, T. Cache attacks on Intel SGX. In Proceedings of the Proceedings of the 10th European Workshop on Systems Security, 2017; pp. 1–6.
- Moradi, A.; Shalmani, M.T.M.; Salmasizadeh, M. A generalized method of differential fault attack against AES cryptosystem. In Proceedings of the Cryptographic Hardware and Embedded Systems-CHES 2006: 8th International Workshop, Yokohama, Japan, 2006. Proceedings 8. Springer, 2006, October 10-13; pp. 91–100.
- Pessl, P.; Gruss, D.; Maurice, C.; Schwarz, M.; Mangard, S. {DRAMA}: Exploiting {DRAM} Addressing for {Cross-CPU} Attacks. In Proceedings of the 25th USENIX security symposium (USENIX security 16); 2016; pp. 565–581. [Google Scholar]
- Das, M.; Sardar, B.; Banerjee, A. Attacks on branch predictors: an empirical exploration. In Proceedings of the Information Systems Security: 11th International Conference, ICISS 2015, Kolkata, India, 2015. Proceedings 11. Springer, 2015, December 16-20; pp. 511–520.
- Evtyushkin, D.; Riley, R.; Abu-Ghazaleh, N.C.; ECE. ; Ponomarev, D. Branchscope: A new side-channel attack on directional branch predictor. ACM SIGPLAN Notices 2018, 53, 693–707. [Google Scholar] [CrossRef]
- Yarom, Y.; Falkner, K. {FLUSH+ RELOAD}: A high resolution, low noise, l3 cache {Side-Channel} attack. In Proceedings of the 23rd USENIX security symposium (USENIX security 14); 2014; pp. 719–732. [Google Scholar]
- Irazoqui, G.; Inci, M.S.; Eisenbarth, T.; Sunar, B. Wait a minute! A fast, Cross-VM attack on AES. In Proceedings of the Research in Attacks, Intrusions and Defenses: 17th International Symposium, RAID 2014, Gothenburg, Sweden, 2014. Proceedings 17. Springer, 2014, September 17-19; pp. 299–319.
- Gülmezoğlu, B.; Inci, M.S.; Irazoqui, G.; Eisenbarth, T.; Sunar, B. A faster and more realistic flush+ reload attack on AES. In Proceedings of the Constructive Side-Channel Analysis and Secure Design: 6th International Workshop, COSADE 2015, Berlin, Germany, 2015. Revised Selected Papers 6. Springer, 2015, April 13-14; pp. 111–126.
- Gruss, D.; Kraft, E.; Tiwari, T.; Schwarz, M.; Trachtenberg, A.; Hennessey, J.; Ionescu, A.; Fogh, A. Page cache attacks. In Proceedings of the Proceedings of the 2019 ACM SIGSAC Conference on Computer and Communications Security, 2019; pp. 167–180.
- Gruss, D. Software-based microarchitectural attacks. it-Information Technology 2018, 60, 335–341. [Google Scholar] [CrossRef]
- Yarom, Y.; Genkin, D.; Heninger, N. CacheBleed: a timing attack on OpenSSL constant-time RSA. Journal of Cryptographic Engineering 2017, 7, 99–112. [Google Scholar] [CrossRef]
- Lipp, M.; Schwarz, M.; Gruss, D.; Prescher, T.; Haas, W.; Mangard, S.; Kocher, P.; Genkin, D.; Yarom, Y.; Hamburg, M. Meltdown. arXiv preprint arXiv:1801.01207, arXiv:1801.01207 2018.
- Van Bulck, J.; Minkin, M.; Weisse, O.; Genkin, D.; Kasikci, B.; Piessens, F.; Silberstein, M.; Wenisch, T.F.; Yarom, Y.; Strackx, R. Foreshadow: Extracting the keys to the intel {SGX} kingdom with transient {Out-of-Order} execution. In Proceedings of the 27th USENIX Security Symposium (USENIX Security 18); 2018; pp. 991–1008. [Google Scholar]
- Chen, G.; Chen, S.; Xiao, Y.; Zhang, Y.; Lin, Z.; Lai, T.H. Sgxpectre: Stealing intel secrets from sgx enclaves via speculative execution. In Proceedings of the 2019 IEEE European Symposium on Security and Privacy (EuroS&, 2019, P). IEEE; pp. 142–157.
- Schwarz, M.; Schwarzl, M.; Lipp, M.; Masters, J.; Gruss, D. Netspectre: Read arbitrary memory over network. In Proceedings of the Computer Security–ESORICS 2019: 24th European Symposium on Research in Computer Security, Luxembourg, 2019, Proceedings, Part I 24. Springer, 2019, September 23–27; pp. 279–299.
- Kiriansky, V.; Waldspurger, C. Speculative buffer overflows: Attacks and defenses. arXiv preprint arXiv:1807.03757, arXiv:1807.03757 2018.
- Weisse, O.; Van Bulck, J.; Minkin, M.; Genkin, D.; Kasikci, B.; Piessens, F.; Silberstein, M.; Strackx, R.; Wenisch, T.F.; Yarom, Y. Foreshadow-NG: Breaking the virtual memory abstraction with transient out-of-order execution. Technical report 2018. [Google Scholar]
- Mohammadian Koruyeh, E.; Khasawneh, K.; Song, C.; Abu-Ghazaleh, N. Spectre Returns! Speculation Attacks using the Return Stack Buffer. arXiv e-prints 2018, arXiv–1807. [Google Scholar]
- Wang, G.; Chattopadhyay, S.; Gotovchits, I.; Mitra, T.; Roychoudhury, A. oo7: Low-overhead defense against spectre attacks via program analysis. IEEE Transactions on Software Engineering 2019, 47, 2504–2519. [Google Scholar] [CrossRef]
- Khasawneh, K.N.; Koruyeh, E.M.; Song, C.; Evtyushkin, D.; Ponomarev, D.; Abu-Ghazaleh, N. Safespec: Banishing the spectre of a meltdown with leakage-free speculation. In Proceedings of the 2019 56th ACM/IEEE Design Automation Conference (DAC). IEEE; 2019; pp. 1–6. [Google Scholar]
- Dong, X.; Shen, Z.; Criswell, J.; Cox, A.; Dwarkadas, S. Spectres, virtual ghosts, and hardware support. In Proceedings of the Proceedings of the 7th International Workshop on Hardware and Architectural Support for Security and Privacy, 2018; pp. 1–9.
- Mcilroy, R.; Sevcik, J.; Tebbi, T.; Titzer, B.L.; Verwaest, T. Spectre is here to stay: An analysis of side-channels and speculative execution. arXiv 2019, arXiv:1902.05178 2019. [Google Scholar]
- Behrens, J.; Belay, A.; Kaashoek, M.F. Performance evolution of mitigating transient execution attacks. In Proceedings of the Proceedings of the Seventeenth European Conference on Computer Systems, 2022; pp. 251–265.
- Al-Mulhem, M.; Al-Shaikh, R. Performance Evaluation of Intel and Portland Compilers Using Intel Westmere Processor. In Proceedings of the 2011 Second International Conference on Intelligent Systems, Modelling and Simulation. IEEE; 2011; pp. 261–266. [Google Scholar]
- Sun, C.; Le, V.; Zhang, Q.; Su, Z. Toward understanding compiler bugs in GCC and LLVM. In Proceedings of the Proceedings of the 25th international symposium on software testing and analysis, 2016; pp. 294–305.
- Alqurashi, F.S.; Al-Hashimi, M. An Experimental Approach to Estimation of the Energy Cost of Dynamic Branch Prediction in an Intel High-Performance Processor. Computers 2023, 12, 139. [Google Scholar] [CrossRef]
- Aljabri, N.; Al-Hashimi, M.; Saleh, M.; Abulnaja, O. Investigating power efficiency of mergesort. The Journal of Supercomputing 2019, 75, 6277–6302. [Google Scholar] [CrossRef]
- Jenkins, I.R.; Anantharaman, P.; Shapiro, R.; Brady, J.P.; Bratus, S.; Smith, S.W. Ghostbusting: Mitigating Spectre with intraprocess memory isolation. In Proceedings of the Proceedings of the 7th Symposium on Hot Topics in the Science of Security, 2020; pp. 1–11.
- Saini, S.; Hood, R.; Chang, J.; Baron, J. Performance evaluation of an Intel Haswell-and Ivy Bridge-based supercomputer using scientific and engineering applications. In Proceedings of the 2016 IEEE 18th International Conference on High Performance Computing and Communications; 2016, IEEE 14th International Conference on Smart City; IEEE 2nd International Conference on Data Science and Systems (HPCC/SmartCity/DSS). IEEE; pp. 1196–1203.
- Khan, K.N.; Hirki, M.; Niemi, T.; Nurminen, J.K.; Ou, Z. Rapl in action: Experiences in using rapl for power measurements. ACM Transactions on Modeling and Performance Evaluation of Computing Systems (TOMPECS) 2018, 3, 1–26. [Google Scholar] [CrossRef]










| Strategy | Description |
|---|---|
| No-Mitigation | In this strategy, the code is compiled without any mitigation. This strategy used as a baseline for otherstrategies. |
| Comprehensive Conditional Branch Mitigation (CCBM) | Mitigates Spectre V1 by applying fixes to all conditional branches. |
| Targeted Pattern Mitigation (TPM) | Mitigates Spectre V1 by applying fixes to patterns of code that are known to be susceptible to speculative execution attacks. |
| Speculative Load Defense (SLD) | Mitigates Spectre V1 by hardening speculative loads to prevent data leakage through speculative execution paths. |
| Indirect Branches Inline Thunk (IBIT) | Mitigates Spectre V2 by using inline thunks for indirect branches to prevent speculative execution vulnerabilities. Thunks are small code snippets that act as intermediaries to redirect the execution flow, ensuring that speculative execution does not bypass security checks. |
| Indirect Branches External Thunk (IBET) | Mitigates Spectre V2 by using external thunks for indirect branches, isolating branch targets to prevent speculative execution vulnerabilities. |
| Function Calls Inline Thunk (FCIT) | Mitigates Spectre V2 by using inline thunks for function calls to prevent speculative execution vulnerabilities. |
| Function Calls External Thunk (FCET) | Mitigates Spectre V2 by using external thunks for function calls to prevent speculative execution vulnerabilities. |
| Function Returns Inline Thunk (FRIT) | Mitigates Spectre V2 by using external thunks for function returns to prevent speculative execution vulnerabilities. |
| Return Trampoline (RT) | Mitigates Spectre V2 by using return trampolines to prevent speculative execution vulnerabilities. Return trampolines replace indirect jumps and calls with returns to secure speculative paths. |
| Return Trampolines External Thunk (RTET) | Mitigates Spectre V2 by using external return trampolines to prevent speculative execution vulnerabilities. |
| Benchmark | Workload Type | Computational Characteristics |
|---|---|---|
| Barnes | N-Body Simulation | Tree-based n-body method; irregular memory access patterns |
| Canneal | Optimization | Simulated annealing; high memory usage, intensive data manipulation |
| Cholesky | Dense Matrix Factorization | Matrix operations; high computational intensity, data dependencies |
| Dedup | Compression | Data duplication; disk I/O intensive, moderate CPU usage |
| Ferret | Content-Based Similarity Search | Search and retrieval; intensive communication between processes |
| FMM | N-Body Simulation | Fast multi-pole method; hierarchical computations, high data locality |
| Freqmine | Data Mining | Frequent item set mining; intensive computation, irregular memory access |
| Oceancp | Ocean Simulation | Climate modeling; stencil computations, high data locality |
| Raytrace | Image Rendering | Ray tracing; high computational intensity, data locality |
| X264 | Video Encoding | H.264 video encoding; high computation, data streaming, real-time processing |
| Strategy | Flag | Compiler(s) | Spectre Variant |
|---|---|---|---|
| CCBM | -mconditional-branch=all-fix | IC | V1 |
| TPM | -mconditional-branch=pattern-fix | IC | V1 |
| SLD | -mspeculative-load-hardening | Clang | V1 |
| IBIT | -mindirect-branch=thunk-inline | IC, GCC | V2 |
| IBET | -mindirect-branch=thunk-extern | IC, GCC | V2 |
| FCIT | -mfunction-call=thunk-inline | IC | V2 |
| FCET | -mfunction-call=thunk-extern | IC | V2 |
| FRIT | -mfunction-return=thunk-inline | IC | V2 |
| RT | -mretpoline | Clang | V2 |
| RTEX | -mretpoline-external-thunk | Clang | V2 |
| Processor : Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz | ||||||
|---|---|---|---|---|---|---|
| # of physical cores: 12 | # of logical cores: 24 | L1d cache: 3K | ||||
| L1i cache: 32K | L2 cache: 256K | L3 cache: 30720K | ||||
| Operating System: Lubuntu 18.04.6 LTS | Kernal: 4.15. | |||||
| Compiler | Unrolling | Total Energy(W) |
Total Running Times (s) |
|---|---|---|---|
| IC | OFF | 3086 | 70.72 |
| ON | 3090 | 70.58 | |
| GCC | OFF | 2263 | 47.7 |
| ON | 2280 | 47.94 | |
| Clang | OFF | 2355 | 47.15 |
| ON | 2358 | 47.11 |
| Mitigation Strategies |
Compiler | unroll | Barnes | Canneal | Cholesky | Dedup | Ferret | FMM | Freqmine | Oceancp | Raytrace | X264 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| CCBM | IC | OFF | 485 | 151 | 2 | 826 | 341 | 522 | 5504 | 653 | 583 | 613 |
| ON | 482 | 152 | 2 | 838 | 346 | 520 | 5424 | 651 | 586 | 611 | ||
| TPM | IC | OFF | 172 | 123 | 1 | 676 | 256 | 132 | 1998 | 179 | 234 | 244 |
| ON | 166 | 126 | 1 | 694 | 248 | 134 | 1984 | 180 | 231 | 244 | ||
| SLD | Clang | OFF | 286 | 160 | 1 | 1053 | 642 | 171 | 683 | 184 | 685 | 398 |
| ON | 286 | 159 | 1 | 1054 | 636 | 172 | 696 | 183 | 687 | 400 |
| Mitigation Strategies |
Compiler | unroll | Barnes | Canneal | Cholesky | Dedup | Ferret | FMM | Freqmine | Oceancp | Raytrace | X264 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| CCBM | IC | OFF | 11.55 | 3.56 | 0.03 | 44.44 | 17.74 | 12.72 | 131.68 | 15.58 | 13.76 | 18 |
| ON | 11.52 | 3.6 | 0.04 | 44.24 | 17.75 | 12.67 | 131.5 | 15.57 | 13.8 | 18.01 | ||
| TPM | IC | OFF | 6.7 | 3.72 | 0.02 | 26.2 | 14.61 | 4 | 10.02 | 4.14 | 16 | 9.21 |
| ON | 6.72 | 3.69 | 0.02 | 26.14 | 14.4 | 4.02 | 10.29 | 4.11 | 15.99 | 9.21 | ||
| SLD | Clang | OFF | 3.92 | 2.93 | 0.03 | 15.77 | 6.3 | 3.07 | 46.77 | 3.96 | 5.15 | 6.39 |
| ON | 3.77 | 2.99 | 0.02 | 15.73 | 6.31 | 3.11 | 46.54 | 3.96 | 5.09 | 6.4 |
| Mitigation Strategies |
Compiler | unroll | Barnes | Canneal | Cholesky | Dedup | Ferret | FMM | Freqmine | Oceancp | Raytrace | X264 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| CCBM | IC | OFF | 84.7 | 6.0 | 2.0 | 81.0 | 41.0 | 92.2 | 233.3 | 25.6 | 24.9 | 34.2 |
| ON | 84.8 | 6.0 | 1.8 | 81.0 | 41.0 | 92.3 | 233.3 | 25.5 | 24.9 | 34.7 | ||
| TPM | IC | OFF | 40.7 | 5.7 | 1.9 | 81.0 | 41.0 | 38.2 | 209.5 | 24.4 | 23.1 | 34.8 |
| ON | 40.7 | 5.7 | 1.8 | 81.0 | 41.0 | 38.1 | 209.6 | 24.4 | 23.1 | 34.9 | ||
| SLD | Clang | OFF | 63.2 | 13.6 | 1.9 | 81.0 | 41.0 | 67.6 | 52.8 | 28.0 | 35.5 | 47.5 |
| ON | 62.8 | 13.6 | 1.8 | 81.0 | 41.0 | 61.9 | 52.6 | 27.8 | 35.4 | 47.2 |
| Mitigation Strategies |
Compiler | unroll | Barnes | Canneal | Cholesky | Dedup | Ferret | FMM | Freqmine | Oceancp | Raytrace | X264 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| IBIT | IC | OFF | 164 | 109 | 1 | 594 | 245 | 126 | 1226 | 178 | 432 | 259 |
| ON | 167 | 108 | 1 | 604 | 249 | 127 | 1228 | 178 | 431 | 252 | ||
| GCC | OFF | 166 | 91 | 1 | 593 | 258 | 134 | 387 | 174 | 435 | 324 | |
| ON | 165 | 90 | 1 | 599 | 254 | 131 | 416 | 175 | 440 | 327 | ||
| IBET | IC | OFF | 163 | 108 | 1 | 595 | 243 | 129 | 1232 | 178 | 233 | 245 |
| ON | 162 | 108 | 1 | 593 | 244 | 129 | 1231 | 178 | 231 | 246 | ||
| GCC | OFF | 164 | 90 | 1 | 604 | 248 | 134 | 385 | 175 | 236 | 249 | |
| ON | 165 | 91 | 1 | 604 | 246 | 130 | 412 | 176 | 235 | 250 | ||
| FCIT | IC | OFF | 162 | 107 | 1 | 591 | 242 | 129 | 1234 | 180 | 232 | 247 |
| ON | 164 | 106 | 1 | 590 | 241 | 125 | 1234 | 180 | 232 | 249 | ||
| FCET | IC | OFF | 166 | 108 | 1 | 594 | 244 | 124 | 1239 | 180 | 229 | 250 |
| ON | 163 | 109 | 1 | 592 | 247 | 125 | 1231 | 179 | 228 | 247 | ||
| FRIT | IC | OFF | 299 | 115 | 1 | 630 | 260 | 130 | 1825 | 180 | 290 | 450 |
| ON | 303 | 115 | 1 | 632 | 262 | 131 | 1828 | 179 | 294 | 459 | ||
| GCC | OFF | 288 | 95 | 1 | 602 | 260 | 142 | 668 | 175 | 287 | 266 | |
| ON | 297 | 96 | 1 | 603 | 256 | 135 | 684 | 174 | 296 | 272 | ||
| RT | Clang | OFF | 147 | 128 | 1 | 604 | 264 | 144 | 351 | 171 | 438 | 317 |
| ON | 145 | 129 | 1 | 605 | 262 | 132 | 354 | 172 | 429 | 314 | ||
| RTET | Clang | OFF | 146 | 82 | 1 | 602 | 263 | 130 | 348 | 171 | 349 | 291 |
| ON | 147 | 82 | 1 | 602 | 263 | 130 | 348 | 171 | 354 | 292 |
| Mitigation Strategies |
Compiler | unroll | Barnes | Canneal | Cholesky | Dedup | Ferret | FMM | Freqmine | Oceancp | Raytrace | X264 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| IBIT | IC | OFF | 3.75 | 2.55 | 0.02 | 15.77 | 6.29 | 2.93 | 27.6 | 3.89 | 9.78 | 6.39 |
| ON | 3.77 | 2.56 | 0.02 | 15.72 | 6.31 | 2.95 | 27.59 | 3.93 | 9.81 | 6.4 | ||
| GCC | OFF | 3.76 | 2.14 | 0.02 | 13.32 | 5.64 | 3.12 | 5.13 | 3.94 | 9.83 | 7.38 | |
| ON | 3.74 | 2.13 | 0.02 | 13.44 | 5.53 | 3.06 | 5.56 | 3.93 | 9.93 | 7.43 | ||
| IBET | IC | OFF | 3.67 | 2.55 | 0.02 | 13.55 | 12.07 | 6.4 | 62.44 | 8.67 | 11.14 | 12.25 |
| ON | 3.68 | 2.55 | 0.02 | 13.56 | 12.1 | 6.47 | 62.04 | 8.69 | 11.27 | 12.27 | ||
| GCC | OFF | 3.74 | 2.13 | 0.02 | 13.6 | 5.36 | 3.21 | 5.11 | 3.93 | 5.2 | 5.81 | |
| ON | 3.75 | 2.16 | 0.02 | 13.62 | 5.39 | 3.14 | 5.48 | 3.94 | 5.17 | 5.74 | ||
| FCIT | IC | OFF | 3.7 | 2.53 | 0.02 | 13.59 | 5.41 | 2.96 | 27.76 | 3.94 | 5.07 | 5.53 |
| ON | 3.72 | 2.52 | 0.02 | 13.58 | 5.45 | 2.87 | 27.75 | 3.95 | 4.95 | 5.55 | ||
| FCET | IC | OFF | 3.8 | 2.57 | 0.02 | 14.46 | 5.39 | 2.89 | 27.91 | 3.94 | 5 | 5.63 |
| ON | 3.7 | 2.55 | 0.02 | 13.6 | 5.42 | 2.86 | 27.72 | 3.93 | 4.98 | 5.68 | ||
| FRIT | IC | OFF | 6.91 | 2.72 | 0.02 | 15.66 | 6.25 | 3.01 | 41.65 | 3.95 | 6.4 | 6.35 |
| ON | 6.97 | 2.69 | 0.02 | 15.62 | 6.23 | 3.03 | 41.66 | 3.9 | 6.5 | 6.36 | ||
| GCC | OFF | 6.66 | 2.25 | 0.02 | 13.58 | 5.56 | 3.31 | 9.46 | 3.94 | 6.39 | 6.07 | |
| ON | 6.91 | 2.25 | 0.02 | 13.31 | 5.5 | 3.12 | 9.63 | 3.92 | 6.51 | 6.17 | ||
| RT | Clang | OFF | 3.34 | 3.04 | 0.02 | 15.53 | 5.75 | 3.38 | 5.94 | 3.87 | 9.88 | 7.23 |
| ON | 3.32 | 3.03 | 0.02 | 15.5 | 5.68 | 3.1 | 6.1 | 3.88 | 9.7 | 7.19 | ||
| RTET | Clang | OFF | 3.32 | 2.56 | 0.02 | 14.41 | 5.39 | 3.17 | 5.57 | 3.88 | 9.27 | 6.78 |
| ON | 3.33 | 2.45 | 0.02 | 14.38 | 5.33 | 2.91 | 5.72 | 3.88 | 9.1 | 6.75 |
| Mitigation Strategies |
Compiler | unroll | Barnes | Canneal | Cholesky | Dedup | Ferret | FMM | Freqmine | Oceancp | Raytrace | X264 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| IBIT | IC | OFF | 40.4 | 5.7 | 1.7 | 81.0 | 41.0 | 37.4 | 206.7 | 24.4 | 25.2 | 35.9 |
| ON | 40.3 | 5.7 | 1.8 | 81.0 | 41.0 | 37.4 | 206.8 | 24.4 | 25.2 | 36.0 | ||
| GCC | OFF | 39.6 | 5.6 | 1.6 | 80.0 | 40.0 | 41.5 | 216.5 | 19.5 | 26.3 | 35.7 | |
| ON | 39.5 | 5.6 | 1.6 | 79.0 | 38.0 | 40.0 | 220.5 | 17.1 | 26.2 | 35.5 | ||
| IBET | IC | OFF | 40.3 | 5.7 | 1.9 | 81.0 | 40.0 | 39.8 | 222.0 | 24.5 | 23.1 | 35.4 |
| ON | 40.4 | 5.7 | 1.8 | 81.0 | 39.0 | 40.6 | 223.1 | 24.5 | 23.1 | 35.7 | ||
| GCC | OFF | 39.5 | 4.7 | 1.8 | 79.0 | 40.0 | 39.6 | 216.5 | 19.5 | 24.2 | 31.4 | |
| ON | 39.5 | 4.3 | 1.7 | 79.0 | 37.0 | 40.5 | 220.5 | 17.1 | 23.2 | 30.3 | ||
| FCIT | IC | OFF | 40.5 | 5.7 | 2.1 | 81.0 | 40.0 | 37.0 | 245.1 | 24.4 | 23.1 | 34.3 |
| ON | 41.6 | 5.7 | 1.7 | 81.0 | 37.0 | 37.1 | 301.7 | 24.4 | 23.1 | 34.8 | ||
| FCET | IC | OFF | 40.4 | 5.7 | 1.8 | 81.0 | 41.0 | 37.1 | 206.8 | 24.4 | 23.1 | 34.7 |
| ON | 40.5 | 5.7 | 2.0 | 81.0 | 38.0 | 37.1 | 206.8 | 24.4 | 23.1 | 34.8 | ||
| FRIT | IC | OFF | 59.0 | 5.7 | 1.9 | 81.0 | 40.0 | 37.7 | 290.6 | 24.4 | 23.9 | 34.6 |
| ON | 59.2 | 5.7 | 2.0 | 81.0 | 39.0 | 37.8 | 210.7 | 24.4 | 23.9 | 34.8 | ||
| GCC | OFF | 56.1 | 5.7 | 1.7 | 79.0 | 40.0 | 42.5 | 222.0 | 19.5 | 25.1 | 35.0 | |
| ON | 57.6 | 5.7 | 1.6 | 79.0 | 39.0 | 40.0 | 225.8 | 17.1 | 25.0 | 34.5 | ||
| RT | Clang | OFF | 51.0 | 26.0 | 2.0 | 87.0 | 47.0 | 39.4 | 42.8 | 17.9 | 24.9 | 39.0 |
| ON | 41.3 | 26.1 | 1.9 | 87.0 | 42.0 | 37.9 | 41.2 | 17.8 | 24.9 | 38.7 | ||
| RTET | Clang | OFF | 51.0 | 26.0 | 2.1 | 87.0 | 48.0 | 40.5 | 42.9 | 17.9 | 25.1 | 39.0 |
| ON | 53.4 | 26.2 | 1.9 | 87.0 | 47.0 | 43.1 | 43.5 | 17.8 | 24.9 | 38.8 |
| Mitigation Strategies |
Compiler | Unroll | Barnes | Canneal | Cholesky | Dedup | Ferret | FMM | Freqmine | Oceancp | Raytrace | X264 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| CCBM | IC | OFF | -2 | 2 | 41 | -56 | -57 | -7 | -5 | -8 | -8 | -75 |
| ON | -4 | 2 | 20 | -55 | -56 | -5 | -7 | -8 | -6 | -23 | ||
| TPM | IC | OFF | 2 | 2 | 5 | 2 | -8 | -3 | -3 | -1 | -1 | 118 |
| ON | 1 | 1 | 61 | 5 | -12 | -1 | -3 | 0 | 0 | 116 | ||
| SLD | Clang | OFF | -5 | 13 | 46 | -10 | -10 | 8 | 2 | 3 | -36 | -15 |
| ON | -8 | 12 | 40 | -10 | -9 | 3 | 4 | 3 | -36 | -14 | ||
| IBIT | IC | OFF | 2 | 3 | 6 | -11 | -12 | -3 | 1 | 0 | -4 | -8 |
| ON | 1 | 2 | 2 | -9 | -11 | -1 | 1 | -1 | -3 | -11 | ||
| GCC | OFF | 1 | 0 | 13 | 2 | -1 | -1 | 0 | 1 | -2 | 0 | |
| ON | 0 | 0 | 17 | 2 | 1 | 1 | -1 | 3 | -2 | 0 | ||
| IBET | IC | OFF | 3 | 2 | 2 | 4 | -55 | -54 | -55 | -55 | -54 | -55 |
| ON | 1 | 2 | 8 | 4 | -54 | -54 | -55 | -55 | -55 | -55 | ||
| GCC | OFF | 1 | 0 | 2 | 2 | 0 | -3 | 0 | 2 | 0 | -3 | |
| ON | 0 | 0 | 8 | 1 | 0 | -2 | -1 | 3 | 1 | -1 | ||
| FCIT | IC | OFF | 2 | 2 | 0 | 3 | 1 | -2 | 1 | 0 | -1 | 1 |
| ON | 1 | 1 | 14 | 3 | 0 | 0 | 1 | 0 | 3 | 1 | ||
| FCET | IC | OFF | 2 | 2 | 9 | -3 | 2 | -3 | 1 | 0 | -1 | 1 |
| ON | 1 | 3 | 16 | 3 | 3 | 1 | 1 | 0 | 1 | -2 | ||
| FRIT | IC | OFF | 1 | 2 | 13 | -5 | -6 | -2 | 0 | 0 | -2 | 61 |
| ON | 0 | 3 | 22 | -4 | -5 | 0 | 0 | 1 | 0 | 63 | ||
| GCC | OFF | -1 | -1 | 9 | 1 | 1 | 0 | -6 | 2 | -1 | -1 | |
| ON | -2 | 1 | 19 | 3 | 2 | 2 | -6 | 2 | 1 | 0 | ||
| RT | Clang | OFF | -2 | 10 | 7 | -15 | -7 | 7 | -14 | 2 | -51 | -16 |
| ON | -6 | 9 | 2 | -15 | -5 | 2 | -13 | 2 | -52 | -16 | ||
| RTET | Clang | OFF | -2 | -16 | 4 | -7 | -1 | 2 | -7 | 2 | -44 | -15 |
| ON | -4 | -13 | 0 | -6 | 2 | 7 | -7 | 2 | -42 | -15 |
| Benchmark | Time | Energy | Benchmark | Time | Energy |
|---|---|---|---|---|---|
| Barnes | 3.77% | 8.10% | Fmm | -1.02% | -0.96% |
| Canneal | -2.15% | -2.60% | Freqmine | -2.18% | -3.44% |
| Cholesky | 0.23% | 0.42% | Ocean_CP | 1.44% | 3.26% |
| Dedup | -0.58% | -0.60% | Raytrace | 0.09% | -0.08% |
| Ferret | -0.43% | -1.10% | X264 | -0.50% | 0.30% |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).