Message ID | 20191113101151.13389-1-richard.henderson@linaro.org |
---|---|
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp9375918ilf; Wed, 13 Nov 2019 02:12:10 -0800 (PST) X-Google-Smtp-Source: APXvYqz1PCq6XyLKglXvPS+WKq0dek5YMjHGiFQkMDomARAS2lIWlQX4w67dswmWKhwQADhKkUqv X-Received: by 2002:a50:ec83:: with SMTP id e3mr2569759edr.292.1573639930064; Wed, 13 Nov 2019 02:12:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573639930; cv=none; d=google.com; s=arc-20160816; b=NdZys9GR//EIScg5aSXHu8stLb8pgTdxiQnPkbu/HJQ9PdAgOs4FcaAEmLhO5nwDku gvnymxR4InKjn0pXtkNJF2slMSqpqAt5Khpsi00Bt0+6d6ntdauKCvgByP0HGJrnQbR0 6UZmSlI6h4OJ60isnSkxAtTQFCQY9Sq7utgkMBp3Oc0C3XoW6jC1+dCSrSjXuNrMVuFs oLAReaBaErvMaZimuGu7S9kOWS4XPBgH8X3WBPUChhaNqTGJ0LStzFMswIYi+LB/Nv01 UOigClq43swhAQo2zIHzNPPGAht7NX8c50YxYw77Raq8wubX6DgE8pr0JFLvdxBrlNCC eaBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=qfsOH+V+FFt5Iv+QrGgZE8TPXjX+qzSLSAGyJ3kwIrE=; b=0n6cPW66CHPGiEBf5eXMzC4pljND2zlL3JteHraXX+fIC3PPKLUgNUlRMRmzazZWpH M+jCxbstwCXCdh63aZUB69Lg2yz6OzrD1OhT7u7hQbin7u4TU/MwXlnImZPz9N5T0eMB D6Yoeloo+a2Aa86R7WSCIDsaSS1sFfiAch8WWpyN9t4Q/Bsy1tB1PLopEAKWcZKNPGvT UWWJieNNykMkEDgkKqxlc5JUkJiK6HsiAJNjdmCMSUh/tQhKLDyLX3M4FbTTn0yy7x8a hc6kcjlgsu6jocCiGorMufD8dTzm37Pl9X0JUV5fV4gOBb2totnB31W5KOBe6zWvb1yb SAFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tWbstU+F; 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: <linux-crypto-owner@vger.kernel.org> Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l5si897542edv.108.2019.11.13.02.12.09; Wed, 13 Nov 2019 02:12:10 -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=tWbstU+F; 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 S1727437AbfKMKMI (ORCPT <rfc822;sumit.garg@linaro.org> + 3 others); Wed, 13 Nov 2019 05:12:08 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:50217 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726613AbfKMKMI (ORCPT <rfc822;linux-crypto@vger.kernel.org>); Wed, 13 Nov 2019 05:12:08 -0500 Received: by mail-wm1-f66.google.com with SMTP id l17so1335537wmh.0 for <linux-crypto@vger.kernel.org>; Wed, 13 Nov 2019 02:12:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=qfsOH+V+FFt5Iv+QrGgZE8TPXjX+qzSLSAGyJ3kwIrE=; b=tWbstU+FDUA1HwWfrqONQYhJnptM18pTgDImtEgJRnYbe6cRnq9xn2sqaZoCEupOh3 d2ttQcZQStn7nW+BP6Ns7HpLcqO6w9QNq5/KHknjlPqTu2/bc2Wsy1tmmPVC18xkq6EE 2cxG7T1z0gZPO1SniOavy3d0gSW+Qj+nUrRYJJ/tw+G9BAeoN6q46DEnTug+BlCxMYjW k6hty9B65FK6crBvzXrWZ6YMdUwaW3Hv9fL5O68URS+kD/IuXdeJrx/ggnWc1o4GLGmp m4rZTZQGX02OCafVBuExt12p6K4AAGiIJs9fa/uQxNvUxSs70602RA/zVB34rI9KNLzD Z+UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=qfsOH+V+FFt5Iv+QrGgZE8TPXjX+qzSLSAGyJ3kwIrE=; b=OwoDkY3vX8qYUby49nAvmuyyYsuJM3l6WNmJ5j99sZlY33sZQazMsLiijvlJrKTOYd vK0qe8MG79eREGael2WnkY6JiQW8CxaKlLj6d0+JYt6S9w0V1OYK5UmAQbRsPdUx+zOY lLR4SdgESAMAplT3WvCF2Mdw4FcONDY/h5UXnvkQfLRgDI8i7DFIj/yL2LwELfNbBJwB ZMqyDAW7HI2HObn/eceGR46hncScqOn9l9f5JAzKnXU7VovisU5hC+Z54WZJUsxw2oz+ dWYrEeEgeB7r7UHn8GwlFZht5BvBQR6rCU7MUFDKxUexlKlVsM8zbGTdqivflkFAHq+s S4yg== X-Gm-Message-State: APjAAAVpX5N2QeiFRupcHZIn+hgLgzf/KciWHzrfpxlgNMKLC6rvCvbN 7WGCHVhCnB5CIT6OffC0brxLTj0bkIHPxw== X-Received: by 2002:a7b:c055:: with SMTP id u21mr2046674wmc.55.1573639926058; Wed, 13 Nov 2019 02:12:06 -0800 (PST) Received: from localhost.localdomain (219.red-37-158-56.dynamicip.rima-tde.net. [37.158.56.219]) by smtp.gmail.com with ESMTPSA id j66sm1488993wma.19.2019.11.13.02.12.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Nov 2019 02:12:05 -0800 (PST) From: richard.henderson@linaro.org To: linux-arm-kernel@lists.infradead.org Cc: mark.rutland@arm.com, ard.biesheuvel@linaro.org, linux-crypto@vger.kernel.org, Richard Henderson <richard.henderson@linaro.org> Subject: [PATCH v6 0/1] arm64: Implement archrandom.h for ARMv8.5-RNG Date: Wed, 13 Nov 2019 11:11:50 +0100 Message-Id: <20191113101151.13389-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: <linux-crypto.vger.kernel.org> X-Mailing-List: linux-crypto@vger.kernel.org |
Series |
arm64: Implement archrandom.h for ARMv8.5-RNG
|
expand
|
From: Richard Henderson <richard.henderson@linaro.org> Here's v6. I believe I've collected all of the comments from both Ard and Mark across v4 and v5, as well as from the cafe in Lyon. I had thought about using a simple function pointer for arch_get_random_seed_long, but didn't see a good place where I could update that at the end of boot. Which lead me to ALTERNATIVE_CB, which is way overkill, but is already part of the update infrastructure. Tested with qemu -cpu {max,cortex-a57}, which covers both sides of the alternative. GDB breakpoints confirm that boot_get_random_seed_long is what is called from rand_initialize, and that this_cpu_has_cap returns the correct result. r~ Documentation/arm64/cpu-feature-registers.rst | 2 + arch/arm64/include/asm/archrandom.h | 55 +++++++++++++++ arch/arm64/include/asm/cpucaps.h | 3 +- arch/arm64/include/asm/sysreg.h | 4 ++ arch/arm64/kernel/cpufeature.c | 13 ++++ arch/arm64/kernel/random.c | 67 +++++++++++++++++++ arch/arm64/Kconfig | 12 ++++ arch/arm64/kernel/Makefile | 1 + drivers/char/Kconfig | 4 +- 9 files changed, 158 insertions(+), 3 deletions(-) create mode 100644 arch/arm64/include/asm/archrandom.h create mode 100644 arch/arm64/kernel/random.c -- 2.17.1