<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/arch/x86/kernel/cpu/mcheck/mce_intel.c, branch v3.10.76</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/mce: Rework cmci_rediscover() to play well with CPU hotplug</title>
<updated>2013-04-02T21:04:01+00:00</updated>
<author>
<name>Srivatsa S. Bhat</name>
<email>srivatsa.bhat@linux.vnet.ibm.com</email>
</author>
<published>2013-03-20T10:01:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7a0c819d28f5c91955854e048766d6afef7c8a3d'/>
<id>7a0c819d28f5c91955854e048766d6afef7c8a3d</id>
<content type='text'>
Dave Jones reports that offlining a CPU leads to this trace:

numa_remove_cpu cpu 1 node 0: mask now 0,2-3
smpboot: CPU 1 is now offline
BUG: using smp_processor_id() in preemptible [00000000] code:
cpu-offline.sh/10591
caller is cmci_rediscover+0x6a/0xe0
Pid: 10591, comm: cpu-offline.sh Not tainted 3.9.0-rc3+ #2
Call Trace:
 [&lt;ffffffff81333bbd&gt;] debug_smp_processor_id+0xdd/0x100
 [&lt;ffffffff8101edba&gt;] cmci_rediscover+0x6a/0xe0
 [&lt;ffffffff815f5b9f&gt;] mce_cpu_callback+0x19d/0x1ae
 [&lt;ffffffff8160ea66&gt;] notifier_call_chain+0x66/0x150
 [&lt;ffffffff8107ad7e&gt;] __raw_notifier_call_chain+0xe/0x10
 [&lt;ffffffff8104c2e3&gt;] cpu_notify+0x23/0x50
 [&lt;ffffffff8104c31e&gt;] cpu_notify_nofail+0xe/0x20
 [&lt;ffffffff815ef082&gt;] _cpu_down+0x302/0x350
 [&lt;ffffffff815ef106&gt;] cpu_down+0x36/0x50
 [&lt;ffffffff815f1c9d&gt;] store_online+0x8d/0xd0
 [&lt;ffffffff813edc48&gt;] dev_attr_store+0x18/0x30
 [&lt;ffffffff81226eeb&gt;] sysfs_write_file+0xdb/0x150
 [&lt;ffffffff811adfb2&gt;] vfs_write+0xa2/0x170
 [&lt;ffffffff811ae16c&gt;] sys_write+0x4c/0xa0
 [&lt;ffffffff81613019&gt;] system_call_fastpath+0x16/0x1b

However, a look at cmci_rediscover shows that it can be simplified quite
a bit, apart from solving the above issue. It invokes functions that
take spin locks with interrupts disabled, and hence it can run in atomic
context. Also, it is run in the CPU_POST_DEAD phase, so the dying CPU
is already dead and out of the cpu_online_mask. So take these points into
account and simplify the code, and thereby also fix the above issue.

Reported-by: Dave Jones &lt;davej@redhat.com&gt;
Signed-off-by: Srivatsa S. Bhat &lt;srivatsa.bhat@linux.vnet.ibm.com&gt;
Signed-off-by: Tony Luck &lt;tony.luck@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Dave Jones reports that offlining a CPU leads to this trace:

numa_remove_cpu cpu 1 node 0: mask now 0,2-3
smpboot: CPU 1 is now offline
BUG: using smp_processor_id() in preemptible [00000000] code:
cpu-offline.sh/10591
caller is cmci_rediscover+0x6a/0xe0
Pid: 10591, comm: cpu-offline.sh Not tainted 3.9.0-rc3+ #2
Call Trace:
 [&lt;ffffffff81333bbd&gt;] debug_smp_processor_id+0xdd/0x100
 [&lt;ffffffff8101edba&gt;] cmci_rediscover+0x6a/0xe0
 [&lt;ffffffff815f5b9f&gt;] mce_cpu_callback+0x19d/0x1ae
 [&lt;ffffffff8160ea66&gt;] notifier_call_chain+0x66/0x150
 [&lt;ffffffff8107ad7e&gt;] __raw_notifier_call_chain+0xe/0x10
 [&lt;ffffffff8104c2e3&gt;] cpu_notify+0x23/0x50
 [&lt;ffffffff8104c31e&gt;] cpu_notify_nofail+0xe/0x20
 [&lt;ffffffff815ef082&gt;] _cpu_down+0x302/0x350
 [&lt;ffffffff815ef106&gt;] cpu_down+0x36/0x50
 [&lt;ffffffff815f1c9d&gt;] store_online+0x8d/0xd0
 [&lt;ffffffff813edc48&gt;] dev_attr_store+0x18/0x30
 [&lt;ffffffff81226eeb&gt;] sysfs_write_file+0xdb/0x150
 [&lt;ffffffff811adfb2&gt;] vfs_write+0xa2/0x170
 [&lt;ffffffff811ae16c&gt;] sys_write+0x4c/0xa0
 [&lt;ffffffff81613019&gt;] system_call_fastpath+0x16/0x1b

