| Message ID | 20260108061822.3896153-1-stefan.reinauer@coreboot.org (mailing list archive) |
|---|---|
| Headers |
Return-Path: <libc-alpha-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 256954BA2E34 for <patchwork@sourceware.org>; Thu, 8 Jan 2026 06:19:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 256954BA2E34 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, secure) header.d=coreboot.org header.i=@coreboot.org header.a=rsa-sha256 header.s=dkim header.b=UcJuMdLX X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from coreboot.org (mail.coreboot.org [78.46.105.101]) by sourceware.org (Postfix) with ESMTPS id 137DA4BA2E05 for <libc-alpha@sourceware.org>; Thu, 8 Jan 2026 06:19:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 137DA4BA2E05 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=coreboot.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=coreboot.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 137DA4BA2E05 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=78.46.105.101 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1767853141; cv=pass; b=lLnfuynKwEeBegxt2P6nOJ9iUgmXLl7Q6IJj6+unHK0M3ivElW8sZ7CTeFQ8k8ss2ACTpQYe5mvpqiU00neE4lnjPM9PtrZ4Sozusgh+weL4cqDU84PR6lLbcuBvm6lMw6RDcDzpwpwgsPHNAFPYgjvMqxm9PyTAYZB2GuPzP3o= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1767853141; c=relaxed/simple; bh=CIx9kE/Wc1A4UzTvjHGa/nHbewQ0sUjUkOKpJhCu5PY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=bpawwK7f4TQ8N7FY+3nyCNTNqNn0f4e1Iq62/I2LEB/57Os3PZ3/jFGLQ4KjxZz0OfJyxiyoTQCGeijzlToALrmqGO6UtRm7I2iLgJGttnqMHoRhonuVYw+k0Ar/6lK6rCD8l5eoDjXsRo9CDgmQwT8Erknx2r/JYzrzSG4pMFA= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 137DA4BA2E05 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id 30E4F81758; Thu, 8 Jan 2026 06:18:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=coreboot.org; s=dkim; t=1767853139; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=axRFzfU5orDfYZpNzshxuZSPt/cPqSG4GCS+gIDL59c=; b=UcJuMdLXODdnInL9huWLIusPHE+bsgHuRFfQ0w+WGkskendqXDORUsmrBKwKotRT0HS36R HuwTFkouwtx0JepM++a0l/FCbV53mn2/QeASM19a+7gLoQhD8LAH3zBjZEsprUSwgV/sT2 BOcPUSsLdTtaTG2xeLFfZOx7XE+gdxg= From: Stefan <stefan.reinauer@coreboot.org> To: libc-alpha@sourceware.org Cc: geert@linux-m68k.org, debian-68k@lists.debian.org, Stefan <stefan.reinauer@coreboot.org> Subject: [PATCH 0/2] m68k: Add vDSO support for TLS and clock_gettime64 Date: Wed, 7 Jan 2026 22:18:20 -0800 Message-ID: <20260108061822.3896153-1-stefan.reinauer@coreboot.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=coreboot.org; s=dkim; t=1767853139; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=axRFzfU5orDfYZpNzshxuZSPt/cPqSG4GCS+gIDL59c=; b=BPV5CSQn0ChOfPbA0FzbjcQS63y3rKNqpLwm/J1dZxLAJlEveYzKatHZWZDdruizzWo6q6 V4aQRDTHCiflcud2Xeqn8+g3IY6KYfllNO1A2+31dSKgSC/AkpKITRPoXetVUzGRPmWLOZ sRdbUWfuwEbVF/xh+864AyP45pyIwFY= ARC-Seal: i=1; s=dkim; d=coreboot.org; t=1767853139; a=rsa-sha256; cv=none; b=newUvxCcnKskKUb1xV8o+9qpAo0Z2lLOTNozNuOnrOKpD4R9nOQT26L2LkaB8ydr8wNGXUJhFATO4mKtF4joa8oX7Mlh8zltfDq/3MXIcPDx0+50KD0JyU2YDhqiqDNluJLc+mUqcq2NaBNN1WGs7a7EAIsDcL/T2t0Ib/KCiw8= ARC-Authentication-Results: i=1; coreboot.org; auth=pass smtp.auth=stepan@coreboot.org smtp.mailfrom=stefan.reinauer@coreboot.org X-Spamd-Bar: ++++ Authentication-Results: coreboot.org; auth=pass smtp.auth=stepan@coreboot.org smtp.mailfrom=stefan.reinauer@coreboot.org X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org |
| Series |
m68k: Add vDSO support for TLS and clock_gettime64
|
|
Message
Stefan Reinauer
Jan. 8, 2026, 6:18 a.m. UTC
This series adds vDSO support for m68k, enabling userspace to access the thread pointer and clock_gettime64 without syscall overhead. The m68k vDSO provides a data page mapped at a fixed offset from the ELF header (passed via AT_SYSINFO_EHDR). The kernel maintains the thread pointer and timing data in this page, updating them on context switches. Patch 1 optimizes __m68k_read_tp() to read the thread pointer directly from the vDSO data page instead of using the get_thread_area syscall. This significantly reduces overhead for TLS access, which is a frequent operation in threaded applications. Patch 2 enables the vDSO clock_gettime64 by defining HAVE_CLOCK_GETTIME64_VSYSCALL along with the necessary VDSO_NAME and VDSO_HASH for symbol lookup. This allows glibc to use the kernel-provided __vdso_clock_gettime64 for fast time retrieval. Both changes include fallback paths for older kernels that lack vDSO support. Performance Results (QEMU Quadra 800) ------------------------------------- Before (syscall): ~2057 ns/call After (vDSO): ~675 ns/call Improvement: ~3x faster Tested on qemu-system-m68k with Linux 6.18 (Debian/m68k). Stefan Reinauer (2): m68k: Use vDSO for thread pointer access m68k: Enable vDSO clock_gettime64 sysdeps/unix/sysv/linux/m68k/m68k-helpers.c | 77 ++++++++++++++++++++- sysdeps/unix/sysv/linux/m68k/sysdep.h | 7 ++ 2 files changed, 83 insertions(+), 1 deletion(-)
Comments
Am Donnerstag, 8. Januar 2026, 07:18:20 Mitteleuropäische Normalzeit schrieb Stefan: > This series adds vDSO support for m68k, enabling userspace to access > the thread pointer and clock_gettime64 without syscall overhead. After the release only please (given other concerns are addressed) > > The m68k vDSO provides a data page mapped at a fixed offset from the > ELF header (passed via AT_SYSINFO_EHDR). The kernel maintains the > thread pointer and timing data in this page, updating them on context > switches. > > Patch 1 optimizes __m68k_read_tp() to read the thread pointer directly > from the vDSO data page instead of using the get_thread_area syscall. > This significantly reduces overhead for TLS access, which is a frequent > operation in threaded applications. > > Patch 2 enables the vDSO clock_gettime64 by defining > HAVE_CLOCK_GETTIME64_VSYSCALL along with the necessary VDSO_NAME and > VDSO_HASH for symbol lookup. This allows glibc to use the > kernel-provided __vdso_clock_gettime64 for fast time retrieval. > > Both changes include fallback paths for older kernels that lack vDSO > support. > > Performance Results (QEMU Quadra 800) > ------------------------------------- > Before (syscall): ~2057 ns/call > After (vDSO): ~675 ns/call > Improvement: ~3x faster > > Tested on qemu-system-m68k with Linux 6.18 (Debian/m68k). > > Stefan Reinauer (2): > m68k: Use vDSO for thread pointer access > m68k: Enable vDSO clock_gettime64 > > sysdeps/unix/sysv/linux/m68k/m68k-helpers.c | 77 ++++++++++++++++++++- > sysdeps/unix/sysv/linux/m68k/sysdep.h | 7 ++ > 2 files changed, 83 insertions(+), 1 deletion(-) > >