Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2486044ybx; Fri, 8 Nov 2019 05:06:36 -0800 (PST) X-Google-Smtp-Source: APXvYqxknWdfsqta3fPTr5lR7Y+/L9oetpW4RF5ktK4BsZjCgbbGB58/M5zBABp+4JDY5x1tMXN2 X-Received: by 2002:a05:6402:1a34:: with SMTP id be20mr10135537edb.221.1573218395954; Fri, 08 Nov 2019 05:06:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573218395; cv=none; d=google.com; s=arc-20160816; b=mO9umg7a9FjBMHf1F5GFY0HN643VNkmh3jCHyt6SdKhWboi9yi+qMDqOD8V+voCT4O eyP2KWI+/6oB9cwCtiFc0ViAv+pyqHuRRkp8YI0q5LYy/01xWBWX4HwibpxSKFonbDig 0BrYlapqnCzAUfu7RavDb5mI8aSD0VYyEtybZc1OGLcVTfpT+Dk59TlwHR0vXz9RoD// LNKiQ0YxLnfWM957LJ78NrMeWmHnXNvu+CK0/RyFH5+iXocSCy9nrDsaF/fyt0dt+0/q fSFrsMMQ3c2KJvq2JytYhBQ5V5sRv2yZe5K6OciuDXgjMLPppPERRkKT6902kzPSvuYf 6NKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=RD3rCfuQNE2f6lJThi4WImY0CO33DjtVpBFoOhDzKvA=; b=KfggQ+c6p+8Zt/8G/tyEWcfcwab1TEo9NSWybAkMURVLu8GTMjFuVSYsNElZVf488j XOnckmHM7BJ/vBaNzfs9UkTIhC11FIip32ocyXK/vGpWKYvdmvbOXg0ZNmbygf6aBgHi kF/bOl4yHNe/6GxOJzlewDk4imrE/EwPt1kIlVXkZKUbYPQ9bqoL4PPw9CVBZBb3YdZj NO4xQputJPB2vE0xx4DxbSRftg3aV8++6jtZOW/10uV0Bt8fB5kC9dvkpzGNJq+wgSCI oL8Cv8ZMXlvxm5IRKjtxGx64vycIRejaX8KP1WD2BB4qy6CCxZN0fEvmeP7HVql1XZur //hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="bRgco/j6"; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b14si3972690edf.199.2019.11.08.05.06.06; Fri, 08 Nov 2019 05:06:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="bRgco/j6"; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727233AbfKHND4 (ORCPT + 99 others); Fri, 8 Nov 2019 08:03:56 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:55656 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727065AbfKHNDz (ORCPT ); Fri, 8 Nov 2019 08:03:55 -0500 Received: by mail-wm1-f65.google.com with SMTP id b11so6095287wmb.5 for ; Fri, 08 Nov 2019 05:03:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RD3rCfuQNE2f6lJThi4WImY0CO33DjtVpBFoOhDzKvA=; b=bRgco/j6fJMrPrbhgZZvBs1Cx7s60pHxKUupeQ9oSiAO+j59MSXWl5ZycYmUdl4N+n LBzf56vqaExjhUDzR7jxVXOldV7wJbk+AuIiSZSLxp5JfP32Cd1DbPVl3V7S4GUEJEnP 13G+dqk59eT7kGI4uHyXESl+fEq/UyX9sD45Z8DvOazsg5sJBGbhUjeDkqWA+gvOmpFG RYRfaoSjM93UVhHNudlSXaYwMW4I5+ICRg+hPm9efN2S4a7lbMEVD+lDu2JbOk8pIprH rt0r4IXHPz/l4pDogHC2pDCaN4phRztbjYx/BvT3ecuoATtLB3lw1yFgaBFPT8d6fv4h 1tzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RD3rCfuQNE2f6lJThi4WImY0CO33DjtVpBFoOhDzKvA=; b=h5SHtwaCZ4ZGuMYI6PfUUynFh1APuP2q4v3SXt6lrY7SkZTrrCopBNsP4rOBcKXDkm cnwyjByMFn6RuUJXpPUPkg7DExdYErQcbiwzRE75/e0gRxkr7TSUc28cwX9eYOOCo8Jp fjLxgTPBNWJqj5cdgcCSiVxlxPght1xQkjiXPW0jcrx4/G97jCq3yVQqo6YSbCDj8yOh L371vsfdRq6R1PjMlnEIALd2MNHNFTa1ZdZIsFhNVrcDGZTsKO2pwArIfbMzzY+6M4p6 ttwqVS3t+w3hFGwFTvPsFWjnMj7h/ixBwEMCtQ/8xe6WAQ0Mmovhz2m0lay3hfCDdOIb ryUA== X-Gm-Message-State: APjAAAVGnhGb16TQ4u6MZfmWCS6h8ngh2mB0HygYFjrKUXRfrWeGAmqu Fvgux9ZJRk5aWR+zAs/LcQNpqroDuQpPsHpqMGPLLg== X-Received: by 2002:a1c:64d6:: with SMTP id y205mr7605417wmb.136.1573218233883; Fri, 08 Nov 2019 05:03:53 -0800 (PST) MIME-Version: 1.0 References: <20191106141954.30657-1-rth@twiddle.net> <20191106141954.30657-2-rth@twiddle.net> <23ce309b-1561-ed95-7ce7-463a991bd19b@linaro.org> In-Reply-To: <23ce309b-1561-ed95-7ce7-463a991bd19b@linaro.org> From: Ard Biesheuvel Date: Fri, 8 Nov 2019 14:03:42 +0100 Message-ID: Subject: Re: [PATCH v4 1/1] arm64: Implement archrandom.h for ARMv8.5-RNG To: Richard Henderson , Marc Zyngier Cc: linux-arm-kernel , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , Mark Rutland Content-Type: text/plain; charset="UTF-8" Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Fri, 8 Nov 2019 at 12:10, Richard Henderson wrote: > > On 11/6/19 10:30 PM, Ard Biesheuvel wrote: > > On Wed, 6 Nov 2019 at 15:20, Richard Henderson > > wrote: > >> +static inline bool has_random(void) > >> +{ > >> + /* > >> + * We "have" RNG if either > >> + * (1) every cpu in the system has RNG, or > >> + * (2) in a non-preemptable context, current cpu has RNG. > >> + * Case 1 is the expected case when RNG is deployed, but > >> + * case 2 is present as a backup in case some big/little > >> + * system only has RNG on big cpus, we can still add entropy > >> + * from the interrupt handler of the big cpus. > > > > I don't understand the reference to the interrupt handler here. > > To add_interrupt_randomness(), invoked by handle_irq_event_percpu(). > Better if I reword the above to include the function name? > This is one of the several places where arch_random_get_seed_long() is called, so if you are going to single it out like that, it does make sense to clarify that. > > It is > > worth mentioning though that this arrangement permits > > rand_initialize() to use the instructions regardless of whether they > > are implemented only by the boot CPU or by all of them. > > Yes, I'll include that. > > > r~