However, a look at cmci_rediscover shows that it can be simplified quite
a bit, apart from solving the above issue. It invokes functions that
take spin locks with interrupts disabled, and hence it can run in atomic
context. Also, it is run in the CPU_POST_DEAD phase, so the dying CPU
is already dead and out of the cpu_online_mask. So take these points into
account and simplify the code, and thereby also fix the above issue.

Reported-by: Dave Jones &lt;davej@redhat.com&gt;
Signed-off-by: Srivatsa S. Bhat &lt;srivatsa.bhat@linux.vnet.ibm.com&gt;
Signed-off-by: Tony Luck &lt;tony.luck@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'x86-ras-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2012-12-14T17:59:59+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-12-14T17:59:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2d9c8b5d6a5f5f7a6111cc68a050b5b44729376b'/>
<id>2d9c8b5d6a5f5f7a6111cc68a050b5b44729376b</id>
<content type='text'>
Pull x86 RAS update from Ingo Molnar:
 "Rework all config variables used throughout the MCA code and collect
  them together into a mca_config struct.  This keeps them tightly and
  neatly packed together instead of spilled all over the place.

  Then, convert those which are used as booleans into real booleans and
  save some space.  These bits are exposed via
     /sys/devices/system/machinecheck/machinecheck*/"

* 'x86-ras-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86, MCA: Finish mca_config conversion
  x86, MCA: Convert the next three variables batch
  x86, MCA: Convert rip_msr, mce_bootlog, monarch_timeout
  x86, MCA: Convert dont_log_ce, banks and tolerant
  drivers/base: Add a DEVICE_BOOL_ATTR macro
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull x86 RAS update from Ingo Molnar:
 "Rework all config variables used throughout the MCA code and collect
  them together into a mca_config struct.  This keeps them tightly and
  neatly packed together instead of spilled all over the place.

  Then, convert those which are used as booleans into real booleans and
  save some space.  These bits are exposed via
     /sys/devices/system/machinecheck/machinecheck*/"

* 'x86-ras-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86, MCA: Finish mca_config conversion
  x86, MCA: Convert the next three variables batch
  x86, MCA: Convert rip_msr, mce_bootlog, monarch_timeout
  x86, MCA: Convert dont_log_ce, banks and tolerant
  drivers/base: Add a DEVICE_BOOL_ATTR macro
</pre>
</div>
</content>
</entry>
<entry>
<title>x86/mce: Do not change worker's running cpu in cmci_rediscover().</title>
<updated>2012-10-30T21:38:12+00:00</updated>
<author>
<name>Tang Chen</name>
<email>tangchen@cn.fujitsu.com</email>
</author>
<published>2012-10-29T03:01:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=85b97637bb40a9f486459dd254598759af9c3d50'/>
<id>85b97637bb40a9f486459dd254598759af9c3d50</id>
<content type='text'>
cmci_rediscover() used set_cpus_allowed_ptr() to change the current process's
running cpu, and migrate itself to the dest cpu. But worker processes are not
allowed to be migrated. If current is a worker, the worker will be migrated to
another cpu, but the corresponding  worker_pool is still on the original cpu.

In this case, the following BUG_ON in try_to_wake_up_local() will be triggered:
BUG_ON(rq != this_rq());

This will cause the kernel panic. The call trace is like the following:

