From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: Justin Forbes <jmforbes@linuxtx.org>,
Zwane Mwaikambo <zwane@arm.linux.org.uk>,
"Theodore Ts'o" <tytso@mit.edu>,
Randy Dunlap <rdunlap@xenotime.net>,
Dave Jones <davej@redhat.com>,
Chuck Wolber <chuckw@quantumlinux.com>,
Chris Wedgwood <reviews@ml.cw.f00f.org>,
Michael Krufky <mkrufky@linuxtv.org>,
Chuck Ebbert <cebbert@redhat.com>,
Domenico Andreoli <cavokz@gmail.com>, Willy Tarreau <w@1wt.eu>,
Rodrigo Rubira Branco <rbranco@la.checkpoint.com>,
Jake Edge <jake@lwn.net>, Eugene Teo <eteo@redhat.com>,
torvalds@linux-foundation.org, akpm@linux-foundation.org,
alan@lxorguk.ukuu.org.uk,
Andrea Shepard <andrea@persephoneslair.org>,
"David S. Miller" <davem@davemloft.net>
Subject: [patch 11/16] sparc64: Fix race in arch/sparc64/kernel/trampoline.S
Date: Fri, 7 Nov 2008 15:26:20 -0800 [thread overview]
Message-ID: <20081107232620.GL4282@kroah.com> (raw)
In-Reply-To: <20081107232544.GA4282@kroah.com>
[-- Attachment #1: 0001-sparc64-Fix-race-in-arch-sparc64-kernel-trampoline.patch --]
[-- Type: text/plain, Size: 1908 bytes --]
2.6.25-stable review patch. If anyone has any objections, please let us know.
------------------
From: Andrea Shepard <andrea@persephoneslair.org>
[ Upstream commit e0037df3852b4b60edbe01f70f4968e4a9fdb272 ]
Make arch/sparc64/kernel/trampoline.S in 2.6.27.1 lock prom_entry_lock
when calling the PROM. This prevents a race condition that I observed
causing a hang on startup on a 12-CPU E4500.
I am not subscribed to this list, so please CC me on replies.
Signed-off-by: Andrea Shepard <andrea@persephoneslair.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/sparc64/kernel/trampoline.S | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
--- a/arch/sparc64/kernel/trampoline.S
+++ b/arch/sparc64/kernel/trampoline.S
@@ -328,6 +328,12 @@ after_lock_tlb:
wrpr %g0, 0, %wstate
+ sethi %hi(prom_entry_lock), %g2
+1: ldstub [%g2 + %lo(prom_entry_lock)], %g1
+ membar #StoreLoad | #StoreStore
+ brnz,pn %g1, 1b
+ nop
+
/* As a hack, put &init_thread_union into %g6.
* prom_world() loads from here to restore the %asi
* register.
@@ -337,7 +343,7 @@ after_lock_tlb:
sethi %hi(is_sun4v), %o0
lduw [%o0 + %lo(is_sun4v)], %o0
- brz,pt %o0, 1f
+ brz,pt %o0, 2f
nop
TRAP_LOAD_TRAP_BLOCK(%g2, %g3)
@@ -369,10 +375,10 @@ after_lock_tlb:
call %o1
add %sp, (2047 + 128), %o0
- ba,pt %xcc, 2f
+ ba,pt %xcc, 3f
nop
-1: sethi %hi(sparc64_ttable_tl0), %o0
+2: sethi %hi(sparc64_ttable_tl0), %o0
set prom_set_trap_table_name, %g2
stx %g2, [%sp + 2047 + 128 + 0x00]
mov 1, %g2
@@ -386,7 +392,11 @@ after_lock_tlb:
call %o1
add %sp, (2047 + 128), %o0
-2: ldx [%l0], %g6
+3: sethi %hi(prom_entry_lock), %g2
+ stb %g0, [%g2 + %lo(prom_entry_lock)]
+ membar #StoreStore | #StoreLoad
+
+ ldx [%l0], %g6
ldx [%g6 + TI_TASK], %g4
mov 1, %g5
--
next prev parent reply other threads:[~2008-11-07 23:35 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20081107231848.995297975@mini.kroah.org>
2008-11-07 23:25 ` [patch 00/16] 2.6.25.20-stable review Greg KH
2008-11-07 23:25 ` [patch 01/16] gpiolib: fix oops in gpio_get_value_cansleep() Greg KH
2008-11-07 23:26 ` [patch 02/16] ext: Avoid printk floods in the face of directory corruption (CVE-2008-3528) Greg KH
2008-11-10 2:57 ` Eugene Teo
2008-11-07 23:26 ` [patch 03/16] edac cell: fix incorrect edac_mode Greg KH
2008-11-07 23:26 ` [patch 04/16] net: Fix recursive descent in __scm_destroy() Greg KH
2008-11-07 23:26 ` [patch 05/16] libertas: fix buffer overrun Greg KH
2008-11-07 23:26 ` [patch 06/16] file caps: always start with clear bprm->caps_* Greg KH
2008-11-07 23:26 ` [patch 07/16] ALSA: use correct lock in snd_ctl_dev_disconnect() Greg KH
2008-11-07 23:26 ` [patch 08/16] ACPI: dock: avoid check _STA method Greg KH
2008-11-07 23:26 ` [patch 09/16] tcpv6: fix option space offsets with md5 Greg KH
2008-11-07 23:26 ` [patch 10/16] net: Fix netdev_run_todo dead-lock Greg KH
2008-11-07 23:26 ` Greg KH [this message]
2008-11-07 23:26 ` [patch 12/16] math-emu: Fix signalling of underflow and inexact while packing result Greg KH
2008-11-07 23:26 ` [patch 13/16] ACPI: video: fix brightness allocation Greg KH
2008-11-07 23:26 ` [patch 14/16] netfilter: xt_iprange: fix range inversion match Greg KH
2008-11-07 23:26 ` [patch 15/16] netfilter: snmp nat leaks memory in case of failure Greg KH
2008-11-07 23:26 ` [patch 16/16] netfilter: restore lost ifdef guarding defrag exception Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081107232620.GL4282@kroah.com \
--to=gregkh@suse.de \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=andrea@persephoneslair.org \
--cc=cavokz@gmail.com \
--cc=cebbert@redhat.com \
--cc=chuckw@quantumlinux.com \
--cc=davej@redhat.com \
--cc=davem@davemloft.net \
--cc=eteo@redhat.com \
--cc=jake@lwn.net \
--cc=jmforbes@linuxtx.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkrufky@linuxtv.org \
--cc=rbranco@la.checkpoint.com \
--cc=rdunlap@xenotime.net \
--cc=reviews@ml.cw.f00f.org \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=tytso@mit.edu \
--cc=w@1wt.eu \
--cc=zwane@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox