rdmsr from userspace

Mike Meyer mwm-keyword-freebsdhackers2.e313df at mired.org
Sat May 17 17:30:13 UTC 2008


On Sat, 17 May 2008 11:13:52 +0300
Andriy Gapon <avg at icyb.net.ua> wrote:
> It seems that rdmsr instruction can be executed only at the highest 
> privilege level and thus is not permitted from userland. Maybe we should 
> provide something like Linux /dev/cpu/msr?
> I don't like interface of that device, I think that ioctl approach would 
> be preferable in this case.
> Something like create /dev/cpuN and allow some ioctls on it: 
> ioctl(cpu_fd, CPU_RDMSR, arg).
> What do you think?

Ok, this points directly at a question I've been wondering about, but
haven't been able to find an answer in the google.

I've been mucking about with general access to sysctl's (a sysctl
plugin for gkrellm, and a python module for accessing sysctls), and
with that hammer in my hand, the nail for this problem is obviously a
dev.cpu.#.msr sysctl.

Except that this would be harder to use from languages that don't
provide direct access to libc functions than a file, with or without
an ioctl (ioctl's are at at least POSIX, which is a functionality
level a lot of languages aspire to), and also easier to manipulate
with standard Unix tools in general.

However, I thought I'd sense some hostility towards /dev/proc-like
things from the freebsd community. Which is where my questions come
in: Am I imagining that? If not, is there a real basis for it - and
what would that be?

     Thanks,
     <mike
-- 
Mike Meyer <mwm at mired.org>		http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org


More information about the freebsd-hackers mailing list