[ 6155.451107] ------------[ cut here ]------------
[ 6155.452019] kernel BUG at kernel/sched/core.c:1654!
......
[ 6155.452019] RIP: 0010:[&lt;ffffffff810add15&gt;]  [&lt;ffffffff810add15&gt;] try_to_wake_up_local+0x115/0x130
......
[ 6155.452019] Call Trace:
[ 6155.452019]  [&lt;ffffffff8166fc14&gt;] __schedule+0x764/0x880
[ 6155.452019]  [&lt;ffffffff81670059&gt;] schedule+0x29/0x70
[ 6155.452019]  [&lt;ffffffff8166de65&gt;] schedule_timeout+0x235/0x2d0
[ 6155.452019]  [&lt;ffffffff810db57d&gt;] ? mark_held_locks+0x8d/0x140
[ 6155.452019]  [&lt;ffffffff810dd463&gt;] ? __lock_release+0x133/0x1a0
[ 6155.452019]  [&lt;ffffffff81671c50&gt;] ? _raw_spin_unlock_irq+0x30/0x50
[ 6155.452019]  [&lt;ffffffff810db8f5&gt;] ? trace_hardirqs_on_caller+0x105/0x190
[ 6155.452019]  [&lt;ffffffff8166fefb&gt;] wait_for_common+0x12b/0x180
[ 6155.452019]  [&lt;ffffffff810b0b30&gt;] ? try_to_wake_up+0x2f0/0x2f0
[ 6155.452019]  [&lt;ffffffff8167002d&gt;] wait_for_completion+0x1d/0x20
[ 6155.452019]  [&lt;ffffffff8110008a&gt;] stop_one_cpu+0x8a/0xc0
[ 6155.452019]  [&lt;ffffffff810abd40&gt;] ? __migrate_task+0x1a0/0x1a0
[ 6155.452019]  [&lt;ffffffff810a6ab8&gt;] ? complete+0x28/0x60
[ 6155.452019]  [&lt;ffffffff810b0fd8&gt;] set_cpus_allowed_ptr+0x128/0x130
[ 6155.452019]  [&lt;ffffffff81036785&gt;] cmci_rediscover+0xf5/0x140
[ 6155.452019]  [&lt;ffffffff816643c0&gt;] mce_cpu_callback+0x18d/0x19d
[ 6155.452019]  [&lt;ffffffff81676187&gt;] notifier_call_chain+0x67/0x150
[ 6155.452019]  [&lt;ffffffff810a03de&gt;] __raw_notifier_call_chain+0xe/0x10
[ 6155.452019]  [&lt;ffffffff81070470&gt;] __cpu_notify+0x20/0x40
[ 6155.452019]  [&lt;ffffffff810704a5&gt;] cpu_notify_nofail+0x15/0x30
[ 6155.452019]  [&lt;ffffffff81655182&gt;] _cpu_down+0x262/0x2e0
[ 6155.452019]  [&lt;ffffffff81655236&gt;] cpu_down+0x36/0x50
[ 6155.452019]  [&lt;ffffffff813d3eaa&gt;] acpi_processor_remove+0x50/0x11e
[ 6155.452019]  [&lt;ffffffff813a6978&gt;] acpi_device_remove+0x90/0xb2
[ 6155.452019]  [&lt;ffffffff8143cbec&gt;] __device_release_driver+0x7c/0xf0
[ 6155.452019]  [&lt;ffffffff8143cd6f&gt;] device_release_driver+0x2f/0x50
[ 6155.452019]  [&lt;ffffffff813a7870&gt;] acpi_bus_remove+0x32/0x6d
[ 6155.452019]  [&lt;ffffffff813a7932&gt;] acpi_bus_trim+0x87/0xee
[ 6155.452019]  [&lt;ffffffff813a7a21&gt;] acpi_bus_hot_remove_device+0x88/0x16b
[ 6155.452019]  [&lt;ffffffff813a33ee&gt;] acpi_os_execute_deferred+0x27/0x34
[ 6155.452019]  [&lt;ffffffff81090589&gt;] process_one_work+0x219/0x680
[ 6155.452019]  [&lt;ffffffff81090528&gt;] ? process_one_work+0x1b8/0x680
[ 6155.452019]  [&lt;ffffffff813a33c7&gt;] ? acpi_os_wait_events_complete+0x23/0x23
[ 6155.452019]  [&lt;ffffffff810923be&gt;] worker_thread+0x12e/0x320
[ 6155.452019]  [&lt;ffffffff81092290&gt;] ? manage_workers+0x110/0x110
[ 6155.452019]  [&lt;ffffffff81098396&gt;] kthread+0xc6/0xd0
[ 6155.452019]  [&lt;ffffffff8167c4c4&gt;] kernel_thread_helper+0x4/0x10
[ 6155.452019]  [&lt;ffffffff81671f30&gt;] ? retint_restore_args+0x13/0x13
[ 6155.452019]  [&lt;ffffffff810982d0&gt;] ? __init_kthread_worker+0x70/0x70
[ 6155.452019]  [&lt;ffffffff8167c4c0&gt;] ? gs_change+0x13/0x13

