Re: MSR: some random thoughts (it's saturday, sorry if they feel a , little week-endish...)

Stephan Meyer (Stephan.Meyer@pobox.com)
Sun, 16 Nov 1997 10:46:00 +0100 (MET)


On Sat, 15 Nov 1997, Lorenzo M. Catucci wrote:
> Stephan, and the other,
> at first, I think that MSR stuff should go into /proc/_PID_
> pseudofiles, to make the owner of the process able to track its
> performances. Since /proc/_PID_ is owned from the owner of the process,
> all of the security issues could be stopped then. Tell me if I am wrong...

That's a really good idea! It only applies to the performance values
though.
We will still need to place access to the raw MSRs elsewhere.
The performance counters are only a *subset* of the MSRs.

> Second, I think that we should some way attempt to mimic the
> performance saver idea from FPU context switch: don't save MSR status when
> unneeded: just add a single flag to signal that some MSR was set/read, and
> then do the expensive MSR save in context switch only if the flag is
> enabled. I fear many people would otherwise avoid compiling MSR support
> into the kernel.

Saving/restoring the *performance counters* will be necessary on each
context switch, I'm afraid.
However, we could add sort of a "flag file" to the <PID> directory, so
that the owner of the process could indicate whether performance tracking
should occur. He would have to specify the events to be counted as well,
anyway. If the performance is of no interest, there need not be saving of
the performance counters on context switch.

Please don't confuse "MSR" and "performance counter".

> l.

------------------------------------------------
Stephan.Meyer@pobox.com
meyerst@informatik.uni-muenchen.de
http://pobox.com/~stephan.meyer/
2A 64 F0 73 02 91 10 FC 18 CC 83 1E E2 2C 7E 79

So what would an angel say
The devil wants to know