public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* msr(7) manpage
@ 2009-02-22 17:05 Andi Kleen
       [not found] ` <20090222170549.GA23589-qrUzlfsMFqo/4alezvVtWx2eb7JE58TQ@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Andi Kleen @ 2009-02-22 17:05 UTC (permalink / raw)
  To: linux-man-u79uwXL29TY76Z2rM5mHXA,
	mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w

Here's a simple manpage for the msr device.

-Andi


.\" Some sentences copied from comment in arch/x86/kernel/msr.c
.TH MSR 7 2009-02-22 "Linux" "Linux Programmer's Manual"
.SH NAME
msr \- x86 CPU MSR access device
.SH DESCRIPTION
.I /dev/cpu/CPUNUM/msr
allows to read and write the model specific registers (MSRs) of an x86 CPU.
.I CPUNUM 
is the number of the cpu to access as listed in 
.I /proc/cpuinfo.
The register access is done by opening the file and seeking to the MSR number
as offset in the file and then read or write in chunks of 8 bytes.
A larger size than 8 bytes means multiple reads or writes of the 
same register.
.SH NOTES
The 
.I msr
driver is not auto-loaded. On modular kernel you might need to use
.B modprobe msr
to load it explicitely before use.
.SH SEE ALSO
Intel Corporation Intel 64 and IA-32 Architectures Software Developer's Manual Volume 3B Appendix B
for an overview of the Intel CPU MSRs.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: msr(7) manpage
       [not found] ` <20090222170549.GA23589-qrUzlfsMFqo/4alezvVtWx2eb7JE58TQ@public.gmane.org>
@ 2009-02-24  9:40   ` Michael Kerrisk
       [not found]     ` <cfd18e0f0902240140u464fdb95g25f9bb97a49cda63-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2009-03-30 19:29   ` Michael Kerrisk
  1 sibling, 1 reply; 7+ messages in thread
From: Michael Kerrisk @ 2009-02-24  9:40 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

On 2/23/09, Andi Kleen <andi-Vw/NltI1exuRpAAqCnN02g@public.gmane.org> wrote:
> Here's a simple manpage for the msr device.
>
> -Andi

Thanks for this page Andi.

A few comments/questions below.

> .\" Some sentences copied from comment in arch/x86/kernel/msr.c
> .TH MSR 7 2009-02-22 "Linux" "Linux Programmer's Manual"
> .SH NAME
> msr \- x86 CPU MSR access device
> .SH DESCRIPTION
> .I /dev/cpu/CPUNUM/msr
> allows to read and write the model specific registers (MSRs) of an x86 CPU.
> .I CPUNUM
> is the number of the cpu to access as listed in
> .I /proc/cpuinfo.
> The register access is done by opening the file and seeking to the MSR
> number

Could you clarify "seek to the MSR number" == does that mean seek to
offset (MSR_number * 8) or something like that?

> as offset in the file and then read or write in chunks of 8 bytes.
> A larger size than 8 bytes means multiple reads or writes of the
> same register.

What are the semantics of reading the same register multiple times?
Is a read non-destructive?  Do the multiple reads always get the same
value?

Cheers,

Michael

> .SH NOTES
> The
> .I msr
> driver is not auto-loaded. On modular kernel you might need to use
> .B modprobe msr
> to load it explicitely before use.
> .SH SEE ALSO
> Intel Corporation Intel 64 and IA-32 Architectures Software Developer's
> Manual Volume 3B Appendix B
> for an overview of the Intel CPU MSRs.
>


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
git://git.kernel.org/pub/scm/docs/man-pages/man-pages.git
man-pages online: http://www.kernel.org/doc/man-pages/online_pages.html
Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: msr(7) manpage
       [not found]     ` <cfd18e0f0902240140u464fdb95g25f9bb97a49cda63-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2009-02-24  9:44       ` Michael Kerrisk
       [not found]         ` <cfd18e0f0902240144o3f1a9fbew57d880a484eb99de-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2009-02-24 10:14       ` Andi Kleen
  1 sibling, 1 reply; 7+ messages in thread
From: Michael Kerrisk @ 2009-02-24  9:44 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA, H. Peter Anvin

[CC+=hpa]

On 2/24/09, Michael Kerrisk <mtk.manpages-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:
> On 2/23/09, Andi Kleen <andi-Vw/NltI1exuRpAAqCnN02g@public.gmane.org> wrote:
>> Here's a simple manpage for the msr device.
>>
>> -Andi
>
> Thanks for this page Andi.
>
> A few comments/questions below.
>
>> .\" Some sentences copied from comment in arch/x86/kernel/msr.c
>> .TH MSR 7 2009-02-22 "Linux" "Linux Programmer's Manual"
>> .SH NAME
>> msr \- x86 CPU MSR access device
>> .SH DESCRIPTION
>> .I /dev/cpu/CPUNUM/msr
>> allows to read and write the model specific registers (MSRs) of an x86
>> CPU.
>> .I CPUNUM
>> is the number of the cpu to access as listed in
>> .I /proc/cpuinfo.
>> The register access is done by opening the file and seeking to the MSR
>> number
>
> Could you clarify "seek to the MSR number" == does that mean seek to
> offset (MSR_number * 8) or something like that?
>
>> as offset in the file and then read or write in chunks of 8 bytes.
>> A larger size than 8 bytes means multiple reads or writes of the
>> same register.
>
> What are the semantics of reading the same register multiple times?
> Is a read non-destructive?  Do the multiple reads always get the same
> value?
>
> Cheers,
>
> Michael
>
>> .SH NOTES
>> The
>> .I msr
>> driver is not auto-loaded. On modular kernel you might need to use
>> .B modprobe msr
>> to load it explicitely before use.
>> .SH SEE ALSO
>> Intel Corporation Intel 64 and IA-32 Architectures Software Developer's
>> Manual Volume 3B Appendix B
>> for an overview of the Intel CPU MSRs.
>>
>
>
> --
> Michael Kerrisk
> Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
> git://git.kernel.org/pub/scm/docs/man-pages/man-pages.git
> man-pages online: http://www.kernel.org/doc/man-pages/online_pages.html
> Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html
>


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
git://git.kernel.org/pub/scm/docs/man-pages/man-pages.git
man-pages online: http://www.kernel.org/doc/man-pages/online_pages.html
Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: msr(7) manpage
       [not found]     ` <cfd18e0f0902240140u464fdb95g25f9bb97a49cda63-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2009-02-24  9:44       ` Michael Kerrisk
@ 2009-02-24 10:14       ` Andi Kleen
  1 sibling, 0 replies; 7+ messages in thread
