Skip to contentSkip to conversation

Access MSR functions in userspace?

DISCUSSION Hasan Rashid 3 participants 3 messages Feb 6, 2008

lore
Share & tools
lore
#0 lore raw

Is there a way to use RDMSR and WRMSR in userspace? I only need to write to one register, writing a module with a userspace piece to handle that seems like an over kill.

TIA!

Signature · 1 line
Regards, Hasan R.
#1 lore raw
Quoted 5 lines · On Wednesday, 6 February 2008 05:29:47 Hasan Rashid wrote:

Is there a way to use RDMSR and WRMSR in userspace? I only need to write to one register, writing a module with a userspace piece to handle that seems like an over kill.

TIA!

Fortunately linux have /dev/cpu/*/msr
Take look at $LINUX_SOURCES/arch/x86/kernel/msr.c to learn how to use it.

Best regards,
Maxim Levitsky

#2 lore raw
Quoted 11 lines · Maxim Levitsky
Quoted 5 lines · On Wednesday, 6 February 2008 05:29:47 Hasan Rashid wrote:

Is there a way to use RDMSR and WRMSR in userspace? I only need to write to one register, writing a module with a userspace piece to handle that seems like an over kill.

TIA!

Fortunately linux have /dev/cpu/*/msr
Take look at $LINUX_SOURCES/arch/x86/kernel/msr.c to learn how to use it.

You might also find these useful:

http://www.kernel.org/pub/linux/utils/cpu/msr-tools/msr-tools-1.1.2.tar.bz2

-hpa