This patch removes the set_cpus_allowed_ptr() call, and put the cmci rediscover
jobs onto all the other cpus using system_wq. This could bring some delay for
the jobs.

Signed-off-by: Tang Chen &lt;tangchen@cn.fujitsu.com&gt;
Signed-off-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;
Signed-off-by: Tony Luck &lt;tony.luck@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
cmci_rediscover() used set_cpus_allowed_ptr() to change the current process's
running cpu, and migrate itself to the dest cpu. But worker processes are not
allowed to be migrated. If current is a worker, the worker will be migrated to
another cpu, but the corresponding  worker_pool is still on the original cpu.

In this case, the following BUG_ON in try_to_wake_up_local() will be triggered:
BUG_ON(rq != this_rq());

This will cause the kernel panic. The call trace is like the following:

[ 6155.451107] ------------[ cut here ]------------
[ 6155.452019] kernel BUG at kernel/sched/core.c:1654!
......
[ 6155.452019] RIP: 0010:[&lt;ffffffff810add15&gt;]  [&lt;ffffffff810add15&gt;] try_to_wake_up_local+0x115/0x130
......
[ 6155.452019] Call Trace:
[ 6155.452019]  [&lt;ffffffff8166fc14&gt;] __schedule+0x764/0x880
[ 6155.452019]  [&lt;ffffffff81670059&gt;] schedule+0x29/0x70
[ 6155.452019]  [&lt;ffffffff8166de65&gt;] schedule_timeout+0x235/0x2d0
[ 6155.452019]  [&lt;ffffffff810db57d&gt;] ? mark_held_locks+0x8d/0x140
[ 6155.452019]  [&lt;ffffffff810dd463&gt;] ? __lock_release+0x133/0x1a0
[ 6155.452019]  [&lt;ffffffff81671c50&gt;] ? _raw_spin_unlock_irq+0x30/0x50
[ 6155.452019]  [&lt;ffffffff810db8f5&gt;] ? trace_hardirqs_on_caller+0x105/0x190
[ 6155.452019]  [&lt;ffffffff8166fefb&gt;] wait_for_common+0x12b/0x180
[ 6155.452019]  [&lt;ffffffff810b0b30&gt;] ? try_to_wake_up+0x2f0/0x2f0
[ 6155.452019]  [&lt;ffffffff8167002d&gt;] wait_for_completion+0x1d/0x20
[ 6155.452019]  [&lt;ffffffff8110008a&gt;] stop_one_cpu+0x8a/0xc0
[ 6155.452019]  [&lt;ffffffff810abd40&gt;] ? __migrate_task+0x1a0/0x1a0
[ 6155.452019]  [&lt;ffffffff810a6ab8&gt;] ? complete+0x28/0x60
[ 6155.452019]  [&lt;ffffffff810b0fd8&gt;] set_cpus_allowed_ptr+0x128/0x130
[ 6155.452019]  [&lt;ffffffff81036785&gt;] cmci_rediscover+0xf5/0x140
[ 6155.452019]  [&lt;ffffffff816643c0&gt;] mce_cpu_callback+0x18d/0x19d
[ 6155.452019]  [&lt;ffffffff81676187&gt;] notifier_call_chain+0x67/0x150
[ 6155.452019]  [&lt;ffffffff810a03de&gt;] __raw_notifier_call_chain+0xe/0x10
[ 6155.452019]  [&lt;ffffffff81070470&gt;] __cpu_notify+0x20/0x40
[ 6155.452019]  [&lt;ffffffff810704a5&gt;] cpu_notify_nofail+0x15/0x30
[ 6155.452019]  [&lt;ffffffff81655182&gt;] _cpu_down+0x262/0x2e0
[ 6155.452019]  [&lt;ffffffff81655236&gt;] cpu_down+0x36/0x50
[ 6155.452019]  [&lt;ffffffff813d3eaa&gt;] acpi_processor_remove+0x50/0x11e
[ 6155.452019]  [&lt;ffffffff813a6978&gt;] acpi_device_remove+0x90/0xb2
[ 6155.452019]  [&lt;ffffffff8143cbec&gt;] __device_release_driver+0x7c/0xf0
[ 6155.452019]  [&lt;ffffffff8143cd6f&gt;] device_release_driver+0x2f/0x50
[ 6155.452019]  [&lt;ffffffff813a7870&gt;] acpi_bus_remove+0x32/0x6d
[ 6155.452019]  [&lt;ffffffff813a7932&gt;] acpi_bus_trim+0x87/0xee
[ 6155.452019]  [&lt;ffffffff813a7a21&gt;] acpi_bus_hot_remove_device+0x88/0x16b
[ 6155.452019]  [&lt;ffffffff813a33ee&gt;] acpi_os_execute_deferred+0x27/0x34
[ 6155.452019]  [&lt;ffffffff81090589&gt;] process_one_work+0x219/0x680
[ 6155.452019]  [&lt;ffffffff81090528&gt;] ? process_one_work+0x1b8/0x680
[ 6155.452019]  [&lt;ffffffff813a33c7&gt;] ? acpi_os_wait_events_complete+0x23/0x23
[ 6155.452019]  [&lt;ffffffff810923be&gt;] worker_thread+0x12e/0x320
[ 6155.452019]  [&lt;ffffffff81092290&gt;] ? manage_workers+0x110/0x110
[ 6155.452019]  [&lt;ffffffff81098396&gt;] kthread+0xc6/0xd0
[ 6155.452019]  [&lt;ffffffff8167c4c4&gt;] kernel_thread_helper+0x4/0x10
[ 6155.452019]  [&lt;ffffffff81671f30&gt;] ? retint_restore_args+0x13/0x13
[ 6155.452019]  [&lt;ffffffff810982d0&gt;] ? __init_kthread_worker+0x70/0x70
[ 6155.452019]  [&lt;ffffffff8167c4c0&gt;] ? gs_change+0x13/0x13

