Changes

426 bytes added ,  20:36, 12 August 2018
no edit summary
Line 48: Line 48:  
To enumerate which components of the frame are enabled execute <code>cpuid_count(0xd, 0, &eax, &ebx, &ecx, &edx)</code>. Each component will have bit set to 1 in 64 bit mask <code>eax + ((uint64_t)edx << 32)</code> if enabled.
 
To enumerate which components of the frame are enabled execute <code>cpuid_count(0xd, 0, &eax, &ebx, &ecx, &edx)</code>. Each component will have bit set to 1 in 64 bit mask <code>eax + ((uint64_t)edx << 32)</code> if enabled.
   −
Current list of known components are the following (numbers are the bit position):
+
Current list of known components is the following (numbers are the bit position):
    
* <code>0</code>: x87 floating point registers
 
* <code>0</code>: x87 floating point registers
Line 61: Line 61:  
* <code>9</code>: Protection Keys User registers
 
* <code>9</code>: Protection Keys User registers
 
* <code>10</code>: Hardware Duty Cycling
 
* <code>10</code>: Hardware Duty Cycling
 +
 +
Once the bit mask is obtained we have to walk over each bit set and call <code>cpuid_count(0xd, component, &eax, &ebx, &ecx, &edx)</code>, where <code>component</code> is the *bit* position we are interested in. In other words it should be from 0 to 10. The result of this call is sitting in <code>ebx</code> which represent offset of the component from the frame base address and <code>eax</code> which shows component size.