https://bugs.kde.org/show_bug.cgi?id=126348

--- Comment #5 from Vince Weaver <vincent.wea...@maine.edu> ---
(In reply to Julian Seward from comment #4) 
> IIUC (and correct me if I am wrong): rdpmc support is something that
> is either enabled or disabled at a process granularity (or larger), but
> doesn't change whilst a process runs.

It's a bit more complicated than that :(

If you try to do a rdpmc and rdpmc is disabled in the CR4 register, you
actually get a GPF:

[419335.853268] traps: rdpmc_invalid[31138] general protection fault
ip:56259dd2d056 sp:7fffed404ac0 error:0 in rdpmc_invalid[56259dd2d000+1000]

The CR4 register status can change while the process is running.  There's
actually 3 states (I think) that happen on Linux, and this is configurable via
/sys/devices/cpu/rdpmc

0. rdpmc disabled for everyone
1. rdpmc only enabled if a perf_event_open() enabled hardware event is active
2. rdpmc globally enabled for everyone

I think "1" is currently the default on modern Linux kernels.  With this
setting, the CR4 bit value might change while the program is running, it is
enabled at perf_event_open() and disabled after close() of that event.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to