feat: HWP scaling, C1E, closed-loop thermal governor for Intel CPUs

This commit is contained in:
2026-07-05 10:51:11 +02:00
parent 46c56b057b
commit 35e5aba23f
19 changed files with 903 additions and 9 deletions
+6
View File
@@ -11,6 +11,7 @@
#include <Hal/IDT.hpp>
#include <Hal/MSR.hpp>
#include <Hal/Cpu.hpp>
#include <Hal/CpuPower.hpp>
#include <Memory/Paging.hpp>
#include <Memory/PageFrameAllocator.hpp>
#include <Memory/HHDM.hpp>
@@ -204,6 +205,9 @@ namespace Smp {
// --- Check MWAIT support ---
cpu->hasMwait = Hal::HasMwait();
// --- Per-CPU power setup (C1E promotion, HWP request) ---
Hal::CpuPower::InitializeAp();
// --- Signal that we are online ---
cpu->started = true;
@@ -212,6 +216,8 @@ namespace Smp {
static volatile uint64_t s_idleMonitor = 0;
for (;;) {
// Pick up thermal-governor frequency changes decided by the BSP.
Hal::CpuPower::ApplyPolicyIfChanged();
Hal::CpuIdle::Wait(10, cpu->hasMwait, &s_idleMonitor);
}
}