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
+19
View File
@@ -200,6 +200,9 @@ namespace montauk::abi {
static constexpr uint64_t SYS_SDR_SETPARAM = 147; // (handle, param, value)
static constexpr uint64_t SYS_SDR_GETPARAM = 148; // (handle, param) -> value
// CPU power/thermal status
static constexpr uint64_t SYS_POWERINFO = 149; // (PowerInfo*) -> 0, -1 unsupported
// Tunable parameters (for SYS_SDR_SETPARAM / SYS_SDR_GETPARAM).
static constexpr int SDR_PARAM_FREQ = 0; // center frequency, Hz
static constexpr int SDR_PARAM_SAMPLE_RATE = 1; // sample rate, Hz
@@ -493,6 +496,22 @@ namespace montauk::abi {
uint32_t _pad;
};
// CPU power/thermal snapshot (returned by SYS_POWERINFO)
struct PowerInfo {
uint8_t hwpActive; // hardware P-state scaling enabled
uint8_t throttling; // thermal governor currently limiting frequency
uint8_t tempC; // package temperature, degrees C (0 = unknown)
uint8_t tjMaxC; // hardware throttle temperature
uint8_t highestPerf; // HWP performance range (ratio units)
uint8_t lowestPerf;
uint8_t curMaxPerf; // thermal governor's current ceiling
uint8_t epp; // energy/perf preference (0=perf, 255=power)
uint32_t baseMHz; // nominal base frequency (0 = unknown)
uint32_t maxMHz; // max turbo frequency
uint32_t effMHz; // measured average active frequency
uint32_t apIdleHint; // MWAIT hint used for AP deep idle
};
struct ProcInfo {
int32_t pid;
int32_t parentPid;