<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/arch/x86/include/asm/msr.h, branch v3.3.1</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>x86: Document rdmsr_safe restrictions</title>
<updated>2011-12-05T13:28:37+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>borislav.petkov@amd.com</email>
</author>
<published>2011-12-05T13:28:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ce37defc0f6673f5ca2c92ed5cfcaf290ae7dd16'/>
<id>ce37defc0f6673f5ca2c92ed5cfcaf290ae7dd16</id>
<content type='text'>
Recently, I got bitten by using rdmsr_safe too early in the boot
process. Document its shortcomings for future reference.

Link: http://lkml.kernel.org/r/4ED5B70F.606@lwfinger.net
Signed-off-by: Borislav Petkov &lt;borislav.petkov@amd.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Recently, I got bitten by using rdmsr_safe too early in the boot
process. Document its shortcomings for future reference.

Link: http://lkml.kernel.org/r/4ED5B70F.606@lwfinger.net
Signed-off-by: Borislav Petkov &lt;borislav.petkov@amd.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86, gcc-4.6: Avoid unused by set variables in rdmsr</title>
<updated>2010-07-20T22:38:18+00:00</updated>
<author>
<name>Andi Kleen</name>
<email>andi@firstfloor.org</email>
</author>
<published>2010-07-20T22:19:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5f755293ca61520b70b11afe1b1d6e1635cb6c00'/>
<id>5f755293ca61520b70b11afe1b1d6e1635cb6c00</id>
<content type='text'>
Avoids quite a lot of warnings with a gcc 4.6 -Wall build
because this happens in a commonly used header file (apic.h)

Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;
LKML-Reference: &lt;201007202219.o6KMJme6021066@imap1.linux-foundation.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: H. Peter Anvin &lt;hpa@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Avoids quite a lot of warnings with a gcc 4.6 -Wall build
because this happens in a commonly used header file (apic.h)

Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;
LKML-Reference: &lt;201007202219.o6KMJme6021066@imap1.linux-foundation.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: H. Peter Anvin &lt;hpa@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86, msr: msrs_alloc/free for CONFIG_SMP=n</title>
<updated>2009-12-16T23:36:32+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>petkovbb@googlemail.com</email>
</author>
<published>2009-12-16T23:16:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6ede31e03084ee084bcee073ef3d1136f68d0906'/>
<id>6ede31e03084ee084bcee073ef3d1136f68d0906</id>
<content type='text'>
Randy Dunlap reported the following build error:

"When CONFIG_SMP=n, CONFIG_X86_MSR=m:

ERROR: "msrs_free" [drivers/edac/amd64_edac_mod.ko] undefined!
ERROR: "msrs_alloc" [drivers/edac/amd64_edac_mod.ko] undefined!"

This is due to the fact that &lt;arch/x86/lib/msr.c&gt; is conditioned on
CONFIG_SMP and in the UP case we have only the stubs in the header.
Fork off SMP functionality into a new file (msr-smp.c) and build
msrs_{alloc,free} unconditionally.

Reported-by: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Signed-off-by: Borislav Petkov &lt;petkovbb@gmail.com&gt;
LKML-Reference: &lt;20091216231625.GD27228@liondog.tnic&gt;
Signed-off-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Randy Dunlap reported the following build error:

"When CONFIG_SMP=n, CONFIG_X86_MSR=m:

ERROR: "msrs_free" [drivers/edac/amd64_edac_mod.ko] undefined!
ERROR: "msrs_alloc" [drivers/edac/amd64_edac_mod.ko] undefined!"

This is due to the fact that &lt;arch/x86/lib/msr.c&gt; is conditioned on
CONFIG_SMP and in the UP case we have only the stubs in the header.
Fork off SMP functionality into a new file (msr-smp.c) and build
msrs_{alloc,free} unconditionally.

Reported-by: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Signed-off-by: Borislav Petkov &lt;petkovbb@gmail.com&gt;
LKML-Reference: &lt;20091216231625.GD27228@liondog.tnic&gt;
Signed-off-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86: Add IA32_TSC_AUX MSR and use it</title>
<updated>2009-12-16T08:02:42+00:00</updated>
<author>
<name>Sheng Yang</name>
<email>sheng@linux.intel.com</email>
</author>
<published>2009-12-16T05:48:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5df974009fe513c664303de24725ea0f8b47f12e'/>
<id>5df974009fe513c664303de24725ea0f8b47f12e</id>
<content type='text'>
Clean up write_tsc() and write_tscp_aux() by replacing
hardcoded values.

