[20.04 Feature] Enable glibc for POWER10

Bug #1887989 reported by bugproxy
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
The Ubuntu-power-systems project
Fix Released
Medium
Ubuntu on IBM Power Systems Bug Triage
glibc (Ubuntu)
Fix Released
Undecided
Canonical Foundations Team
Focal
Fix Released
Undecided
Canonical Foundations Team
Groovy
Fix Released
Undecided
Canonical Foundations Team

Bug Description

[Impact]

 * glibc / ld does not know about new power10 capability, and thus unable to load libraries optimizied for power10, on power10 hardware.

[Test Case]

 * sudo rm /etc/ld.so.cache
 * LD_SHOW_AUXV=yes LD_DEBUG=libs /bin/true

Expectations are that in AT_HWCAP2 power10 specific features are listed
AT_PLATFORM is set to power10
and that search paths include /power10/ directories

The sample output from power8 machine is this

$ LD_SHOW_AUXV=yes LD_DEBUG=libs /bin/true
AT_DCACHEBSIZE: 0x80
AT_ICACHEBSIZE: 0x80
AT_UCACHEBSIZE: 0x0
AT_SYSINFO_EHDR: 0x73b685b20000
AT_L1I_CACHESIZE: 32768
AT_L1I_CACHEGEOMETRY: 128B line size, 8-way set associative
AT_L1D_CACHESIZE: 65536
AT_L1D_CACHEGEOMETRY: 128B line size, 8-way set associative
AT_L2_CACHESIZE: 524288
AT_L2_CACHEGEOMETRY: 128B line size, 8-way set associative
AT_L3_CACHESIZE: 8388608
AT_L3_CACHEGEOMETRY: 128B line size, 8-way set associative
AT_HWCAP: true_le archpmu vsx arch_2_06 dfp ic_snoop smt mmu fpu altivec ppc64 ppc32
AT_PAGESZ: 65536
AT_CLKTCK: 100
AT_PHDR: 0x5b376320040
AT_PHENT: 56
AT_PHNUM: 9
AT_BASE: 0x73b685b40000
AT_FLAGS: 0x0
AT_ENTRY: 0x5b376321ab0
AT_UID: 1000
AT_EUID: 1000
AT_GID: 1000
AT_EGID: 1000
AT_SECURE: 0
AT_RANDOM: 0x7fffc779b3f2
AT_HWCAP2: htm-nosc vcrypto tar isel ebb dscr htm arch_2_07
AT_EXECFN: /bin/true
AT_PLATFORM: power8
AT_BASE_PLATFORM: power8
    277374: find library=libc.so.6 [0]; searching
    277374: search cache=/etc/ld.so.cache
    277374: search path=/lib/powerpc64le-linux-gnu/tls/power8/altivec/dfp:/lib/powerpc64le-linux-gnu/tls/power8/altivec:/lib/powerpc64le-linux-gnu/tls/power8/dfp:/lib/powerpc64le-linux-gnu/tls/power8:/lib/powerpc64le-linux-gnu/tls/altivec/dfp:/lib/powerpc64le-linux-gnu/tls/altivec:/lib/powerpc64le-linux-gnu/tls/dfp:/lib/powerpc64le-linux-gnu/tls:/lib/powerpc64le-linux-gnu/power8/altivec/dfp:/lib/powerpc64le-linux-gnu/power8/altivec:/lib/powerpc64le-linux-gnu/power8/dfp:/lib/powerpc64le-linux-gnu/power8:/lib/powerpc64le-linux-gnu/altivec/dfp:/lib/powerpc64le-linux-gnu/altivec:/lib/powerpc64le-linux-gnu/dfp:/lib/powerpc64le-linux-gnu:/usr/lib/powerpc64le-linux-gnu/tls/power8/altivec/dfp:/usr/lib/powerpc64le-linux-gnu/tls/power8/altivec:/usr/lib/powerpc64le-linux-gnu/tls/power8/dfp:/usr/lib/powerpc64le-linux-gnu/tls/power8:/usr/lib/powerpc64le-linux-gnu/tls/altivec/dfp:/usr/lib/powerpc64le-linux-gnu/tls/altivec:/usr/lib/powerpc64le-linux-gnu/tls/dfp:/usr/lib/powerpc64le-linux-gnu/tls:/usr/lib/powerpc64le-linux-gnu/power8/altivec/dfp:/usr/lib/powerpc64le-linux-gnu/power8/altivec:/usr/lib/powerpc64le-linux-gnu/power8/dfp:/usr/lib/powerpc64le-linux-gnu/power8:/usr/lib/powerpc64le-linux-gnu/altivec/dfp:/usr/lib/powerpc64le-linux-gnu/altivec:/usr/lib/powerpc64le-linux-gnu/dfp:/usr/lib/powerpc64le-linux-gnu:/lib/tls/power8/altivec/dfp:/lib/tls/power8/altivec:/lib/tls/power8/dfp:/lib/tls/power8:/lib/tls/altivec/dfp:/lib/tls/altivec:/lib/tls/dfp:/lib/tls:/lib/power8/altivec/dfp:/lib/power8/altivec:/lib/power8/dfp:/lib/power8:/lib/altivec/dfp:/lib/altivec:/lib/dfp:/lib:/usr/lib/tls/power8/altivec/dfp:/usr/lib/tls/power8/altivec:/usr/lib/tls/power8/dfp:/usr/lib/tls/power8:/usr/lib/tls/altivec/dfp:/usr/lib/tls/altivec:/usr/lib/tls/dfp:/usr/lib/tls:/usr/lib/power8/altivec/dfp:/usr/lib/power8/altivec:/usr/lib/power8/dfp:/usr/lib/power8:/usr/lib/altivec/dfp:/usr/lib/altivec:/usr/lib/dfp:/usr/lib (system search path)
    277374: trying file=/lib/powerpc64le-linux-gnu/tls/power8/altivec/dfp/libc.so.6
    277374: trying file=/lib/powerpc64le-linux-gnu/tls/power8/altivec/libc.so.6
    277374: trying file=/lib/powerpc64le-linux-gnu/tls/power8/dfp/libc.so.6
    277374: trying file=/lib/powerpc64le-linux-gnu/tls/power8/libc.so.6
    277374: trying file=/lib/powerpc64le-linux-gnu/tls/altivec/dfp/libc.so.6
    277374: trying file=/lib/powerpc64le-linux-gnu/tls/altivec/libc.so.6
    277374: trying file=/lib/powerpc64le-linux-gnu/tls/dfp/libc.so.6
    277374: trying file=/lib/powerpc64le-linux-gnu/tls/libc.so.6
    277374: trying file=/lib/powerpc64le-linux-gnu/power8/altivec/dfp/libc.so.6
    277374: trying file=/lib/powerpc64le-linux-gnu/power8/altivec/libc.so.6
    277374: trying file=/lib/powerpc64le-linux-gnu/power8/dfp/libc.so.6
    277374: trying file=/lib/powerpc64le-linux-gnu/power8/libc.so.6
    277374: trying file=/lib/powerpc64le-linux-gnu/altivec/dfp/libc.so.6
    277374: trying file=/lib/powerpc64le-linux-gnu/altivec/libc.so.6
    277374: trying file=/lib/powerpc64le-linux-gnu/dfp/libc.so.6
    277374: trying file=/lib/powerpc64le-linux-gnu/libc.so.6
    277374:
    277374:
    277374: calling init: /lib/powerpc64le-linux-gnu/libc.so.6
    277374:
    277374:
    277374: initialize program: /bin/true
    277374:
    277374:
    277374: transferring control: /bin/true
    277374:
    277374:
    277374: calling fini: /bin/true [0]
    277374:

