linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Anton Blanchard <anton@samba.org>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [patch 1/3] powerpc: Move 64bit VDSO to improve context switch performance
Date: Sat, 03 Oct 2009 16:51:29 +0200	[thread overview]
Message-ID: <m2ocoo1qfi.fsf@igel.home> (raw)
In-Reply-To: <m28wfsef79.fsf@igel.home> (Andreas Schwab's message of "Sat, 03 Oct 2009 16:15:38 +0200")

Andreas Schwab <schwab@linux-m68k.org> writes:

> Andreas Schwab <schwab@linux-m68k.org> writes:
>
>> Anton Blanchard <anton@samba.org> writes:
>>
>>> On 64bit applications the VDSO is the only thing in segment 0. Since the VDSO
>>> is position independent we can remove the hint and let get_unmapped_area pick
>>> an area.
>>
>> This breaks gdb.  The section table in the VDSO image when mapped into
>> the process no longer contains meaningful values, and gdb rejects it.
>
> The problem is that the load segment requires 64k alignment, but the
> page allocater of course only provides PAGE_SIZE alignment, causing the
> image to be unaligned in memory.

Here is a patch.  The disadvantage is that now gdb complains that the
vdso does not contain section headers, because they are no longer
covered by the load segment.

Andreas.
---
>From 003c323c753d8717e58220c9560329882bcfa2c2 Mon Sep 17 00:00:00 2001
From: Andreas Schwab <schwab@linux-m68k.org>
Date: Sat, 3 Oct 2009 16:46:45 +0200
Subject: [PATCH] powerpc: fix unaligned load segment in vdso64

Since the page allocator can only guarantee PAGE_SIZE alignment the load
segment in the vdso object cannot claim more than that alignment.  Use 4k
alignment which is the minimum possible page size.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
---
 arch/powerpc/kernel/vdso64/Makefile |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kernel/vdso64/Makefile b/arch/powerpc/kernel/vdso64/Makefile
index 79da65d..d4be303 100644
--- a/arch/powerpc/kernel/vdso64/Makefile
+++ b/arch/powerpc/kernel/vdso64/Makefile
@@ -10,7 +10,9 @@ obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64))
 GCOV_PROFILE := n
 
 EXTRA_CFLAGS := -shared -fno-common -fno-builtin
+# Force maximum page size of 4k so that it works with any page size
 EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso64.so.1 \
+		-Wl,-z,max-page-size=4096 \
 		$(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
 EXTRA_AFLAGS := -D__VDSO64__ -s
 
-- 
1.6.4.4


-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

  reply	other threads:[~2009-10-03 14:51 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 [this message]
2009-10-03 21:53         ` Benjamin Herrenschmidt
2009-10-04 12:35           ` Andreas Schwab
2009-07-14  6:53 ` [patch 2/3] powerpc: Rearrange SLB preload code Anton Blanchard
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=m2ocoo1qfi.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=anton@samba.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 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).