x86_cstates: disable C5 and C6 states on Skylake

could help with #19341

see https://bugzilla.kernel.org/show_bug.cgi?id=109081

Change-Id: Ide72f46193093c3c4695c39d4466e9418808cbd0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8881
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
Jérôme Duval 2025-01-29 18:03:46 +01:00 committed by waddlesplash
parent 6c380f3c8e
commit d59339ff6c

View File

@ -155,6 +155,14 @@ init_cstates()
if ((cpuid.regs.ecx & CPUID_MWAIT_ECX_SUPPORT) != CPUID_MWAIT_ECX_SUPPORT)
return B_ERROR;
cpu_ent* cpu = &gCPU[0];
uint8 model = cpu->arch.model + (cpu->arch.extended_model << 4);
if (cpu->arch.family == 6) {
// disable C5 and C6 states on Skylake (same as Linux)
if (model == 0x5e && (mwaitSubStates & (0xf << 28)) != 0)
mwaitSubStates &= 0xf00fffff;
}
char cStates[64];
unsigned int offset = 0;
for (int32 i = 1; i < CPUIDLE_CSTATE_MAX; i++) {