[Regression Potential]

 * The additional parsing of the new constant for HWCAP / PLATFORM are backwards compatible, however, it would be nice for the kernel to have the constants backported too. Such that focal kernel has support for POWER10 platform too. These will arrive in the hwe kernel, but should be backported to the generic kernel too.

At the moment Ubuntu, does not provide any power10 libraries, thus only locally built/provided libraries could be installed and loaded from the power10 paths. If such files are present on disk, on a power10 machines, and happen to be buggy and/or abi incompatible, hard to debug crashes may occur. However, this is no different to locally built power9/avx2/avx512/lse etc built libraries on other architectures.

There might be other pieces of software in focal unprepared for power10 AT_PLATFORM as it does sort lower than power9, when similar stanzas looped in the past unintended breakage may also occur.

If incompatibilities with power10 support are detected, they would need to be fixed up under HWE banner.

Note there are no current power10 hardware in production, thus these changes can currently only affect pre-release hardware.

[Other Info]

 * Original bug report

== Comment: #0 - Tulio Magno Quites Machado Filho <email address hidden> - 2020-06-04 09:30:54 ==
Add the basic enablement of POWER10 in glibc (AT_PLATFORM and AT_HWCAP2) allowing userspace software to use POWER10 features by using STT_GNU_IFUNC or providing shared libraries for POWER10, e.g. with files in /usr/lib/powerpc64le-linux-gnu/power10/.

