https://github.com/softdevteam/user_rdpmc
Enable RDPMC from Linux userspace.
https://github.com/softdevteam/user_rdpmc
Last synced: 3 months ago
JSON representation
Enable RDPMC from Linux userspace.
- Host: GitHub
- URL: https://github.com/softdevteam/user_rdpmc
- Owner: softdevteam
- License: other
- Created: 2016-08-23T15:53:40.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-08-23T16:24:50.000Z (almost 9 years ago)
- Last Synced: 2025-03-23T19:44:51.180Z (4 months ago)
- Language: C
- Homepage:
- Size: 7.81 KB
- Stars: 8
- Watchers: 7
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
The user_rdpmc Linux Kernel Module
==================================A simple Linux kernel module which, when loaded, allows ring 3 (userspace)
programs to use the `RDPMC` assembler instruction by flipping the `PMC` flag in
the `CR4` register.This module only makes sense on an x86 machine.
Building
--------Install Linux kernel headers and run `make`.
The build currently assumes a Debian Linux system. You may have to tweak some
paths in the Makefile for other distributions.Using
-----First run the `test_rdpmc` program and check that the program crashes, thus
confirming that the userspace cannot invoke `RDPMC`.Insert the module with `sudo insmod user_rdpmc.ko`. The dmesg buffer should
then display a message similar to:```
[ 5016.743382] Enabling RDPMC from ring 3 for 4 CPUs
```Now if you re-run the test program, it should not crash. Userspace can now
invoke `RDPMC`.If you remove the `user_rdpmc` module, userspace is then denied use of `RDPMC`.