diff options
author | Iru Cai <mytbk920423@gmail.com> | 2019-04-10 16:00:23 +0800 |
---|---|---|
committer | Iru Cai <mytbk920423@gmail.com> | 2019-05-31 16:03:18 +0800 |
commit | cd184d861f5702e0ec5855e7247584c799bd24a2 (patch) | |
tree | fa4dea6b6adf438dca6b023cd7b0cda14807fc0e /attack_code/evict_load/victim.c | |
parent | 3fe13600a91d1eb8a353f1ac7455d9a1d977027a (diff) | |
download | gem5-cd184d861f5702e0ec5855e7247584c799bd24a2.tar.xz |
add attack code and attack test script
Diffstat (limited to 'attack_code/evict_load/victim.c')
-rw-r--r-- | attack_code/evict_load/victim.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/attack_code/evict_load/victim.c b/attack_code/evict_load/victim.c new file mode 100644 index 000000000..e9d3249bf --- /dev/null +++ b/attack_code/evict_load/victim.c @@ -0,0 +1,16 @@ +#include <stdlib.h> +#include <stdint.h> +#include <x86intrin.h> + +extern uint8_t array1[]; +extern uint8_t array2[]; +extern size_t array_size; + +uint8_t victim(size_t idx) +{ + if (idx < array_size) { + return array2[array1[idx] * 64]; + } + return 0; +} + |