Subject: Re: [PATCH -V10 10/15] powerpc: Prevent gcc to re-read the pagetables

From: Benjamin Herrenschmidt <[email-masked]>
Date: Thu, 06 Jun 2013 08:39:38 +1000

On Wed, 2013-06-05 at 16:41 +0100, David Laight wrote:
> >  	ptep = pte_offset_kernel(&pmd, addr);
> >  	do {
> > -		pte_t pte = *ptep;
> > +		pte_t pte = ACCESS_ONCE(*ptep);
> 
> Why not just define ptep as a 'pointer to volatile'?

ACCESS_ONCE is the proper way to do it in Linux. pointer to volatile
can have ... interesting semantics.

Cheers,
Ben.