Hi list,
The following patch [1] adds Speedstep/PowerNow support in NetBSD dom0.
As Xen 3 traps MSR instructions, I just made some adjustments in the files.xen/compat files and config(5) so that the operations are avalaible within dom0.
Please note that, depending on the version of the hypervisor you are using, some instructions won't be handled by Xen. In that case, they will result in a NOOP, and the error will be logged by xen dmesg.
=> with Xen 3.1, rdmsr() should always succeed, but some wrmsr() will fail with a "Domain attempted to WRMSR xxx from yyy to zzz". This means that this patch allows you to get the CPU current frequency (through machdep.est.frequency.current), but you cannot set it through machdep.est.frequency.target.
=> with Xen 3.3, provided you passed "cpufreq=dom0-kernel" as parameter to Xen kernel during boot, you can change CPU speed the same way as you would do with a GENERIC kernel.
Compiled and tested for Speedstep under i386 for XEN3_DOM0 and XEN3PAE_DOM0 kernels. amd64 and PowerNow were only compile tested (no hardware, sigh).
Current patch mimics GENERIC, and enables Speedstep/PowerNow by default.
Please, review.
[1]
http://www.netbsd.org/~jym/msr_xen--
Jean-Yves Migeon
jeanyves.migeon%free.fr@localhost