From patchwork Thu Feb 1 19:36:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Jeanson X-Patchwork-Id: 85171 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 EC8D6385E02A for ; Thu, 1 Feb 2024 19:39:23 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from smtpout.efficios.com (smtpout.efficios.com [IPv6:2607:5300:203:b2ee::31e5]) by sourceware.org (Postfix) with ESMTPS id 1114B3857C52 for ; Thu, 1 Feb 2024 19:37:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1114B3857C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1114B3857C52 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:5300:203:b2ee::31e5 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706816246; cv=none; b=WBIfnC2Bq3zwen9VgNjXY6/uf0AblV6BtNIblIr85pwMOUDVALStyLoRAfIhsYhU35DqRiFPzlqhaUpPJuJAUvov6lH4qAyXSrIP6PRkdMhM9+D3Dx3yn2Y+VlFpdXPEqYhN/Br+6payIqMyQM+fFC/LaeV4H6A93X/ou+6XAm4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706816246; c=relaxed/simple; bh=aX9kTJaJPuQEulCsU+WxDWPDi04zQNxYFqlMU/W9O0o=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=iM+Ot/MnOkPg1Q4DsIIFQL4Rintfq+a7+B6vaGX8/2hN86dQ/DRKfuQohnSSsrur58sgou8HkTMEWiZIoal8COrCiKnSBsbi6eEElGZlrOwnCrbgIBoLLAVSeqKxJZGKk+uqAFxGdX/ZzFntQbFhqp1ELZaLJXHZungpkCmehmo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1706816243; bh=aX9kTJaJPuQEulCsU+WxDWPDi04zQNxYFqlMU/W9O0o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p+WYijUBUE+QghrKaWSu2hxivJ8uROL09x9LN1lqf242Phfp999BYQI+wcX0bWVjw VgET2RQLUrP9+Ctk+S4JMAggcpDzMbpT0zl77cwXeB3imIJWr/q28A8cODEyweF3/N mqjolYQmhtX+TvRUfiJVuMEii55hQFXvTXvlt722gDgrXjni0tXhGCam/IZ0hyD/tA CGL76Zlaw7x2aptaVdPTALzEZXhiKgaBHy6a7H96X1Kt+/tO5qHmc5udWxsyhghYfb 39WoMHQVXEqUO4zcf0Tp0edCIQOVhsn7Cfb+6vvw405hHdksslYomAuyQ8eoeREUrr /vDNo3teCc88g== Received: from laptop-mjeanson.internal.efficios.com (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4TQq1H4qh7zX3x; Thu, 1 Feb 2024 14:37:23 -0500 (EST) From: Michael Jeanson To: libc-alpha@sourceware.org Cc: Michael Jeanson , Florian Weimer , Carlos O'Donell , Mathieu Desnoyers Subject: [PATCH v7 4/8] nptl: Add features to internal 'struct rseq_area' Date: Thu, 1 Feb 2024 14:36:44 -0500 Message-Id: <20240201193648.584917-5-mjeanson@efficios.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240201193648.584917-1-mjeanson@efficios.com> References: <20240201193648.584917-1-mjeanson@efficios.com> MIME-Version: 1.0 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org The 'struct rseq_area' is used to define the offset of the various features available in the rseq ABI. Add fields that follow cpu_id (rseq_cs, flags, node_id, mm_cid) in preparation for their use. Access to features following the original rseq ABI 20 bytes (after 'flags') starting with 'node_id' must be gated by an rseq feature size test. Signed-off-by: Michael Jeanson --- sysdeps/unix/sysv/linux/rseq-internal.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sysdeps/unix/sysv/linux/rseq-internal.h b/sysdeps/unix/sysv/linux/rseq-internal.h index b6c9deea6b..a63e4afbdb 100644 --- a/sysdeps/unix/sysv/linux/rseq-internal.h +++ b/sysdeps/unix/sysv/linux/rseq-internal.h @@ -28,13 +28,17 @@ #include /* rseq area registered with the kernel. Use a custom definition - here to isolate from kernel struct rseq changes. The - implementation of sched_getcpu needs acccess to the cpu_id field; - the other fields are unused and not included here. */ + here to isolate from kernel struct rseq changes. Access to fields + beyond the 20 bytes of the original ABI (after 'flags') must be gated + by a check of the feature size. */ struct rseq_area { uint32_t cpu_id_start; uint32_t cpu_id; + uint64_t rseq_cs; + uint32_t flags; + uint32_t node_id; + uint32_t mm_cid; }; static inline struct rseq_area *