aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-09 02:44:39 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-09 02:44:39 -0700
commit34784d80b59aa416b3495e012bb62a7f0f9f4b53 (patch)
tree708ad679b70c06c5f228df5b0030d703f3b50bf4 /arch
parentb632197434841d10c7e84d364a84882aba142dd8 (diff)
parent2425359bdc1891fe4293cf6f592488f54e438db9 (diff)
downloadhistory-34784d80b59aa416b3495e012bb62a7f0f9f4b53.tar.gz
Merge bk://bk.arm.linux.org.uk/linux-2.6-rmk
into ppc970.osdl.org:/home/torvalds/v2.6/linux
Diffstat (limited to 'arch')
-rw-r--r--arch/ia64/mm/init.c2
-rw-r--r--arch/ppc64/mm/slb_low.S33
2 files changed, 24 insertions, 11 deletions
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index a85063a1260b4e..3ab0b37e0fa9d8 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -63,6 +63,7 @@ check_pgt_cache (void)
low = pgt_cache_water[0];
high = pgt_cache_water[1];
+ preempt_disable();
if (pgtable_cache_size > (u64) high) {
do {
if (pgd_quicklist)
@@ -71,6 +72,7 @@ check_pgt_cache (void)
free_page((unsigned long)pmd_alloc_one_fast(0, 0));
} while (pgtable_cache_size > (u64) low);
}
+ preempt_enable();
}
void
diff --git a/arch/ppc64/mm/slb_low.S b/arch/ppc64/mm/slb_low.S
index 367cb7dec8580b..4b3dfe091c1ff3 100644
--- a/arch/ppc64/mm/slb_low.S
+++ b/arch/ppc64/mm/slb_low.S
@@ -37,9 +37,6 @@ _GLOBAL(slb_allocate)
* a free slot first but that took too long. Unfortunately we
* dont have any LRU information to help us choose a slot.
*/
- srdi r9,r1,27
- ori r9,r9,1 /* mangle SP for later compare */
-
ld r10,PACASTABRR(r13)
3:
addi r10,r10,1
@@ -48,18 +45,32 @@ _GLOBAL(slb_allocate)
blt+ 4f
li r10,SLB_NUM_BOLTED
-4:
- slbmfee r11,r10
- /* Don't throw out the segment for our kernel stack. Since we
+
+ /*
+ * Never cast out the segment for our kernel stack. Since we
* dont invalidate the ERAT we could have a valid translation
- * for the kernel stack during the first part of exception
- * exit which gets invalidated due to a tlbie from another cpu
- * at a non recoverable point (after setting srr0/1) - Anton
- *
+ * for the kernel stack during the first part of exception exit
+ * which gets invalidated due to a tlbie from another cpu at a
+ * non recoverable point (after setting srr0/1) - Anton
+ */
+4: slbmfee r11,r10
+ srdi r11,r11,27
+ /*
+ * Use paca->ksave as the value of the kernel stack pointer,
+ * because this is valid at all times.
* The >> 27 (rather than >> 28) is so that the LSB is the
* valid bit - this way we check valid and ESID in one compare.
+ * In order to completely close the tiny race in the context
+ * switch (between updating r1 and updating paca->ksave),
+ * we check against both r1 and paca->ksave.
*/
- srdi r11,r11,27
+ srdi r9,r1,27
+ ori r9,r9,1 /* mangle SP for later compare */
+ cmpd r11,r9
+ beq- 3b
+ ld r9,PACAKSAVE(r13)
+ srdi r9,r9,27
+ ori r9,r9,1
cmpd r11,r9
beq- 3b