-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prime+Scope implementation #6
base: main
Are you sure you want to change the base?
Conversation
5e61447
to
bec7e05
Compare
Hi, I tried to work around with those functions (actually only PS is, as I understand it, a method for producing easily reproducible measures, so it seem strange to me that such fluctuation can be observed between several captures. |
Hey, one factor that might cause some runs to fail is if the generation of eviction-sets fails, this happens at the start of the program and is independent of the PS run. You can use the PTE map to check if that is the cause, and in general enabling huge pages and disabling CPU frequency scaling might help with finding eviction-sets more consistently. |
Just an idea, but maybe we can rely on the |
The linear algorithm presented in that paper is already implemented in Mastik - you can enable it by setting the L3FLAG_LINEARMAP flag in the l3info_t struct you pass into ps_prepare. |
68c2584
to
64ebb70
Compare
I have tried running PS.c on two systems. It consumes all available memory and gets killed. |
The Prime+Scope code itself doesn't allocate a lot of memory (unless the reported number of L3 sets is incorrect), ps->ngroups = ps->mm->l3ngroups;
ps->groupsize = ps->mm->l3groupsize; To make sure the number of L3 sets is not reported incorrectly, leading to the allocation of a lot of memory. Otherwise, some more information on where/what is causing the excessive allocations might be needed so I can reproduce the behavior on my end. |
64ebb70
to
7dd297f
Compare
implementation for finding prime patterns
7dd297f
to
61fd610
Compare
This PR adds a Prime+Scope [Purnal et al.] implementation, including an implementation of the genetic algorithm (termed "PrimeTime" by the authors) which searches for optimal prime patterns on the given CPU.
Currently the API exposes three functions:
ps_prime()
, which primes all monitored linesps_scope()
, which times all monitored lineps_prime_and_scope(...)
, which primes all monitored lines, and then repeatedly scopes them, returning the first accessed lineAre there any further functions which should be exposed?
The PR includes example usage at
demo/PS.c
anddemo/PS-prime-time.c
for using the attack and finding prime patterns respectively. The PS demo itself contains an optimal pattern for the i5-8250U CPU, and it would only work well on other CPUs by changing the pattern.