From patchwork Sat Oct 3 14:51:29 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 34928 X-Patchwork-Delegate: benh@kernel.crashing.org Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id B41F0100A59 for ; Sun, 4 Oct 2009 00:51:40 +1000 (EST) Received: by ozlabs.org (Postfix) id C1769B7C02; Sun, 4 Oct 2009 00:51:33 +1000 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) by ozlabs.org (Postfix) with ESMTP id 1ED49B7BF9 for ; Sun, 4 Oct 2009 00:51:32 +1000 (EST) Received: from mail01.m-online.net (mail.m-online.net [192.168.3.149]) by mail-out.m-online.net (Postfix) with ESMTP id 191731C00153; Sat, 3 Oct 2009 16:51:31 +0200 (CEST) Received: from localhost (dynscan2.mnet-online.de [192.168.1.215]) by mail.m-online.net (Postfix) with ESMTP id EF8CB90247; Sat, 3 Oct 2009 16:51:30 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.3.149]) by localhost (dynscan2.mnet-online.de [192.168.1.215]) (amavisd-new, port 10024) with ESMTP id imkr1QyM2Dxw; Sat, 3 Oct 2009 16:51:29 +0200 (CEST) Received: from igel.home (DSL01.83.171.164.227.ip-pool.NEFkom.net [83.171.164.227]) by mail.mnet-online.de (Postfix) with ESMTP; Sat, 3 Oct 2009 16:51:29 +0200 (CEST) Received: by igel.home (Postfix, from userid 501) id 69A7D10DCF8; Sat, 3 Oct 2009 16:51:29 +0200 (CEST) From: Andreas Schwab To: Anton Blanchard Subject: Re: [patch 1/3] powerpc: Move 64bit VDSO to improve context switch performance References: <20090714065350.659537380@samba.org> <20090714065425.301516312@samba.org> X-Yow: It's strange, but I'm only TRULY ALIVE when I'm covered in POLKA DOTS and TACO SAUCE... Date: Sat, 03 Oct 2009 16:51:29 +0200 In-Reply-To: (Andreas Schwab's message of "Sat, 03 Oct 2009 16:15:38 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Cc: linuxppc-dev@ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Andreas Schwab writes: > Andreas Schwab writes: > >> Anton Blanchard 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 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 --- 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