linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/mm: Comment arch_unmap()
@ 2019-04-23 15:17 Laurent Dufour
  2019-04-23 16:46 ` Laurent Dufour
  0 siblings, 1 reply; 2+ messages in thread
From: Laurent Dufour @ 2019-04-23 15:17 UTC (permalink / raw)
  To: mpe; +Cc: Thomas Gleixner, linuxppc-dev, linux-kernel

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)
+	 *  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;
 }
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-23 16:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-23 15:17 [PATCH] powerpc/mm: Comment arch_unmap() Laurent Dufour
2019-04-23 16:46 ` Laurent Dufour

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).