This patch removes the set_cpus_allowed_ptr() call, and put the cmci rediscover
jobs onto all the other cpus using system_wq. This could bring some delay for
the jobs.

Signed-off-by: Tang Chen &lt;tangchen@cn.fujitsu.com&gt;
Signed-off-by: Miao Xie &lt;miaox@cn.fujitsu.com&gt;
Signed-off-by: Tony Luck &lt;tony.luck@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86, MCA: Finish mca_config conversion</title>
<updated>2012-10-26T12:37:58+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>bp@alien8.de</email>
</author>
<published>2012-10-17T10:05:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1462594bf2866c1dc80066ed6f49f4331c551901'/>
<id>1462594bf2866c1dc80066ed6f49f4331c551901</id>
<content type='text'>
mce_ser, mce_bios_cmci_threshold and mce_disabled are the last three
bools which need conversion. Move them to the mca_config struct and
adjust usage sites accordingly.

Signed-off-by: Borislav Petkov &lt;bp@alien8.de&gt;
Acked-by: Tony Luck &lt;tony.luck@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
mce_ser, mce_bios_cmci_threshold and mce_disabled are the last three
bools which need conversion. Move them to the mca_config struct and
adjust usage sites accordingly.

Signed-off-by: Borislav Petkov &lt;bp@alien8.de&gt;
Acked-by: Tony Luck &lt;tony.luck@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86, MCA: Convert the next three variables batch</title>
<updated>2012-10-26T12:37:57+00:00</updated>
<author>
<name>Borislav Petkov</name>
<email>bp@alien8.de</email>
</author>
<published>2012-10-15T18:25:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7af19e4afdafa4adb5fffc569d5bb1c5e568ba98'/>
<id>7af19e4afdafa4adb5fffc569d5bb1c5e568ba98</id>
<content type='text'>
Move them into the mca_config struct and adjust code touching them
accordingly.

Signed-off-by: Borislav Petkov &lt;bp@alien8.de&gt;
Acked-by: Tony Luck &lt;tony.luck@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move them into the mca_config struct and adjust code touching them
accordingly.

Signed-off-by: Borislav Petkov &lt;bp@alien8.de&gt;
Acked-by: Tony Luck &lt;tony.luck@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86/mce: Provide boot argument to honour bios-set CMCI threshold</title>
<updated>2012-09-27T17:08:00+00:00</updated>
<author>
<name>Naveen N. Rao</name>
<email>naveen.n.rao@linux.vnet.ibm.com</email>
</author>
<published>2012-09-27T17:08:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=450cc201038f31bd496e1b3a44a49790b8827a06'/>
<id>450cc201038f31bd496e1b3a44a49790b8827a06</id>
<content type='text'>
The ACPI spec doesn't provide for a way for the bios to pass down
recommended thresholds to the OS on a _per-bank_ basis. This patch adds
a new boot option, which if passed, tells Linux to use CMCI thresholds
set by the bios.

