Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp475768ybi; Fri, 21 Jun 2019 02:54:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqy491Aj7HsnmVZIr/w0pkSfLVMnmWc72y8rt3O6kBGlyLbHyTUXzIES1M76wLZpE2ARx4WU X-Received: by 2002:a63:3c14:: with SMTP id j20mr5887499pga.169.1561110871827; Fri, 21 Jun 2019 02:54:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561110871; cv=none; d=google.com; s=arc-20160816; b=AA7WDMA4h0evA20dzJqaV9xIdfWVBSaA27BjMskJ2al5x9pzBunFVK4+1xCu0nhoDl 6+G6vEUIttChLp7jzsTiA+5VyzKRA3quRDhWz3CTEHkGApM0AHS3RXneL3AW/X/BrEQl apDfyhglBiTBvFJF+VmB1gWRkb+srn28XecqEFtOB1o5/bqulYImeRc5OlJ4mYZLezmt mvw6mXyx9eGkzW0jtY6Fjn0qPwQjFffGzY/YH8Jwe4YbXJGfdx91Sw1l+Coa4rdSc2iS SmTC3pD7NI2ztnHEZJ/t8PSpJZNfWH+ZoG5ZpBwoIdkH9VSn8xshVUa0f0IOL7r/+Mcn /D7g== 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=AzYBaB0j++xl9QjV0ryVF8IcdfrvkDPc4zZD0sBOIps=; b=h++ow73PN2qM4LlzyvvQvyO3msoKlgc0tBZePalxh3mER/Ib1RTcqQPf4GvpbTFy26 vwN2BC5x6SWGFdP52rn+2ccdlSg/n1b/g3OSnFjs6L2UI9P+0rQo3Vtwb15IpfpTFeug rBiJUHYsRxbelh1prAo1AdM41XlVNMusKZm0xKqcx8fg2KC9LHzoX78PIsC36IxEhDkI N+igA45X8oEz8n6bN8OCQOSs2OInLP9U6sa/VbrtPJfUM9QQXpSA4y1ZNCPBFh9bC1n+ tpIK5TBOXYVTPgyQWFDsTPoVHULnOMFcF72kAeO5drOsPVuco2uOxaolfqlqc3odgUnT 6b8Q== 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 m3si2469520pld.40.2019.06.21.02.54.17; Fri, 21 Jun 2019 02:54:31 -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 S1727031AbfFUJxr (ORCPT + 99 others); Fri, 21 Jun 2019 05:53:47 -0400 Received: from foss.arm.com ([217.140.110.172]:55542 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726617AbfFUJxo (ORCPT ); Fri, 21 Jun 2019 05:53:44 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7AC4E1500; Fri, 21 Jun 2019 02:53:43 -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 E55743F246; Fri, 21 Jun 2019 02:53:40 -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 , Shijith Thotton , Andre Przywara Subject: [PATCH v7 13/25] arm64: elf: vDSO code page discovery Date: Fri, 21 Jun 2019 10:52:40 +0100 Message-Id: <20190621095252.32307-14-vincenzo.frascino@arm.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190621095252.32307-1-vincenzo.frascino@arm.com> References: <20190621095252.32307-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 Tested-by: Shijith Thotton Tested-by: Andre Przywara --- 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