Bug 1726637 - Request a backport of fixes for SVE Vector PCS on AArch64 (binutils part)
Summary: Request a backport of fixes for SVE Vector PCS on AArch64 (binutils part)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: binutils
Version: 8.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Nick Clifton
QA Contact: Miloš Prchlík
URL:
Whiteboard:
Depends On:
Blocks: 1755139 1746913
TreeView+ depends on / blocked
 
Reported: 2019-07-03 10:39 UTC by Nick Clifton
Modified: 2020-09-20 13:32 UTC (History)
6 users (show)

Fixed In Version: binutils-2 binutils-2.30-60.el8
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-28 16:45:36 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Bugzilla 1724130 unspecified CLOSED Request a backport of fixes for SVE Vector PCS on AArch64 2020-11-14 13:23:38 UTC
Red Hat Product Errata RHSA-2020:1797 None None None 2020-04-28 16:45:59 UTC

Description Nick Clifton 2019-07-03 10:39:51 UTC
Clone of #1724130, created for the binutils 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:

commit 2301ed1c9af1316b4bad3747d2b03f7d44940f87
Commit:     Szabolcs Nagy <szabolcs.nagy@arm.com>
CommitDate: 2019-05-24 15:05:57 +0100

    aarch64: add STO_AARCH64_VARIANT_PCS and DT_AARCH64_VARIANT_PCS

commit f166ae0188dcb89c5ae925034260a708a254ab2f
Commit:     Szabolcs Nagy <szabolcs.nagy@arm.com>
CommitDate: 2019-05-24 15:07:42 +0100

    aarch64: handle .variant_pcs directive in gas

commit 0b4eac57c44ec4c9e13f5201b40936c3b3e6c639
Commit:     Szabolcs Nagy <szabolcs.nagy@arm.com>
CommitDate: 2019-05-24 15:09:06 +0100

    aarch64: override default elf .set handling in gas

commit 823710d5856996d1f54f04ecb2f7647aeae99b5b
Commit:     Szabolcs Nagy <szabolcs.nagy@arm.com>
CommitDate: 2019-05-24 15:11:00 +0100

    aarch64: handle STO_AARCH64_VARIANT_PCS in bfd

commit 65f381e729bedb933f3e1376e7f53f0ff63ac9a8
Commit:     Szabolcs Nagy <szabolcs.nagy@arm.com>
CommitDate: 2019-05-28 12:03:51 +0100

    aarch64: fix variant_pcs ld tests

Comment 6 Nick Clifton 2019-10-29 08:16:22 UTC
Fixed in binutils-2.30-60.el8

Comment 8 Miloš Prchlík 2020-03-17 09:46:02 UTC
Verified with binutils-2.30-73.el8:

PASS: gas/aarch64/symbol-variant_pcs-1
PASS: gas/aarch64/symbol-variant_pcs-2
PASS: gas/aarch64/symbol-variant_pcs-3

PASS: ld-aarch64/variant_pcs-r
FAIL: ld-aarch64/variant_pcs-shared
FAIL: ld-aarch64/variant_pcs-now


The failures seem to be only issues with the expected formatting of the test output, unexpected lines and so on, not actual PCS issues. The patches are applied, and the test output matches the expected when it comes to PCS.

Comment 10 errata-xmlrpc 2020-04-28 16:45:36 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/RHSA-2020:1797


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