Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp2576045imi; Mon, 25 Jul 2022 02:21:29 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tyy6jGQHvL5oFerCfS6ckbpdK8WIQXO9c9+25eTmm7fquCYASvHQu44+CNpKEIm9c9WSsI X-Received: by 2002:a17:906:58d6:b0:72f:2cce:7cf8 with SMTP id e22-20020a17090658d600b0072f2cce7cf8mr9421297ejs.452.1658740888843; Mon, 25 Jul 2022 02:21:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658740888; cv=none; d=google.com; s=arc-20160816; b=N5AjkOTdDZhapEEyoK9Y7WHQY8V4AFkBxVI5nv8zKhs1/RqP8Tjcg5eqoXhfWyeLoK zXCPCCpuvsoJ/rxsTPqXswESpuOEqUmKQyiBRD605WwTueRcVc+rVB7xGvHvME1vxHUM mNTZ6IcinFjbLu1HXyhcVId3dMAcmcK48NXB7IlCocFM8ePzkwYZU2YHtdQsp+YKkNf2 oeSKejPJsZ36+/ZJSF3gD56AluJo2PRYG7ALTYY7LVE99xcS0j0xpFtrOa+gFTmpRd1r P81Eni/EJV391DPjfKDmVQhY+eI4P0oEEnCKnBe5UZYBI47SFdYtnWoRB26hGIozV0uV us3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=y8+OPz04Mm3bqiVDA6mAcu8D6mVOL+XugMvcUTMr5wA=; b=BD/ZusWxPR5aSWa3iZ4mHK74eMfoEIUTKRzlFoTSKuzjFqHI6vsX7j2XHGolO11NW5 il9AsPk3Z9tyDBTW+KnSLIJEg99EKZ5KjjG8CYZbFMke6nYumed8Hkdk5ptxYfmRLNeB 02uF/LTRubAVkB/P/WCtrCzQJx64wKy0H4N/uFBWg71eX6NbEXZ3K8ovy4D9wFnBc3wN 4wLl9se1ioICaTH1wakZCddCEzaezwuDSr1Uy2/2AXST4nMBCC5ICFE46r8EH5PylghZ aFVNPz0IDW/ZFByr4G7NUVrWeqTBLTU71FEBY+5JnBdbCvHAlxw54EdQApTFRsRijEhJ nyfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=MRG0sLK8; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b="m+A1w/lC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id me22-20020a170906aed600b0072b3bc2edb1si10905301ejb.364.2022.07.25.02.21.03; Mon, 25 Jul 2022 02:21:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=MRG0sLK8; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b="m+A1w/lC"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234497AbiGYJTK (ORCPT + 99 others); Mon, 25 Jul 2022 05:19:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234491AbiGYJTJ (ORCPT ); Mon, 25 Jul 2022 05:19:09 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDC6B15A3D; Mon, 25 Jul 2022 02:19:07 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 97BD0350E8; Mon, 25 Jul 2022 09:19:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1658740746; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y8+OPz04Mm3bqiVDA6mAcu8D6mVOL+XugMvcUTMr5wA=; b=MRG0sLK8VVefxC1ixuMHbOSAJj1mdrVx3NtwXrBkAn+ENDSVo2B8cwX0kgEAT0UtSwDx8c X2hI07bPbyxhcwaAsR1lLIEr4nKskRITLsgPUtZqN0B9fbuOYVOPCEyhu7a2/RoFe5CerK CayaZFQExQIq7UbL2bf6HmONxfqRR9A= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1658740746; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y8+OPz04Mm3bqiVDA6mAcu8D6mVOL+XugMvcUTMr5wA=; b=m+A1w/lC6xockiwf/C5RpRUq38XogmmzGrWkYdsGEXLNctMtGxpXHzUVE7fuMuNvatsEP/ p3gwdOavldQGtzDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7DBB613A8D; Mon, 25 Jul 2022 09:19:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id sHdUHgpg3mIrDQAAMHmgww (envelope-from ); Mon, 25 Jul 2022 09:19:06 +0000 Date: Mon, 25 Jul 2022 11:19:01 +0200 From: Borislav Petkov To: "Jason A. Donenfeld" Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, x86@kernel.org, Will Deacon , Alexander Gordeev , Thomas Gleixner , "H . Peter Anvin" , Catalin Marinas , Heiko Carstens , Johannes Berg , Mark Rutland , Harald Freudenberger , Michael Ellerman Subject: Re: [PATCH v3] random: handle archrandom with multiple longs Message-ID: References: <20220719130207.147536-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220719130207.147536-1-Jason@zx2c4.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 19, 2022 at 03:02:07PM +0200, Jason A. Donenfeld wrote: > Since callers need to check this return value and loop anyway, each arch > implementation does not bother implementing its own loop to try again to > fill the maximum number of longs. Additionally, all existing callers > pass in a constant max_longs parameter. Hmm, maybe this has come up already but it reads weird. If I have a function arch_get_random_longs(), I'd expect it to give me the number of longs I requested or say, error. Why do the callers need to loop? If I have to loop, I'd call the "get me one long" function and loop N times. -- Regards/Gruss, Boris. SUSE Software Solutions Germany GmbH GF: Ivo Totev, Andrew Myers, Andrew McDonald, Martje Boudien Moerman (HRB 36809, AG Nürnberg)