From patchwork Wed Aug 1 22:23:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 143316 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1414766ljj; Wed, 1 Aug 2018 15:24:21 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcfeOjdAaSPVBbgXLYQ0Z7e2UN/toym6LOyvQu+NJ79R6F/O6DNutCpiIT41LKii38e/o7i X-Received: by 2002:a63:4f1a:: with SMTP id d26-v6mr183176pgb.121.1533162260937; Wed, 01 Aug 2018 15:24:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533162260; cv=none; d=google.com; s=arc-20160816; b=HAIwPcztcc3PNTpuCCwuhKsb6AXcbZLZgVrmBAKrFJHrHev/vhOAdEloYpyFTG24DF D9ZcLY9qhxPsci57H9fbCHcvzDr0Ckf6MXKem4KgO56yuq6Ip0GMqxCprSTwutxCLDxe kBCmMMcq7g8L5ABpwxYaaKRKndhcCTtkN7kXrmnvsc9lOxcBCcjSDbbxvqByh5bihUOd ldvfuSsGjmy2j2EcQhiv5UYLFwErEseBHUFnalzqdlH2blJ7pBUTjhpIQoqLGj4D/B4N 89vapYETCFJGLQLGSSu8AfN3F4HoNx6vMSgFkhfWf7tAlvu4MxWCOcSJ1zlLJeNot3Q2 6fZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:sender:dkim-signature :delivered-to:sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list :arc-authentication-results; bh=Tv1ia5wHA3+ldKU+ijBJuH9QtEjVpYaseFI4o6xQcM0=; b=iK0mGNm3TbC2b83LjDsMfINZtMK4xMPci1kylwW5xaoFEL25soyNGEenv/dzg0ZLIg aHwYJ63uBrlcBGbYKz8oyJI2Qy4yzSK5zKt8zy0o3RmNpH9X5ZXWQEd38jh/rU38NyYo gCQoHcLs5aX5ZpE893rRxkd7mQgKlHt3WuSMVlhvkYmUUSPLDATiW2m2ENtXnJ1WRhN7 AnGYrXYvQfwLBgKuzEfiTK9H824XulmVCXEKXy9OMcynAmpl3OFo4ms0Eq6k5HpKpRms UjaTj5GZmgqxxQTPINoo1RPdmG1QC9EGZd5f9Qx23oLjdakafCIl0TXlLZHLi8zv4KM1 Tp2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SZ5aEqfN; spf=pass (google.com: domain of libc-alpha-return-94986-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-94986-patch=linaro.org@sourceware.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id c38-v6si143734pgb.489.2018.08.01.15.24.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Aug 2018 15:24:20 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-94986-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SZ5aEqfN; spf=pass (google.com: domain of libc-alpha-return-94986-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-94986-patch=linaro.org@sourceware.org" Received: (qmail 24078 invoked by alias); 1 Aug 2018 22:23:58 -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 23736 invoked by uid 89); 1 Aug 2018 22:23:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.7 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_2, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Markus X-HELO: mail-vk0-f46.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=Tv1ia5wHA3+ldKU+ijBJuH9QtEjVpYaseFI4o6xQcM0=; b=SZ5aEqfNt5+x9e9tSkaVouiCcKP5SVcVHP0CjwRk0ZcSIT1sRC7bABiQpPGPZPUHUQ xldJbx0Z4Q2VsyaOSDL6wT4r5gGhRS75z/92YlMmwhoqQrbq+fFiC+x6B1Q76SjDzNEx NHCbJ9WVANn/CSz0KH+Ex6GlOV4aESBcVEuog6vaeB5rQ4A7cLX/rAQrUQtlsLu82hdb h2u1RWmG4l3Ln7HLcJlayLIoIBmD8B47RS/gsD0aLNNYEoY2ydstkETCUuXkZKJJ5dJd MEpi4f7VlqIlb3NpsiNu549rePXLstR4P4nErNpdOfbo7vYDVMvFJYGhjS1BMqL/5evx px6w== Return-Path: Sender: Richard Henderson From: rth@twiddle.net To: libc-alpha@sourceware.org Cc: marcus.shawcroft@linaro.org, szabolcs.nagy@arm.com, Richard Henderson Subject: [PATCH 0/3] aarch64: Update ld.so for vector abi Date: Wed, 1 Aug 2018 18:23:44 -0400 Message-Id: <20180801222347.18903-1-rth@twiddle.net> From: Richard Henderson There is a new calling convention defined for vectorized functions [1]. This is similar to what has happened for x86_64, where the original ABI did not pass or preserve full vector contents, but then a new ABI is defined that does. There was an old patch for [BZ #15128] that saves full AdvSIMD registers along _dl_runtime_resolve, but failed to do so for _dl_runtime_profile. In the chatter for the BZ [2], Markus Shawcroft mentions that it should save and restore d0-d7, which is indeed correct fro the original ABI. It is not clear from the BZ why q0-q7 are saved instead. That said, the new abi for AdvSIMD does use q0-q7. When SVE is enabled, we need to save even more: z0-z7 plus p0-p3. This fixes a number of minor issues with _dl_runtime_resolve itself, and more major issues with _dl_runtime_profile before copying those routines and making the modifications required for SVE. I have *not* attempted to extend the interface for the new ABI. This should be done with more discussion on list. I have instead simply saved and restored registers as the abi requires, so that the actual callee gets the correct data. I have lightly tested this under QEMU, in that the new sve paths pass the same glibc tests as the old paths. r~ [1] http://infocenter.arm.com/help/topic/com.arm.doc.ecm0665628/abi_sve_aapcs64_100986_0000_00_en.pdf [2] https://sourceware.org/bugzilla/show_bug.cgi?id=15128#c11 Richard Henderson (3): aarch64: Clean up _dl_runtime_resolve aarch64: Clean up _dl_runtime_profile aarch64: Save and restore SVE registers in ld.so sysdeps/aarch64/dl-machine.h | 13 +- sysdeps/aarch64/dl-trampoline.S | 531 +++++++++++++++++++++++++------- 2 files changed, 438 insertions(+), 106 deletions(-) -- 2.17.1