Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp823310ybi; Thu, 30 May 2019 07:18:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqyv4L/XuP5goMVcIIKP2REgaC3XQoB3ac+P4PgFDALIuRTKpD+YD97rTClCdDo3XcnPo7gI X-Received: by 2002:a63:1344:: with SMTP id 4mr3871069pgt.448.1559225932653; Thu, 30 May 2019 07:18:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559225932; cv=none; d=google.com; s=arc-20160816; b=MKrPQIQ65DFNzqCSgeFXm0R+4+xK6dyMmxN5GnaZd6fjXcbPyRellkyncjME2CzanO 4wgkyFNa1+cuzn3crjvzDeCwXEmxRC2eYhJhbQ/NQEJOtgLDSEh1Wp4nqH36Q4mwlB9k SjSQVa4KbmM/Pt7gH7CrZvi0oOQynkyT++Ur0RrLQz0/z93USkEhPIHra/j0yLSVwzn+ fbPM+ZGhLfwYshrx0hi2qXThD3ICKyho4Q5iZrakGkCiCwt0PBUASB91UPdGKX/SYM3v u4Tat7hNvW55NOe3qWPo4Cr3mh4XlnJjJRfo2+vXqIRvrsTnE908rEAUi0tduDq/3bgF 6dyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=rpUHtLDFsiYLWX1pfpfzuvEPUy3ZdG/ahMf+tYRCI9U=; b=KWdweQ6bdjsg6iZZYzNiOkGnO/TgYBYVEhhIj3hAWQjc8RS/GxalebFqWV+KpjU+2r kN/x7Jm0/CfkknE3LfkyXlUJczmc72hn+3X1c35RoTfp+5JQ9ExTd/8k1P7r3YFnjQTr u0iEVd+esdPWmB1TGST+CE06qpcWzPQCjfPz+gKggA33M9Ni0teu12Mjum2LYLH6O3s6 J9PFoeOWx89K8Sg2v9IV2FQd2AOGZs5UabhtaBRNuFrcJ/IOxwiAs0jCOSDnC/c5Fei7 tGO2BLZJoJd6OISI/uU4lMX5lcF8t40TS0S/R7IlAcLOQkehbDCnF+xdXzKj4WR42xY2 PZGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k33si3490388pld.359.2019.05.30.07.18.35; Thu, 30 May 2019 07:18:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727513AbfE3OQd (ORCPT + 99 others); Thu, 30 May 2019 10:16:33 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:36784 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727484AbfE3OQ3 (ORCPT ); Thu, 30 May 2019 10:16:29 -0400 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 2936915AD; Thu, 30 May 2019 07:16:29 -0700 (PDT) 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 11C0C3F59C; Thu, 30 May 2019 07:16:25 -0700 (PDT) From: Vincenzo Frascino To: linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: Catalin Marinas , Will Deacon , Arnd Bergmann , Russell King , Ralf Baechle , Paul Burton , Daniel Lezcano , Thomas Gleixner , Mark Salyzyn , Peter Collingbourne , Shuah Khan , Dmitry Safonov <0x7f454c46@gmail.com>, Rasmus Villemoes , Huw Davies Subject: [PATCH v6 13/19] arm64: elf: vDSO code page discovery Date: Thu, 30 May 2019 15:15:25 +0100 Message-Id: <20190530141531.43462-14-vincenzo.frascino@arm.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530141531.43462-1-vincenzo.frascino@arm.com> References: <20190530141531.43462-1-vincenzo.frascino@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Add 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 355d120b78cb..34cabaf78011 100644 --- a/arch/arm64/include/asm/elf.h +++ b/arch/arm64/include/asm/elf.h @@ -213,7 +213,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 \ -- 2.21.0