From patchwork Tue Aug 6 14:08:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 33976 Received: (qmail 103912 invoked by alias); 6 Aug 2019 14:08:17 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 103893 invoked by uid 89); 6 Aug 2019 14:08:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=csu X-HELO: mx0a-001b2d01.pphosted.com From: Stefan Liebler Subject: Re: [PATCH 03/12] s390: Enable VDSO for static linking To: libc-alpha@sourceware.org Cc: Heiko Carstens References: <20190614152908.8101-1-adhemerval.zanella@linaro.org> <20190614152908.8101-3-adhemerval.zanella@linaro.org> Date: Tue, 6 Aug 2019 16:08:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: x-cbid: 19080614-0008-0000-0000-00000305CECF X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19080614-0009-0000-0000-0000A17FD840 Message-Id: <2379984f-9948-5ecf-9437-fd54e8a1d32e@linux.ibm.com> On 8/2/19 2:34 PM, Adhemerval Zanella wrote: > Ping. > > On 14/06/2019 12:28, Adhemerval Zanella wrote: >> Although s390 explicit does not enable vDSO for binaries without >> (arch/s390/kernel/vdso.c:217), there is no indication in the code >> the rationale for disabling it. In fact, I rebuilt a kernel with the >> check removed and the vDSO does work for static build for supplied >> symbols. Hi Adhemerval, Sorry, I haven't recognized this patch as it was hidden behind the email-thread starting with "[PATCH 01/12] m68k: Remove vDSO support". Please cc me if I'm not responding for s390 patches. I've just had a look into the kernel arch/s390/kernel/vdso.c file and I'm a little bit confused regarding the line number 217 (see my excerpt below). Just to be sure, have you removed the "if (!uses_interp)" or the "if (!vdso_enabled)"? /* * This is called from binfmt_elf, we create the special vma for the * vDSO and insert it into the mm struct tree */ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) { struct mm_struct *mm = current->mm; struct vm_area_struct *vma; unsigned long vdso_pages; unsigned long vdso_base; int rc; 217: if (!vdso_enabled) return 0; /* * Only map the vdso for dynamically linked elf binaries. */ 222: if (!uses_interp) return 0; As far as I know, vdso was disabled for statically linked binaries as glibc had not supported it and thus nothing "useless" was mapped (especially on 31bit). I've also cc'ed Heiko. Perhaps he can also enable it on s390 for statically linked binaries. Nevertheless this patch breaks s390. I've just committed the attached fix which adds the removed VDSO_SETUP macro definition. Bye. Stefan commit cf6ac72fdd2026e91c0672ccf0eefd2e58920bdc Author: Stefan Liebler Date: Tue Aug 6 14:15:09 2019 +0200 s390: Fix Enable VDSO for static linking The commit 5e855c8954014bca7b0d6f07312ec09553695ffd "s390: Enable VDSO for static linking" removed the definition of VDSO_SETUP which leads to not setup the vdso symbols. Instead it jumps to false addresses. This patch just re adds the removed VDSO_SETUP macro definition. ChangeLog: * sysdeps/unix/sysv/linux/s390/init-first.c (VDSO_SETUP): New define. diff --git a/sysdeps/unix/sysv/linux/s390/init-first.c b/sysdeps/unix/sysv/linux/s390/init-first.c index 8c54d13935..a1ad9458e3 100644 --- a/sysdeps/unix/sysv/linux/s390/init-first.c +++ b/sysdeps/unix/sysv/linux/s390/init-first.c @@ -53,4 +53,6 @@ _libc_vdso_platform_setup (void) VDSO_SYMBOL (getcpu) = p; } +#define VDSO_SETUP _libc_vdso_platform_setup + #include