
tify bottlenecks, and optimize performance.
The analysis highlights how Flush+Fault attacks
affect cache timing and branch mispredictions. Using
gem5 provides deep insights into attack behavior, aid-
ing in mitigation strategies like strengthening branch
predictors and improving cache defenses.
8 DISCUSSION
Our results show that the Flush+Fault attack exposes
vulnerabilities in the RISC-V architecture, signifi-
cantly increasing Instruction Cache (ICache) misses
from 280 to 643 (Figure 3). This is likely due to the
fence.i instruction flushing the cache and disrupt-
ing instruction fetch. Data Cache (DCache) misses
rise slightly from 4,960 to 5,012 (Figure 4), confirm-
ing the attack primarily targets the ICache. Branch
prediction is heavily impacted, with the branch mis-
predictions rising from 332 to 1,181,977 (Figure 5).
Our simulation-based approach enables fine-grained
analysis, complementing hardware-based research by
Gerlach et al. (2023). While gem5 allows controlled
studies, simulations may not fully capture real-world
timing variations. Future work should validate these
effects across different RISC-V implementations.
To mitigate Flush+Fault attacks, restricting access
to fence.i to privileged users can prevent unautho-
rized cache flushing. Introducing random execution
delays can reduce side-channel exploitability, though
at a performance cost. Improving branch predic-
tion algorithms can limit execution flow manipula-
tion. Implementing these countermeasures will en-
hance RISC-V security against side-channel threats.
9 FUTURE WORK
A key goal is to develop a gem5-based security re-
search platform with flexible cache and pipeline tem-
plates. Automated tools could track speculative exe-
cution and cache activity, simplifying analysis.
Future work includes adding hardware perfor-
mance counters in gem5 to monitor events like cache
accesses or branch mispredictions. Evaluating se-
curity mechanisms such as cache partitioning, ro-
bust branch prediction, and instruction randomiza-
tion could enhance defenses. Studying runtime de-
fenses will help assess performance-security trade-
offs. While gem5 provides cycle-accurate studies
close to hardware and detailed microarchitectural in-
sights, future work will test RISC-V side-channel at-
tacks across various simulators and RISC-V hardware
to compare results with those from gem5.
10 CONCLUSION
This paper demonstrates that gem5 is a valuable tool
for RISC-V security research, enabling controlled
analysis of microarchitectural components like caches
and branch predictors. By implementing and vali-
dating the Flush+Fault attack in gem5, we identified
vulnerabilities that could be exploited through side-
channel attacks. Our findings show that the attack
disrupts instruction caching and branch prediction,
increasing cache misses and mispredictions, making
timing-based information leakage easier. To mitigate
these risks, we suggest restricting access to cache-
flushing instructions, improving branch predictor se-
curity, and enhancing memory isolation. Future re-
search should focus on real-time attack detection, in-
tegrating hardware performance counters in gem5,
and exploring secure cache and branch prediction de-
signs. As RISC-V adoption grows, these insights
will help shape stronger security measures for mod-
ern processors.
REFERENCES
Ayoub, P. and Maurice, C. (2021). Reproducing spectre
attack with gem5: How to do it right? In Proceedings
of the 14th European Workshop on Systems Security.
Domas, C. (2017). Breaking the x86 isa. Black Hat, 1:1–6.
Gerlach, L., Weber, D., Zhang, R., and Schwarz, M. (2023).
A security risc: microarchitectural attacks on hard-
ware risc-v cpus. In IEEE S&P.
Li, J., Tufte, K., Shkapenyuk, V., Papadimos, V., Johnson,
T., and Maier, D. (2008). Out-of-order processing:
a new architecture for high-performance stream sys-
tems. Proceedings of the VLDB, 1(1).
Lowe-Power, J. (2018). Visualizing specter with
gem5. http://www.lowepower.com/jason/
visualizing-spectre-with-gem5.html.
Lowe-Power, J. (2024). Gem5 documentation. https://www.
gem5.org/documentation/.
Lowe-Power, J. et al. (2020). The gem5 simulator. arXiv.
Qureshi, Y. M., Simon, W. A., Zapater, M., Olcoz, K., and
Atienza, D. (2021). Gem5-x: A many-core hetero-
geneous simulation platform for architectural explo-
ration and optimization. ACM Transactions on Archi-
tecture and Code Optimization (TACO), 18(4):1–27.
Ta, T., Cheng, L., and Batten, C. (2018). Simulating multi-
core risc-v systems in gem5. In Workshop on Com-
puter Architecture Research with RISC-V.
Yarom, Y. and Falkner, K. (2014). {FLUSH+ RELOAD}
attack. In USENIX).
SECRYPT 2025 - 22nd International Conference on Security and Cryptography
612