From patchwork Wed Jun 1 10:21:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 54674 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 557F238303D9 for ; Wed, 1 Jun 2022 10:22:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 557F238303D9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1654078923; bh=bGphmRozNMnjNYulafsA8xyAgviCIdcPHiY+8un6uVg=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=MlgM5TTowcClBsDVZ5napdiQxDHutf2e4ru8C3GeAH4qG8a7FQPULlWyK/PBgI7QO j2NB+/9lVWzeEAotSGfHlbrNRGV6ENJ7JOze0V3tB/LcB10yuiGY0SWnfNiA3WUY/h Rp0HjLNQruIb02cZiUfsqCDalzRgzP9wELl0W5O0= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 1847D3834E67 for ; Wed, 1 Jun 2022 10:21:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1847D3834E67 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-660-BgFstfQUMhKDcuZGSdDB6g-1; Wed, 01 Jun 2022 06:21:37 -0400 X-MC-Unique: BgFstfQUMhKDcuZGSdDB6g-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BE74A3979691; Wed, 1 Jun 2022 10:21:36 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.190]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0A978492C3B; Wed, 1 Jun 2022 10:21:35 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH] Linux: Adjust struct rseq definition to current kernel version Date: Wed, 01 Jun 2022 12:21:34 +0200 Message-ID: <87pmjsptu9.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, 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.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Cc: Mathieu Desnoyers Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" This definition is only used as a fallback with old kernel headers. The change follows kernel commit bfdf4e6208051ed7165b2e92035b4bf11 ("rseq: Remove broken uapi field layout on 32-bit little endian"). Tested on i686-linux-gnu and x86_64-linux-gnu. No test changes are needed because we do not have any real rseq tests (for the restarting behavior). --- sysdeps/unix/sysv/linux/sys/rseq.h | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/sysdeps/unix/sysv/linux/sys/rseq.h b/sysdeps/unix/sysv/linux/sys/rseq.h index 8533782cf4..6133165cfe 100644 --- a/sysdeps/unix/sysv/linux/sys/rseq.h +++ b/sysdeps/unix/sysv/linux/sys/rseq.h @@ -129,28 +129,13 @@ struct rseq targeted by the rseq_cs. Also needs to be set to NULL by user-space before reclaiming memory that contains the targeted struct rseq_cs. - Read and set by the kernel. Set by user-space with single-copy - atomicity semantics. This field should only be updated by the - thread which registered this data structure. Aligned on 64-bit. */ - union - { - uint64_t ptr64; -# ifdef __LP64__ - uint64_t ptr; -# else /* __LP64__ */ - struct - { -#if __BYTE_ORDER == __BIG_ENDIAN - uint32_t padding; /* Initialized to zero. */ - uint32_t ptr32; -# else /* LITTLE */ - uint32_t ptr32; - uint32_t padding; /* Initialized to zero. */ -# endif /* ENDIAN */ - } ptr; -# endif /* __LP64__ */ - } rseq_cs; + Read and set by the kernel. Set by user-space with single-copy + atomicity semantics. This field should only be updated by the + thread which registered this data structure. Aligned on 64-bit. + 32-bit architectures should update the low order bits of the + rseq_cs field, leaving the high order bits initialized to 0. */ + __u64 rseq_cs; /* Restartable sequences flags field. This field should only be updated by the thread which