public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: "H.J. Lu via Libc-alpha" <libc-alpha@sourceware.org>
Subject: Re: [PATCH] x86: Support GNU_PROPERTY_X86_ISA_1_V[234] marker [BZ #26717]
Date: Tue, 13 Oct 2020 04:49:19 -0700	[thread overview]
Message-ID: <CAMe9rOqXt9eFNQFALNE60AskGjfCrJu58BGOvET_bBUSzkCqNA@mail.gmail.com> (raw)
In-Reply-To: <87y2kav2k6.fsf@oldenburg2.str.redhat.com>

On Tue, Oct 13, 2020 at 3:32 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * H. J. Lu via Libc-alpha:
>
> > GCC 11 supports -march=x86-64-v[234] to enable x86 micro-architecture ISA
> > levels:
> >
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97250
> >
> > Binutils has been updated to support GNU_PROPERTY_X86_ISA_1_V[234] marker:
> >
> > https://gitlab.com/x86-psABIs/x86-64-ABI/-/merge_requests/13
> >
> > with
> >
> > commit 32930e4edbc06bc6f10c435dbcc63131715df678
> > Author: H.J. Lu <hjl.tools@gmail.com>
> > Date:   Fri Oct 9 05:05:57 2020 -0700
> >
> >     x86: Support GNU_PROPERTY_X86_ISA_1_V[234] marker
> >
> > in x86 ELF binaries to indicate the micro-architecture ISA level required
> > to execute the binary.
>
> I'm not sure if this is the right design.  But maybe it helps to get
> vendors to stop releasing new v2-only CPUs. 8-/
>
> > Add GNU_PROPERTY_X86_ISA_1_V[234] marker support to ld.so if binutils
> > 2.32 or newer is used to build glibc:
> >
> > 1. Add GNU_PROPERTY_X86_ISA_1_V[234] markers to elf.h.
> > 2. Add GNU_PROPERTY_X86_ISA_1_V[234] marker to abi-note.o based on the
> > ISA level used to compile abi-note.o, assuming that the same ISA level
> > is used to compile the whole glibc.
> > 3. Add isa_1 to cpu_features to record the supported x86 ISA level.
> > 4. Rename _dl_process_cet_property_note to _dl_process_property_note and
> > add GNU_PROPERTY_X86_ISA_1_V[234] marker detection.
> > 5. Update _rtld_main_check and _dl_open_check to check loaded objects
> > with the incompatible ISA level.
> > 6. Add a testcase to verify that dlopen an x86-64-v4 shared object fails
> > on lesser platforms.
>
> It's not clear based on this description if the expectation is that the
> search for alternative implementations continues after an attempt to
> load an object fails due to an architecture level mismatch.
>

1. ldconfig should issue an error for shared objects with mismatched ISA
level and mark such shared objects in ld.so cache.
2. ld.so should skip shared objects with incompatible ISA level similar to
EM_386 shared objects.   If ld.so detects it after loading such a shared
object, ld.so should issue a hard error.

-- 
H.J.

  reply	other threads:[~2020-10-13 11:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-10 13:21 H.J. Lu
2020-10-12 22:13 ` Joseph Myers
2020-10-12 22:30   ` H.J. Lu
2020-10-12 23:12     ` Joseph Myers
2020-10-12 23:29       ` H.J. Lu
2020-10-13 10:32 ` Florian Weimer
2020-10-13 11:49   ` H.J. Lu [this message]
2020-10-17 12:58     ` V2 " H.J. Lu
2020-10-28  0:40       ` PING: " H.J. Lu
2020-10-28 11:08     ` Florian Weimer
2020-10-28 13:12       ` H.J. Lu

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=CAMe9rOqXt9eFNQFALNE60AskGjfCrJu58BGOvET_bBUSzkCqNA@mail.gmail.com \
    --to=hjl.tools@gmail.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).