Thread (3 messages) flat view 3 messages, 2 authors, 2016-05-04
STALE3780d

[PATCH 1/2] powerpc/mm/subpage: Init user psize correctly

From: Aneesh Kumar K.V <hidden>
Date: 2016-05-02 10:52:57
Subsystem: linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Linus Torvalds

Check against a context.id value of zero instead of MMU_NO_CONTEXT
when doing a slice psize init. Without this patch we end up with
a slice psize value of zero and we always end up using 4K hpte.

Signed-off-by: Aneesh Kumar K.V <redacted>
---
 arch/powerpc/mm/mmu_context_book3s64.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/mm/mmu_context_book3s64.c b/arch/powerpc/mm/mmu_context_book3s64.c
index b5288b460bef..a28ed6a96286 100644
--- a/arch/powerpc/mm/mmu_context_book3s64.c
+++ b/arch/powerpc/mm/mmu_context_book3s64.c
@@ -85,8 +85,16 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
 		/* The old code would re-promote on fork, we don't do that
 		 * when using slices as it could cause problem promoting slices
 		 * that have been forced down to 4K
+		 *
+		 * For book3s we have MMU_NO_CONTEXT set to be ~0. Hence check
+		 * explicitly against context.id == 0. This ensures that we
+		 * properly initialize context slice details for newly allocated
+		 * mm and don't alter context slice inherited via fork.
+		 *
+		 * We should not be calling init_new_context on init_mm. Hence a
+		 * check against 0 is ok.
 		 */
-		if (slice_mm_new_context(mm))
+		if (mm->context.id == 0)
 			slice_set_user_psize(mm, mmu_virtual_psize);
 		subpage_prot_init_new_context(mm);
 	}
-- 
2.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help