<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel_samsung_smdk4412/arch/x86/kernel/microcode_intel.c, branch replicant-6.0</title>
<subtitle>kernel/samsung/smdk4412
</subtitle>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/kernel_samsung_smdk4412/'/>
<entry>
<title>x86/microcode: Fix double vfree() and remove redundant pointer checks before vfree()</title>
<updated>2010-12-27T13:33:30+00:00</updated>
<author>
<name>Jesper Juhl</name>
<email>jj@chaosbits.net</email>
</author>
<published>2010-12-25T18:57:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/kernel_samsung_smdk4412/commit/?id=5cdd2de0a76d0ac47f107c8a7b32d75d25768dc1'/>
<id>5cdd2de0a76d0ac47f107c8a7b32d75d25768dc1</id>
<content type='text'>
In arch/x86/kernel/microcode_intel.c::generic_load_microcode()
we have  this:

	while (leftover) {
		...
		if (get_ucode_data(mc, ucode_ptr, mc_size) ||
		    microcode_sanity_check(mc) &lt; 0) {
			vfree(mc);
			break;
		}
		...
	}

	if (mc)
		vfree(mc);

This will cause a double free of 'mc'. This patch fixes that by
just  removing the vfree() call in the loop since 'mc' will be
freed nicely just  after we break out of the loop.

There's also a second change in the patch. I noticed a lot of
checks for  pointers being NULL before passing them to vfree().
That's completely  redundant since vfree() deals gracefully with
being passed a NULL pointer.  Removing the redundant checks
yields a nice size decrease for the object  file.

Size before the patch:
   text    data     bss     dec     hex filename
   4578     240    1032    5850    16da arch/x86/kernel/microcode_intel.o
Size after the patch:
   text    data     bss     dec     hex filename
   4489     240     984    5713    1651 arch/x86/kernel/microcode_intel.o

Signed-off-by: Jesper Juhl &lt;jj@chaosbits.net&gt;
Acked-by: Tigran Aivazian &lt;tigran@aivazian.fsnet.co.uk&gt;
Cc: Shaohua Li &lt;shaohua.li@intel.com&gt;
LKML-Reference: &lt;alpine.LNX.2.00.1012251946100.10759@swampdragon.chaosbits.net&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In arch/x86/kernel/microcode_intel.c::generic_load_microcode()
we have  this:

	while (leftover) {
		...
		if (get_ucode_data(mc, ucode_ptr, mc_size) ||
		    microcode_sanity_check(mc) &lt; 0) {
			vfree(mc);
			break;
		}
		...
	}

	if (mc)
		vfree(mc);

This will cause a double free of 'mc'. This patch fixes that by
just  removing the vfree() call in the loop since 'mc' will be
freed nicely just  after we break out of the loop.

There's also a second change in the patch. I noticed a lot of
checks for  pointers being NULL before passing them to vfree().
That's completely  redundant since vfree() deals gracefully with
being passed a NULL pointer.  Removing the redundant checks
yields a nice size decrease for the object  file.

Size before the patch:
   text    data     bss     dec     hex filename
   4578     240    1032    5850    16da arch/x86/kernel/microcode_intel.o
Size after the patch:
   text    data     bss     dec     hex filename
   4489     240     984    5713    1651 arch/x86/kernel/microcode_intel.o

Signed-off-by: Jesper Juhl &lt;jj@chaosbits.net&gt;
Acked-by: Tigran Aivazian &lt;tigran@aivazian.fsnet.co.uk&gt;
Cc: Shaohua Li &lt;shaohua.li@intel.com&gt;
LKML-Reference: &lt;alpine.LNX.2.00.1012251946100.10759@swampdragon.chaosbits.net&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Update broken web addresses in arch directory.</title>
<updated>2010-10-18T09:03:21+00:00</updated>
<author>
<name>Justin P. Mattock</name>
<email>justinmattock@gmail.com</email>
</author>
<published>2010-10-16T17:36:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/kernel_samsung_smdk4412/commit/?id=50a23e6eec6f20d55a3a920e47adb455bff6046e'/>
<id>50a23e6eec6f20d55a3a920e47adb455bff6046e</id>
<content type='text'>
The patch below updates broken web addresses in the arch directory.

Signed-off-by: Justin P. Mattock &lt;justinmattock@gmail.com&gt;
Signed-off-by: Maciej W. Rozycki &lt;macro@linux-mips.org&gt;
Cc: Finn Thain &lt;fthain@telegraphics.com.au&gt;
Cc: Randy Dunlap &lt;rdunlap@xenotime.net&gt;
Reviewed-by: Finn Thain &lt;fthain@telegraphics.com.au&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The patch below updates broken web addresses in the arch directory.

