cpu init: support for no_turbo kernel argument

This commit is contained in:
Balazs Gerofi
2015-06-25 12:18:27 +09:00
parent 41b85281a4
commit fbb776e4fb

View File

@ -117,6 +117,7 @@ extern char page_fault[], general_protection_exception[];
extern char debug_exception[], int3_exception[];
uint64_t boot_pat_state = 0;
int no_turbo = 0; /* May be updated by early parsing of kargs */
static void init_idt(void)
{
@ -292,6 +293,7 @@ void init_pstate_and_turbo(void)
* When set to 1: disengages IDA
* When set to 0: enables IDA
*/
if (!no_turbo) {
if (eax & (1 << 1)) {
uint64_t turbo_value;
@ -312,6 +314,7 @@ void init_pstate_and_turbo(void)
else {
value = value << 8;
}
}
wrmsr(MSR_IA32_PERF_CTL, value);