All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba.org>
To: benh@kernel.crashing.org
Cc: linuxppc-dev@ozlabs.org
Subject: [patch 2/3] powerpc: Rearrange SLB preload code
Date: Tue, 14 Jul 2009 16:53:52 +1000	[thread overview]
Message-ID: <20090714065425.460605043@samba.org> (raw)
In-Reply-To: 20090714065350.659537380@samba.org

With the new top down layout it is likely that the pc and stack will be in the
same segment, because the pc is most likely in a library allocated via a top
down mmap. Right now we bail out early if these segments match.

Rearrange the SLB preload code to sanity check all SLB preload addresses
are not in the kernel, then check all addresses for conflicts.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: linux.trees.git/arch/powerpc/mm/slb.c
===================================================================
--- linux.trees.git.orig/arch/powerpc/mm/slb.c	2009-07-14 15:06:26.000000000 +1000
+++ linux.trees.git/arch/powerpc/mm/slb.c	2009-07-14 15:09:39.000000000 +1000
@@ -225,23 +225,18 @@
 	else
 		unmapped_base = TASK_UNMAPPED_BASE_USER64;
 
-	if (is_kernel_addr(pc))
-		return;
-	slb_allocate(pc);
-
-	if (esids_match(pc,stack))
+	if (is_kernel_addr(pc) || is_kernel_addr(stack) ||
+	    is_kernel_addr(unmapped_base))
 		return;
 
-	if (is_kernel_addr(stack))
-		return;
-	slb_allocate(stack);
+	slb_allocate(pc);
 
-	if (esids_match(pc,unmapped_base) || esids_match(stack,unmapped_base))
-		return;
+	if (!esids_match(pc, stack))
+		slb_allocate(stack);
 
-	if (is_kernel_addr(unmapped_base))
-		return;
-	slb_allocate(unmapped_base);
+	if (!esids_match(pc, unmapped_base) &&
+	    !esids_match(stack, unmapped_base))
+		slb_allocate(unmapped_base);
 }
 
 static inline void patch_slb_encoding(unsigned int *insn_addr,

-- 

  parent reply	other threads:[~2009-07-14  7:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-14  6:53 [patch 0/3] PowerPC context switch optimisations Anton Blanchard
2009-07-14  6:53 ` [patch 1/3] powerpc: Move 64bit VDSO to improve context switch performance Anton Blanchard
2009-07-14  7:07   ` Benjamin Herrenschmidt
2009-07-14  7:38     ` Anton Blanchard
2009-10-02 19:14   ` Andreas Schwab
     [not found]   ` <m2ocophale.fsf__34527.2158309401$1254511503$gmane$org@igel.home>
2009-10-03 14:15     ` Andreas Schwab
2009-10-03 14:51       ` Andreas Schwab
2009-10-03 21:53         ` Benjamin Herrenschmidt
2009-10-04 12:35           ` Andreas Schwab
2009-07-14  6:53 ` Anton Blanchard [this message]
2009-07-14  6:53 ` [patch 3/3] powerpc: Preload application text segment instead of TASK_UNMAPPED_BASE Anton Blanchard
2009-07-14  7:10   ` Benjamin Herrenschmidt
2009-07-14  7:27     ` Anton Blanchard

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=20090714065425.460605043@samba.org \
    --to=anton@samba.org \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.