From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57252C433FE for ; Wed, 30 Nov 2022 15:07:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229513AbiK3PHw (ORCPT ); Wed, 30 Nov 2022 10:07:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229593AbiK3PHv (ORCPT ); Wed, 30 Nov 2022 10:07:51 -0500 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BECAD13F58; Wed, 30 Nov 2022 07:07:49 -0800 (PST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 211863200918; Wed, 30 Nov 2022 10:07:48 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Wed, 30 Nov 2022 10:07:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1669820867; x=1669907267; bh=EYBohq7Wmj /uFHqGx3hCuQfFGuTEIDd6kMXNccH+gNw=; b=GDUdx+GjmEKduBDSilj+n1NSbq Ic269td72thVocWg+G4micCeNOnsNyYyY4jbe32JM9KaxP3/HY715S6euRzl+OHM vvP+p/DD8NJa2LIAXh9AAqgR9FWQsGlcFQ/cYyQ65Ew2hLxpbng8K+KpuGfucXDX KYCEjcOfukOVqfYxVtv+4UPg+4twU4BFjYlHZ1+4uTUodumLkwFmsUexfCE4NQ/E 8rCZg7ulhiE6NT5uT7tuB8XRHYGJjApwLHWVw6nU2UZP4CcoKKH6ap82W4pSnHzR ndwDTRKc3SljqM6y98atShVleNRl8pjLcwXHwnriopbaLH/Qw3SX0EKfR2qA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1669820867; x=1669907267; bh=EYBohq7Wmj/uFHqGx3hCuQfFGuTE IDd6kMXNccH+gNw=; b=A1flL476eQAuzf8UkuooY5DxSucqSeE95cwMSYX0kTEg SzBwA2GK6ljdkdkwdorqSBZtoZ2TP4Zdo/4dGYiZkqZVuQeV5+DlSKCHwYl3UYA2 56HApMp86ss11am5cqJ2xITBAz/pM4yqD1Bi8T21G9zU6FLRdHN2kITMFTNw1ncL kFchvmlT5D4pSQy4AVip1T4rQ7s1qiAwc5n2XQoHgcyq6+XzMGlXWjJXTLhmrQHo civsyuYklJ2Fth64UNKk7p1Q16WPCoA2ranGOgnKFi3KtITN3jxWxlmOWxrE7zBG ZAVExXIaQz0zXNQ1nMBytulZyJQiZhYXQ26NLP5QUg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrtdefgdejudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdetrhhn ugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrghtth gvrhhnpeffheeugeetiefhgeethfejgfdtuefggeejleehjeeutefhfeeggefhkedtkeet ffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrh hnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 5A85BB60086; Wed, 30 Nov 2022 10:07:47 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1115-g8b801eadce-fm-20221102.001-g8b801ead Mime-Version: 1.0 Message-Id: <16ec2a7a-c469-4732-aeca-e74a9fb88d3e@app.fastmail.com> In-Reply-To: References: <20221129210639.42233-1-Jason@zx2c4.com> <20221129210639.42233-4-Jason@zx2c4.com> <878rjs7mcx.fsf@oldenburg.str.redhat.com> Date: Wed, 30 Nov 2022 16:07:27 +0100 From: "Arnd Bergmann" To: "Jason A . Donenfeld" , "Florian Weimer" Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, "Thomas Gleixner" , linux-crypto@vger.kernel.org, linux-api@vger.kernel.org, x86@kernel.org, "Greg Kroah-Hartman" , "Adhemerval Zanella Netto" , "Carlos O'Donell" , "Christian Brauner" Subject: Re: [PATCH v10 3/4] random: introduce generic vDSO getrandom() implementation Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-api@vger.kernel.org On Wed, Nov 30, 2022, at 15:59, Jason A. Donenfeld wrote: > On Wed, Nov 30, 2022 at 03:51:01PM +0100, Jason A. Donenfeld wrote: >> On Wed, Nov 30, 2022 at 11:44:30AM +0100, Florian Weimer wrote: >> > >> > * vdso_data will be accessed by 64 bit and compat code at the same time >> > * so we should be careful before modifying this structure. >> > >> > So the ABI must be same for 32-bit and 64-bit mode, and long isn't. > I'll do something like this: > > > +#ifdef CONFIG_64BIT > +typedef u64 vdso_kernel_ulong; > +#else > +typedef u32 vdso_kernel_ulong; > +#endif This does not address the ABI concern: to allow 32-bit and 64-bit tasks to share the same data page, it has to be the same width on both, either u32 or 64, but not depending on a configuration option. > struct vdso_rng_data { > vdso_kernel_ulong generation; > bool is_ready; > }; There is another problem with this: you have implicit padding in the structure because the two members have different size and alignment requirements. The easiest fix is to make them both u64, or you could have a u32 is_ready and an explit u32 for the padding. Arnd