From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 3B2611F4B4 for ; Tue, 13 Oct 2020 11:49:59 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 04ACB3840C3C; Tue, 13 Oct 2020 11:49:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 04ACB3840C3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1602589798; bh=CPyLNiuTuaORbMquqkP6JWqnW5vsc+jtgxVonySkqVE=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=JlWO8G5wL8M9GbT+l7/GwZGprL3MF12oAnZHt8mT7coWoxuF0xcay3sHh0XVf6XfS +hkhmRGqsmMJsrJaTstR8FvBW7kLhOcOw1SY9MXE0ZEehlbeddyvHrZzonc8wYZQ4x V7BGEDOgp1umylzQuMmYUREIn8UskYoT/IQ2LK04= Received: from mail-oo1-xc2e.google.com (mail-oo1-xc2e.google.com [IPv6:2607:f8b0:4864:20::c2e]) by sourceware.org (Postfix) with ESMTPS id 9F072385780B for ; Tue, 13 Oct 2020 11:49:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9F072385780B Received: by mail-oo1-xc2e.google.com with SMTP id o20so4808228ook.1 for ; Tue, 13 Oct 2020 04:49:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CPyLNiuTuaORbMquqkP6JWqnW5vsc+jtgxVonySkqVE=; b=UMSIlGPZIxAhqjtznIdK3DJ1TrKm8u1Y7INvgNJzaBV9+1fENHa+o/ryn4+9RIKNLm dT2LxKMkKWi36ObeBNFhrTuOD0AztOAjzIz3zgE71AKyPQkG++geYOYhCTxg/x8tTifG 2301ZPIDoXDghdv1QGcNygFjiYSNn228d1JNNu4nVeDBukIOd7UGDUHgOKi7rwfhJBJf nKONqQ0omUsoBADwOybktAqV+xcRM9RyJOgkdkDVQm4JhvSWJZiXUShiCdHC/jVxPPRN heLL3PDnxXWvgC17irNPIlezyy7rQzb0+60LVN+IheG3+YwjN/vDRhEAyueIpG2mT7xc qdOA== X-Gm-Message-State: AOAM532hm6qXIEu6Rql47/PdTGwqK1f+XSIHyg9Q4nZKjXjZkPwNuvmV XzoxH8RNOAiadn/w5ivB9ijl4cDt2s+RGfj3/X4= X-Google-Smtp-Source: ABdhPJxblhIdt3m2LoDGk6kNw61QmD99LnmkmmYaWM5qOKV4LSvSqTPUYpvng20Kf0A7g57WQJ5c20b2u6Siu8LNLx4= X-Received: by 2002:a4a:d40c:: with SMTP id n12mr21821687oos.35.1602589795064; Tue, 13 Oct 2020 04:49:55 -0700 (PDT) MIME-Version: 1.0 References: <20201010132155.3340815-1-hjl.tools@gmail.com> <87y2kav2k6.fsf@oldenburg2.str.redhat.com> In-Reply-To: <87y2kav2k6.fsf@oldenburg2.str.redhat.com> Date: Tue, 13 Oct 2020 04:49:19 -0700 Message-ID: Subject: Re: [PATCH] x86: Support GNU_PROPERTY_X86_ISA_1_V[234] marker [BZ #26717] To: Florian Weimer Content-Type: text/plain; charset="UTF-8" X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: "H.J. Lu via Libc-alpha" Reply-To: "H.J. Lu" Cc: "H.J. Lu via Libc-alpha" Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" On Tue, Oct 13, 2020 at 3:32 AM Florian Weimer 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 > > 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.