feat: HWP scaling, C1E, closed-loop thermal governor for Intel CPUs
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user