Skip to content

Commit

Permalink
Merge tag 'v5.10.119' into v5.10-rt
Browse files Browse the repository at this point in the history
 Conflicts:
	arch/x86/kernel/cpu/mshyperv.c
	drivers/char/random.c
	drivers/hv/vmbus_drv.c
	include/linux/random.h
	kernel/irq/handle.c

NOTE: the updates to the random code from v5.10.119 completely replaced the
code from commit c19a1b9 ("random: Make it work on rt").

Signed-off-by: Luis Claudio R. Goncalves <lgoncalv@redhat.com>
  • Loading branch information
lclaudio committed Jun 10, 2022
2 parents 02071c3 + 56c31ac commit edbca35
Show file tree
Hide file tree
Showing 79 changed files with 1,864 additions and 3,051 deletions.
6 changes: 6 additions & 0 deletions Documentation/admin-guide/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4035,6 +4035,12 @@
fully seed the kernel's CRNG. Default is controlled
by CONFIG_RANDOM_TRUST_CPU.

random.trust_bootloader={on,off}
[KNL] Enable or disable trusting the use of a
seed passed by the bootloader (if available) to
fully seed the kernel's CRNG. Default is controlled
by CONFIG_RANDOM_TRUST_BOOTLOADER.

ras=option[,option,...] [KNL] RAS-specific options

cec_disable [X86]
Expand Down
22 changes: 8 additions & 14 deletions Documentation/admin-guide/sysctl/kernel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1006,28 +1006,22 @@ This is a directory, with the following entries:
* ``boot_id``: a UUID generated the first time this is retrieved, and
unvarying after that;

* ``uuid``: a UUID generated every time this is retrieved (this can
thus be used to generate UUIDs at will);

* ``entropy_avail``: the pool's entropy count, in bits;

* ``poolsize``: the entropy pool size, in bits;

* ``urandom_min_reseed_secs``: obsolete (used to determine the minimum
number of seconds between urandom pool reseeding).

* ``uuid``: a UUID generated every time this is retrieved (this can
thus be used to generate UUIDs at will);
number of seconds between urandom pool reseeding). This file is
writable for compatibility purposes, but writing to it has no effect
on any RNG behavior;

* ``write_wakeup_threshold``: when the entropy count drops below this
(as a number of bits), processes waiting to write to ``/dev/random``
are woken up.

If ``drivers/char/random.c`` is built with ``ADD_INTERRUPT_BENCH``
defined, these additional entries are present:

* ``add_interrupt_avg_cycles``: the average number of cycles between
interrupts used to feed the pool;

* ``add_interrupt_avg_deviation``: the standard deviation seen on the
number of cycles between interrupts used to feed the pool.
are woken up. This file is writable for compatibility purposes, but
writing to it has no effect on any RNG behavior.


randomize_va_space
Expand Down
2 changes: 2 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -14671,6 +14671,8 @@ F: arch/mips/generic/board-ranchu.c

RANDOM NUMBER DRIVER
M: "Theodore Ts'o" <tytso@mit.edu>
M: Jason A. Donenfeld <Jason@zx2c4.com>
T: git https://git.kernel.org/pub/scm/linux/kernel/git/crng/random.git
S: Maintained
F: drivers/char/random.c

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 5
PATCHLEVEL = 10
SUBLEVEL = 118
SUBLEVEL = 119
EXTRAVERSION =
NAME = Dare mighty things

Expand Down
1 change: 1 addition & 0 deletions arch/alpha/include/asm/timex.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ static inline cycles_t get_cycles (void)
__asm__ __volatile__ ("rpcc %0" : "=r"(ret));
return ret;
}
#define get_cycles get_cycles

#endif
1 change: 1 addition & 0 deletions arch/arm/include/asm/timex.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@

typedef unsigned long cycles_t;
#define get_cycles() ({ cycles_t c; read_current_timer(&c) ? 0 : c; })
#define random_get_entropy() (((unsigned long)get_cycles()) ?: random_get_entropy_fallback())

#endif
1 change: 1 addition & 0 deletions arch/ia64/include/asm/timex.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ get_cycles (void)
ret = ia64_getreg(_IA64_REG_AR_ITC);
return ret;
}
#define get_cycles get_cycles

extern void ia64_cpu_local_tick (void);
extern unsigned long long ia64_native_sched_clock (void);
Expand Down
2 changes: 1 addition & 1 deletion arch/m68k/include/asm/timex.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static inline unsigned long random_get_entropy(void)
{
if (mach_random_get_entropy)
return mach_random_get_entropy();
return 0;
return random_get_entropy_fallback();
}
#define random_get_entropy random_get_entropy

