lkml.org 
[lkml]   [2004]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] ppc64: Fix possible race with set_pte on a present PTE
From
Date
(RESENT)

There is a subtle race which can cause set_pte to be called on ppc64 on
a PTE that is already present (that normally doesn't happen for us) and
which itself, in the proper race condition, can trigger a duplicate hash
entry to be added to the hash table (very bad).

This fixes it by making sure we trigger the actual flush of the batch
whenever set_pte is called on a present PTE, before putting the new PTE
in.

===== include/asm-ppc64/pgtable.h 1.32 vs edited =====
--- 1.32/include/asm-ppc64/pgtable.h Fri Apr 9 03:30:57 2004
+++ edited/include/asm-ppc64/pgtable.h Thu May 20 15:47:40 2004
@@ -396,8 +396,10 @@
*/
static inline void set_pte(pte_t *ptep, pte_t pte)
{
- if (pte_present(*ptep))
+ if (pte_present(*ptep)) {
pte_clear(ptep);
+ flush_tlb_pending();
+ }
*ptep = __pte(pte_val(pte)) & ~_PAGE_HPTEFLAGS;
}


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.069 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site