diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2020-01-21 13:58:52 +0100 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2020-01-22 10:54:18 +0100 |
commit | 1a50ec0b3b2e9a83f1b1245ea37a853aac2f741c (patch) | |
tree | 14509c3a940e8c2072ff34ffef36d0c53c9905b6 /arch/arm64/include/asm/hwcap.h | |
parent | Linux 5.5-rc3 (diff) | |
download | linux-1a50ec0b3b2e9a83f1b1245ea37a853aac2f741c.tar.xz linux-1a50ec0b3b2e9a83f1b1245ea37a853aac2f741c.zip |
arm64: Implement archrandom.h for ARMv8.5-RNG
Expose the ID_AA64ISAR0.RNDR field to userspace, as the RNG system
registers are always available at EL0.
Implement arch_get_random_seed_long using RNDR. Given that the
TRNG is likely to be a shared resource between cores, and VMs,
do not explicitly force re-seeding with RNDRRS. In order to avoid
code complexity and potential issues with hetrogenous systems only
provide values after cpufeature has finalized the system capabilities.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
[Modified to only function after cpufeature has finalized the system
capabilities and move all the code into the header -- broonie]
Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
[will: Advertise HWCAP via /proc/cpuinfo]
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/include/asm/hwcap.h')
-rw-r--r-- | arch/arm64/include/asm/hwcap.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/hwcap.h b/arch/arm64/include/asm/hwcap.h index 3d2f2472a36c..fa186480e805 100644 --- a/arch/arm64/include/asm/hwcap.h +++ b/arch/arm64/include/asm/hwcap.h @@ -86,6 +86,7 @@ #define KERNEL_HWCAP_SVESM4 __khwcap2_feature(SVESM4) #define KERNEL_HWCAP_FLAGM2 __khwcap2_feature(FLAGM2) #define KERNEL_HWCAP_FRINT __khwcap2_feature(FRINT) +#define KERNEL_HWCAP_RNG __khwcap2_feature(RNG) /* * This yields a mask that user programs can use to figure out what |