Expand Down
17 changes: 8 additions & 9 deletions arch/mips/include/asm/timex.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,25 +76,24 @@ static inline cycles_t get_cycles(void)
else
return 0; /* no usable counter */
}
#define get_cycles get_cycles

/*
* Like get_cycles - but where c0_count is not available we desperately
* use c0_random in an attempt to get at least a little bit of entropy.
*
* R6000 and R6000A neither have a count register nor a random register.
* That leaves no entropy source in the CPU itself.
*/
static inline unsigned long random_get_entropy(void)
{
unsigned int prid = read_c0_prid();
unsigned int imp = prid & PRID_IMP_MASK;
unsigned int c0_random;

if (can_use_mips_counter(prid))
if (can_use_mips_counter(read_c0_prid()))
return read_c0_count();
else if (likely(imp != PRID_IMP_R6000 && imp != PRID_IMP_R6000A))
return read_c0_random();

if (cpu_has_3kex)
c0_random = (read_c0_random() >> 8) & 0x3f;
else
return 0; /* no usable register */
c0_random = read_c0_random() & 0x3f;
return (random_get_entropy_fallback() << 6) | (0x3f - c0_random);
}
#define random_get_entropy random_get_entropy

Expand Down
3 changes: 3 additions & 0 deletions arch/nios2/include/asm/timex.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@
typedef unsigned long cycles_t;

extern cycles_t get_cycles(void);
#define get_cycles get_cycles

#define random_get_entropy() (((unsigned long)get_cycles()) ?: random_get_entropy_fallback())

#endif
3 changes: 2 additions & 1 deletion arch/parisc/include/asm/timex.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@

typedef unsigned long cycles_t;

static inline cycles_t get_cycles (void)
static inline cycles_t get_cycles(void)
{
return mfctl(16);
}
#define get_cycles get_cycles

#endif
1 change: 1 addition & 0 deletions arch/powerpc/include/asm/timex.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ static inline cycles_t get_cycles(void)
{
return mftb();
}
#define get_cycles get_cycles

#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_TIMEX_H */
2 changes: 1 addition & 1 deletion arch/riscv/include/asm/timex.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static inline u32 get_cycles_hi(void)
static inline unsigned long random_get_entropy(void)
{
if (unlikely(clint_time_val == NULL))
return 0;
return random_get_entropy_fallback();
return get_cycles();
}
#define random_get_entropy() random_get_entropy()
Expand Down
1 change: 1 addition & 0 deletions arch/s390/include/asm/timex.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ static inline cycles_t get_cycles(void)
{
return (cycles_t) get_tod_clock() >> 2;
}
#define get_cycles get_cycles

int get_phys_clock(unsigned long *clock);
void init_cpu_timer(void);
Expand Down
4 changes: 1 addition & 3 deletions arch/sparc/include/asm/timex_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */

/* XXX Maybe do something better at some point... -DaveM */
typedef unsigned long cycles_t;
#define get_cycles() (0)
#include <asm-generic/timex.h>

#endif
9 changes: 2 additions & 7 deletions arch/um/include/asm/timex.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@
#ifndef __UM_TIMEX_H
#define __UM_TIMEX_H

typedef unsigned long cycles_t;

static inline cycles_t get_cycles (void)
{
return 0;
}

#define CLOCK_TICK_RATE (HZ)

#include <asm-generic/timex.h>

#endif
4 changes: 3 additions & 1 deletion arch/x86/crypto/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ obj-$(CONFIG_CRYPTO_SHA512_SSSE3) += sha512-ssse3.o
sha512-ssse3-y := sha512-ssse3-asm.o sha512-avx-asm.o sha512-avx2-asm.o sha512_ssse3_glue.o

obj-$(CONFIG_CRYPTO_BLAKE2S_X86) += blake2s-x86_64.o
blake2s-x86_64-y := blake2s-core.o blake2s-glue.o
blake2s-x86_64-y := blake2s-shash.o
obj-$(if $(CONFIG_CRYPTO_BLAKE2S_X86),y) += libblake2s-x86_64.o
libblake2s-x86_64-y := blake2s-core.o blake2s-glue.o

obj-$(CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL) += ghash-clmulni-intel.o
ghash-clmulni-intel-y := ghash-clmulni-intel_asm.o ghash-clmulni-intel_glue.o
Expand Down

0 comments on commit edbca35

Please sign in to comment.