linux/arch/arm
Linus Torvalds 268325bda5 Random number generator updates for Linux 6.2-rc1.
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEq5lC5tSkz8NBJiCnSfxwEqXeA64FAmOU+U8ACgkQSfxwEqXe
 A67NnQ//Y5DltmvibyPd7r1TFT2gUYv+Rx3sUV9ZE1NYptd/SWhhcL8c5FZ70Fuw
 bSKCa1uiWjOxosjXT1kGrWq3de7q7oUpAPSOGxgxzoaNURIt58N/ajItCX/4Au8I
 RlGAScHy5e5t41/26a498kB6qJ441fBEqCYKQpPLINMBAhe8TQ+NVp0rlpUwNHFX
 WrUGg4oKWxdBIW3HkDirQjJWDkkAiklRTifQh/Al4b6QDbOnRUGGCeckNOhixsvS
 waHWTld+Td8jRrA4b82tUb2uVZ2/b8dEvj/A8CuTv4yC0lywoyMgBWmJAGOC+UmT
 ZVNdGW02Jc2T+Iap8ZdsEmeLHNqbli4+IcbY5xNlov+tHJ2oz41H9TZoYKbudlr6
 /ReAUPSn7i50PhbQlEruj3eg+M2gjOeh8OF8UKwwRK8PghvyWQ1ScW0l3kUhPIhI
 PdIG6j4+D2mJc1FIj2rTVB+Bg933x6S+qx4zDxGlNp62AARUFYf6EgyD6aXFQVuX
 RxcKb6cjRuFkzFiKc8zkqg5edZH+IJcPNuIBmABqTGBOxbZWURXzIQvK/iULqZa4
 CdGAFIs6FuOh8pFHLI3R4YoHBopbHup/xKDEeAO9KZGyeVIuOSERDxxo5f/ITzcq
 APvT77DFOEuyvanr8RMqqh0yUjzcddXqw9+ieufsAyDwjD9DTuE=
 =QRhK
 -----END PGP SIGNATURE-----

Merge tag 'random-6.2-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random