No change in functionality.

Signed-off-by: Sheng Yang &lt;sheng@linux.intel.com&gt;
Cc: Avi Kivity &lt;avi@redhat.com&gt;
Cc: Marcelo Tosatti &lt;mtosatti@redhat.com&gt;
LKML-Reference: &lt;1260942485-19156-4-git-send-email-sheng@linux.intel.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Clean up write_tsc() and write_tscp_aux() by replacing
hardcoded values.

No change in functionality.

Signed-off-by: Sheng Yang &lt;sheng@linux.intel.com&gt;
Cc: Avi Kivity &lt;avi@redhat.com&gt;
Cc: Marcelo Tosatti &lt;mtosatti@redhat.com&gt;
LKML-Reference: &lt;1260942485-19156-4-git-send-email-sheng@linux.intel.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86, msr: Add support for non-contiguous cpumasks</title>
<updated>2009-12-11T18:59:21+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>borislav.petkov@amd.com</email>
</author>
<published>2009-12-11T17:14:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=505422517d3f126bb939439e9d15dece94e11d2c'/>
<id>505422517d3f126bb939439e9d15dece94e11d2c</id>
<content type='text'>
The current rd/wrmsr_on_cpus helpers assume that the supplied
cpumasks are contiguous. However, there are machines out there
like some K8 multinode Opterons which have a non-contiguous core
enumeration on each node (e.g. cores 0,2 on node 0 instead of 0,1), see
http://www.gossamer-threads.com/lists/linux/kernel/1160268.

This patch fixes out-of-bounds writes (see URL above) by adding per-CPU
msr structs which are used on the respective cores.

Additionally, two helpers, msrs_{alloc,free}, are provided for use by
the callers of the MSR accessors.

Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
Cc: Aristeu Rozanski &lt;aris@redhat.com&gt;
Cc: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Cc: Doug Thompson &lt;dougthompson@xmission.com&gt;
Signed-off-by: Borislav Petkov &lt;borislav.petkov@amd.com&gt;
LKML-Reference: &lt;20091211171440.GD31998@aftab&gt;
Signed-off-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The current rd/wrmsr_on_cpus helpers assume that the supplied
cpumasks are contiguous. However, there are machines out there
like some K8 multinode Opterons which have a non-contiguous core
enumeration on each node (e.g. cores 0,2 on node 0 instead of 0,1), see
http://www.gossamer-threads.com/lists/linux/kernel/1160268.

This patch fixes out-of-bounds writes (see URL above) by adding per-CPU
msr structs which are used on the respective cores.

Additionally, two helpers, msrs_{alloc,free}, are provided for use by
the callers of the MSR accessors.

Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
Cc: Aristeu Rozanski &lt;aris@redhat.com&gt;
Cc: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Cc: Doug Thompson &lt;dougthompson@xmission.com&gt;
Signed-off-by: Borislav Petkov &lt;borislav.petkov@amd.com&gt;
LKML-Reference: &lt;20091211171440.GD31998@aftab&gt;
Signed-off-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86, msr, cpumask: Use struct cpumask rather than the deprecated cpumask_t</title>
<updated>2009-11-08T10:58:38+00:00</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2009-11-05T12:15:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0d0fbbddcc27c062815732b38c44b544e656c799'/>
<id>0d0fbbddcc27c062815732b38c44b544e656c799</id>
<content type='text'>
This makes the declarations match the definitions, which already
use 'struct cpumask'.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Acked-by: Borislav Petkov &lt;borislav.petkov@amd.com&gt;
LKML-Reference: &lt;200911052245.41803.rusty@rustcorp.com.au&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes the declarations match the definitions, which already
use 'struct cpumask'.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Acked-by: Borislav Petkov &lt;borislav.petkov@amd.com&gt;
LKML-Reference: &lt;200911052245.41803.rusty@rustcorp.com.au&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86, msr: Unify rdmsr_on_cpus/wrmsr_on_cpus</title>
<updated>2009-09-15T07:15:54+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>borislav.petkov@amd.com</email>
</author>
<published>2009-07-30T09:10:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b8a4754147d61f5359a765a3afd3eb03012aa052'/>
<id>b8a4754147d61f5359a765a3afd3eb03012aa052</id>
<content type='text'>
Since rdmsr_on_cpus and wrmsr_on_cpus are almost identical, unify them
into a common __rwmsr_on_cpus helper thus avoiding code duplication.

