linux-stable/arch/loongarch/kernel
Linus Torvalds f1947d7c8a Random number generator fixes for Linux 6.1-rc1.
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEq5lC5tSkz8NBJiCnSfxwEqXeA64FAmNHYD0ACgkQSfxwEqXe
 A655AA//dJK0PdRghqrKQsl18GOCffV5TUw5i1VbJQbI9d8anfxNjVUQiNGZi4et
 qUwZ8OqVXxYx1Z1UDgUE39PjEDSG9/cCvOpMUWqN20/+6955WlNZjwA7Fk6zjvlM
 R30fz5CIJns9RFvGT4SwKqbVLXIMvfg/wDENUN+8sxt36+VD2gGol7J2JJdngEhM
 lW+zqzi0ABqYy5so4TU2kixpKmpC08rqFvQbD1GPid+50+JsOiIqftDErt9Eg1Mg
 MqYivoFCvbAlxxxRh3+UHBd7ZpJLtp1UFEOl2Rf00OXO+ZclLCAQAsTczucIWK9M
 8LCZjb7d4lPJv9RpXFAl3R1xvfc+Uy2ga5KeXvufZtc5G3aMUKPuIU7k28ZyblVS
 XXsXEYhjTSd0tgi3d0JlValrIreSuj0z2QGT5pVcC9utuAqAqRIlosiPmgPlzXjr
 Us4jXaUhOIPKI+Musv/fqrxsTQziT0jgVA3Njlt4cuAGm/EeUbLUkMWwKXjZLTsv
 vDsBhEQFmyZqxWu4pYo534VX2mQWTaKRV1SUVVhQEHm57b00EAiZohoOvweB09SR
 4KiJapikoopmW4oAUFotUXUL1PM6yi+MXguTuc1SEYuLz/tCFtK8DJVwNpfnWZpE
 lZKvXyJnHq2Sgod/hEZq58PMvT6aNzTzSg7YzZy+VabxQGOO5mc=
 =M+mV
 -----END PGP SIGNATURE-----

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

Pull more random number generator updates from Jason Donenfeld:
 "This time with some large scale treewide cleanups.

  The intent of this pull is to clean up the way callers fetch random
  integers. The current rules for doing this right are:

   - If you want a secure or an insecure random u64, use get_random_u64()

   - If you want a secure or an insecure random u32, use get_random_u32()

     The old function prandom_u32() has been deprecated for a while
     now and is just a wrapper around get_random_u32(). Same for
     get_random_int().

   - If you want a secure or an insecure random u16, use get_random_u16()

   - If you want a secure or an insecure random u8, use get_random_u8()

   - If you want secure or insecure random bytes, use get_random_bytes().

     The old function prandom_bytes() has been deprecated for a while
     now and has long been a wrapper around get_random_bytes()

   - If you want a non-uniform random u32, u16, or u8 bounded by a
     certain open interval maximum, use prandom_u32_max()

     I say "non-uniform", because it doesn't do any rejection sampling
     or divisions. Hence, it stays within the prandom_*() namespace, not
     the get_random_*() namespace.

     I'm currently investigating a "uniform" function for 6.2. We'll see
     what comes of that.

  By applying these rules uniformly, we get several benefits:

   - By using prandom_u32_max() with an upper-bound that the compiler
     can prove at compile-time is ≤65536 or ≤256, internally
     get_random_u16() or get_random_u8() is used, which wastes fewer
     batched random bytes, and hence has higher throughput.

   - By using prandom_u32_max() instead of %, when the upper-bound is
     not a constant, division is still avoided, because
     prandom_u32_max() uses a faster multiplication-based trick instead.

   - By using get_random_u16() or get_random_u8() in cases where the
     return value is intended to indeed be a u16 or a u8, we waste fewer
     batched random bytes, and hence have higher throughput.

  This series was originally done by hand while I was on an airplane
  without Internet. Later, Kees and I worked on retroactively figuring
  out what could be done with Coccinelle and what had to be done
  manually, and then we split things up based on that.

  So while this touches a lot of files, the actual amount of code that's
  hand fiddled is comfortably small"

* tag 'random-6.1-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random:
  prandom: remove unused functions
  treewide: use get_random_bytes() when possible
  treewide: use get_random_u32() when possible
  treewide: use get_random_{u8,u16}() when possible, part 2
  treewide: use get_random_{u8,u16}() when possible, part 1
  treewide: use prandom_u32_max() when possible, part 2
  treewide: use prandom_u32_max() when possible, part 1
