Bug 1726641 - Request a backport of fixes for SVE Vector PCS on AArch64 (gcc part)
Summary: Request a backport of fixes for SVE Vector PCS on AArch64 (gcc part)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: gcc
Version: ---
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Marek Polacek
QA Contact: Alexandra Petlanová Hájková
Kevin Owen
URL:
Whiteboard:
Depends On:
Blocks: 1724130 1755139
TreeView+ depends on / blocked
 
Reported: 2019-07-03 10:56 UTC by Nick Clifton
Modified: 2021-09-17 14:35 UTC (History)
9 users (show)

Fixed In Version: gcc-toolset-9-gcc-9.2.1-2.1.el8
Doc Type: Bug Fix
Doc Text:
.Advanced SIMD functions on the 64-bit ARM architecture no longer miscompile when lazily resolved Previously, the new vector Procedure Call Standard (PCS) for Advanced SIMD did not properly save and restore certain callee-saved registers when lazily resolving Advanced SIMD functions. As a consequence, binaries could misbehave at runtime. With this update, the Advanced SIMD and SVE vector functions in the symbol table are marked with `.variant_pcs` and, as a result, the dynamic linker will bind such functions early.
Clone Of:
Environment:
Last Closed: 2020-04-28 15:58:37 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1724130 1 None None None 2021-09-17 12:24:12 UTC
Red Hat Issue Tracker RHELPLAN-26786 0 None None None 2021-08-27 22:46:04 UTC
Red Hat Product Errata RHBA-2020:1683 0 None None None 2020-04-28 15:58:46 UTC

Description Nick Clifton 2019-07-03 10:56:56 UTC
Clone of #1724130, created for the gcc component.

Description of problem:

Arm has introduced a vector PCS for SVE and Advanced SIMD. This showed a problem with lazy binding on SVE vector PCS while testing the qemu implementation of SVE primarily to do with saving and restoring the additional callee saved register state in the new vector PCS when lazily resolving SVE functions. 

The draft text for fixing the ABI for this is at
https://sourceware.org/ml/libc-alpha/2019-05/msg00501.html

It requires the marking of vector functions in the symbol table so the dynamic linker can bind them early. For this the symbol marking has to be propagated from the compiler to the final dynamic linked binary.


Running an executable with vector pcs turned on for SVE. Note that such binaries could be generated by other commercial toolchains as well.


This has been fixed by a series of patches for gcc
binutils and glibc. These need to be backported on systems
that run on SVE hardware to support binaries with extern
SVE calls and to support compiling code with SVE or AdvSIMD
vector calls.

Without the glibc backport, the dynamic linker clobbers
SVE call argument registers in the lazy binding entry code
when the function is first called. So binaries with extern
SVE calls will misbehave at runtime.

Without the binutils backport, the bfd linker silently
drops symbol markings at link time, creating broken
binaries that misbehave even with an updated glibc.
Without the binutils backport, the assembler fails to
assemble code with SVE or AdvSIMD calls because it does
not understand the new .variant_pcs directive.

Without the gcc backport, gcc-9 emits AdvSIMD vector calls
without marking them with .variant_pcs and thus they won't
follow the new ABI. This is unlikely to cause runtime
problems now as AdvSIMD registers are unlikely to be
corrupted by the dynamic linker, but the marking is an ABI
requirement and will be necessary to support LD_AUDIT or
arbitrary ifunc resolvers for AdvSIMD vector calls among
other features.

We plan to backport the patches below to gcc-9, binutils-2.32
and several glibc release branches.

patches:

gcc:

commit 779640c76d37b32f4d8a7b97637ed9e345d750b4
Commit:     nsz <nsz@138bc75d-0d04-0410-961f-82ee72b054a4>
CommitDate: 2019-06-03 13:50:53 +0000

    aarch64: emit .variant_pcs for aarch64_vector_pcs symbol references
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@271869 138bc75d-0d04-0410-961f-82ee72b054a4

commit d403a7711c2cf9a7a4892d76b875a1c99a690f89
Commit:     nsz <nsz@138bc75d-0d04-0410-961f-82ee72b054a4>
CommitDate: 2019-06-04 16:16:52 +0000

    aarch64: fix asm visibility for extern symbols
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@271913 138bc75d-0d04-0410-961f-82ee72b054a4

Comment 11 errata-xmlrpc 2020-04-28 15:58:37 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:1683


Note You need to log in before you can comment on or make changes to this bug.