Skip to content

Commit cda8fde

Browse files
committed
added the prime+scope's SF prime pattern for ICX
This assumes the ptr chasing pattern proposed in the original prime+probe paper still works on ICX
1 parent eeb0957 commit cda8fde

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

libs/cache/monitor.c

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "cache/access_seq.h"
33
#include "cache/evchain.h"
44
#include "sync.h"
5+
#include <stdlib.h>
56

67
void prime_skx_sf_evset_para(EVSet *evset, u32 arr_repeat, u32 l2_repeat) {
78
EVTestConfig *tconf = &evset->config->test_config;
@@ -27,6 +28,7 @@ void prime_skx_sf_evset_para(EVSet *evset, u32 arr_repeat, u32 l2_repeat) {
2728
}
2829

2930
// from the PRIME+SCOPE implementation
31+
#if defined (SKYLAKE) || defined (CASCADE)
3032
void prime_evchain_prime_scope(evchain *ptr) {
3133
__asm__ __volatile__("mfence;"
3234
"movq (%%rcx), %%rcx;"
@@ -50,6 +52,42 @@ void prime_evchain_prime_scope(evchain *ptr) {
5052
: "c"(ptr)
5153
: "cc", "memory");
5254
}
55+
#elif defined (ICELAKE)
56+
void prime_evchain_prime_scope(evchain *ptr) {
57+
__asm__ __volatile__("mfence;"
58+
"movq (%%rcx), %%rcx;"
59+
"movq (%%rcx), %%rcx;"
60+
"mfence;"
61+
"movq (%%rcx), %%rcx;"
62+
"movq (%%rcx), %%rcx;"
63+
"mfence;"
64+
"movq (%%rcx), %%rcx;"
65+
"movq (%%rcx), %%rcx;"
66+
"mfence;"
67+
"movq (%%rcx), %%rcx;"
68+
"movq (%%rcx), %%rcx;"
69+
"mfence;"
70+
"movq (%%rcx), %%rcx;"
71+
"movq (%%rcx), %%rcx;"
72+
"mfence;"
73+
"movq (%%rcx), %%rcx;"
74+
"movq (%%rcx), %%rcx;"
75+
"mfence;"
76+
"movq (%%rcx), %%rcx;"
77+
"movq (%%rcx), %%rcx;"
78+
"mfence;"
79+
"movq (%%rcx), %%rcx;"
80+
"movq (%%rcx), %%rcx;"
81+
:
82+
: "c"(ptr)
83+
: "cc", "memory");
84+
}
85+
#else
86+
void prime_evchain_prime_scope(evchain *ptr) {
87+
_error("Prime+Scope's prime chain is not implemented!\n");
88+
exit(EXIT_FAILURE);
89+
}
90+
#endif
5391

5492
void prime_skx_sf_evset_ps_sense(evchain *chain1, evchain *chain2,
5593
bool prime_sense, EVSet *lower) {

0 commit comments

Comments
 (0)