From patchwork Fri Nov 9 12:37:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincenzo Frascino X-Patchwork-Id: 10675871 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0E5D214BD for ; Fri, 9 Nov 2018 12:45:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0BEA2EBF5 for ; Fri, 9 Nov 2018 12:45:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E48742EC3F; Fri, 9 Nov 2018 12:45:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 925362EBF5 for ; Fri, 9 Nov 2018 12:45:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Onl1Qk4jD1OARZA1A6gIcTzmMRYe+YvYqMHdpFMkFaE=; b=oT6IB7K3vdRux1 ydylKfFkFu+rvzdCwg6Hcmcwwv63bS9zbmTeBtrJdQunYAhgjr68zzGGpEbChasc8U4j2TUDx/Ya9 Vd0IlSituHbUrL7m5GNGlyy+e4mC8jnYlGlXunnGB0gW9QRltuFY6BWzLtWrpuvSmJkOG4p6InwI5 nQSUFnX0sXfMtSsxvLJsEcqBr4/F3pG1W/5lX3ojXkZLXtUSmmja78NyoQQ7Yhmhbawh4EsBtDbQf D8c0Gn6j0MFfHshnuU3UfJrzbrmdBRMqEHQ0wFsculQphBU9z92uuQDcjSud5mh0hGztUgRqvVLmM KlPtaU9wVl6XeQn894hA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gL6A2-0004ml-Lm; Fri, 09 Nov 2018 12:45:18 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gL63j-0005GE-Tu for linux-arm-kernel@bombadil.infradead.org; Fri, 09 Nov 2018 12:38:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=EjWkX9sueZEICDF36WDjLsPdn6yTOIMS46DbtVW/9m4=; b=qmiT4djnV1RgRE3IeSL1FfIBLM xTIXJx0vCnggo1nM4LXO9ueguKyOb+auAIzOPctS1sbdBDj7PYBJospBOTHQokfeG/KfYPCKo/iGt XWPLCYOCefYQ35mhSRJBAhiJ5IF2FAySfnCafXSZhGx9igkO1EPS9xcix+qhm/R2ZNTJn0sDtNRcZ G7avVBiYVQYpUITBfz9z2c+qEcSAkzRjLIqF8/XDxFud0BTPVfQErsFhX8sfpkqykRS5Ua7AuPEbN TieGtQMy09WGEeqnUZNXOoLwzCNYeD7IK/yuGuAetpIgNgWQ0rwCMEfDp86OTpbsCEr682y1O9upq KYyV/mYw==; Received: from foss.arm.com ([217.140.101.70]) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gL63g-0006YZ-LL for linux-arm-kernel@lists.infradead.org; Fri, 09 Nov 2018 12:38:46 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 02D291650; Fri, 9 Nov 2018 04:38:34 -0800 (PST) Received: from e119884-lin.cambridge.arm.com (e119884-lin.cambridge.arm.com [10.1.196.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E58CC3F718; Fri, 9 Nov 2018 04:38:31 -0800 (PST) From: Vincenzo Frascino To: linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 19/27] arm64: elf: vDSO code page discovery Date: Fri, 9 Nov 2018 12:37:22 +0000 Message-Id: <20181109123730.8743-20-vincenzo.frascino@arm.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181109123730.8743-1-vincenzo.frascino@arm.com> References: <20181109123730.8743-1-vincenzo.frascino@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181109_123844_964260_2011A448 X-CRM114-Status: GOOD ( 11.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Catalin Marinas , Daniel Lezcano , Will Deacon , Russell King , Ralf Baechle , Mark Salyzyn , Paul Burton , Thomas Gleixner , Peter Collingbourne Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Like in normal vDSOs, when compat vDSOs are enabled the auxiliary vector symbol AT_SYSINFO_EHDR needs to point at the address of the vDSO code, to allow the dynamic linker to find it. This patch adds the necessary code to the elf arm64 module to make this possible. Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Vincenzo Frascino --- arch/arm64/include/asm/elf.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h index f2b6b486deb7..3fb46968da6a 100644 --- a/arch/arm64/include/asm/elf.h +++ b/arch/arm64/include/asm/elf.h @@ -209,7 +209,21 @@ typedef compat_elf_greg_t compat_elf_gregset_t[COMPAT_ELF_NGREG]; ({ \ set_thread_flag(TIF_32BIT); \ }) +#ifdef CONFIG_GENERIC_COMPAT_VDSO +#define COMPAT_ARCH_DLINFO \ +do { \ + /* \ + * Note that we use Elf64_Off instead of elf_addr_t because \ + * elf_addr_t in compat is defined as Elf32_Addr and casting \ + * current->mm->context.vdso to it triggers a cast warning of \ + * cast from pointer to integer of different size. \ + */ \ + NEW_AUX_ENT(AT_SYSINFO_EHDR, \ + (Elf64_Off)current->mm->context.vdso); \ +} while (0) +#else #define COMPAT_ARCH_DLINFO +#endif extern int aarch32_setup_additional_pages(struct linux_binprm *bprm, int uses_interp); #define compat_arch_setup_additional_pages \