As fail-safe, we initialize threshold to 1 if some banks have not been
initialized by the bios and warn the user.

Signed-off-by: Naveen N. Rao &lt;naveen.n.rao@linux.vnet.ibm.com&gt;
Signed-off-by: Tony Luck &lt;tony.luck@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The ACPI spec doesn't provide for a way for the bios to pass down
recommended thresholds to the OS on a _per-bank_ basis. This patch adds
a new boot option, which if passed, tells Linux to use CMCI thresholds
set by the bios.

As fail-safe, we initialize threshold to 1 if some banks have not been
initialized by the bios and warn the user.

Signed-off-by: Naveen N. Rao &lt;naveen.n.rao@linux.vnet.ibm.com&gt;
Signed-off-by: Tony Luck &lt;tony.luck@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86/mce: Add CMCI poll mode</title>
<updated>2012-08-09T18:44:51+00:00</updated>
<author>
<name>Chen Gong</name>
<email>gong.chen@linux.intel.com</email>
</author>
<published>2012-08-09T18:44:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=55babd8f41f122f5f4c7cebf520c766c983282c6'/>
<id>55babd8f41f122f5f4c7cebf520c766c983282c6</id>
<content type='text'>
On Intel systems corrected machine check interrupts (CMCI) may be sent to
multiple logical processors; possibly to all processors on the affected
socket (SDM Volume 3B "15.5.1 CMCI Local APIC Interface").  This means
that a persistent error (such as a stuck bit in ECC memory) may cause
a storm of interrupts that greatly hinders or prevents forward progress
(probably on many processors).

To solve this we keep track of the rate at which each processor sees
CMCI. If we exceed a threshold, we disable CMCI delivery and switch to
polling the machine check banks. If the storm subsides (none of the
affected processors see any more errors for a complete poll interval) we
re-enable CMCI.

[Tony: Added console messages when storm begins/ends and increased storm
threshold from 5 to 15 so we have a few more logged entries before we
disable interrupts and start dropping reports]

Signed-off-by: Chen Gong &lt;gong.chen@linux.intel.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Chen Gong &lt;gong.chen@linux.intel.com&gt;
Signed-off-by: Tony Luck &lt;tony.luck@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On Intel systems corrected machine check interrupts (CMCI) may be sent to
multiple logical processors; possibly to all processors on the affected
socket (SDM Volume 3B "15.5.1 CMCI Local APIC Interface").  This means
that a persistent error (such as a stuck bit in ECC memory) may cause
a storm of interrupts that greatly hinders or prevents forward progress
(probably on many processors).

To solve this we keep track of the rate at which each processor sees
CMCI. If we exceed a threshold, we disable CMCI delivery and switch to
polling the machine check banks. If the storm subsides (none of the
affected processors see any more errors for a complete poll interval) we
re-enable CMCI.

[Tony: Added console messages when storm begins/ends and increased storm
threshold from 5 to 15 so we have a few more logged entries before we
disable interrupts and start dropping reports]

Signed-off-by: Chen Gong &lt;gong.chen@linux.intel.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Chen Gong &lt;gong.chen@linux.intel.com&gt;
Signed-off-by: Tony Luck &lt;tony.luck@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86/mce: Make cmci_discover() quiet</title>
<updated>2012-08-09T17:59:21+00:00</updated>
<author>
<name>Tony Luck</name>
<email>tony.luck@intel.com</email>
</author>
<published>2012-08-09T17:59:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4670a300a2169e1e922593c5d35b0cdaee112901'/>
<id>4670a300a2169e1e922593c5d35b0cdaee112901</id>
<content type='text'>
cmci_discover() works out which machine check banks support CMCI, and
which of those are shared by multiple logical processors. It uses this
information to ensure that exactly one cpu is designated the owner of
each bank so that when interrupts are broadcast to multiple cpus, only one
of them will look in a shared bank to log the error and clear the bank.

At boot time cmci_discover() performs this task silently. But during
certain cpu hotplug operations it prints out a set of summary lines
like this:

