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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7F5B9C433EF for ; Mon, 18 Jul 2022 06:49:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NkrtRAO01L7Zk3sTHG3RayMa5UCzb3Z4X0xMqDZVnmc=; b=BR8Pakm5+pwtj4 ZpiExufHY1jB0gSAKMeVXZAV/fHV+1ZudKnfFfKmnGo/j4lIa3AFynK8RCeS/Jv1ou4cw95Y/I1vu JawFXFLLDFHXyX6Gso4nsHjApY9h7FpCLjeYF3yWsnUC/hrjOih57mFMe7ql1qqU2M/lNSItLpH9A wuFSk1SeSwe4VFEihMwyJ6Y6HbC5CWECDITWNqjya2KgmrwUbGXeqRb1mOkkeGdRD8Ym0CY77Iot/ XudKcOlA0lGXGjb/3gjRkouICzevDkhFCb/stnvD53CQ2h/hT6N18zm/5CXYDM/2/qRjjGjWVGkgd Z8Wil0tI6KL/CdYMe0bg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDKXw-00BIRP-Il; Mon, 18 Jul 2022 06:48:00 +0000 Received: from outbound1sev.lav.puc.rediris.es ([130.206.19.169] helo=mx02.puc.rediris.es) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDKXs-00BIO9-KU for linux-arm-kernel@lists.infradead.org; Mon, 18 Jul 2022 06:47:58 +0000 Received: from mta-out02.sim.rediris.es (mta-out02.sim.rediris.es [130.206.24.44]) by mx02.puc.rediris.es with ESMTP id 26I6l6DX004035-26I6l6DZ004035 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 18 Jul 2022 08:47:07 +0200 Received: from mta-out02.sim.rediris.es (localhost.localdomain [127.0.0.1]) by mta-out02.sim.rediris.es (Postfix) with ESMTPS id E2B90C0F386; Mon, 18 Jul 2022 08:47:04 +0200 (CEST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mta-out02.sim.rediris.es (Postfix) with ESMTP id 9D9D7C17E64; Mon, 18 Jul 2022 08:47:03 +0200 (CEST) X-Amavis-Modified: Mail body modified (using disclaimer) - mta-out02.sim.rediris.es Received: from mta-out02.sim.rediris.es ([127.0.0.1]) by localhost (mta-out02.sim.rediris.es [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 9qTGP4eSaCwO; Mon, 18 Jul 2022 08:47:03 +0200 (CEST) Received: from lt-gp.iram.es (haproxy02.sim.rediris.es [130.206.24.70]) by mta-out02.sim.rediris.es (Postfix) with ESMTPA id 625F7C0F386; Mon, 18 Jul 2022 08:46:57 +0200 (CEST) Date: Mon, 18 Jul 2022 08:46:52 +0200 From: Gabriel Paubert To: Michael Ellerman Cc: "Jason A. Donenfeld" , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, x86@kernel.org, Catalin Marinas , Heiko Carstens , Johannes Berg , Harald Freudenberger , "H . Peter Anvin" , Alexander Gordeev , Borislav Petkov , Will Deacon , Thomas Gleixner Subject: Re: [PATCH v2] random: handle archrandom in plural words Message-ID: References: <20220717200356.75060-1-Jason@zx2c4.com> <87a697dj9s.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87a697dj9s.fsf@mpe.ellerman.id.au> X-FE-Policy-ID: 23:8:4:SYSTEM DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; d=iram.es; s=DKIM; c=relaxed/relaxed; h=date:from:to:cc:subject:message-id:references:mime-version:content-type; bh=Wg38rCj2x4YYjxQL6BVoKGWVRrD69jESiDVvF8U5xmg=; b=W+WzCvv0eeULltUer/AJgfAyg3adRlOqeJJCwsrUFP/G/1bkoAxquvG21QbEnxEpYRVTkoFuvkrF pFNh8TEZdk4pCeDgow0o89jeSjCXtkmJXgaFKDx1itCdOomjBrRbgIeQKUrq8tmiKY1Z5NkfmwGQ 155G1h9LL3VMAGWQLv70SdVbh1DkWNIn1mUnMGUmaWmypGQt5UH6NJoiEwPM3hbYPxWOIVkKFHUf E5xXAs1ZvUL2DL1A1D19oeXmI5r8n7qPsXGAh86o8d4DDP7UwdPlWaVPIoson7YntX3H6FrX2DAa 27+DFutwLm3R/a3QqGl8Dt0uQsGYqS+KPGbBow== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220717_234757_007981_5D7F139B X-CRM114-Status: GOOD ( 16.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jul 18, 2022 at 04:31:11PM +1000, Michael Ellerman wrote: > "Jason A. Donenfeld" writes: > > The archrandom interface was originally designed for x86, which supplies > > RDRAND/RDSEED for receiving random words into registers, resulting in > > one function to generate an int and another to generate a long. However, > > other architectures don't follow this. > > > > On arm64, the SMCCC TRNG interface can return between 1 and 3 words. On > > s390, the CPACF TRNG interface can return between 1 and 32 words for the > > same cost as for one word. On UML, the os_getrandom() interface can return > > arbitrary amounts. > > > > So change the api signature to take a "words" parameter designating the > > maximum number of words requested, and then return the number of words > > generated. > > On powerpc a word is 32-bits and a doubleword is 64-bits (at least > according to the ISA). I think that's also true on other 64-bit > architectures. IIRC, this is (or was) not the case on Alpha, where word was defined as 16 bits. All assembly mnemonics had w for 16 bits, l for 32 bits, and q for 64 bits. Blame the PDP-11... Gabriel > > You could avoid any confusion by defining the API in terms of "longs" > rather than "words". > > But that's just a comment, see what others think. > > > arch/powerpc/include/asm/archrandom.h | 30 ++------ > > arch/powerpc/kvm/book3s_hv.c | 2 +- > > Acked-by: Michael Ellerman (powerpc) > > cheers _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel