lkml.org 
[lkml]   [2004]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] ppc64: Fix possible race with set_pte on a present PTE
From
Date

> static inline void ptep_update_dirty_accessed(pte_t *ptep, pte_t entry, int dirty)
> {
> unsigned long bits = pte_value(entry) & (_PAGE_DIRTY | _PAGE_ACCESSED);
> unsigned long tmp;
>
> __asm__ __volatile__(
> "1: lwarx %0,0,%3\n\
> or %0,%2,%0\n\
> stwcx. %0,0,%3\n\
> bne- 1b"
> :"=&r" (tmp), "=m" (*ptep)
> :"r" (bits), "r" (ptep)
> :"cc");
> }
>
> /* Make asm-generic/pgtable.h know about it.. */
> #define ptep_update_dirty_accessed ptep_update_dirty_accessed

That looks good on a first look, I need to re-read the whole discussion since
yesterday through to make sure I didn't miss anything. Note that I'd rather
call the function ptep_set_* than ptep_update_* to make clear that it can
only ever be used to _set_ those bits.

Ben.


-
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.157 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site