Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4886178pxb; Tue, 25 Jan 2022 23:08:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJy1VDFkVRow67kzdV8mfzWFa23EuMFwhp7XZhXmhfUEQiHFambv0YKpQvHkbNG3CJS8q0X7 X-Received: by 2002:a17:902:a38a:b0:14a:d175:9b06 with SMTP id x10-20020a170902a38a00b0014ad1759b06mr21248714pla.64.1643180919588; Tue, 25 Jan 2022 23:08:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643180919; cv=none; d=google.com; s=arc-20160816; b=qoYVhRRFU1O9NqRGEk4Qw0vtvMNQFyUOB4HZjoenjTE+QptZhhHEg76a5h1Uiw3NP4 vV5JIgIj8sUXY4OduCYJZ0i2HJIPOhhunKABJPzq1NvO0/sFCJ2rDTlf743euNFit7XD qWU3wv/WmCdmCdGNBbQFXKdOHv7PY3Tma86LgwD36tsv5+LKyHEIzMyzZMu19gbYIvk+ BixY/aLOKolHOKUPhzeSHibWUQKvbN8P/NU3eSYmfdkiODWCaR2uCNfSw31uTBFPBz9D bDAzheWpDLjVlzeyx4shrNduMULDoRB33npIucx16bhlboe0rfPq63T9unZdKEeXyqL4 VPXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:dkim-signature:dkim-filter; bh=xG2OTorEeD0amCPtFxqQHT32yhM8ef9v4q4M9il8G7k=; b=026POR6QGRpDwsvsZvf//jxdh7REP7R+vyoZqLKhsF/solW+VDIjMg3aqhBZ+QQpgU g9QF3sPJE9Fejq00oAyd6RXHwjSIzzmCBeKRuVNAFiXoycIwAM1GEeEHv2IbZld2+pOH y6BttSb6K5Bhw4qFw5TtSZDGX6PIJWaEAaLTELJ2ozH42keb1+M0Y9mRMQwSqeIU3iz0 0vUkYxuNenhu1oNDSsZHcQEPPTsVOSIqIQz7BDbUCePdnCOdcVIGYaGdUe94iJ+rHIzu OEgtH/7TzU8/3fe7sNNZJI05uJ9JLnHCmQXYgKje4aAd5YvN3wMmAOzrFJML+jXd5ZhU FcAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=JtD3PQQ9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e7si10002800pgc.781.2022.01.25.23.07.58; Tue, 25 Jan 2022 23:08:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=JtD3PQQ9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233067AbiAYTBA (ORCPT + 99 others); Tue, 25 Jan 2022 14:01:00 -0500 Received: from mail.efficios.com ([167.114.26.124]:51906 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229610AbiAYTAu (ORCPT ); Tue, 25 Jan 2022 14:00:50 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id EC54F34FA18; Tue, 25 Jan 2022 14:00:48 -0500 (EST) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 5xdczh2_v_rL; Tue, 25 Jan 2022 14:00:48 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 8B3A834F568; Tue, 25 Jan 2022 14:00:48 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 8B3A834F568 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1643137248; bh=xG2OTorEeD0amCPtFxqQHT32yhM8ef9v4q4M9il8G7k=; h=Date:From:To:Message-ID:MIME-Version; b=JtD3PQQ94e5OxufsRH8LXTmTTVgOwXJnukhcYA7gs1L+a5UeqvuZd305VMTd5ew8s 5GxrhQ1Mx6obyvxKKPAYTDVG+2K+WRsV0POwdrPMKlwj3ADTqlV71Tu6XMJlAU2QWG YhJ3V5UwzS/5HdOll28wgL9fQpeQ/3cTXKz3E9xcZykG7RjLrn6OueGvuDxe/fLUCB lpUzoBJcVHCxFfM2lPs7S/N/3PIfQ4O8lZUcr1UQjjsduGvbhY4ImFKge70wvYMHL7 m8eci4G1P2Ps7Jg6xMt3o5U8XxFe/TqObHR8MNDsYxkXNN4ZUvEKg5en1QbetjWJQP EVrhOWRTm4twg== X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id nyPQtUQPY9hv; Tue, 25 Jan 2022 14:00:48 -0500 (EST) Received: from mail03.efficios.com (mail03.efficios.com [167.114.26.124]) by mail.efficios.com (Postfix) with ESMTP id 6D88334F565; Tue, 25 Jan 2022 14:00:48 -0500 (EST) Date: Tue, 25 Jan 2022 14:00:48 -0500 (EST) From: Mathieu Desnoyers To: Christian Brauner Cc: Thomas Gleixner , linux-kernel , Peter Zijlstra , paulmck , Boqun Feng , "H. Peter Anvin" , Paul Turner , linux-api , shuah , linux-kselftest , Florian Weimer , Andy Lutomirski , Dave Watson , Andrew Morton , Russell King , Andi Kleen , Christian Brauner , Ben Maurer , rostedt , Josh Triplett , Linus Torvalds , Catalin Marinas , Will Deacon , Michael Kerrisk , Joel Fernandes Message-ID: <1445357149.71067.1643137248305.JavaMail.zimbra@efficios.com> In-Reply-To: <1234069751.70438.1643121673355.JavaMail.zimbra@efficios.com> References: <20220124171253.22072-1-mathieu.desnoyers@efficios.com> <20220124171253.22072-3-mathieu.desnoyers@efficios.com> <20220125122156.v2f5anzcs35i3rii@wittgenstein> <1234069751.70438.1643121673355.JavaMail.zimbra@efficios.com> Subject: Re: [RFC PATCH 02/15] rseq: Remove broken uapi field layout on 32-bit little endian MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [167.114.26.124] X-Mailer: Zimbra 8.8.15_GA_4180 (ZimbraWebClient - FF96 (Linux)/8.8.15_GA_4177) Thread-Topic: rseq: Remove broken uapi field layout on 32-bit little endian Thread-Index: jBpzgk+GT1oWkc+mziLmJCxydp6hDf1GHpYP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- On Jan 25, 2022, at 9:41 AM, Mathieu Desnoyers mathieu.desnoyers@efficios.com wrote: > ----- On Jan 25, 2022, at 7:21 AM, Christian Brauner brauner@kernel.org wrote: [...] >>> include/uapi/linux/rseq.h | 17 ++++------------- [...] >>> union { >> >> A bit unfortunate we seem to have to keep the union around even though >> it's just one field now. > > Well, as far as the user-space projects that I know of which use rseq > are concerned (glibc, librseq, tcmalloc), those end up with their own > copy of the uapi header anyway to deal with the big/little endian field > on 32-bit. So I'm very much open to remove the union if we accept that > this uapi header is really just meant to express the ABI and is not > expected to be used as an API by user-space. > > That would mean we also bring a uapi header copy into the kernel > rseq selftests as well to minimize the gap between librseq and > the kernel sefltests (the kernel sefltests pretty much include a > copy of librseq for convenience. librseq is maintained out of tree). > > Thoughts ? Actually, if we go ahead and remove the union, and replace: struct rseq { union { __u64 ptr64; } rseq_cs; [...] } v; by: struct rseq { __u64 rseq_cs; } v; expressions such as these are unchanged: - sizeof(v.rseq_cs), - &v.rseq_cs, - __alignof__(v.rseq_cs), - offsetof(struct rseq, rseq_cs). So users of the uapi rseq.h (as an API) can still use rseq_abi->rseq_cs before and after the change. Based on this, I am inclined to remove the union, and just make the rseq_cs field a __u64. Any objections ? Thanks, Mathieu > > Thanks, > > Mathieu > > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com