Signed-off-by: Justin P. Mattock &lt;justinmattock@gmail.com&gt;
Signed-off-by: Maciej W. Rozycki &lt;macro@linux-mips.org&gt;
Cc: Finn Thain &lt;fthain@telegraphics.com.au&gt;
Cc: Randy Dunlap &lt;rdunlap@xenotime.net&gt;
Reviewed-by: Finn Thain &lt;fthain@telegraphics.com.au&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86: Improve Intel microcode loader performance</title>
<updated>2010-03-11T12:49:06+00:00</updated>
<author>
<name>Dimitri Sivanich</name>
<email>sivanich@sgi.com</email>
</author>
<published>2010-03-05T17:42:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/kernel_samsung_smdk4412/commit/?id=938179b4f8cf8a4f11234ebf2dff2eb48400acfe'/>
<id>938179b4f8cf8a4f11234ebf2dff2eb48400acfe</id>
<content type='text'>
We've noticed that on large SGI UV system configurations,
running microcode.ctl can take very long periods of time.  This
is due to the large number of vmalloc/vfree calls made by the
Intel generic_load_microcode() logic.

By reusing allocated space, the following patch reduces the time
to run microcode.ctl on a 1024 cpu system from approximately 80
seconds down to 1 or 2 seconds.

Signed-off-by: Dimitri Sivanich &lt;sivanich@sgi.com&gt;
Acked-by: Dmitry Adamushko &lt;dmitry.adamushko@gmail.com&gt;
Cc: Avi Kivity &lt;avi@redhat.com&gt;
Cc: Bill Davidsen &lt;davidsen@tmr.com&gt;
LKML-Reference: &lt;20100305174203.GA19638@sgi.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>
We've noticed that on large SGI UV system configurations,
running microcode.ctl can take very long periods of time.  This
is due to the large number of vmalloc/vfree calls made by the
Intel generic_load_microcode() logic.

By reusing allocated space, the following patch reduces the time
to run microcode.ctl on a 1024 cpu system from approximately 80
seconds down to 1 or 2 seconds.

Signed-off-by: Dimitri Sivanich &lt;sivanich@sgi.com&gt;
Acked-by: Dmitry Adamushko &lt;dmitry.adamushko@gmail.com&gt;
Cc: Avi Kivity &lt;avi@redhat.com&gt;
Cc: Bill Davidsen &lt;davidsen@tmr.com&gt;
LKML-Reference: &lt;20100305174203.GA19638@sgi.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86: Remove trailing spaces in messages</title>
<updated>2010-02-07T16:47:51+00:00</updated>
<author>
<name>Frans Pop</name>
<email>elendil@planet.nl</email>
</author>
<published>2010-02-06T17:47:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/kernel_samsung_smdk4412/commit/?id=3235dc3f22378f35ce77eba0d0f62db2d9c4844e'/>
<id>3235dc3f22378f35ce77eba0d0f62db2d9c4844e</id>
<content type='text'>
Signed-off-by: Frans Pop &lt;elendil@planet.nl&gt;
Cc: Avi Kivity &lt;avi@redhat.com&gt;
Cc: x86@kernel.org
LKML-Reference: &lt;1265478443-31072-10-git-send-email-elendil@planet.nl&gt;
[ Left out the KVM bits. ]
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Frans Pop &lt;elendil@planet.nl&gt;
Cc: Avi Kivity &lt;avi@redhat.com&gt;
Cc: x86@kernel.org
LKML-Reference: &lt;1265478443-31072-10-git-send-email-elendil@planet.nl&gt;
[ Left out the KVM bits. ]
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>arch/x86/kernel/microcode*: Use pr_fmt() and remove duplicated KERN_ERR prefix</title>
<updated>2009-12-09T07:25:57+00:00</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2009-12-09T06:30:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/kernel_samsung_smdk4412/commit/?id=f58e1f53de52a70391b6478617311207c7203363'/>
<id>f58e1f53de52a70391b6478617311207c7203363</id>
<content type='text'>
- Use #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- Remove "microcode: " prefix from each pr_&lt;level&gt;
- Fix duplicated KERN_ERR prefix
- Coalesce pr_&lt;level&gt; format strings
- Add a space after an exclamation point

