From patchwork Mon Mar 25 18:29:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Jeanson X-Patchwork-Id: 87636 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 AC3313858433 for ; Mon, 25 Mar 2024 18:30:36 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by sourceware.org (Postfix) with ESMTPS id A2F293858C78 for ; Mon, 25 Mar 2024 18:29:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A2F293858C78 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 A2F293858C78 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=167.114.26.122 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711391389; cv=none; b=upMVSNfuROYD470I+VzOAYY1xHrqrRoiiksQouFtyxyeXtR+Am7vqGUO6LyYqV1eUGdGK7Etaw/PFEzKN/YO40ARK3/ujfLh9662NaHIy2OfBiax+wJih/Gx1EpLTstIvCDs5gPlli/QrkTJMk0w30lJsA8tgVPKF8+2ybk+Ltw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711391389; c=relaxed/simple; bh=g48MnpLKyMjmxBQ9SRJzJsivYQ81D/sz1Y0CBVlLeNg=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=dLeJUUX9uvL2q7VFPwFbvOhpfHwyeTwwsp0kIOhyMBDur9QEw+B9Xav0K28LtpKLVPI7ZPBW4WVVIE7x3+pdFrTZCe4/4lkJh/fGt/7XIC+swlE6CbCmdM5lz46G+n3OyAJQlWh0hbDNAP7qca92CIbdHbIc9meyVLTtxx5CYOg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1711391386; bh=g48MnpLKyMjmxBQ9SRJzJsivYQ81D/sz1Y0CBVlLeNg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hg+FBoPM09yc7kiyix9bMiRoVdGyNc3bsPPxyg0V57TUIn+6iqfELDRM4g/GT6k2O N8/LEgbmLnCO+5Z5Wr1zDwUnWUCKzS0LwufU48wdKPRtvb9uBk9a5KQDfSYD2v49A1 sF7qwWR1xzwh1e/k827x5IIt30KzEawPHTS8RNGz7O2ZpH2EoCQ8oJR8qKdIgN9hKz VKDzoYzgqBYKKx4hj3rDpJbabsXgCRHdQTBLMIO/q9Um5huaLy4OTXJKp4tOWL58A3 7k/RXbM8Oe2i1af+xbj/cF1JyyttlzZpoarSer2OPsCIhiD7r3Q8uUKhvVc8hQ4nJd wDA1W4kUSCm5g== 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 4V3M0p1yX6zmpq; Mon, 25 Mar 2024 14:29:46 -0400 (EDT) From: Michael Jeanson To: libc-alpha@sourceware.org Cc: Michael Jeanson , Florian Weimer , Carlos O'Donell , DJ Delorie , Mathieu Desnoyers Subject: [PATCH v10 4/4] nptl: Add features to internal 'struct rseq_area' Date: Mon, 25 Mar 2024 14:29:27 -0400 Message-Id: <20240325182927.914830-5-mjeanson@efficios.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240325182927.914830-1-mjeanson@efficios.com> References: <20240325182927.914830-1-mjeanson@efficios.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.9 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 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 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 *