From patchwork Fri Nov 13 09:44:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 41039 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8E3B33A1B80D; Fri, 13 Nov 2020 09:44:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8E3B33A1B80D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605260694; bh=fHJbCYOyUaxPA2jnQ11kRZTmhCF9+By4p2gUuc0qPJ8=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=gScw15JgU2nVkDVedFJ6Xjha8Q43ssYwbnJ2+eMxlB23/Q4ALl7ty1W+LJJjMhZ3G V3hr9aT9hpZXAjxpeHJ6g9yKNO4LhxLwDUSH8D7SCuktl8z7nhoP9qScPAGNZBONBC Yc6vwmJIike3Cov+kXYI6E/Pf0zuHMNYr53fxSQ4= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id CADD93854813 for ; Fri, 13 Nov 2020 09:44:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CADD93854813 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-513-k_VaLUTSNPWWXj_LQGRuSg-1; Fri, 13 Nov 2020 04:44:49 -0500 X-MC-Unique: k_VaLUTSNPWWXj_LQGRuSg-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 CEC596D244 for ; Fri, 13 Nov 2020 09:44:48 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-113-222.ams2.redhat.com [10.36.113.222]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 45C2C5B4B0 for ; Fri, 13 Nov 2020 09:44:48 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH] x86: Remove UP macro. Define LOCK_PREFIX unconditionally. Date: Fri, 13 Nov 2020 10:44:46 +0100 Message-ID: <878sb5vbe9.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (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 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The UP macro is never defined. Also define LOCK_PREFIX unconditionally, to the same string. Reviewed-by: Adhemerval Zanella --- sysdeps/i386/nptl/tls.h | 8 +------- sysdeps/i386/pthread_spin_trylock.S | 8 +------- sysdeps/x86/atomic-machine.h | 8 +------- sysdeps/x86_64/nptl/pthread_spin_trylock.S | 8 +------- sysdeps/x86_64/nptl/tls.h | 8 +------- 5 files changed, 5 insertions(+), 35 deletions(-) diff --git a/sysdeps/i386/nptl/tls.h b/sysdeps/i386/nptl/tls.h index ec03fc189c..5042d52b98 100644 --- a/sysdeps/i386/nptl/tls.h +++ b/sysdeps/i386/nptl/tls.h @@ -155,13 +155,7 @@ union user_desc_init # define INIT_SYSINFO #endif -#ifndef LOCK_PREFIX -# ifdef UP -# define LOCK_PREFIX /* nothing */ -# else -# define LOCK_PREFIX "lock;" -# endif -#endif +#define LOCK_PREFIX "lock;" static inline void __attribute__ ((unused, always_inline)) tls_fill_user_desc (union user_desc_init *desc, diff --git a/sysdeps/i386/pthread_spin_trylock.S b/sysdeps/i386/pthread_spin_trylock.S index 8edb676381..bdebc71f9a 100644 --- a/sysdeps/i386/pthread_spin_trylock.S +++ b/sysdeps/i386/pthread_spin_trylock.S @@ -20,17 +20,11 @@ #include -#ifdef UP -# define LOCK -#else -# define LOCK lock -#endif - ENTRY (pthread_spin_trylock) movl 4(%esp), %edx movl $1, %eax xorl %ecx, %ecx - LOCK + lock cmpxchgl %ecx, (%edx) movl $EBUSY, %eax #ifdef HAVE_CMOV diff --git a/sysdeps/x86/atomic-machine.h b/sysdeps/x86/atomic-machine.h index bb49648374..7b3c81ea0f 100644 --- a/sysdeps/x86/atomic-machine.h +++ b/sysdeps/x86/atomic-machine.h @@ -49,13 +49,7 @@ typedef intmax_t atomic_max_t; typedef uintmax_t uatomic_max_t; -#ifndef LOCK_PREFIX -# ifdef UP -# define LOCK_PREFIX /* nothing */ -# else -# define LOCK_PREFIX "lock;" -# endif -#endif +#define LOCK_PREFIX "lock;" #define USE_ATOMIC_COMPILER_BUILTINS 1 diff --git a/sysdeps/x86_64/nptl/pthread_spin_trylock.S b/sysdeps/x86_64/nptl/pthread_spin_trylock.S index c084577755..84c9b41448 100644 --- a/sysdeps/x86_64/nptl/pthread_spin_trylock.S +++ b/sysdeps/x86_64/nptl/pthread_spin_trylock.S @@ -20,16 +20,10 @@ #include -#ifdef UP -# define LOCK -#else -# define LOCK lock -#endif - ENTRY(pthread_spin_trylock) movl $1, %eax xorl %ecx, %ecx - LOCK + lock cmpxchgl %ecx, (%rdi) movl $EBUSY, %eax cmovel %ecx, %eax diff --git a/sysdeps/x86_64/nptl/tls.h b/sysdeps/x86_64/nptl/tls.h index 7ba9c4e69b..fbd7f9cb89 100644 --- a/sysdeps/x86_64/nptl/tls.h +++ b/sysdeps/x86_64/nptl/tls.h @@ -99,13 +99,7 @@ _Static_assert (offsetof (tcbhead_t, __glibc_unused2) == 0x80, /* Get system call information. */ # include -#ifndef LOCK_PREFIX -# ifdef UP -# define LOCK_PREFIX /* nothing */ -# else -# define LOCK_PREFIX "lock;" -# endif -#endif +#define LOCK_PREFIX "lock;" /* This is the size of the initial TCB. Can't be just sizeof (tcbhead_t), because NPTL getpid, __libc_alloca_cutoff etc. need (almost) the whole