Pull random number generator updates from Jason Donenfeld:

 - Replace prandom_u32_max() and various open-coded variants of it,
   there is now a new family of functions that uses fast rejection
   sampling to choose properly uniformly random numbers within an
   interval:

       get_random_u32_below(ceil) - [0, ceil)
       get_random_u32_above(floor) - (floor, U32_MAX]
       get_random_u32_inclusive(floor, ceil) - [floor, ceil]

   Coccinelle was used to convert all current users of
   prandom_u32_max(), as well as many open-coded patterns, resulting in
   improvements throughout the tree.

   I'll have a "late" 6.1-rc1 pull for you that removes the now unused
   prandom_u32_max() function, just in case any other trees add a new
   use case of it that needs to converted. According to linux-next,
   there may be two trivial cases of prandom_u32_max() reintroductions
   that are fixable with a 's/.../.../'. So I'll have for you a final
   conversion patch doing that alongside the removal patch during the
   second week.

   This is a treewide change that touches many files throughout.

 - More consistent use of get_random_canary().

 - Updates to comments, documentation, tests, headers, and
   simplification in configuration.

 - The arch_get_random*_early() abstraction was only used by arm64 and
   wasn't entirely useful, so this has been replaced by code that works
   in all relevant contexts.

 - The kernel will use and manage random seeds in non-volatile EFI
   variables, refreshing a variable with a fresh seed when the RNG is
   initialized. The RNG GUID namespace is then hidden from efivarfs to
   prevent accidental leakage.

   These changes are split into random.c infrastructure code used in the
   EFI subsystem, in this pull request, and related support inside of
   EFISTUB, in Ard's EFI tree. These are co-dependent for full
   functionality, but the order of merging doesn't matter.

 - Part of the infrastructure added for the EFI support is also used for
   an improvement to the way vsprintf initializes its siphash key,
   replacing an sleep loop wart.

 - The hardware RNG framework now always calls its correct random.c
   input function, add_hwgenerator_randomness(), rather than sometimes
   going through helpers better suited for other cases.

 - The add_latent_entropy() function has long been called from the fork
   handler, but is a no-op when the latent entropy gcc plugin isn't
   used, which is fine for the purposes of latent entropy.

   But it was missing out on the cycle counter that was also being mixed
   in beside the latent entropy variable. So now, if the latent entropy
   gcc plugin isn't enabled, add_latent_entropy() will expand to a call
   to add_device_randomness(NULL, 0), which adds a cycle counter,
   without the absent latent entropy variable.

 - The RNG is now reseeded from a delayed worker, rather than on demand
   when used. Always running from a worker allows it to make use of the
   CPU RNG on platforms like S390x, whose instructions are too slow to
   do so from interrupts. It also has the effect of adding in new inputs
   more frequently with more regularity, amounting to a long term
   transcript of random values. Plus, it helps a bit with the upcoming
   vDSO implementation (which isn't yet ready for 6.2).

 - The jitter entropy algorithm now tries to execute on many different
   CPUs, round-robining, in hopes of hitting even more memory latencies
   and other unpredictable effects. It also will mix in a cycle counter
   when the entropy timer fires, in addition to being mixed in from the
   main loop, to account more explicitly for fluctuations in that timer
   firing. And the state it touches is now kept within the same cache
   line, so that it's assured that the different execution contexts will
   cause latencies.

* tag 'random-6.2-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random: (23 commits)
  random: include <linux/once.h> in the right header
  random: align entropy_timer_state to cache line
  random: mix in cycle counter when jitter timer fires
  random: spread out jitter callback to different CPUs
  random: remove extraneous period and add a missing one in comments
  efi: random: refresh non-volatile random seed when RNG is initialized
  vsprintf: initialize siphash key using notifier
  random: add back async readiness notifier
  random: reseed in delayed work rather than on-demand
  random: always mix cycle counter in add_latent_entropy()
  hw_random: use add_hwgenerator_randomness() for early entropy
  random: modernize documentation comment on get_random_bytes()
  random: adjust comment to account for removed function
  random: remove early archrandom abstraction
  random: use random.trust_{bootloader,cpu} command line option only
  stackprotector: actually use get_random_canary()
  stackprotector: move get_random_canary() into stackprotector.h
  treewide: use get_random_u32_inclusive() when possible
  treewide: use get_random_u32_{above,below}() instead of manual loop
  treewide: use get_random_u32_below() instead of deprecated function
  ...
2022-12-12 16:22:22 -08:00
..
boot SoC: DT changes for 6.2 2022-12-12 10:21:03 -08:00
common ARM/dma-mapping: remove dmabounce 2022-07-07 18:18:56 +02:00
configs SoC: arm defconfig updates for 6.2 2022-12-12 10:10:16 -08:00
crypto crypto: Kconfig - simplify cipher entries 2022-08-26 18:50:43 +08:00
include Random number generator updates for Linux 6.2-rc1. 2022-12-12 16:22:22 -08:00
kernel treewide: use get_random_u32_below() instead of deprecated function 2022-11-18 02:15:15 +01:00
lib ARM: 9233/1: stacktrace: Skip frame pointer boundary check for call_with_stack() 2022-10-04 11:09:47 +01:00
mach-actions
mach-airoha
mach-alpine
mach-artpec
mach-asm9260
mach-aspeed ARM: aspeed: Kconfig: Fix indentation 2022-09-28 22:33:55 +02:00
mach-at91 ARM: at91: fix build for SAMA5D3 w/o L2 cache 2022-11-24 12:50:07 +02:00
mach-axxia
mach-bcm SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
mach-berlin
mach-clps711x
mach-cns3xxx ARM: cns3xxx: add CONFIG_UNUSED_BOARD_FILES dependency 2022-07-22 14:18:52 +02:00
mach-davinci ARM: SoC code changes for 6.1 2022-10-06 11:22:25 -07:00
mach-digicolor
mach-dove ARM: make ARCH_MULTIPLATFORM user-visible 2022-08-30 11:18:09 +02:00
mach-ep93xx TTY/Serial driver update for 6.1-rc1 2022-10-07 16:36:24 -07:00
mach-exynos
mach-footbridge Merge branch 'arm-multiplatform-cleanup' of https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc into arm/soc 2022-09-15 22:20:59 +02:00
mach-gemini
mach-highbank ARM/dma-mapping: use dma-direct unconditionally 2022-07-07 18:18:57 +02:00
mach-hisi genirq: GENERIC_IRQ_EFFECTIVE_AFF_MASK depends on SMP 2022-07-07 09:38:04 +01:00
mach-hpe
mach-imx ARM: imx3: Remove unneeded #include <linux/pinctrl/machine.h> 2022-11-11 15:04:15 +08:00
mach-iop32x ARM: remove obsolete Makefile.boot infrastructure 2022-08-18 16:44:59 +02:00
mach-ixp4xx ARM: ixp4xx: Remove unused debug iomap 2022-11-23 09:29:20 +01:00
mach-keystone ARM: keystone: Replace platform SMP with PSCI 2022-10-27 20:12:27 -05:00
mach-lpc18xx ARM: remove obsolete Makefile.boot infrastructure 2022-08-18 16:44:59 +02:00
mach-lpc32xx ARM: remove obsolete Makefile.boot infrastructure 2022-08-18 16:44:59 +02:00
mach-mediatek
mach-meson
mach-milbeaut
mach-mmp ARM: mmp: fix timer_read delay 2022-12-04 13:11:40 +01:00
mach-moxart
mach-mstar
mach-mv78xx0 ARM: make ARCH_MULTIPLATFORM user-visible 2022-08-30 11:18:09 +02:00
mach-mvebu ARM: mvebu: switch to using gpiod API in pm-board code 2022-11-28 01:12:58 +01:00
mach-mxs SoC code updates for 6.2 2022-12-12 10:14:52 -08:00
mach-nomadik
mach-npcm
mach-nspire ARM: Kconfig: clean up platform selection 2022-08-18 16:44:59 +02:00
mach-omap1 - Core Frameworks 2022-10-07 11:24:20 -07:00
mach-omap2 ARM: OMAP2+: Drop legacy hwmod data for omap3 otg 2022-11-22 13:25:20 +02:00
mach-orion5x ARM: make ARCH_MULTIPLATFORM user-visible 2022-08-30 11:18:09 +02:00
mach-oxnas
mach-pxa - Core Frameworks 2022-08-06 10:25:16 -07:00
mach-qcom ARM: mach-qcom: Add support for MSM8909 2022-07-18 18:06:08 -05:00
mach-rda
mach-realtek
mach-rockchip
mach-rpc ARM: Kconfig: clean up platform selection 2022-08-18 16:44:59 +02:00
mach-s3c USB/Thunderbolt changes for 6.1-rc1 2022-10-07 16:48:26 -07:00
mach-s5pv210
mach-sa1100 ARM: Kconfig: clean up platform selection 2022-08-18 16:44:59 +02:00
mach-shmobile ARM: shmobile: Drop selecting GPIOLIB and PINCTRL 2022-10-28 14:31:24 +02:00
mach-socfpga
mach-spear ARM: spear: Do not use timer namespace for timer_shutdown() function 2022-11-24 15:09:10 +01:00
mach-sti
mach-stm32 ARM: remove obsolete Makefile.boot infrastructure 2022-08-18 16:44:59 +02:00
mach-sunplus ARM: sunplus: fix serial console kconfig and build problems 2022-09-23 14:20:00 +02:00
mach-sunxi
mach-tegra
mach-uniphier
mach-ux500 ARM: ux500: Drop unused register file 2022-11-08 21:18:42 +01:00
mach-versatile TTY/Serial driver update for 6.1-rc1 2022-10-07 16:36:24 -07:00
mach-vt8500 ARM: remove obsolete Makefile.boot infrastructure 2022-08-18 16:44:59 +02:00
mach-zynq
mm ARM fixes for 6.1 2022-12-10 10:14:52 -08:00
net
nwfpe
plat-orion ARM: orion: fix include path 2022-09-23 21:55:54 +02:00
probes ARM: 9214/1: alignment: advance IT state after emulating Thumb instruction 2022-07-06 22:44:49 +01:00
tools
vdso
vfp
xen xen/virtio: Optimize the setup of "xen-grant-dma" devices 2022-12-05 12:59:49 +01:00
Kbuild
Kconfig - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in 2022-10-10 17:53:04 -07:00
Kconfig-nommu
Kconfig.assembler
Kconfig.debug ARM: make ARCH_MULTIPLATFORM user-visible 2022-08-30 11:18:09 +02:00
Makefile Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00