BookE pmap_enter() bug?

Marcel Moolenaar xcllnt at mac.com
Tue Jun 1 17:35:37 UTC 2010


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 at mac.com





More information about the freebsd-ppc mailing list