从用户态写入 x86 MSR 寄存器
我有一个运行 Linux 的嵌入式系统,我需要在启动时写入特定的 MSR 寄存器,以修复硬件问题。
编写内核模块是一个明显的选择,但是有多个内核版本(全部都是 2.6.xx),并且系统中的 insmod/modprobe 实用程序不支持 -f 标志。因此,我需要编译和分发该模块的一堆版本,即使它们没有使用任何内核 API。如果可能的话我想避免这种情况。
有什么我可能会忽略的选择吗?
谢谢!
I have an embedded system running Linux where I need to write to a specific MSR register at boot time, in order to fix a hardware issue.
Writing a kernel module is an obvious option, however there are several kernel versions around (all of them 2.6.xx) and the insmod/modprobe utils in the system do not have support for the -f flag. Thus I would need to compile and distribute a bunch of versions of the module, even when they are not using any kernel API. I would like to avoid this if possible.
Are there any options I may be overlooking?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
msrtool 通过
/dev/cpu/%d/msr
读取MSR;如man 4 msr
,也可以使用相同的路径来编写它们。
msrtool reads MSRs via
/dev/cpu/%d/msr
; as documented inman 4 msr
, the same path can be used to write them too.