Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 01 Jun 2010 09:35:06 -0700
From:      Marcel Moolenaar <xcllnt@mac.com>
To:        Alan Cox <alc@cs.rice.edu>
Cc:        Marcel Moolenaar <marcel@freebsd.org>, ppc@freebsd.org
Subject:   Re: BookE pmap_enter() bug?
Message-ID:  <B5C7F1F3-AD95-49C9-AC9F-02AFCB3FEF06@mac.com>
In-Reply-To: <4C053389.1040204@cs.rice.edu>
References:  <4C053389.1040204@cs.rice.edu>

next in thread | previous in thread | raw e-mail | index | archive | help

On Jun 1, 2010, at 9:21 AM, Alan Cox wrote:

> I've been reviewing the various pmap_enter() implementations and came across the following bit of code in the BookE pmap_enter():
> 
>       if (prot & VM_PROT_EXECUTE) {
>           flags |= PTE_SX;
>           if (!su)
>               flags |= PTE_UX;
> 
>           /*
>            * Check existing flags for execute permissions: if we
>            * are turning execute permissions on, icache should
>            * be flushed.
>            */
>           if ((flags & (PTE_UX | PTE_SX)) == 0)
>               sync++;
>       }
> 
> 
> This will never flush the instruction cache because the new flags, not the old flags, are being used.  I suspect that the attached change should be made.

*snip*

You're right.

I'm not aware of icache incoherency problems on BookE, so this raises
the question as to whether we actually need to worry about syncing the
icache here. But that's ortogonal...

-- 
Marcel Moolenaar
xcllnt@mac.com






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B5C7F1F3-AD95-49C9-AC9F-02AFCB3FEF06>