Skip to content

Commit

Permalink
Merge branch 'android-4.9-q' of https://android.googlesource.com/kern…
Browse files Browse the repository at this point in the history
…el/common into twelve
  • Loading branch information
Kyuofox committed Jul 6, 2022
2 parents 2938e2a + 47df852 commit abb2e38
Show file tree
Hide file tree
Showing 135 changed files with 2,988 additions and 2,907 deletions.
2 changes: 1 addition & 1 deletion Documentation/ABI/testing/sysfs-bus-iio-vf610
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
What: /sys/bus/iio/devices/iio:deviceX/conversion_mode
What: /sys/bus/iio/devices/iio:deviceX/in_conversion_mode
KernelVersion: 4.2
Contact: [email protected]
Description:
Expand Down
12 changes: 12 additions & 0 deletions Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3609,6 +3609,18 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
ramdisk_size= [RAM] Sizes of RAM disks in kilobytes
See Documentation/blockdev/ramdisk.txt.

random.trust_cpu={on,off}
[KNL] Enable or disable trusting the use of the
CPU's random number generator (if available) to
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.

rcu_nocbs= [KNL]
The argument is a cpu list, as described above.

Expand Down
35 changes: 33 additions & 2 deletions Documentation/sysctl/kernel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -804,9 +804,40 @@ The kernel command line parameter printk.devkmsg= overrides this and is
a one-time setting until next reboot: once set, it cannot be changed by
this sysctl interface anymore.

==============================================================
pty
===

See Documentation/filesystems/devpts.rst.


random
======

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). 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. This file is writable for compatibility purposes, but
writing to it has no effect on any RNG behavior.


randomize_va_space:
randomize_va_space
==================

This option can be used to select the type of process address
space randomization that is used in the system, for architectures
Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -10085,6 +10085,7 @@ F: drivers/block/brd.c

RANDOM NUMBER DRIVER
M: "Theodore Ts'o" <[email protected]>
M: Jason A. Donenfeld <[email protected]>
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,6 +1,6 @@
VERSION = 4
PATCHLEVEL = 9
SUBLEVEL = 319
SUBLEVEL = 321
EXTRAVERSION =
NAME = Roaring Lionus

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 @@ -27,5 +27,6 @@ static inline cycles_t get_cycles (void)
__asm__ __volatile__ ("rpcc %0" : "=r"(ret));
return ret;
}
#define get_cycles get_cycles

#endif
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/imx6qdl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@
regulator-name = "vddpu";
regulator-min-microvolt = <725000>;
regulator-max-microvolt = <1450000>;
regulator-enable-ramp-delay = <150>;
regulator-enable-ramp-delay = <380>;
anatop-reg-offset = <0x140>;
anatop-vol-bit-shift = <9>;
anatop-vol-bit-width = <5>;
Expand Down
1 change: 1 addition & 0 deletions arch/arm/include/asm/timex.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,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/arm/mach-axxia/platsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ static int axxia_boot_secondary(unsigned int cpu, struct task_struct *idle)
return -ENOENT;

syscon = of_iomap(syscon_np, 0);
of_node_put(syscon_np);
if (!syscon)
return -ENOMEM;

Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-cns3xxx/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ static void __init cns3xxx_init(void)
/* De-Asscer SATA Reset */
cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SATA));
}
of_node_put(dn);

dn = of_find_compatible_node(NULL, NULL, "cavium,cns3420-sdhci");
if (of_device_is_available(dn)) {
Expand All @@ -392,6 +393,7 @@ static void __init cns3xxx_init(void)
cns3xxx_pwr_clk_en(CNS3XXX_PWR_CLK_EN(SDIO));
cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SDIO));
}
of_node_put(dn);

pm_power_off = cns3xxx_power_off;

Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-exynos/exynos.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ static void exynos_map_pmu(void)
np = of_find_matching_node(NULL, exynos_dt_pmu_match);
if (np)
pmu_base_addr = of_iomap(np, 0);
of_node_put(np);
}

