lkml.org 
[lkml]   [2006]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] x86/PAE: Fix pte_clear for the >4GB RAM case
From
Date
Linux Kernel Mailing List <linux-kernel@vger.kernel.org> writes:
> +/*
> + * For PTEs and PDEs, we must clear the P-bit first when clearing a page table
> + * entry, so clear the bottom half first and enforce ordering with a compiler
> + * barrier.
> + */
> +static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
> +{
> + ptep->pte_low = 0;
> + smp_wmb();
> + ptep->pte_high = 0;
> +}
> +
> +static inline void pmd_clear(pmd_t *pmd)
> +{
> + u32 *tmp = (u32 *)pmd;
> + *tmp = 0;
> + smp_wmb();
> + *(tmp + 1) = 0;
> +}

I think that's still wrong - it should be wmb() not smp_wmb because this
problem can happen on a UP kernel already.

-Andi

-
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: 2006-04-28 07:21    [W:0.068 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site