Dear gem5 users, and in particular Jason Lowe-Power,
I read with interest the blog post by Jason about Visualizing Spectre with
gem5:
http://www.lowepower.com/jason/visualizing-spectre-with-gem5.html
<http://www.lowepower.com/jason/visualizing-spectre-with-gem5.html>
I then investigated visualising what happens when fences are added. I modified
the code, adding _mm_lfence or _mm_mfence in the victim function
> void victim_function(size_t x) {
> if (x < array1_size) {
> FENCE ADDED HERE
> temp &= array2[array1[x] * 512];
> }
> }
Running both modifications natively resulted in no leakage of the secret
(although that does not prove that no leakage is possible with the right
tweaking of parameters).
However, running in gem5
> build/X86/gem5.opt configs/learning_gem5/part1/two_level.py spectre
using the modifications to two_level.py described in the blog, there was no
leakage using mfence but the secret was leaked using lfence.
Does anyone have an idea of why this is happening? Output from the O3 pipeline
viewer shows that the fetch of the fence instruction is delayed in the one case
and not the other (I haven’t included screenshots due to message size
restrictions of the list but I can supply them in separate messages if
requested).
Potential causes are
- some misunderstanding on my part
- incorrect implementation of lfence in gem5
- two_level.py may be too simplistic for investigating fences
Thanking you in advance
Vashti
----------------------------------------------
Vashti Galpin
Laboratory for Foundations of Computer Science
School of Informatics, University of Edinburgh
----------------------------------------------
The University of Edinburgh is a charitable body,
registered in Scotland, with registration number SC005336.
----------------------------------------------
Vashti Galpin
Laboratory for Foundations of Computer Science
School of Informatics, University of Edinburgh
----------------------------------------------
The University of Edinburgh is a charitable body,
registered in Scotland, with registration number SC005336.
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users