From: Andi Kleen @ 2009-02-24 10:14 UTC (permalink / raw)
  To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w
  Cc: Andi Kleen, linux-man-u79uwXL29TY76Z2rM5mHXA

On Tue, Feb 24, 2009 at 10:40:57PM +1300, Michael Kerrisk wrote:
> > .\" Some sentences copied from comment in arch/x86/kernel/msr.c
> > .TH MSR 7 2009-02-22 "Linux" "Linux Programmer's Manual"
> > .SH NAME
> > msr \- x86 CPU MSR access device
> > .SH DESCRIPTION
> > .I /dev/cpu/CPUNUM/msr
> > allows to read and write the model specific registers (MSRs) of an x86 CPU.
> > .I CPUNUM
> > is the number of the cpu to access as listed in
> > .I /proc/cpuinfo.
> > The register access is done by opening the file and seeking to the MSR
> > number
> 
> Could you clarify "seek to the MSR number" == does that mean seek to
> offset (MSR_number * 8) or something like that?

No it means seek to MSR number. Yes the semantics are a little weird.

> 
> > as offset in the file and then read or write in chunks of 8 bytes.
> > A larger size than 8 bytes means multiple reads or writes of the
> > same register.
> 
> What are the semantics of reading the same register multiple times?
> Is a read non-destructive?  Do the multiple reads always get the same
> value?

It depends on the hardware. A typical x86 CPU has hundreds
of different MSRs. Typically they're non destructive, but some
might still change. I intentionally didn't try to cover that but
just added references (although those could be probably also
extended)

BTW what I also forgot was a note that it's root only.

Please just edit it yourself. I assume you'll be doing that anyways.

-Andi

-- 
ak-VuQAYsv1563Yd54FQh9/CA@public.gmane.org -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: msr(7) manpage
       [not found]         ` <cfd18e0f0902240144o3f1a9fbew57d880a484eb99de-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2009-02-24 17:15           ` H. Peter Anvin
  0 siblings, 0 replies; 7+ messages in thread
From: H. Peter Anvin @ 2009-02-24 17:15 UTC (permalink / raw)
  To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w
  Cc: Andi Kleen, linux-man-u79uwXL29TY76Z2rM5mHXA

Michael Kerrisk wrote:
>> Could you clarify "seek to the MSR number" == does that mean seek to
>> offset (MSR_number * 8) or something like that?

No, it means see to offset (MSR_number).

>>> as offset in the file and then read or write in chunks of 8 bytes.
>>> A larger size than 8 bytes means multiple reads or writes of the
>>> same register.
>> What are the semantics of reading the same register multiple times?
>> Is a read non-destructive?  Do the multiple reads always get the same
>> value?

