Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp554627imm; Fri, 8 Jun 2018 01:05:28 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLgo+OcFXLv6h9PwpwqdphqtYJJZ1fjZuCVs4TtsVQPmNiU2pJ2NoiwP2M6CZLmdJ5zKinO X-Received: by 2002:a65:4d47:: with SMTP id j7-v6mr4316855pgt.19.1528445128205; Fri, 08 Jun 2018 01:05:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528445128; cv=none; d=google.com; s=arc-20160816; b=MFbrVtXvSBqmMXtIrssww1j/y03N8oUzraC8CkxuktU45zlWUQrZm/MEPhdQj1ulS+ PZAtdKR1P7VQEgt/PjB5sWvOZxmvrWiY7dq1uJcNRSAw16+3QKl17pckxe43RoiyW+JO 1MaFjcuelUhlTsHxDlOadhlZGjPLKlQ3VnkLUBB5VrZ0GoLs5KUnWc2kLvEdbECq9neV SOHCu8mnpaxItldz+Lrb6eeo4tmzGP4hq7vCYm//8LAUCyN/4oDD4K+ZTY5D1vwOsun+ syKMsnK1j85e/6PKYL+k18qwIxXdkI5iPUC7a+I4sIND3+B8BxlIkDZz5OpbP/u4jdMC Uz7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=pm+rP4DAbXWxAnntINn7D7pBCvqb2YuLo+gVTbgINT4=; b=CCiT/akO2soJ88rzoE3FDM5JpxsB07z+3Sjc5jfIysD87JjONAOT5TGl1feCVTij3B rPa5/8pMvuPYQQ5jPSrjPXGsZD/LdN2C5IBP3nA5i/BoIVBgYV7VQkDCF/94oUISITQV UOYbTtHZw9rhtzltaM/IDHN/30pqLL6iNBRp982g1aBI6+5auk4f7MyoCJGiZ+woN4g7 KVLzrFzLTLmvBlhmyTBcvp9Al7cpzWkRQKUoMdloItC8ESTG0Z9XAv2zgs6RKHSH7hnZ RNc8olLnP1mxhtxY/3DhRz4xGGCCrvIqoyMZxpI7K2eTWJ/3SPHREH5z9i2P0TO4ytYc FTSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b15-v6si26626510pfc.320.2018.06.08.01.05.13; Fri, 08 Jun 2018 01:05:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751486AbeFHIEn (ORCPT + 99 others); Fri, 8 Jun 2018 04:04:43 -0400 Received: from mx2.suse.de ([195.135.220.15]:40914 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751138AbeFHIEk (ORCPT ); Fri, 8 Jun 2018 04:04:40 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id E9DA5AE54; Fri, 8 Jun 2018 08:04:38 +0000 (UTC) Date: Fri, 8 Jun 2018 10:04:37 +0200 From: Petr Mladek To: Thierry Escande Cc: Andrew Morton , David Miller , Rasmus Villemoes , "Tobin C . Harding" , linux-kernel@vger.kernel.org, Andy Shevchenko Subject: Re: [PATCH RESEND] lib/test_printf.c: call wait_for_random_bytes() before plain %p tests Message-ID: <20180608080437.n2b5nv73d3kp6yhb@pathway.suse.cz> References: <20180604113708.11554-1-thierry.escande@linaro.org> <20180607122434.i4x7b5ij4p6dpx7w@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 2018-06-07 20:47:25, Thierry Escande wrote: > Hi Petr, > > On 07/06/2018 14:24, Petr Mladek wrote: > > On Mon 2018-06-04 13:37:08, Thierry Escande wrote: > > > If the test_printf module is loaded before the crng is initialized, the > > > plain 'p' tests will fail because the printed address will not be hashed > > > and the buffer will contain '(ptrval)' instead. > > > This patch adds a call to wait_for_random_bytes() before plain 'p' tests > > > to make sure the crng is initialized. > > > > Hmm, my system did not boot with this patch and > > CONFIG_TEST_PRINTF=y > > > > I guess that there was not enough entropy. It is basically a deadlock. > > The build-in module init calls are called when SMP is enabled but > > there is no real activity and the init calls are called sequentially. > > Therefore there is nothing that could produce some entropy, ... > > > > I suggest to skip the test when crng is not ready. > > Thanks for pointing this out. > > The issue is that the crng_ready() is not available outside of random.c. > I'll leave the call to wait_for_random_bytes() if test_printf is compiled as > a module and use add_random_ready_callback() to check if crng is initialized > otherwise. Does that sound ok to you? Great, I was not aware of add_random_ready_callback(). I suggest to make the decision in test_printf_init() and run all tests either as the callback or immediately. Best Regards, Petr