From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id E00E5393D00B for ; Tue, 11 Jan 2022 20:37:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E00E5393D00B Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-407-g2YkscAXPKm-3XqR9onsPA-1; Tue, 11 Jan 2022 15:37:28 -0500 X-MC-Unique: g2YkscAXPKm-3XqR9onsPA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2CE2586A060; Tue, 11 Jan 2022 20:37:27 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.102]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 20E2656F69; Tue, 11 Jan 2022 20:37:25 +0000 (UTC) From: Florian Weimer To: "H.J. Lu" Cc: GNU C Library , Jakub Jelinek Subject: Re: [PATCH 0/2] Remove some i386 system call optimizations References: Date: Tue, 11 Jan 2022 21:37:24 +0100 In-Reply-To: (H. J. Lu's message of "Tue, 11 Jan 2022 12:30:58 -0800") Message-ID: <87iluqqa9n.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Tue, 11 Jan 2022 20:37:31 -0000 * H. J. Lu: > On Tue, Jan 11, 2022 at 6:00 AM H.J. Lu wrote: >> >> On Tue, Jan 11, 2022 at 2:05 AM Florian Weimer wrote: >> > >> > The configure check for CAN_USE_REGISTER_ASM_EBP is unreliable. And we >> > used it to switch away from using %ebx in assembler constraints, but >> > this appears to be no longer necessary. >> >> This GCC bug has been fixed in GCC 5 as seen in >> >> commit 021478683cc091de9902d297a7b161f8343ffb6a >> Author: Uros Bizjak >> Date: Fri Oct 17 08:00:58 2014 +0200 >> >> cpuid.h (__cpuid): Remove definitions that handle %ebx register in >> a special way. >> >> * config/i386/cpuid.h (__cpuid): Remove definitions that handle %ebx >> register in a special way. >> (__cpuid_count): Ditto. >> * config/i386/driver-i386.h: Protect with >> "#if defined(__GNUC__) && (__GNUC__ >= 5 || !defined(__PIC__))". >> (host_detect_local_cpu): Mention that GCC with non-fixed %ebx >> is required to compile the function. >> >> From-SVN: r216362 >> >> Since GCC 6.2 or above is required to build glibc, please >> remove the !OPTIMIZE_FOR_GCC_5 path and this issue >> will be resolved automatically. > > There are > > /* Since GCC 5 and above can properly spill %ebx with PIC when needed, > we can inline syscalls with 6 arguments if GCC 5 or above is used > to compile glibc. Disable GCC 5 optimization when compiling for > profiling or when -fno-omit-frame-pointer is used since asm ("ebp") > can't be used to put the 6th argument in %ebp for syscall. */ > #if !defined PROF && CAN_USE_REGISTER_ASM_EBP > # define OPTIMIZE_FOR_GCC_5 > #endif > > If we want to support profiling or -fno-omit-frame-pointer, > we need to keep these codes. This is strictly for %ebp, I think, as indicated by the comment. %ebx does not need to be special-cased for profiling. I assume that building glibc (with profiling) is proof enough that this works? Thanks, Florian