Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4293850imw; Tue, 12 Jul 2022 05:38:14 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v1XHoBSGJmit0mA/qOjESwnh842vmlhH3EbtszlaAe2F4hjWfvVZK5+H3Z4++dE/kUhlaI X-Received: by 2002:a05:6a00:124a:b0:525:894b:7924 with SMTP id u10-20020a056a00124a00b00525894b7924mr23418443pfi.31.1657629494754; Tue, 12 Jul 2022 05:38:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657629494; cv=none; d=google.com; s=arc-20160816; b=bx873pEgpn9Vrt6bowAnwInq83EBzl6+LV2glx01APHJixDs+lkDwgjqLqaWuUX8MN J5PRa0xflcNoyPYyMieQyEOROHCJF+dwQy+L5bNZNgvU8NYPqDRGVVDUzCHeXgSsg9tN OTpX0xOn/7G4q5Sog/ufNa/fWxjlSV7Z0UZDQ1C2vzUdgKXHqh5Kji9UMkcCSsvR1Jtm moiq4VXG8q+F7nhAGMz/LtBCsXcAa7boUbt8oE8pfQGw0JB6pa/tcUtV2UV6GQssKCto Gj8RsQf0FJwXClbAGQAojrlvkHecjNh8mgJJqSdlL+TRtRNwQIjq2qUJrK/KhkufhVjJ 6+pw== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YZIRjEv14tSXjCzag3Hx80j5e2Wjq/ASDZSp8N5bDFk=; b=cWLuuD68pISX/K/Eu2LDlU/WgZT/nNmGKHmi+IPdOCir/xIjGrRnj2CE1EglC5pk46 uLr8P7tbemkbBcXmBQQ7a5INMbY/E5JYNWadwmBubYrK3g23N80sN4fOzkyQHUEEMc48 6EST4sfXZl/8pVq8Ss0LmjofHNENKpbvNSICICEA4whsfJglEtXfOV8gbY8BBj5pFBc4 jdhYnEk3Uf2upvleU46P7Swq0Zg3QZKGV6/hGqtL7XbWER+QmxGc0xZNrRxwiua+Xqor RHZHz6T+xXrawW0nkwf7ttrKx3T5UmiYjG5Fh/wK53usopBcm4/ATxrPoqW4hbxXmf6R P2rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=nmAvebnd; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 202-20020a6215d3000000b00528a31c652bsi12495491pfv.68.2022.07.12.05.37.49; Tue, 12 Jul 2022 05:38:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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=@zx2c4.com header.s=20210105 header.b=nmAvebnd; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232136AbiGLM1J (ORCPT + 99 others); Tue, 12 Jul 2022 08:27:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229772AbiGLM1I (ORCPT ); Tue, 12 Jul 2022 08:27:08 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01115AA776; Tue, 12 Jul 2022 05:27:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A7B57B817DE; Tue, 12 Jul 2022 12:27:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9982BC341C8; Tue, 12 Jul 2022 12:27:04 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="nmAvebnd" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1657628822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YZIRjEv14tSXjCzag3Hx80j5e2Wjq/ASDZSp8N5bDFk=; b=nmAvebndOKs5BzD8Q7YSio8wyD9Y4kFexKe3k320FHatz8PWllya/zR2K9FGxbkNJppdMJ 8ZE116Wv6mtq27RhdD0yXREv/l+9079Lgydcc6Gr/XZGplHTtRQVj6F8wHzQws6atu0BWK fFc19qs+WTtJtqhAMALwkXsrSuWXiHA= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id a5c466a7 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Tue, 12 Jul 2022 12:27:02 +0000 (UTC) Date: Tue, 12 Jul 2022 14:27:00 +0200 From: "Jason A. Donenfeld" To: Harald Freudenberger Cc: linux390-list@tuxmaker.boeblingen.de.ibm.com, linux-crypto@vger.kernel.org, linux-s390@vger.kernel.org, jchrist@linux.ibm.com, dengler@linux.ibm.com Subject: Re: [PATCH] s390/archrandom: remove CPACF trng invocations in interrupt context Message-ID: References: <20220712100829.128574-1-freude@linux.ibm.com> <4881578c512c5420315abfef47068df0@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4881578c512c5420315abfef47068df0@linux.ibm.com> X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Hi Harald, On Tue, Jul 12, 2022 at 02:09:35PM +0200, Harald Freudenberger wrote: > > You've gone through the troubles of confirming experimentally what > > in_task() does, but that doesn't answer *why* it should be disallowed > > variously in each one of these contexts. > > I think, I showed this. The only real occurrences remaining for the > arch_get_random_seed_long() call is within softirq context when the > network layer tries to allocate some skb buffers. My personal feeling > about this is that it does not hurt - but I asked our network guys > and their feedback is clear: no way - every delay there may cause > high bandwidth traffic to stumble and this is to be absolutely avoided. > However, they can't give me any measurements. > > So yes, the intention is now with checking for in_task() to prevent > the trng call in hard and soft interrupt context. But still I'd like > to meet your condition to provide good random at kernel startup. That's too bad, but okay. Final question: do you see any of the in_task() vs in_whatever() semantics changing if arch_get_random_words{,_seed}() is ever implemented, which would reduce the current multitude of calls to the trng to a single call? Jason