No other change in output.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Cc: Andy Whitcroft &lt;apw@canonical.com&gt;
Cc: Andreas Herrmann &lt;herrmann.der.user@googlemail.com&gt;
LKML-Reference: &lt;1260340250.27677.191.camel@Joe-Laptop.home&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Use #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- Remove "microcode: " prefix from each pr_&lt;level&gt;
- Fix duplicated KERN_ERR prefix
- Coalesce pr_&lt;level&gt; format strings
- Add a space after an exclamation point

No other change in output.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Cc: Andy Whitcroft &lt;apw@canonical.com&gt;
Cc: Andreas Herrmann &lt;herrmann.der.user@googlemail.com&gt;
LKML-Reference: &lt;1260340250.27677.191.camel@Joe-Laptop.home&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86: microcode: use smp_call_function_single instead of set_cpus_allowed, cleanup of synchronization logic</title>
<updated>2009-05-12T08:36:44+00:00</updated>
<author>
<name>Dmitry Adamushko</name>
<email>dmitry.adamushko@gmail.com</email>
</author>
<published>2009-05-11T21:48:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/kernel_samsung_smdk4412/commit/?id=871b72dd1e12afc3f024479531d25a9339d2e3f9'/>
<id>871b72dd1e12afc3f024479531d25a9339d2e3f9</id>
<content type='text'>
* Solve issues described in 6f66cbc63081fd70e3191b4dbb796746780e5ae1
  in a way that doesn't resort to set_cpus_allowed();

* in fact, only collect_cpu_info and apply_microcode callbacks
  must run on a target cpu, others will do just fine on any other.
  smp_call_function_single() (as suggested by Ingo) is used to run
  these callbacks on a target cpu.

* cleanup of synchronization logic of the 'microcode_core' part

  The generic 'microcode_core' part guarantees that only a single cpu
  (be it a full-fledged cpu, one of the cores or HT)
  is being updated at any particular moment of time.

  In general, there is no need for any additional sync. mechanism in
  arch-specific parts (the patch removes existing spinlocks).

  See also the "Synchronization" section in microcode_core.c.

* return -EINVAL instead of -1 (which is translated into -EPERM) in
  microcode_write(), reload_cpu() and mc_sysdev_add(). Other suggestions
  for an error code?

* use 'enum ucode_state' as return value of request_microcode_{fw, user}
  to gain more flexibility by distinguishing between real error cases
  and situations when an appropriate ucode was not found (which is not an
  error per-se).

* some minor cleanups

Thanks a lot to Hugh Dickins for review/suggestions/testing!

   Reference: http://marc.info/?l=linux-kernel&amp;m=124025889012541&amp;w=2

[ Impact: refactor and clean up microcode driver locking code ]

Signed-off-by: Dmitry Adamushko &lt;dmitry.adamushko@gmail.com&gt;
Acked-by: Hugh Dickins &lt;hugh@veritas.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Andreas Herrmann &lt;andreas.herrmann3@amd.com&gt;
Cc: Peter Oruba &lt;peter.oruba@amd.com&gt;
Cc: Arjan van de Ven &lt;arjan@infradead.org&gt;
LKML-Reference: &lt;1242078507.5560.9.camel@earth&gt;
[ did some more cleanups ]
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
 arch/x86/include/asm/microcode.h  |   25 ++
 arch/x86/kernel/microcode_amd.c   |   58 ++----
 arch/x86/kernel/microcode_core.c  |  326 +++++++++++++++++++++-----------------
 arch/x86/kernel/microcode_intel.c |   92 +++-------
 4 files changed, 261 insertions(+), 240 deletions(-)

(~20 new comment lines)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Solve issues described in 6f66cbc63081fd70e3191b4dbb796746780e5ae1
  in a way that doesn't resort to set_cpus_allowed();

* in fact, only collect_cpu_info and apply_microcode callbacks
  must run on a target cpu, others will do just fine on any other.
  smp_call_function_single() (as suggested by Ingo) is used to run
  these callbacks on a target cpu.

* cleanup of synchronization logic of the 'microcode_core' part

  The generic 'microcode_core' part guarantees that only a single cpu
  (be it a full-fledged cpu, one of the cores or HT)
  is being updated at any particular moment of time.

  In general, there is no need for any additional sync. mechanism in
  arch-specific parts (the patch removes existing spinlocks).

  See also the "Synchronization" section in microcode_core.c.

* return -EINVAL instead of -1 (which is translated into -EPERM) in
  microcode_write(), reload_cpu() and mc_sysdev_add(). Other suggestions
  for an error code?

