kernel: Add MONITOR/MWAIT C1 idle support (P24)

Implement CPU power-saving idle loop using x86 MONITOR/MWAIT:
- Add monitor(), mwait(), enable_and_mwait() to interrupt module
- Detect MWAIT availability via CPUID at boot
- Use MONITOR+MWAIT instead of STI+HLT when supported
- Expose /scheme/sys/cstate_policy for userspace control
- Add RdWr Kind variant to sys scheme for read+write files
This commit is contained in:
2026-05-20 16:49:48 +03:00
parent 4fe734d1c2
commit bb4f757ba0
2 changed files with 223 additions and 0 deletions
+2
View File
@@ -45,6 +45,8 @@ patches = [
"../../../local/patches/kernel/P22-x2apic-madt-fallback.patch",
# P23: sys:msr scheme — kernel MSR read/write via /scheme/sys/msr/<cpu>/<msr>
"../../../local/patches/kernel/P23-sys-msr-scheme.patch",
# P24: C-state idle loop with MONITOR/MWAIT support
"../../../local/patches/kernel/P24-cstate-mwait-idle.patch",
]
[build]