Skip to content

Commit 93fd6e3

Browse files
committed
[AMD][Zen] Core Performance Boost is now based on CPUID:CPB and HWCR:CPB
1 parent 37a7541 commit 93fd6e3

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

x86_64/corefreqk.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8307,7 +8307,8 @@ static bool Compute_AMD_Zen_Boost(unsigned int cpu)
83078307

83088308
/* If CPB is enabled then add Boost + XFR to the P0 ratio. */
83098309
RDMSR(PUBLIC(RO(Core, AT(cpu)))->SystemRegister.HWCR, MSR_K7_HWCR);
8310-
if (PUBLIC(RO(Core, AT(cpu)))->SystemRegister.HWCR.Family_17h.CpbDis == 0)
8310+
if ( (PUBLIC(RO(Core, AT(cpu)))->SystemRegister.HWCR.Family_17h.CpbDis == 0)
8311+
&& (PUBLIC(RO(Proc))->Features.AdvPower.EDX.CPB == 1) )
83118312
{
83128313
AMD_17_ZEN2_COF XtraCOF = {.value = 0};
83138314

@@ -8370,9 +8371,14 @@ static bool Compute_AMD_Zen_Boost(unsigned int cpu)
83708371
PRIVATE(OF(Specific))->Boost[1];
83718372
}
83728373
}
8373-
return true; /* Have CPB: inform to add the Xtra Boost ratios */
8374+
/* CPB is enabled then inform to add the Xtra Boost ratios */
8375+
return true;
83748376
} else {
8375-
return false; /* CPB is disabled */
8377+
PUBLIC(RO(Core, AT(cpu)))->Boost[BOOST(CPB)] = \
8378+
PUBLIC(RO(Core, AT(cpu)))->Boost[BOOST(XFR)] = \
8379+
PUBLIC(RO(Core, AT(cpu)))->Boost[BOOST(MAX)];
8380+
8381+
return false; /* CPUID:CPB or HWCR:CPB state are disabled */
83768382
}
83778383
}
83788384

@@ -10387,8 +10393,12 @@ static void PerCore_Query_AMD_Zen_Features(CORE_RO *Core) /* Per SMT */
1038710393
} else {
1038810394
BITCLR_CC(BUS_LOCK, PUBLIC(RW(Proc))->TurboBoost, Core->Bind);
1038910395
}
10390-
BITSET_CC(BUS_LOCK, PUBLIC(RO(Proc))->TurboBoost_Mask, Core->Bind);
10391-
10396+
if (PUBLIC(RO(Proc))->Features.AdvPower.EDX.CPB == 1)
10397+
{
10398+
BITSET_CC(BUS_LOCK, PUBLIC(RO(Proc))->TurboBoost_Mask, Core->Bind);
10399+
} else {
10400+
BITCLR_CC(BUS_LOCK, PUBLIC(RO(Proc))->TurboBoost_Mask, Core->Bind);
10401+
}
1039210402
/* Enable or Disable the Core C6 State. Bit[22,14,16] */
1039310403
RDMSR(CStateCfg, MSR_AMD_F17H_CSTATE_CONFIG);
1039410404

0 commit comments

Comments
 (0)