What will be the exact code for calculating the misses of the cache of the last level on the architecture of Lake Kaby Lake

I read an interesting document called “Attack with a high resolution side channel on the last level cache” and wanted to find out the index hash function for my own machine, that is, Intel Core i7-7500U (Kaby Lake architecture) - following the instructions of this work.

For reverse processing the hash function, the document mentions the first step as:

 for (n=16; ; n++) 
 {
   // ignore any miss on first run
   for (fill=0; !fill; fill++) 
   {
     // set pmc to count LLC miss
     reset_pmc();
     for (a=0; a<n; a++)
       // set_count*line_size=2^19
       load(a*2^19);
   }

   // get the LLC miss count
   if (read_pmc()>0) 
   {
     min = n;
     break;
   }
 }

How can I encode reset_pmc()and read_pmc()C ++? Of all that I have read on the Internet so far, I think it requires built-in build code, but I don’t know what instructions to use to get the missing LLC account. I would be obligated if someone could provide the code for these two steps.

Ubuntu 16.04.1 (64-) VMware.

PS: LONGEST_LAT_CACHE.REFERENCES LONGEST_LAT_CACHE.MISSES 18 3B Intel Architectures, , .

+8
2

perf , , , , .

, . , . , , , Ubunty 16.04:

, ! , , libpfc Ubuntu 16.04. , , ( ) . , , .

Kaby Lake, " ", , , API . libpfc Haswell (PMA v3), , .


1 , PCM, , PCM ( , ),

+8
0

All Articles