mbox series

[v11,0/2] ARMv8.5-RNG support

Message ID 20200117152642.4905-1-broonie@kernel.org (mailing list archive)
Headers show
Series ARMv8.5-RNG support | expand

Message

Mark Brown Jan. 17, 2020, 3:26 p.m. UTC
This series is based on Richard Henderson's previous v7, it addresses
review comments from that version by dropping the boot time RNG
support and adds a new change that uses the v8.5-RNG extension to
seed KASLR when ARCH_RANDOM is enabled.  The boot time support
will be re-added later, there are awkward potential interactons
with CPU feature enumeration which need a bit more thought.

v11:
 - Add a hwcap for v8.5-RNG.
 - Drop the addition of data to the pool, it's of questionable
   value and we need to go back and get the addition of actual
   entropy working anyway.
v10:
 - Spell out that we're adding data not entropy from setup_arch() in
   the commit message for patch 2.
v9:
 - Make another static inline helper for early feature checks.
 - Add init annotations.
 - Use xor to add RNDR output to seed for KASLR.

Mark Brown (1):
  arm64: Use v8.5-RNG entropy for KASLR seed

Richard Henderson (1):
  arm64: Implement archrandom.h for ARMv8.5-RNG

 Documentation/arm64/cpu-feature-registers.rst |  2 +
 Documentation/arm64/elf_hwcaps.rst            |  4 ++
 arch/arm64/Kconfig                            | 12 ++++
 arch/arm64/include/asm/archrandom.h           | 67 +++++++++++++++++++
 arch/arm64/include/asm/cpucaps.h              |  3 +-
 arch/arm64/include/asm/hwcap.h                |  1 +
 arch/arm64/include/asm/sysreg.h               |  4 ++
 arch/arm64/include/uapi/asm/hwcap.h           |  1 +
 arch/arm64/kernel/cpufeature.c                | 14 ++++
 arch/arm64/kernel/kaslr.c                     | 11 +++
 10 files changed, 118 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm64/include/asm/archrandom.h

Comments

Will Deacon Jan. 17, 2020, 4:17 p.m. UTC | #1
On Fri, Jan 17, 2020 at 03:26:40PM +0000, Mark Brown wrote:
> This series is based on Richard Henderson's previous v7, it addresses
> review comments from that version by dropping the boot time RNG
> support and adds a new change that uses the v8.5-RNG extension to
> seed KASLR when ARCH_RANDOM is enabled.  The boot time support
> will be re-added later, there are awkward potential interactons
> with CPU feature enumeration which need a bit more thought.

Thanks, but this fails an allmodconfig build for me:


arch/arm64/kernel/kaslr.c: In function ‘kaslr_early_init’:
arch/arm64/kernel/kaslr.c:127:6: error: implicit declaration of function ‘__early_cpu_has_rndr’; did you mean ‘__early_pfn_to_nid’? [-Werror=implicit-function-declaration]
  if (__early_cpu_has_rndr()) {
      ^~~~~~~~~~~~~~~~~~~~
      __early_pfn_to_nid
cc1: some warnings being treated as errors


(no gcc, we didn't mean that!)

Will
Will Deacon Jan. 17, 2020, 4:43 p.m. UTC | #2
On Fri, Jan 17, 2020 at 04:17:44PM +0000, Will Deacon wrote:
> On Fri, Jan 17, 2020 at 03:26:40PM +0000, Mark Brown wrote:
> > This series is based on Richard Henderson's previous v7, it addresses
> > review comments from that version by dropping the boot time RNG
> > support and adds a new change that uses the v8.5-RNG extension to
> > seed KASLR when ARCH_RANDOM is enabled.  The boot time support
> > will be re-added later, there are awkward potential interactons
> > with CPU feature enumeration which need a bit more thought.
> 
> Thanks, but this fails an allmodconfig build for me:
> 
> 
> arch/arm64/kernel/kaslr.c: In function ‘kaslr_early_init’:
> arch/arm64/kernel/kaslr.c:127:6: error: implicit declaration of function ‘__early_cpu_has_rndr’; did you mean ‘__early_pfn_to_nid’? [-Werror=implicit-function-declaration]
>   if (__early_cpu_has_rndr()) {
>       ^~~~~~~~~~~~~~~~~~~~
>       __early_pfn_to_nid
> cc1: some warnings being treated as errors
> 
> 
> (no gcc, we didn't mean that!)

Also fails on defconfig, so should save you a bit of time.

Will