linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Dufour <ldufour@linux.ibm.com>
To: mpe@ellerman.id.au
Cc: Thomas Gleixner <tglx@linutronix.de>,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] powerpc/mm: Comment arch_unmap()
Date: Tue, 23 Apr 2019 18:46:51 +0200	[thread overview]
Message-ID: <5d1cf986-d51b-3c47-8f6c-ae5ba205f59b@linux.ibm.com> (raw)
In-Reply-To: <20190423151712.79391-1-ldufour@linux.ibm.com>

Le 23/04/2019 à 17:17, Laurent Dufour a écrit :
> During a different patch review, the check in arch_munmap() was found
> spucious due the lake of explanation.
> 
> Adding a comment to clarify the test.
> 
> Suggested-by: Thomas Gleixner <tglx@linutronix.de>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Signed-off-by: Laurent Dufour <ldufour@linux.ibm.com>
> ---
>   arch/powerpc/include/asm/mmu_context.h | 11 +++++++++++
>   1 file changed, 11 insertions(+)
> 
> diff --git a/arch/powerpc/include/asm/mmu_context.h b/arch/powerpc/include/asm/mmu_context.h
> index 6ee8195a2ffb..638f481b3c9f 100644
> --- a/arch/powerpc/include/asm/mmu_context.h
> +++ b/arch/powerpc/include/asm/mmu_context.h
> @@ -240,6 +240,17 @@ static inline void arch_unmap(struct mm_struct *mm,
>   			      struct vm_area_struct *vma,
>   			      unsigned long start, unsigned long end)
>   {
> +	/*
> +	 * There are 2 assumptions here:
> +	 *  1. the VDSO is one page size (guaranteed by vdso_data_store)

Indeed this is not true, only the descriptor is one page size.
This makes that test not handling all the cases, especially if a upper 
part of the VDSO is unmap (start > mm->context.vdso_base).

I'll sent a new fix asap.

> +	 *  2. 'start' and 'end' are page aligned (guaranteed by the caller)
> +	 * The test is wrote in a way to handle unmap operation surrounding the
> +	 * VDSO area like:
> +	 *            | VDSO |
> +	 *    ^ start          ^ end
> +	 * The test also covers the munmap() operation done to the exact VDSO's
> +	 * boundaries.
> +	 */
>   	if (start <= mm->context.vdso_base && mm->context.vdso_base < end)
>   		mm->context.vdso_base = 0;
>   }
> 


      reply	other threads:[~2019-04-23 16:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-23 15:17 [PATCH] powerpc/mm: Comment arch_unmap() Laurent Dufour
2019-04-23 16:46 ` Laurent Dufour [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5d1cf986-d51b-3c47-8f6c-ae5ba205f59b@linux.ibm.com \
    --to=ldufour@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).