From patchwork Tue Feb 27 15:55:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Jeanson X-Patchwork-Id: 1905282 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=efficios.com header.i=@efficios.com header.a=rsa-sha256 header.s=smtpout1 header.b=OXYtB4cv; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TkhvG5Rscz23qP for ; Wed, 28 Feb 2024 02:57:14 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AC3B338582A7 for ; Tue, 27 Feb 2024 15:57:12 +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 EE9E23858414 for ; Tue, 27 Feb 2024 15:55:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EE9E23858414 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 EE9E23858414 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=1709049351; cv=none; b=mIzK7brbYL3NoL2WznhYrqo92XiHzWLMs13ImmIwUHpexVJlyNqkZ529LhwZXBrW2JE4PtQ1+Wsz0DfuKPwFP5mNFZRVfyKtr8q0xmZHyvvc4tLLze6FFNdWMYmsCK+7Mk/LfMi1wpkMg6a6gbjhaAfs4+8Bhj6KJjTv0jufU0E= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709049351; c=relaxed/simple; bh=g48MnpLKyMjmxBQ9SRJzJsivYQ81D/sz1Y0CBVlLeNg=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=hF0JU+ve54mAc1C46lvBgKOU7htupfVjN0yDxK60jqEQHO+dF7Vf3S/DtbTeNKBS1j6tdJ6IsRtYNJy/FladKYUzMT3txsczZq9tPzFYdqc1B4X7fPA3wTRxayqyebpx1tR3jTu1OLLK5MFa6bJFNkLUlor3vDJUVI7dZ+o5WNE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1709049347; bh=g48MnpLKyMjmxBQ9SRJzJsivYQ81D/sz1Y0CBVlLeNg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OXYtB4cvHUJcbuySJ4l6QvLbq/3AhPmUpw+9p1yRxoaDXXAdHOfhV8A//3O+lqsij sEGk39zipO/+igmd1+n1IERdYGkiUaiTd4BNZU5FUuROnUAxbxOvsXZ5pIPcstvYqT njlvy1WVX2TRH0Jx75c468Gt6zE1OS6oldQaZ0Jmfcgc3xjtYiix4nMG+gkuiZQOTL 5h1chfQksp4gvNeXeIKUqm6DsT2CgCxsD+FQYkwYvEIHp87kJm9W+YBwIjFBrYCixo nvxYPPS61YRQgs7aj+Ti7vgCSLuMyCtc9LUIVZf5VXSOnoTAXjn5P2cXJ1ZURhGqos lUrmNV7xkj5Pw== 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 4Tkhsb3xFtzdx8; Tue, 27 Feb 2024 10:55:47 -0500 (EST) From: Michael Jeanson To: libc-alpha@sourceware.org Cc: Michael Jeanson , Florian Weimer , Carlos O'Donell , DJ Delorie , Mathieu Desnoyers Subject: [PATCH 4/4] nptl: Add features to internal 'struct rseq_area' Date: Tue, 27 Feb 2024 10:55:33 -0500 Message-Id: <20240227155533.298617-5-mjeanson@efficios.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240227155533.298617-1-mjeanson@efficios.com> References: <20240227155533.298617-1-mjeanson@efficios.com> MIME-Version: 1.0 X-Spam-Status: No, score=-12.1 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+incoming=patchwork.ozlabs.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 Reviewed-by: DJ Delorie --- 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 4123072274..da98e44dad 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 *