static void __init exynos_init_irq(void)
Expand Down
1 change: 1 addition & 0 deletions arch/ia64/include/asm/timex.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,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 @@ -34,7 +34,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
2 changes: 0 additions & 2 deletions arch/mips/vr41xx/common/icu.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,8 +653,6 @@ static int icu_get_irq(unsigned int irq)

printk(KERN_ERR "spurious ICU interrupt: %04x,%04x\n", pend1, pend2);

atomic_inc(&irq_err_count);

return -1;
}

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 @@ -20,5 +20,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 @@ -11,9 +11,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
27 changes: 9 additions & 18 deletions arch/powerpc/include/asm/archrandom.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,35 @@

#include <asm/machdep.h>

static inline int arch_get_random_long(unsigned long *v)
static inline bool arch_get_random_long(unsigned long *v)
{
return 0;
return false;
}

static inline int arch_get_random_int(unsigned int *v)
static inline bool arch_get_random_int(unsigned int *v)
{
return 0;
return false;
}

static inline int arch_get_random_seed_long(unsigned long *v)
static inline bool arch_get_random_seed_long(unsigned long *v)
{
if (ppc_md.get_random_seed)
return ppc_md.get_random_seed(v);

return 0;
return false;
}
static inline int arch_get_random_seed_int(unsigned int *v)

static inline bool arch_get_random_seed_int(unsigned int *v)
{
unsigned long val;
int rc;
bool rc;

rc = arch_get_random_seed_long(&val);
if (rc)
*v = val;

return rc;
}

static inline int arch_has_random(void)
{
return 0;
}

static inline int arch_has_random_seed(void)
{
return !!ppc_md.get_random_seed;
}
#endif /* CONFIG_ARCH_RANDOM */

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

#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_TIMEX_H */
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -1591,7 +1591,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
tm_reclaim_current(0);
#endif

memset(regs->gpr, 0, sizeof(regs->gpr));
memset(&regs->gpr[1], 0, sizeof(regs->gpr) - sizeof(regs->gpr[0]));
regs->ctr = 0;
regs->link = 0;
regs->xer = 0;
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/platforms/pseries/pseries.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,6 @@ unsigned long pseries_memory_block_size(void);

void pseries_setup_rfi_flush(void);

void pseries_rng_init(void);

#endif /* _PSERIES_PSERIES_H */
11 changes: 3 additions & 8 deletions arch/powerpc/platforms/pseries/rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <asm/archrandom.h>
#include <asm/machdep.h>
#include <asm/plpar_wrappers.h>
#include "pseries.h"


static int pseries_get_random_long(unsigned long *v)
Expand All @@ -28,19 +29,13 @@ static int pseries_get_random_long(unsigned long *v)
return 0;
}

static __init int rng_init(void)
void __init pseries_rng_init(void)
{
struct device_node *dn;

dn = of_find_compatible_node(NULL, NULL, "ibm,random");
if (!dn)
return -ENODEV;

pr_info("Registering arch random hook.\n");

return;
ppc_md.get_random_seed = pseries_get_random_long;

of_node_put(dn);
return 0;
}
machine_subsys_initcall(pseries, rng_init);
1 change: 1 addition & 0 deletions arch/powerpc/platforms/pseries/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ static void __init pSeries_setup_arch(void)
}

ppc_md.pcibios_root_bridge_prepare = pseries_root_bridge_prepare;
pseries_rng_init();
}

static int __init pSeries_init_panel(void)
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 @@ -168,6 +168,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 long *clock);
void init_cpu_timer(void);
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/mm/pgtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ void ptep_zap_key(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
PGSTE_GR_BIT | PGSTE_GC_BIT);
ptev = pte_val(*ptep);
if (!(ptev & _PAGE_INVALID) && (ptev & _PAGE_WRITE))
page_set_storage_key(ptev & PAGE_MASK, PAGE_DEFAULT_KEY, 1);
page_set_storage_key(ptev & PAGE_MASK, PAGE_DEFAULT_KEY, 0);
pgste_set_unlock(ptep, pgste);
preempt_enable();
}
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 @@ -8,8 +8,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
@@ -1,13 +1,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
Loading

0 comments on commit abb2e38

Please sign in to comment.