Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4419768imw; Tue, 12 Jul 2022 07:39:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uJCwDEDa+7mDtxYug641QUHdAeGI+1SBibhxSddWW4gYBi+5uqwfpb+zI871xU6b5xecb9 X-Received: by 2002:a17:907:6da4:b0:72b:7f56:63c with SMTP id sb36-20020a1709076da400b0072b7f56063cmr3621696ejc.6.1657636762711; Tue, 12 Jul 2022 07:39:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657636762; cv=none; d=google.com; s=arc-20160816; b=me6SaguYY8o9HpyymP6P5UQq68eh8MfsYZzkuGjvmbf/6f31gI6BisqvIcFQm39j8i LO5lhrNd05nT5jEEwlXsHpcJmpZzTcoBSiEIFEcmmM1nWB8bAzVw7+QU1Ni4I1Vei/HX 1tyxYPw3Zq/xj+7kvd1p+8t+j20iXBMAxDqBdjj4VHMxWUUQkFurZXq/RxCYeNXXxXne rHLPu76tbABoc9UW6VJIdA2w1u1ECtq7tfILUGGQG6KA+h6Tafji9VXFegzjlXDcR6Ml p+mKmYjYjv8VJiWmflOLBThxhrvu/fKr1vJJyTEYHWbG6hFgf2vMYM90/XNR15LlYfYS mGJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:user-agent :references:in-reply-to:reply-to:subject:cc:to:from:date :mime-version:dkim-signature; bh=kGyzR2fpyeLcBebTuOi+d7JoZMaKSe8+x0WfdvqQfUg=; b=z/63PkEjtM8ptBRKKV9hcmQJbkcAz+lQThLpLXJQrRwp0oPUBODwsQcroxWzWLZizR t+pj+gS/IEiLn/G0R8qtDmCwMUxhOG3e8FWqvZu5P7s44+5yCczYCqyFZ7W6ApQOXfHm 0Zw4k35MwKQNepeZ0FIwIexwU2JTjTZrHsu83t97RIV4w1A1O9hS3u0DUfXzrsWpT6PN SU940/GzOMS+bRczeB/ESSV/X7s/kkzoH6/3oa6Tv2+zcHM/cvywZ4aodMegMBG6Et9m jeIoQVF6GxQiaMEh4mf57mXTnYHGYWUV9HHqkRGpWC0ThLRolAtLX2ps6grpJqDE/zDd feEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=fiyQsI2q; 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=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jx1-20020a170907760100b0072af12dbfafsi13828194ejc.941.2022.07.12.07.38.56; Tue, 12 Jul 2022 07:39:22 -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=@ibm.com header.s=pp1 header.b=fiyQsI2q; 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=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233599AbiGLOgX (ORCPT + 99 others); Tue, 12 Jul 2022 10:36:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233640AbiGLOfs (ORCPT ); Tue, 12 Jul 2022 10:35:48 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D90F7B93FE; Tue, 12 Jul 2022 07:35:45 -0700 (PDT) Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26CDBuiW007915; Tue, 12 Jul 2022 14:35:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=mime-version : date : from : to : cc : subject : reply-to : in-reply-to : references : message-id : content-type : content-transfer-encoding; s=pp1; bh=kGyzR2fpyeLcBebTuOi+d7JoZMaKSe8+x0WfdvqQfUg=; b=fiyQsI2qa0GpRBUEFNxr/mxL/X0zAJdWa/rPpUvfMBB/yoeAifZsdOZjVjYbyd9ouk1W pH5ypuPnqlahBvtci/N9ghVNsUfYVoqiKZoWmns41B1DfEph+AdXrFkG6G4FqWmZPOCv 7YwVl6FHA+3fCNW1U2ggm5LLCwekeERXDEiMuxYRfeS51j58FMVFRfVPqnsXS0O3ySEK Id96mRcuyEX0s6Mn2yjfGs0f6OJyKS+3PuubCguoG7KuSJZdGlMttdccnMEF3w9LXRU3 BGFKHkbXUbDSQPULyp0YHgxZC5h9llSn5ea4sgPJiQFqPVgBujm0JT8+TmAg0GT1epdk JA== Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3h98jvm4ws-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Jul 2022 14:35:44 +0000 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 26CEKWgu029571; Tue, 12 Jul 2022 14:35:44 GMT Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by ppma03dal.us.ibm.com with ESMTP id 3h71a9kxk5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Jul 2022 14:35:44 +0000 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 26CEZgel25297300 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 Jul 2022 14:35:42 GMT Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 61730BE053; Tue, 12 Jul 2022 14:35:42 +0000 (GMT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 05DEBBE04F; Tue, 12 Jul 2022 14:35:41 +0000 (GMT) Received: from ltc.linux.ibm.com (unknown [9.10.229.42]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 12 Jul 2022 14:35:41 +0000 (GMT) MIME-Version: 1.0 Date: Tue, 12 Jul 2022 16:35:41 +0200 From: Harald Freudenberger To: "Jason A. Donenfeld" 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 Reply-To: freude@linux.ibm.com In-Reply-To: References: <20220712100829.128574-1-freude@linux.ibm.com> <4881578c512c5420315abfef47068df0@linux.ibm.com> User-Agent: Roundcube Webmail/1.4.13 Message-ID: X-Sender: freude@linux.ibm.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: dlYjzzuukjachh3QThN5XbF1vkp6nh0M X-Proofpoint-ORIG-GUID: dlYjzzuukjachh3QThN5XbF1vkp6nh0M X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-12_08,2022-07-12_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=87 mlxscore=87 malwarescore=0 suspectscore=0 adultscore=0 lowpriorityscore=0 mlxlogscore=-83 impostorscore=0 clxscore=1015 spamscore=87 bulkscore=0 phishscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207120056 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,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 On 2022-07-12 14:27, Jason A. Donenfeld wrote: > 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 Hm, no, I can't see a way to provide trng random data in any whatever interrupt context for the next future. The only enabler would be to use a buffer ... I started to get in contact with our hardware guys to make the trng data internally buffered and this the invocation could be in no time give back random data. But this may be a hardware development thing for the next machine generation. Thanks Jason for your work Regards Harald Freudenberger