CPU 35 MCA banks CMCI:0 CMCI:1 CMCI:3 CMCI:5 CMCI:6 CMCI:7 CMCI:8 CMCI:9 CMCI:10 CMCI:11
CPU 1 MCA banks CMCI:0 CMCI:1 CMCI:3
CPU 39 MCA banks CMCI:0 CMCI:1 CMCI:3
CPU 38 MCA banks CMCI:0 CMCI:1 CMCI:3
CPU 32 MCA banks CMCI:0 CMCI:1 CMCI:3
CPU 37 MCA banks CMCI:0 CMCI:1 CMCI:3
CPU 36 MCA banks CMCI:0 CMCI:1 CMCI:3
CPU 34 MCA banks CMCI:0 CMCI:1 CMCI:3

The value of these messages seems very low. A user might painstakingly
cross-check against the data sheet for a processor to ensure that all
CMCI supported banks are correctly reported, but this seems improbable.
If users really wanted to do this, we should print the information at
boot time too.

Remove the messages.

Signed-off-by: Tony Luck &lt;tony.luck@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
cmci_discover() works out which machine check banks support CMCI, and
which of those are shared by multiple logical processors. It uses this
information to ensure that exactly one cpu is designated the owner of
each bank so that when interrupts are broadcast to multiple cpus, only one
of them will look in a shared bank to log the error and clear the bank.

At boot time cmci_discover() performs this task silently. But during
certain cpu hotplug operations it prints out a set of summary lines
like this:

CPU 35 MCA banks CMCI:0 CMCI:1 CMCI:3 CMCI:5 CMCI:6 CMCI:7 CMCI:8 CMCI:9 CMCI:10 CMCI:11
CPU 1 MCA banks CMCI:0 CMCI:1 CMCI:3
CPU 39 MCA banks CMCI:0 CMCI:1 CMCI:3
CPU 38 MCA banks CMCI:0 CMCI:1 CMCI:3
CPU 32 MCA banks CMCI:0 CMCI:1 CMCI:3
CPU 37 MCA banks CMCI:0 CMCI:1 CMCI:3
CPU 36 MCA banks CMCI:0 CMCI:1 CMCI:3
CPU 34 MCA banks CMCI:0 CMCI:1 CMCI:3

The value of these messages seems very low. A user might painstakingly
cross-check against the data sheet for a processor to ensure that all
CMCI supported banks are correctly reported, but this seems improbable.
If users really wanted to do this, we should print the information at
boot time too.

Remove the messages.

Signed-off-by: Tony Luck &lt;tony.luck@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>locking, x86: mce: Annotate cmci_discover_lock as raw</title>
<updated>2011-09-13T09:12:09+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2010-07-15T12:28:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=59d958d2c7de20409a0dc202adc87d3973ada13d'/>
<id>59d958d2c7de20409a0dc202adc87d3973ada13d</id>
<content type='text'>
The cmci_discover_lock can be taken in atomic context (cpu bring
up sequence) and therefore cannot be preempted on -rt.

In mainline this change documents the low level nature of
the lock - otherwise there's no functional difference. Lockdep
and Sparse checking will work as usual.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The cmci_discover_lock can be taken in atomic context (cpu bring
up sequence) and therefore cannot be preempted on -rt.

In mainline this change documents the low level nature of
the lock - otherwise there's no functional difference. Lockdep
and Sparse checking will work as usual.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86: Replace uses of current_cpu_data with this_cpu ops</title>
<updated>2010-12-30T11:22:03+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-12-18T15:30:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7b543a5334ff4ea2e3ad3b777fc23cdb8072a988'/>
<id>7b543a5334ff4ea2e3ad3b777fc23cdb8072a988</id>
<content type='text'>
Replace all uses of current_cpu_data with this_cpu operations on the
per cpu structure cpu_info.  The scala accesses are replaced with the
matching this_cpu ops which results in smaller and more efficient
code.

In the long run, it might be a good idea to remove cpu_data() macro
too and use per_cpu macro directly.

tj: updated description

Cc: Yinghai Lu &lt;yinghai@kernel.org&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Acked-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Christoph Lameter &lt;cl@linux.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace all uses of current_cpu_data with this_cpu operations on the
per cpu structure cpu_info.  The scala accesses are replaced with the
matching this_cpu ops which results in smaller and more efficient
code.

In the long run, it might be a good idea to remove cpu_data() macro
too and use per_cpu macro directly.

tj: updated description

Cc: Yinghai Lu &lt;yinghai@kernel.org&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Acked-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Christoph Lameter &lt;cl@linux.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