Related branches

bugproxy (bugproxy)
tags: added: architecture-ppc64le bugnameltc-186074 severity-medium targetmilestone-inin2004
Changed in ubuntu:
assignee: nobody → Ubuntu on IBM Power Systems Bug Triage (ubuntu-power-triage)
affects: ubuntu → glibc (Ubuntu)
Changed in ubuntu-power-systems:
importance: Undecided → Medium
assignee: nobody → Canonical Foundations Team (canonical-foundations)
Frank Heimes (fheimes)
Changed in ubuntu-power-systems:
assignee: Canonical Foundations Team (canonical-foundations) → Ubuntu on IBM Power Systems Bug Triage (ubuntu-power-triage)
Changed in glibc (Ubuntu Groovy):
assignee: Ubuntu on IBM Power Systems Bug Triage (ubuntu-power-triage) → Canonical Foundations Team (canonical-foundations)
Changed in glibc (Ubuntu Focal):
assignee: nobody → Canonical Foundations Team (canonical-foundations)
tags: added: id-5f1220e9995686255c4cc718
Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2020-07-20 14:43 EDT-------
Since Canonical doesn't have any P10 hardware, Tulio confirmed that he will take up the testing/verification for this feature.

Revision history for this message
Frank Heimes (fheimes) wrote :

Request by IBM was to get that done for the 20.04.2 timeframe.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Just to clarify, you want us to compile libc, without ability to execute it, its unittests, nor any autopkgtests of any ubuntu packages, ship it, such that it is used by default on power10 hardware without us able to reproduce any bugs with that build?

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Ignore me, i missread the request.

Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2020-08-12 09:42 EDT-------
No, we're asking to backport the following 3 patches from glibc 2.32 that will allow Ubuntu 20.04 to be used to develop software for POWER10:

commit ae725e3f9cb4e1eb825ebe1d55241c98c2ea32f1
Author: Tulio Magno Quites Machado Filho <email address hidden>
Date: Mon Jun 15 11:15:57 2020 -0300

powerpc: Add new hwcap values

Linux commit ID ee988c11acf6f9464b7b44e9a091bf6afb3b3a49 reserved 2 new
bits in AT_HWCAP2:
- PPC_FEATURE2_ARCH_3_1 indicates the availability of the POWER ISA
3.1;
- PPC_FEATURE2_MMA indicates the availability of the Matrix-Multiply
Assist facility.

commit d2ba3677da7a785556fcd708404d8e049b1c063b
Author: Tulio Magno Quites Machado Filho <email address hidden>
Date: Wed Jun 24 18:04:41 2020 -0300

powerpc: Add support for POWER10

1. Add the directories to hold POWER10 files.

2. Add support to select POWER10 libraries based on AT_PLATFORM.

3. Let submachine=power10 be set automatically.

commit f6add169c89bbdd139a2eb845686127ead5799cd (queue/2.32)
Author: Tulio Magno Quites Machado Filho <email address hidden>
Date: Tue Jul 21 18:01:39 2020 -0300

powerpc: Fix POWER10 selection

Add a line that was missing from a previous commit.
Without increasing str, the null-byte is not validated, and
_dl_string_platform returns -1.

Fixes: d2ba3677da7a ("powerpc: Add support for POWER10")

Reviewed-by: Carlos O'Donell <email address hidden>

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Groovy is targeting 2.32 which has POWER10 AT_PLATFORM support.

Changed in glibc (Ubuntu Groovy):
status: New → In Progress
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

For 20.04 backport the following commits will be needed:

146fea07640387c78e334933de24b6353e1f0eba
d2ba3677da7a785556fcd708404d8e049b1c063b
f6add169c89bbdd139a2eb845686127ead5799cd

Changed in glibc (Ubuntu Focal):
status: New → Triaged
Frank Heimes (fheimes)
Changed in ubuntu-power-systems:
status: New → Triaged
description: updated
Revision history for this message
Robie Basak (racb) wrote : Please test proposed package

Hello bugproxy, or anyone else affected,

Accepted glibc into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/glibc/2.31-0ubuntu9.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in glibc (Ubuntu Focal):
status: Triaged → Fix Committed
tags: added: verification-needed verification-needed-focal
Frank Heimes (fheimes)
Changed in ubuntu-power-systems:
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package glibc - 2.31-0ubuntu11

---------------
glibc (2.31-0ubuntu11) groovy; urgency=medium

  [ Michael Hudson-Doyle ]
  * Mark tst-getpw as XFAIL on arm64. (LP: #1869364)

  [ Balint Reczey ]
  * debian/control: Add Vcs-* pointing to Ubuntu packaging repository
  * debian/gbp.conf: Add initial configuration
  * debian/debhelper.in/libc.preinst: Fix setting LDCONFIG_NOTRIGGER
  * debian/control.in/main: Add Vcs-* pointing to Ubuntu packaging repository
  * Fall back to calling nanosleep syscall when __clock_nanosleep returns EINVAL
    (LP: #1871240)
  * debian/testsuite-xfail-debian.mk: XFAIL stdlib/tst-strtod-round on riscv64
  * debian/testsuite-xfail-debian.mk: XFAIL tst-getpw on armhf, too
  * debian/watch: Use HTTPS and download xz-compressed tarball
  * debian/watch: Use upstream's signing key to verify the tarball
  * XFAIL stdlib/tst-getrandom (LP: #1891403)

  [ Dimitri John Ledkov ]
  * debian/patches/powerpc: Cherrypick upstream patches to support POWER10
    optimized library loading. (LP: #1887989)

  [ Aurelien Jarno ]
  * debian/patches/any/submitted-selinux-deprecations.diff: proposed patch to
    ignore the selinux deprecations introduced in libselinux (>= 3.1), fixing
    an FTBFS. (Closes: #965941)

 -- Balint Reczey <email address hidden> Thu, 27 Aug 2020 23:36:39 +0200

Changed in glibc (Ubuntu Groovy):
status: In Progress → Fix Released
Frank Heimes (fheimes)
Changed in ubuntu-power-systems:
status: In Progress → Fix Committed
Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2020-09-04 14:36 EDT-------
Tested on focal with libc6 2.31-0ubuntu9.1 and confirmed it works.

Thanks!

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (glibc/2.31-0ubuntu9.1)

All autopkgtests for the newly accepted glibc (2.31-0ubuntu9.1) for focal have finished running.
The following regressions have been reported in tests triggered by the package:

prometheus-blackbox-exporter/0.13.0+ds-2 (armhf, amd64, ppc64el, s390x, arm64)
prometheus-pushgateway/1.0.0+ds-1 (armhf, amd64, ppc64el, s390x, arm64)
systemd/245.4-4ubuntu3.2 (s390x, amd64, ppc64el)
gfs2-utils/unknown (amd64)
hugo/0.68.3-1 (armhf, amd64, ppc64el, s390x, arm64)
grubzfs-testsuite/0.4.10 (amd64)
glibc/2.31-0ubuntu9.1 (armhf)
badger/2.0.1-3 (armhf, amd64, ppc64el, s390x, arm64)
resource-agents/1:4.5.0-2ubuntu2 (armhf)
etcd/3.2.26+dfsg-6 (amd64, ppc64el)
postgresql-multicorn/1.3.4-31-g9ff7875-3 (armhf, amd64, ppc64el, s390x)
gfs2-utils/3.2.0-3 (ppc64el, s390x, arm64)
scipy/1.3.3-3build1 (ppc64el)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/focal/update_excuses.html#glibc

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package glibc - 2.31-0ubuntu9.1

---------------
glibc (2.31-0ubuntu9.1) focal; urgency=medium

  [ Michael Hudson-Doyle ]
  * Mark tst-getpw as XFAIL on arm64. (LP: #1869364)

  [ Matthias Klose ]
  * Copy the fully conditionalized x86 variant for math-vector-fortran.h
    to /usr/include/finclude. On all architectures. (LP: #1879092)

  [ Balint Reczey ]
  * debian/gbp.conf: Add initial configuration
  * debian/control.in/main: Add Vcs-* pointing to Ubuntu packaging repository
  * debian/debhelper.in/libc.preinst: Fix setting LDCONFIG_NOTRIGGER
    (LP: #1889190)
  * Fall back to calling nanosleep syscall when __clock_nanosleep returns
    EINVAL due to CLOCK_REALTIME not being supported (LP: #1871129)
  * debian/testsuite-xfail-debian.mk: XFAIL tst-getpw on armhf, too
    (LP: #1869364)
  * XFAIL stdlib/tst-getrandom (LP: #1891403)

  [ Dimitri John Ledkov ]
  * debian/patches/powerpc: Cherrypick upstream patches to support POWER10
    optimized library loading. LP: #1887989

 -- Balint Reczey <email address hidden> Mon, 17 Aug 2020 22:02:52 +0200

Changed in glibc (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for glibc has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Frank Heimes (fheimes)
Changed in ubuntu-power-systems:
status: Fix Committed → Fix Released
tags: added: fr-220
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.