* use 'enum ucode_state' as return value of request_microcode_{fw, user}
  to gain more flexibility by distinguishing between real error cases
  and situations when an appropriate ucode was not found (which is not an
  error per-se).

* some minor cleanups

Thanks a lot to Hugh Dickins for review/suggestions/testing!

   Reference: http://marc.info/?l=linux-kernel&amp;m=124025889012541&amp;w=2

[ Impact: refactor and clean up microcode driver locking code ]

Signed-off-by: Dmitry Adamushko &lt;dmitry.adamushko@gmail.com&gt;
Acked-by: Hugh Dickins &lt;hugh@veritas.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Andreas Herrmann &lt;andreas.herrmann3@amd.com&gt;
Cc: Peter Oruba &lt;peter.oruba@amd.com&gt;
Cc: Arjan van de Ven &lt;arjan@infradead.org&gt;
LKML-Reference: &lt;1242078507.5560.9.camel@earth&gt;
[ did some more cleanups ]
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
 arch/x86/include/asm/microcode.h  |   25 ++
 arch/x86/kernel/microcode_amd.c   |   58 ++----
 arch/x86/kernel/microcode_core.c  |  326 +++++++++++++++++++++-----------------
 arch/x86/kernel/microcode_intel.c |   92 +++-------
 4 files changed, 261 insertions(+), 240 deletions(-)

(~20 new comment lines)
</pre>
</div>
</content>
</entry>
<entry>
<title>x86: microcode: cleanup</title>
<updated>2009-03-18T12:51:17+00:00</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2009-03-11T10:19:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/kernel_samsung_smdk4412/commit/?id=4bae1967357bfc78a2fad1be5e81a4b868980ae6'/>
<id>4bae1967357bfc78a2fad1be5e81a4b868980ae6</id>
<content type='text'>
Impact: cleanup

Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Dmitry Adamushko &lt;dmitry.adamushko@gmail.com&gt;
Cc: Peter Oruba &lt;peter.oruba@amd.com&gt;
LKML-Reference: &lt;200903111632.37279.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>
Impact: cleanup

Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Dmitry Adamushko &lt;dmitry.adamushko@gmail.com&gt;
Cc: Peter Oruba &lt;peter.oruba@amd.com&gt;
LKML-Reference: &lt;200903111632.37279.rusty@rustcorp.com.au&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86: microcode_intel.c fix style problems</title>
<updated>2009-01-12T10:22:40+00:00</updated>
<author>
<name>Jaswinder Singh Rajput</name>
<email>jaswinderrajput@gmail.com</email>
</author>
<published>2009-01-12T09:14:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/kernel_samsung_smdk4412/commit/?id=dd3feda7748b4c2739de47daaaa387fb01926c15'/>
<id>dd3feda7748b4c2739de47daaaa387fb01926c15</id>
<content type='text'>
Impact: cleanup

Fix:

 WARNING: Use #include &lt;linux/uaccess.h&gt; instead of &lt;asm/uaccess.h&gt;
 ERROR: trailing whitespace
 ERROR: "(foo*)" should be "(foo *)"

 total: 3 errors, 1 warnings

Signed-off-by: Jaswinder Singh Rajput &lt;jaswinderrajput@gmail.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>
Impact: cleanup

Fix:

 WARNING: Use #include &lt;linux/uaccess.h&gt; instead of &lt;asm/uaccess.h&gt;
 ERROR: trailing whitespace
 ERROR: "(foo*)" should be "(foo *)"

 total: 3 errors, 1 warnings

Signed-off-by: Jaswinder Singh Rajput &lt;jaswinderrajput@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branches 'x86/apic', 'x86/cleanups', 'x86/cpufeature', 'x86/crashdump', 'x86/debug', 'x86/defconfig', 'x86/detect-hyper', 'x86/doc', 'x86/dumpstack', 'x86/early-printk', 'x86/fpu', 'x86/idle', 'x86/io', 'x86/memory-corruption-check', 'x86/microcode', 'x86/mm', 'x86/mtrr', 'x86/nmi-watchdog', 'x86/pat2', 'x86/pci-ioapic-boot-irq-quirks', 'x86/ptrace', 'x86/quirks', 'x86/reboot', 'x86/setup-memory', 'x86/signal', 'x86/sparse-fixes', 'x86/time', 'x86/uv' and 'x86/xen' into x86/core</title>
<updated>2008-12-23T15:27:23+00:00</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2008-12-23T15:27:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/kernel_samsung_smdk4412/commit/?id=fa623d1b0222adbe8f822e53c08003b9679a410c'/>
<id>fa623d1b0222adbe8f822e53c08003b9679a410c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>x86: fix resume (S2R) broken by Intel microcode module, on A110L</title>
<updated>2008-12-20T13:29:20+00:00</updated>
<author>
<name>Dmitry Adamushko</name>
<email>dmitry.adamushko@gmail.com</email>
</author>
<published>2008-12-19T23:15:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant/kernel_samsung_smdk4412/commit/?id=280a9ca5d0663b185ddc4443052076c29652a328'/>
<id>280a9ca5d0663b185ddc4443052076c29652a328</id>
<content type='text'>
Impact: fix deadlock