2022-10-16 15:27:07 -07:00
..
.gitignore
access-helper.h LoongArch: Add exception/interrupt handling 2022-06-03 20:09:28 +08:00
acpi.c LoongArch: Fix section mismatch due to acpi_os_ioremap() 2022-09-03 18:01:27 +08:00
asm-offsets.c LoongArch changes for v5.20 2022-08-12 09:44:23 -07:00
cacheinfo.c LoongArch: Refactor cache probe and flush methods 2022-10-12 16:36:14 +08:00
cpu-probe.c LoongArch: Fix cpu name after CPU-hotplug 2022-10-12 16:36:08 +08:00
crash_dump.c LoongArch: Add kdump support 2022-10-12 16:36:19 +08:00
dma.c LoongArch: Use acpi_arch_dma_setup() and remove ARCH_HAS_PHYS_TO_DMA 2022-09-24 18:39:21 +02:00
efi-header.S efi/loongarch: Add efistub booting support 2022-09-06 11:19:34 +02:00
efi.c efi/loongarch: libstub: remove dependency on flattened DT 2022-09-27 13:22:49 +02:00
elf.c LoongArch: Add ELF and module support 2022-06-03 20:09:28 +08:00
entry.S LoongArch: Re-tab the assembly files 2022-07-29 18:22:32 +08:00
env.c efi/loongarch: libstub: remove dependency on flattened DT 2022-09-27 13:22:49 +02:00
fpu.S LoongArch: Re-tab the assembly files 2022-07-29 18:22:32 +08:00
genex.S LoongArch: Re-tab the assembly files 2022-07-29 18:22:32 +08:00
head.S LoongArch: Add kexec support 2022-10-12 16:36:19 +08:00
idle.c LoongArch: Add process management 2022-06-03 20:09:28 +08:00
image-vars.h efi/libstub: use EFI provided memcpy/memset routines 2022-09-17 15:13:21 +02:00
inst.c LoongArch: Add ELF and module support 2022-06-03 20:09:28 +08:00
io.c LoongArch: Add misc common routines 2022-06-03 20:09:28 +08:00
irq.c irqchip: Add LoongArch CPU interrupt controller support 2022-07-20 12:09:21 +01:00
machine_kexec.c LoongArch: Add kdump support 2022-10-12 16:36:19 +08:00
Makefile LoongArch changes for v6.1 2022-10-12 10:35:20 -07:00
mem.c LoongArch: Add kdump support 2022-10-12 16:36:19 +08:00
module-sections.c LoongArch: Support R_LARCH_GOT_PC_{LO12,HI20} in modules 2022-10-12 16:36:14 +08:00
module.c LoongArch: Move {signed,unsigned}_imm_check() to inst.h 2022-10-12 16:36:19 +08:00
numa.c LoongArch: Fix section mismatch warning 2022-07-07 17:41:01 +08:00
perf_event.c LoongArch: Add perf events support 2022-10-12 16:36:14 +08:00
perf_regs.c LoongArch: Add perf events support 2022-10-12 16:36:14 +08:00
proc.c LoongArch: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK 2022-08-12 13:10:10 +08:00
process.c treewide: use prandom_u32_max() when possible, part 1 2022-10-11 17:42:55 -06:00
ptrace.c LoongArch: Fix missing fcsr in ptrace's fpr_set 2022-07-29 18:22:33 +08:00
relocate_kernel.S LoongArch: Add kdump support 2022-10-12 16:36:19 +08:00
reset.c LoongArch: Cleanup reset routines with new API 2022-08-25 19:34:59 +08:00
setup.c LoongArch changes for v6.1 2022-10-12 10:35:20 -07:00
signal.c LoongArch: Adjust arch_do_signal_or_restart() to adapt generic entry 2022-09-03 18:01:27 +08:00
smp.c LoongArch: Do not create sysfs control file for io master CPUs 2022-10-12 16:36:08 +08:00
stacktrace.c LoongArch: Add USER_STACKTRACE support 2022-08-12 13:10:11 +08:00
switch.S LoongArch: Add STACKTRACE support 2022-08-12 13:10:11 +08:00
syscall.c LoongArch: Add system call support 2022-06-03 20:09:28 +08:00
sysrq.c LoongArch: Add SysRq-x (TLB Dump) support 2022-10-12 16:36:14 +08:00
time.c LoongArch: Fix unsigned comparison with less than zero 2022-08-12 13:10:10 +08:00
topology.c LoongArch: Do not create sysfs control file for io master CPUs 2022-10-12 16:36:08 +08:00
traps.c LoongArch: Add kdump support 2022-10-12 16:36:19 +08:00
unwind_guess.c LoongArch: Add guess unwinder support 2022-08-12 13:10:11 +08:00
unwind_prologue.c LoongArch: Add prologue unwinder support 2022-08-12 13:10:11 +08:00
vdso.c treewide: use prandom_u32_max() when possible, part 1 2022-10-11 17:42:55 -06:00
vmlinux.lds.S LoongArch: Adjust symbol addressing for AS_HAS_EXPLICIT_RELOCS 2022-10-12 16:36:08 +08:00