> Followup to: <k2g1p0yn1p.fsf@zero.aec.at>
> By author: Andi Kleen <ak@muc.de>
> In newsgroup: linux.dev.kernel
> > >
> > > a) character device
> > >
> > > This is the currently implemented method.
> > > It was criticized by Linus and I get the problem. I believe that
> > > this way, it would be very easy to grant specific users access to
> > > the MSR registers.
> >
> > Why was it criticized? IMHO it's the best solution because it gives
> > all the flexibility of unix permissions for the access control.
> > AFAIK OpenBSD does it the same way.
> >
>
> Only if you take SMP into account (this applies to all methods.) It's
> no good if on an SMP machine you effectively end up setting MSR's on
> any random processor, which may change without notice.
>
> We may want to have a "cpu X only" system call (schedule only on a
> specific processor) for things that use per-processor features, such
> as RDTSC.)
Just give /dev/msr a major number and use minor 0 for CPU#0, 1 for CPU#1
etc.
-Andi