This is in response to the following bug report:

Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=12100
Subject         : resume (S2R) broken by Intel microcode module, on A110L
Submitter       : Andreas Mohr &lt;andi@lisas.de&gt;
Date            : 2008-11-25 08:48 (19 days old)
Handled-By      : Dmitry Adamushko &lt;dmitry.adamushko@gmail.com&gt;

[ The deadlock scenario has been discovered by Andreas Mohr ]

I think I might have a logical explanation why the system:

  (http://bugzilla.kernel.org/show_bug.cgi?id=12100)

might hang upon resuming, OTOH it should have likely hanged each and every time.

(1) possible deadlock in microcode_resume_cpu() if either 'if' section is
taken;

(2) now, I don't see it in spec. and can't experimentally verify it (newer
ucodes don't seem to be available for my Core2duo)... but logically-wise, I'd
think that when read upon resuming, the 'microcode revision' (MSR 0x8B) should
be back to its original one (we need to reload ucode anyway so it doesn't seem
logical if a cpu doesn't drop the version)... if so, the comparison with
memcmp() for the full 'struct cpu_signature' is wrong... and that's how one of
the aforementioned 'if' sections might have been triggered - leading to a
deadlock.

Obviously, in my tests I simulated loading/resuming with the ucode of the same
version (just to see that the file is loaded/re-loaded upon resuming) so this
issue has never popped up.

I'd appreciate if someone with an appropriate system might give a try to the
2nd patch (titled "fix a comparison &amp;&amp; deadlock...").

In any case, the deadlock situation is a must-have fix.

Reported-by: Andreas Mohr &lt;andi@lisas.de&gt;
Signed-off-by: Dmitry Adamushko &lt;dmitry.adamushko@gmail.com&gt;
Tested-by: Andreas Mohr &lt;andi@lisas.de&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: &lt;stable@kernel.org&gt;

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Impact: fix deadlock

This is in response to the following bug report:

Bug-Entry       : http://bugzilla.kernel.org/show_bug.cgi?id=12100
Subject         : resume (S2R) broken by Intel microcode module, on A110L
Submitter       : Andreas Mohr &lt;andi@lisas.de&gt;
Date            : 2008-11-25 08:48 (19 days old)
Handled-By      : Dmitry Adamushko &lt;dmitry.adamushko@gmail.com&gt;

[ The deadlock scenario has been discovered by Andreas Mohr ]

I think I might have a logical explanation why the system:

  (http://bugzilla.kernel.org/show_bug.cgi?id=12100)

might hang upon resuming, OTOH it should have likely hanged each and every time.

(1) possible deadlock in microcode_resume_cpu() if either 'if' section is
taken;

(2) now, I don't see it in spec. and can't experimentally verify it (newer
ucodes don't seem to be available for my Core2duo)... but logically-wise, I'd
think that when read upon resuming, the 'microcode revision' (MSR 0x8B) should
be back to its original one (we need to reload ucode anyway so it doesn't seem
logical if a cpu doesn't drop the version)... if so, the comparison with
memcmp() for the full 'struct cpu_signature' is wrong... and that's how one of
the aforementioned 'if' sections might have been triggered - leading to a
deadlock.

Obviously, in my tests I simulated loading/resuming with the ucode of the same
version (just to see that the file is loaded/re-loaded upon resuming) so this
issue has never popped up.

I'd appreciate if someone with an appropriate system might give a try to the
2nd patch (titled "fix a comparison &amp;&amp; deadlock...").

In any case, the deadlock situation is a must-have fix.

Reported-by: Andreas Mohr &lt;andi@lisas.de&gt;
Signed-off-by: Dmitry Adamushko &lt;dmitry.adamushko@gmail.com&gt;
Tested-by: Andreas Mohr &lt;andi@lisas.de&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: &lt;stable@kernel.org&gt;

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
</feed>
