linux/arch/mips/include/asm
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
..
dec DEC: Limit PMAX memory probing to R3k systems 2022-03-07 13:10:44 +01:00
fw MIPS: pic32: treat port as signed integer 2022-11-11 15:53:58 +01:00
ip32
mach-ar7 MIPS: AR7: remove orphan declarations from arch/mips/include/asm/mach-ar7/ar7.h 2022-09-19 16:37:27 +02:00
mach-ath25 MIPS: Remove TX39XX support 2022-03-01 10:07:22 +01:00
mach-ath79 MIPS: Remove TX39XX support 2022-03-01 10:07:22 +01:00
mach-au1x00 MIPS: Remove TX39XX support 2022-03-01 10:07:22 +01:00
mach-bcm47xx MIPS: BCM47XX: Add support for Netgear WNR3500L v2 2022-07-15 14:22:47 +02:00
mach-bcm63xx PCI: Add defines for normal and subtractive PCI bridges 2022-02-17 15:29:35 -06:00
mach-bmips
mach-cavium-octeon MIPS: Remove TX39XX support 2022-03-01 10:07:22 +01:00
mach-cobalt MIPS: Remove TX39XX support 2022-03-01 10:07:22 +01:00
mach-db1x00
mach-dec MIPS: Remove TX39XX support 2022-03-01 10:07:22 +01:00
mach-generic
mach-ingenic MIPS: Remove TX39XX support 2022-03-01 10:07:22 +01:00
mach-ip22
mach-ip27 MIPS: IP27: Remove incorrect `cpu_has_fpu' override 2022-05-04 22:23:14 +02:00
mach-ip28
mach-ip30 MIPS: IP30: Remove incorrect `cpu_has_fpu' override 2022-05-04 22:23:18 +02:00
mach-ip32
mach-jazz
mach-lantiq MIPS: Remove TX39XX support 2022-03-01 10:07:22 +01:00
mach-loongson2ef MIPS: Remove TX39XX support 2022-03-01 10:07:22 +01:00
mach-loongson32
mach-loongson64 irqchip/loongson-liointc: Add ACPI init support 2022-07-20 12:09:21 +01:00
mach-malta
mach-n64
mach-pic32
mach-ralink mips: ralink: mt7621: define MT7621_SYSC_BASE with __iomem 2022-12-01 13:32:42 +01:00
mach-rc32434 MIPS: rb532: move GPIOD definition into C-files 2022-03-30 20:26:26 +02:00
mach-rm
mach-sibyte
mach-tx49xx MIPS: TXX9: Remove rbtx4939 board support 2022-01-02 14:10:40 +01:00
mips-boards MIPS: launch.h: add include guard to prevent build errors 2021-05-25 15:18:59 +02:00
octeon MIPS: Octeon: remove orphan octeon_hal_setup_reserved32() declaration 2022-09-19 16:35:50 +02:00
pci
sgi
sibyte MIPS: remove orphan sb1250_time_init() declaration 2022-09-24 11:46:58 +02:00
sn MIPS: remove define-only GDA_MAGIC, previously magic number 2022-09-24 14:17:18 +02:00
txx9 MIPS: Remove TX39XX support 2022-03-01 10:07:22 +01:00
vdso MIPS: vdso: Invalid GIC access through VDSO 2021-07-09 15:29:06 +02:00
xtalk
Kbuild
abi.h
addrspace.h
amon.h
arch_hweight.h
asm-eva.h
asm-offsets.h
asm-prototypes.h MIPS: Restore symbol versions for copy_page_cpu and clear_page_cpu 2022-12-01 11:46:05 +01:00
asm.h MIPS: Fix build error due to PTR used in more places 2022-01-27 09:04:19 +01:00
asmmacro-32.h
asmmacro-64.h
asmmacro.h
atomic.h MIPS: retire "asm/llsc.h" 2022-01-05 11:16:35 +01:00
barrier.h
bcache.h
bitops.h bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
bitrev.h
bmips-spaces.h
bmips.h
bootinfo.h MIPS: Ingenic: Add system type for new Ingenic SoCs. 2021-07-19 13:16:42 +02:00
branch.h
break.h
bug.h
bugs.h
cache.h
cacheflush.h Add linux/cacheflush.h 2021-11-17 10:36:15 -05:00
cacheops.h
cdmm.h
cevt-r4k.h
checksum.h MIPS: Rewrite `csum_tcpudp_nofold' in plain C 2022-05-23 11:29:59 +02:00
clocksource.h
cmp.h
cmpxchg.h MIPS: retire "asm/llsc.h" 2022-01-05 11:16:35 +01:00
compat-signal.h
compat.h asm-generic: compat: Cleanup duplicate definitions 2022-04-26 13:35:54 -07:00
compiler.h
cop2.h MIPS: Remove NETLOGIC support 2021-10-24 17:24:47 +02:00
cpu-features.h MIPS: adding a safety check for cpu_has_fpu 2022-05-04 22:26:02 +02:00
cpu-info.h
cpu-type.h MIPS: Remove VR41xx support 2022-07-14 11:52:29 +02:00
cpu.h MIPS: Remove VR41xx support 2022-07-14 11:52:29 +02:00
cpufeature.h
debug.h
delay.h
div64.h MIPS: Avoid handcoded DIVU in `__div64_32' altogether 2021-04-23 13:40:31 +02:00
dma-direct.h
dma-mapping.h
dma.h PCI: Move isa_dma_bridge_buggy out of asm/dma.h 2022-07-22 17:24:47 -05:00
dmi.h
ds1287.h
dsemul.h
dsp.h
edac.h
elf.h
elfcore-compat.h
errno.h
eva.h
exec.h
extable.h
fb.h
fixmap.h
floppy.h
fpregdef.h
fpu.h MIPS: Fix unreachable code issue 2021-07-13 15:08:15 -05:00
fpu_emulator.h
ftrace.h MIPS: Fix build error due to PTR used in more places 2022-01-27 09:04:19 +01:00
futex.h MIPS: remove asm/war.h 2022-02-22 09:35:49 +01:00
ginvt.h MIPS: Avoid macro redefinitions 2021-09-23 11:23:35 +02:00
gio_device.h
gt64120.h
hardirq.h
hazards.h MIPS: Remove NETLOGIC support 2021-10-24 17:24:47 +02:00
highmem.h MIPS: Fix PKMAP with 32-bit MIPS huge page support 2021-06-30 14:41:32 +02:00
hpet.h
hugetlb.h mm: change huge_ptep_clear_flush() to return the original pte 2022-05-13 16:48:55 -07:00
hw_irq.h
i8259.h
ide.h
idle.h
inst.h
io.h added support for Netgear WNR3500L v2 2022-08-06 16:47:19 -07:00
irq.h MIPS: IRQ: remove orphan allocate_irqno() declaration 2022-09-24 11:47:18 +02:00
irq_cpu.h
irq_gt641xx.h
irq_regs.h
irqflags.h
isa-rev.h
isadep.h MIPS: Remove TX39XX support 2022-03-01 10:07:22 +01:00
jazz.h
jazzdma.h
jump_label.h jump_label: make initial NOP patching the special case 2022-06-24 09:48:55 +02:00
kdebug.h
kexec.h
kgdb.h mips: kgdb: adjust the comment to the actual ifdef condition 2021-12-16 15:47:58 +01:00
kprobes.h
kvm_host.h KVM: MIPS: remove unnecessary definition of KVM_PRIVATE_MEM_SLOTS 2022-08-19 04:05:26 -04:00
kvm_types.h
linkage.h
local.h MIPS: Remove duplicated include in local.h 2022-01-09 15:40:18 +01:00
maar.h
machine.h
mc146818-time.h
mc146818rtc.h
mips-cm.h mips: cm: Convert to bitfield API to fix out-of-bounds access 2021-11-02 10:53:52 +01:00
mips-cpc.h
mips-cps.h MIPS: CPS: Use bitfield helpers 2021-11-29 12:43:06 +01:00
mips-gic.h
mips-r2-to-r6-emul.h
mips_mt.h
mipsmtregs.h MIPS: remove asm/war.h 2022-02-22 09:35:49 +01:00
mipsprom.h
mipsregs.h MIPS: Remove VR41xx support 2022-07-14 11:52:29 +02:00
mmiowb.h
mmu.h
mmu_context.h
mmzone.h mm: replace CONFIG_NEED_MULTIPLE_NODES with CONFIG_NUMA 2021-06-29 10:53:55 -07:00
module.h
msa.h MIPS: Avoid macro redefinitions 2021-09-23 11:23:35 +02:00
msc01_ic.h
paccess.h
page.h mm: replace CONFIG_NEED_MULTIPLE_NODES with CONFIG_NUMA 2021-06-29 10:53:55 -07:00
pci.h PCI: Remove pci_get_legacy_ide_irq() and asm-generic/pci.h 2022-07-22 17:23:45 -05:00
perf_event.h
pgalloc.h mips: rename PGD_ORDER to PGD_TABLE_ORDER 2022-07-17 17:14:42 -07:00
pgtable-32.h added support for Netgear WNR3500L v2 2022-08-06 16:47:19 -07:00
pgtable-64.h added support for Netgear WNR3500L v2 2022-08-06 16:47:19 -07:00
pgtable-bits.h
pgtable.h mm: add dummy pmd_young() for architectures not having it 2022-11-30 14:49:41 -08:00
pm-cps.h
pm.h
prefetch.h
processor.h kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
prom.h MIPS: Fix wrong comments in asm/prom.h 2022-03-14 15:09:27 +01:00
ptrace.h
r4k-timer.h
r4kcache.h MIPS: Fix build error due to PTR used in more places 2022-01-27 09:04:19 +01:00
reboot.h
reg.h
regdef.h
rtlx.h
seccomp.h
setup.h MIPS: fix fortify panic when copying asm exception handlers 2022-03-07 13:09:28 +01:00
sgialib.h
sgiarcs.h
shmparam.h
sigcontext.h
signal.h
sim.h
smp-cps.h
smp-ops.h MIPS: only register MT SMP ops if MT is supported 2021-12-21 13:51:39 +01:00
smp.h
sni.h MIPS: remove orphan sni_cpu_time_init() declaration 2022-09-19 16:36:55 +02:00
socket.h
sparsemem.h
spinlock.h
spinlock_types.h
spram.h
stackframe.h MIPS: Remove TX39XX support 2022-03-01 10:07:22 +01:00
stackprotector.h stackprotector: actually use get_random_canary() 2022-11-18 02:18:10 +01:00
stacktrace.h
string.h
switch_to.h
sync.h
syscall.h
thread_info.h MIPS: Only use current_stack_pointer on GCC 2022-03-14 15:02:53 +01:00
time.h
timex.h mips: use fallback for random_get_entropy() instead of just c0 random 2022-05-13 23:59:23 +02:00
tlb.h
tlbdebug.h
tlbex.h
tlbflush.h
tlbmisc.h
topology.h
traps.h MIPS: Allow modules to set board_be_handler 2021-11-09 16:07:26 +01:00
txx9irq.h MIPS: Remove TX39XX support 2022-03-01 10:07:22 +01:00
txx9pio.h
txx9tmr.h MIPS: Remove TX39XX support 2022-03-01 10:07:22 +01:00
types.h
uaccess.h uaccess: generalize access_ok() 2022-02-25 09:36:05 +01:00
uasm.h mips, uasm: Add workaround for Loongson-2F nop CPU errata 2021-10-06 12:28:09 -07:00
unaligned-emul.h MIPS: Fix build error due to PTR used in more places 2022-01-27 09:04:19 +01:00
unistd.h fs: stat: compat: Add __ARCH_WANT_COMPAT_STAT 2022-04-26 13:35:45 -07:00
unroll.h
uprobes.h
vdso.h
vermagic.h MIPS: Remove VR41xx support 2022-07-14 11:52:29 +02:00
vga.h
vmalloc.h
vpe.h
watch.h
wbflush.h
yamon-dt.h