Subject: Re: [PATCH] powerpc/vas: do not set uses_vas for kernel windows

From: Sukadev Bhattiprolu <[email-masked]>
Date: Fri, 9 Feb 2018 20:57:24 -0800

Nicholas Piggin [[email-masked]] wrote:
> cp_abort is only required or user windows, because kernel context
> must not be preempted between a copy/paste pair.

Yes, that is a good optimization.

> 
> Without this patch, the init task gets used_vas set when it runs
> the nx842_powernv_init initcall, which opens windows for kernel
> usage.
> 
> used_vas is then never cleared anywhere, so it gets propagated
> into all other tasks. It's a property of the address space, so it
> should really be cleared when a new mm is created (or in dup_mmap
> if the mmaps are marked as VM_DONTCOPY). For now we seem to have
> no such driver, so leave that for another patch.

If the parent process has the paste address mapped, the child inherits
those mappings - so we can't clear the ->used_vas in a process until
it has unmapped all the send windows right?

If VM_DONCOPY is set, then we can clear it.

> 
> Cc: Sukadev Bhattiprolu <[email-masked]>
> Signed-off-by: Nicholas Piggin <[email-masked]>

Reviewed-by: Sukadev Bhattiprolu <[email-masked]>