[PATCH 4/4] ARM: idmap: use idmap_pgd when setting up mm for reboot

Will Deacon
2011-11-18T17:21:07Z

On Fri, Nov 18, 2011 at 04:56:24PM +0000, Catalin Marinas wrote:
> On 16 November 2011 16:48, Will Deacon <will.deacon@arm.com> wrote:
> > ?void setup_mm_for_reboot(char mode)
> > ?{
> > - ? ? ? /*
> > - ? ? ? ?* We need to access to user-mode page tables here. For kernel threads
> > - ? ? ? ?* we don't have any user-mode mappings so we use the context that we
> > - ? ? ? ?* "borrowed".
> > - ? ? ? ?*/
> > - ? ? ? identity_mapping_add(current->active_mm->pgd, 0, TASK_SIZE);
> > + ? ? ? /* Clean and invalidate L1. */
> > + ? ? ? flush_cache_all();
>
> Is the cache flushing needed here? The setup_mm_for_reboot callers do
> it after this function anyway (unless this is needed for VIVT
> caches?).

I initially added the cache flushing because we used to manipulate the page
tables at this point. We don't do that anymore, but as you say, if we have
a VIVT D-side then we do need that flush before switching to the new pgd.

One thing I will change is the following comment (/* Switch exclusively to kernel
mappings. */) because that's a bit confusing now.

Will