从用户态写入 x86 MSR 寄存器

发布于 2024-12-15 14:18:51 字数 227 浏览 6 评论 0原文

我有一个运行 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

指尖上得阳光 2024-12-22 14:18:51

msrtool 通过/dev/cpu/%d/msr读取MSR;如 man 4 msr,也可以使用相同的路径来编写它们。

msrtool reads MSRs via /dev/cpu/%d/msr; as documented in man 4 msr, the same path can be used to write them too.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文