From patchwork Sat May 16 09:33:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 39274 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 B1179387086F; Sat, 16 May 2020 09:33:22 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by sourceware.org (Postfix) with ESMTPS id 80B523851C2D for ; Sat, 16 May 2020 09:33:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 80B523851C2D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=fw@deneb.enyo.de Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1jZtC1-0002MA-SO; Sat, 16 May 2020 09:33:17 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.92) (envelope-from ) id 1jZtC1-00042x-Pd; Sat, 16 May 2020 11:33:17 +0200 From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH] Linux: Remove remnants of the getcpu cache Date: Sat, 16 May 2020 11:33:17 +0200 Message-ID: <87mu68ns0y.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, 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: , Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The getcpu cache was removed from the kernel in Linux 2.6.24. glibc support from the sched_getcpu implementation was removed in commit dd26c44403582fdf10d663170f947dfe4b3207a0 ("Consolidate sched_getcpu"). --- sysdeps/unix/sysv/linux/pthread_setaffinity.c | 5 ----- sysdeps/unix/sysv/linux/sched_setaffinity.c | 5 ----- sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c | 14 -------------- sysdeps/unix/sysv/linux/x86_64/sched_setaffinity.c | 14 -------------- sysdeps/x86_64/nptl/tcb-offsets.sym | 1 - sysdeps/x86_64/nptl/tls.h | 2 +- 6 files changed, 1 insertion(+), 40 deletions(-) diff --git a/sysdeps/unix/sysv/linux/pthread_setaffinity.c b/sysdeps/unix/sysv/linux/pthread_setaffinity.c index 264d677c29..b0bd90c324 100644 --- a/sysdeps/unix/sysv/linux/pthread_setaffinity.c +++ b/sysdeps/unix/sysv/linux/pthread_setaffinity.c @@ -33,11 +33,6 @@ __pthread_setaffinity_new (pthread_t th, size_t cpusetsize, res = INTERNAL_SYSCALL_CALL (sched_setaffinity, pd->tid, cpusetsize, cpuset); -#ifdef RESET_VGETCPU_CACHE - if (!INTERNAL_SYSCALL_ERROR_P (res)) - RESET_VGETCPU_CACHE (); -#endif - return (INTERNAL_SYSCALL_ERROR_P (res) ? INTERNAL_SYSCALL_ERRNO (res) : 0); diff --git a/sysdeps/unix/sysv/linux/sched_setaffinity.c b/sysdeps/unix/sysv/linux/sched_setaffinity.c index fc2c692783..978291fc3e 100644 --- a/sysdeps/unix/sysv/linux/sched_setaffinity.c +++ b/sysdeps/unix/sysv/linux/sched_setaffinity.c @@ -32,11 +32,6 @@ __sched_setaffinity_new (pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset) { int result = INLINE_SYSCALL (sched_setaffinity, 3, pid, cpusetsize, cpuset); -#ifdef RESET_VGETCPU_CACHE - if (result != -1) - RESET_VGETCPU_CACHE (); -#endif - return result; } libc_hidden_def (__sched_setaffinity_new) diff --git a/sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c b/sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c deleted file mode 100644 index a7bbe38156..0000000000 --- a/sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c +++ /dev/null @@ -1,14 +0,0 @@ -#include - -#define RESET_VGETCPU_CACHE() \ - do { \ - asm volatile ("movl %0, %%fs:%P1\n\t" \ - "movl %0, %%fs:%P2" \ - : \ - : "ir" (0), "i" (offsetof (struct pthread, \ - header.vgetcpu_cache[0])), \ - "i" (offsetof (struct pthread, \ - header.vgetcpu_cache[1]))); \ - } while (0) - -#include diff --git a/sysdeps/unix/sysv/linux/x86_64/sched_setaffinity.c b/sysdeps/unix/sysv/linux/x86_64/sched_setaffinity.c deleted file mode 100644 index d1101c56f5..0000000000 --- a/sysdeps/unix/sysv/linux/x86_64/sched_setaffinity.c +++ /dev/null @@ -1,14 +0,0 @@ -#include - -#define RESET_VGETCPU_CACHE() \ - do { \ - asm volatile ("movl %0, %%fs:%P1\n\t" \ - "movl %0, %%fs:%P2" \ - : \ - : "ir" (0), "i" (offsetof (struct pthread, \ - header.vgetcpu_cache[0])), \ - "i" (offsetof (struct pthread, \ - header.vgetcpu_cache[1]))); \ - } while (0) - -#include "../sched_setaffinity.c" diff --git a/sysdeps/x86_64/nptl/tcb-offsets.sym b/sysdeps/x86_64/nptl/tcb-offsets.sym index 037759eb4f..2bbd563a6c 100644 --- a/sysdeps/x86_64/nptl/tcb-offsets.sym +++ b/sysdeps/x86_64/nptl/tcb-offsets.sym @@ -11,7 +11,6 @@ CLEANUP_PREV offsetof (struct _pthread_cleanup_buffer, __prev) MUTEX_FUTEX offsetof (pthread_mutex_t, __data.__lock) MULTIPLE_THREADS_OFFSET offsetof (tcbhead_t, multiple_threads) POINTER_GUARD offsetof (tcbhead_t, pointer_guard) -VGETCPU_CACHE_OFFSET offsetof (tcbhead_t, vgetcpu_cache) FEATURE_1_OFFSET offsetof (tcbhead_t, feature_1) SSP_BASE_OFFSET offsetof (tcbhead_t, ssp_base) diff --git a/sysdeps/x86_64/nptl/tls.h b/sysdeps/x86_64/nptl/tls.h index cb60ed4c3c..7ba9c4e69b 100644 --- a/sysdeps/x86_64/nptl/tls.h +++ b/sysdeps/x86_64/nptl/tls.h @@ -50,7 +50,7 @@ typedef struct uintptr_t sysinfo; uintptr_t stack_guard; uintptr_t pointer_guard; - unsigned long int vgetcpu_cache[2]; + unsigned long int unused_vgetcpu_cache[2]; /* Bit 0: X86_FEATURE_1_IBT. Bit 1: X86_FEATURE_1_SHSTK. */