The semantics are entirely dependent on the register itself.  Just like
an I/O device, anything can happen.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: msr(7) manpage
       [not found] ` <20090222170549.GA23589-qrUzlfsMFqo/4alezvVtWx2eb7JE58TQ@public.gmane.org>
  2009-02-24  9:40   ` Michael Kerrisk
@ 2009-03-30 19:29   ` Michael Kerrisk
       [not found]     ` <cfd18e0f0903301229n73c47368v64c1aadc12f58056-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  1 sibling, 1 reply; 7+ messages in thread
From: Michael Kerrisk @ 2009-03-30 19:29 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA, H. Peter Anvin

Hi Andi,

On Mon, Feb 23, 2009 at 6:05 AM, Andi Kleen <andi-Vw/NltI1exuRpAAqCnN02g@public.gmane.org> wrote:
> Here's a simple manpage for the msr device.

I've incorporated this page for man-pages-3.20, with the following changes:

* made some small wording edits to the page
* I added a copyright in your name, and a license -- I used the
verbatim license, since that's what you used at least some times in
the past:
http://www.kernel.org/doc/man-pages/licenses.html#verbatim
* I added text noting that the file is only r/w for root.root.

Please let me know if any of the above should be changed/fixed.

The current draft of the page is below.

Cheers,

Michael


.\" Copyright (c) 2009 by Andi Kleen <andi-Vw/NltI1exuRpAAqCnN02g@public.gmane.org>
.\" Some sentences copied from comments in arch/x86/kernel/msr.c
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date.  The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein.  The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.TH MSR 7 2009-03-31 "Linux" "Linux Programmer's Manual"
.SH NAME
msr \- x86 CPU MSR access device
.SH DESCRIPTION
.I /dev/cpu/CPUNUM/msr
provides an interface to read and write the model-specific
registers (MSRs) of an x86 CPU.
.I CPUNUM
is the number of the CPU to access as listed in
.IR /proc/cpuinfo .

The register access is done by opening the file and seeking
to the MSR number as offset in the file, and then
reading or writing in chunks of 8 bytes.
An I/O transfer of more than 8 bytes means multiple reads or writes
of the same register.

This file is protected so that it can only be read and written by the user
.IR root ,
or members of the group
.IR root .
.SH NOTES
The
.I msr
driver is not auto-loaded.
On modular kernels you might need to use the following command
to load it explicitly before use:

    $ \fImodprobe msr\fP
.SH SEE ALSO
Intel Corporation Intel 64 and IA-32 Architectures
Software Developer's Manual Volume 3B Appendix B
for an overview of the Intel CPU MSRs.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: msr(7) manpage
       [not found]     ` <cfd18e0f0903301229n73c47368v64c1aadc12f58056-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2009-03-30 19:35       ` Michael Kerrisk
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Kerrisk @ 2009-03-30 19:35 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA, H. Peter Anvin

On Tue, Mar 31, 2009 at 8:29 AM, Michael Kerrisk
<mtk.manpages-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:
> Hi Andi,
>
> On Mon, Feb 23, 2009 at 6:05 AM, Andi Kleen <andi-Vw/NltI1exuRpAAqCnN02g@public.gmane.org> wrote:
>> Here's a simple manpage for the msr device.
>
> I've incorporated this page for man-pages-3.20, with the following changes:
>
> * made some small wording edits to the page
> * I added a copyright in your name, and a license -- I used the
> verbatim license, since that's what you used at least some times in
> the past:
> http://www.kernel.org/doc/man-pages/licenses.html#verbatim
> * I added text noting that the file is only r/w for root.root.
>
> Please let me know if any of the above should be changed/fixed.

One further change that I forgot to mention: I placed this page in
Section 4 rather than 7.

Thanks,

Michael
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-03-30 19:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-22 17:05 msr(7) manpage Andi Kleen
     [not found] ` <20090222170549.GA23589-qrUzlfsMFqo/4alezvVtWx2eb7JE58TQ@public.gmane.org>
2009-02-24  9:40   ` Michael Kerrisk
     [not found]     ` <cfd18e0f0902240140u464fdb95g25f9bb97a49cda63-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-02-24  9:44       ` Michael Kerrisk
     [not found]         ` <cfd18e0f0902240144o3f1a9fbew57d880a484eb99de-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-02-24 17:15           ` H. Peter Anvin
2009-02-24 10:14       ` Andi Kleen
2009-03-30 19:29   ` Michael Kerrisk
     [not found]     ` <cfd18e0f0903301229n73c47368v64c1aadc12f58056-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-03-30 19:35       ` Michael Kerrisk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox