public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Stefan Liebler <stli@linux.ibm.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH 12/11] s390x: Add Add glibc-hwcaps support
Date: Thu, 10 Dec 2020 11:22:20 +0100	[thread overview]
Message-ID: <16ea2bf3-6516-a214-4474-a5f317c543d6@linux.ibm.com> (raw)
In-Reply-To: <87sg8e4xsm.fsf@oldenburg2.str.redhat.com>

On 12/9/20 7:52 PM, Florian Weimer wrote:
> * Stefan Liebler:
> 
>> I've had a look to your patches. Can you please adjust some lines. Then
>> this patch is okay for s390x:
>> - The commit subject-line contains "Add Add"
> 
> Oops, fixed.
> 
>> - If e.g. a machine newer-than-z15 does not have HWCAP_S390_SORT, then
>> it would fall back to z14:
>>
>> diff --git a/sysdeps/s390/s390-64/dl-hwcaps-subdirs.c
>> b/sysdeps/s390/s390-64/dl-hwcaps-subdirs.c
>> index fa8d2ce1f1..3673808a45 100644
>> --- a/sysdeps/s390/s390-64/dl-hwcaps-subdirs.c
>> +++ b/sysdeps/s390/s390-64/dl-hwcaps-subdirs.c
>> @@ -41,11 +41,12 @@ _dl_hwcaps_subdirs_active (void)
>>      return _dl_hwcaps_subdirs_build_bitmask (subdirs_count, active);
>>    ++active;
>>
>> -  /* z15.  */
>> +  /* z15.
>> +     Note: We do not list HWCAP_S390_SORT and HWCAP_S390_DFLT here as,
>> +     according to the Principles of Operation, those may be replaced or
>> removed
>> +     in future.  */
>>    if (!((GLRO (dl_hwcap) & HWCAP_S390_VXRS_EXT2)
>> -        && (GLRO (dl_hwcap) & HWCAP_S390_VXRS_PDE)
>> -        && (GLRO (dl_hwcap) & HWCAP_S390_SORT)
>> -        && (GLRO (dl_hwcap) & HWCAP_S390_DFLT)))
>> +        && (GLRO (dl_hwcap) & HWCAP_S390_VXRS_PDE)))
>>      return _dl_hwcaps_subdirs_build_bitmask (subdirs_count, active);
>>    ++active;
> 
> Does -march=z15 imply SORT and DFLT?  That bit wasn't clear to me.
> If it does not, we should net test for it.
No, the corresponding instructions are not emitted by gcc -march=z15.
E.g. dfltcc is manually added to zlib. There is a runtime check if this
facility is available.
> 
>> - I've asked the kernel-guys regarding AT_PLATFORM: The list is
>> complete, but it never contains archXYZ. This is only available for
>> binutils/gcc -march=archXYZ.
> 
> Okay, I went with the current kernel sources and did not check the
> history there.
> 
>> - If running e.g. on z196 or older, tst-glibc-hwcaps will always fail,
>> as level would be <= 9 which leads to fails:
>> TEST_COMPARE (marker2 (), MIN (level - 9, 2));
>> Therefore compute_level should always return the baseline for older
>> platforms.
> 
> Oh, good point.
> 
>> - If we are running on z13 or newer and the kernel was booted with novx,
>> then AT_PLATFORM is z13 or newer, but _dl_hwcaps_subdirs_active will
>> return zero and the _dl_hwcaps_subdirs are not searched as HWCAP_S390_VX
>> and all the other VX.. flags are not set. This leads to a test fail.
> 
> That's quite bad because it breaks the existing AT_PLATFORM subdirectory
> for z13 and newer.  (I expect the reason to have such a directory is to
> put vectorized code there.)  Given that this is an unsupported
> configuration for glibc, maybe the test failure is acceptable.  On the
> other hand, if we deprecate the old mechanism (separate discussion),
> this becomes a supported configuration, so adapting the test makes
> sense.
I assume novx is usually used only for testing purposes. If e.g. RHEL 8
is booted with novx, it would fail on the first vector instruction as
the ALS includes those.

Currently I know, that the dfp-subdirectory was used for libdfp in the
past. Now the distros require a minimum architecture level which always
has support for dfp and the base libdfp library is built with hardware
dfp instructions.

There are also different flavors for libatlas. As far as I know, those
are located in the corresponding vector-hwcap subdirectories instead of
z13/z14/z15.

Do you have an outlook when you plan to deprecate/remove the old mechanism?

> 
>> I've also recognized that if build with gcc 6.5.0, I'll get test-fails:
>> elf/tst-glibc-hwcaps-cache
>> elf/tst-glibc-hwcaps-prepend-cache
>> elf/tst-ldconfig-X
>> elf/tst-ldconfig-bad-aux-cache
>> elf/tst-ldconfig-ld_so_conf-update
>> elf/tst-stringtable
>>
>> It seems as it always fails with "String table is too large".
>> I've debugged elf/tst-stringtable into elf/stringtable:185:
>> else if (__builtin_add_overflow (previous->offset,
>>                                  previous->length + 1,
>>                                  &current->offset))
>>                 error (EXIT_FAILURE, 0, _("String table is too large"));
>>
>> It seems as gcc 6.5.0 __builtin_add_overflow is buggy:
> 
> Sorry, I do not recall a discussion of this particular bug.  I do not
> see changes s390.md that would correspond to this (but then I'm not GCC
> developer …).
> 
> I haven't seen such a failure on other architectures.
I assume, there won't be a further gcc 6 version in future which could
fix it. As ldconfig would fail with "String table is too large" if build
with gcc 6.5, would you recommend to use gcc 7.1 as minumum on
s390/s390x? Currently gcc 6.2 and newer is required in <glibc>/configure.ac.

> 
>> While viewing your previous patches, I've found the following "if" in
>> commit "elf: Add glibc-hwcaps subdirectory support to ld.so cache
>> processing":
>> elf/dl-hwcaps.c:
>> static void
>> +sort_priorities_by_name (void)
>> +{
>> ...
>> +	int cmp = memcmp (current->name, previous->name, to_compare);
>> +	if (cmp >= 0
>> +	    || (cmp == 0 && current->name_length >= previous->name_length))
>> +	  break;
>> Is this condition intended? The second part "cmp == 0" will never be
>> evaluated as in this case, the first part "cmp >= 0" is already true.
> 
> Thanks, I've pushed a fix for that.
> 
> I'll post an update of the s390x patch soon.
> 
> Florian
> 
Thanks,
Stefan

  reply	other threads:[~2020-12-10 10:22 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-09 18:40 [PATCH v4 00/11] " Florian Weimer
2020-11-09 18:40 ` [PATCH 01/11] support: Add support_copy_file Florian Weimer
2020-11-26 16:43   ` Adhemerval Zanella
2020-11-26 17:22     ` Florian Weimer
2020-11-09 18:40 ` [PATCH 02/11] elf: Introduce enum opt_format in the ldconfig implementation Florian Weimer
2020-11-26 16:44   ` Adhemerval Zanella
2020-11-26 18:54   ` [PATCH 12/11] s390x: Add Add glibc-hwcaps support Florian Weimer
2020-12-07  8:16     ` Florian Weimer
2020-12-08 15:47       ` Stefan Liebler
2020-12-09 18:52         ` Florian Weimer
2020-12-10 10:22           ` Stefan Liebler [this message]
2020-12-10 14:54             ` Florian Weimer
2020-11-09 18:40 ` [PATCH 03/11] elf: Add glibc-hwcaps support for LD_LIBRARY_PATH Florian Weimer
2020-11-26 20:29   ` Adhemerval Zanella
2020-11-27 19:49     ` Florian Weimer
2020-11-30 18:59       ` Adhemerval Zanella
2020-12-04 12:25       ` Matheus Castanho
2020-12-04 12:43         ` Florian Weimer
2020-12-04 12:59           ` Matheus Castanho
2020-11-09 18:40 ` [PATCH 04/11] elf: Add endianness markup to ld.so.cache Florian Weimer
2020-11-27 13:56   ` Adhemerval Zanella
2020-11-27 19:49     ` Florian Weimer
2020-11-30 19:00       ` Adhemerval Zanella
2020-11-09 18:40 ` [PATCH 05/11] elf: Add extension mechanism " Florian Weimer
2020-11-27 18:01   ` Adhemerval Zanella
2020-11-27 18:55     ` Florian Weimer
2020-11-27 18:56       ` Adhemerval Zanella
2020-11-09 18:40 ` [PATCH 06/11] elf: Implement a string table for ldconfig, with tail merging Florian Weimer
2020-11-27 19:29   ` Adhemerval Zanella
2020-11-27 19:49     ` Florian Weimer
2020-11-30 19:01       ` Adhemerval Zanella
2020-11-09 18:41 ` [PATCH 07/11] elf: Implement tail merging of strings in ldconfig Florian Weimer
2020-11-30 18:41   ` Adhemerval Zanella
2020-12-01 10:28     ` Florian Weimer
2020-11-09 18:41 ` [PATCH 08/11] elf: Process glibc-hwcaps subdirectories " Florian Weimer
2020-11-30 19:46   ` Adhemerval Zanella
2020-11-09 18:41 ` [PATCH 09/11] elf: Add glibc-hwcaps subdirectory support to ld.so cache processing Florian Weimer
2020-11-26 17:11   ` Florian Weimer
2020-12-01 17:45   ` Adhemerval Zanella
2020-12-01 20:45     ` Florian Weimer
2020-12-02 12:08       ` Adhemerval Zanella
2020-12-02 12:16         ` Florian Weimer
2020-11-09 18:41 ` [PATCH 10/11] x86_64: Add glibc-hwcaps support Florian Weimer
2020-12-02 12:49   ` Adhemerval Zanella
2020-11-09 18:41 ` [PATCH 11/11] powerpc64le: " Florian Weimer
2020-12-02 13:46   ` Adhemerval Zanella
2020-12-02 13:51     ` Florian Weimer
2020-12-02 14:27       ` Adhemerval Zanella
2020-12-02 14:31         ` Florian Weimer
2020-12-02 15:34           ` Carlos Seo
2020-12-02 20:14             ` Tulio Magno Quites Machado Filho
2020-12-04  8:56               ` Florian Weimer
2020-12-04 12:35                 ` Adhemerval Zanella
2020-11-09 21:56 ` [PATCH v4 00/11] " Dan Horák
2020-11-10 10:41   ` Florian Weimer
2020-11-25 15:46 ` Florian Weimer
2020-11-25 15:58   ` H.J. Lu
2020-11-25 17:20   ` Adhemerval Zanella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16ea2bf3-6516-a214-4474-a5f317c543d6@linux.ibm.com \
    --to=stli@linux.ibm.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).