While at it, convert cpumask_t's to const struct cpumask *.

Signed-off-by: Borislav Petkov &lt;borislav.petkov@amd.com&gt;
Signed-off-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since rdmsr_on_cpus and wrmsr_on_cpus are almost identical, unify them
into a common __rwmsr_on_cpus helper thus avoiding code duplication.

While at it, convert cpumask_t's to const struct cpumask *.

Signed-off-by: Borislav Petkov &lt;borislav.petkov@amd.com&gt;
Signed-off-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86, msr: Export the register-setting MSR functions via /dev/*/msr</title>
<updated>2009-08-31T23:16:04+00:00</updated>
<author>
<name>H. Peter Anvin</name>
<email>hpa@zytor.com</email>
</author>
<published>2009-08-31T21:16:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ff55df53dfdd338906c8ba9d1f4a759b86b869d5'/>
<id>ff55df53dfdd338906c8ba9d1f4a759b86b869d5</id>
<content type='text'>
Make it possible to access the all-register-setting/getting MSR
functions via the MSR driver.  This is implemented as an ioctl() on
the standard MSR device node.

Signed-off-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Borislav Petkov &lt;petkovbb@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make it possible to access the all-register-setting/getting MSR
functions via the MSR driver.  This is implemented as an ioctl() on
the standard MSR device node.

Signed-off-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Borislav Petkov &lt;petkovbb@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86, msr: Create _on_cpu helpers for {rw,wr}msr_safe_regs()</title>
<updated>2009-08-31T23:15:57+00:00</updated>
<author>
<name>H. Peter Anvin</name>
<email>hpa@zytor.com</email>
</author>
<published>2009-08-31T21:13:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8b956bf1f0f2b552ed93cf6cafe823edff298b3b'/>
<id>8b956bf1f0f2b552ed93cf6cafe823edff298b3b</id>
<content type='text'>
Create _on_cpu helpers for {rw,wr}msr_safe_regs() analogously with the
other MSR functions.  This will be necessary to add support for these
to the MSR driver.

Signed-off-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Borislav Petkov &lt;petkovbb@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Create _on_cpu helpers for {rw,wr}msr_safe_regs() analogously with the
other MSR functions.  This will be necessary to add support for these
to the MSR driver.

Signed-off-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Borislav Petkov &lt;petkovbb@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86, msr: Have the _safe MSR functions return -EIO, not -EFAULT</title>
<updated>2009-08-31T22:15:23+00:00</updated>
<author>
<name>H. Peter Anvin</name>
<email>hpa@zytor.com</email>
</author>
<published>2009-08-31T21:23:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0cc0213e73af5963eca259c84876937c20689dbd'/>
<id>0cc0213e73af5963eca259c84876937c20689dbd</id>
<content type='text'>
For some reason, the _safe MSR functions returned -EFAULT, not -EIO.
However, the only user which cares about the return code as anything
other than a boolean is the MSR driver, which wants -EIO.  Change it
to -EIO across the board.

Signed-off-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Jeremy Fitzhardinge &lt;jeremy@xensource.com&gt;
Cc: Chris Wright &lt;chrisw@sous-sol.org&gt;
Cc: Alok Kataria &lt;akataria@vmware.com&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For some reason, the _safe MSR functions returned -EFAULT, not -EIO.
However, the only user which cares about the return code as anything
other than a boolean is the MSR driver, which wants -EIO.  Change it
to -EIO across the board.

Signed-off-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Jeremy Fitzhardinge &lt;jeremy@xensource.com&gt;
Cc: Chris Wright &lt;chrisw@sous-sol.org&gt;
Cc: Alok Kataria &lt;akataria@vmware.com&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</pre>
</div>
</content>
</entry>
</feed>
