mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-11 13:27:06 +09:00
Merge tag 'v4.9.190' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into odroidg12-4.9.y
This is the 4.9.190 stable release
This commit is contained in:
@@ -6,24 +6,6 @@
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/log2.h>
|
||||
|
||||
/*
|
||||
* Runtime evaluation of get_order()
|
||||
*/
|
||||
static inline __attribute_const__
|
||||
int __get_order(unsigned long size)
|
||||
{
|
||||
int order;
|
||||
|
||||
size--;
|
||||
size >>= PAGE_SHIFT;
|
||||
#if BITS_PER_LONG == 32
|
||||
order = fls(size);
|
||||
#else
|
||||
order = fls64(size);
|
||||
#endif
|
||||
return order;
|
||||
}
|
||||
|
||||
/**
|
||||
* get_order - Determine the allocation order of a memory size
|
||||
* @size: The size for which to get the order
|
||||
@@ -42,19 +24,27 @@ int __get_order(unsigned long size)
|
||||
* to hold an object of the specified size.
|
||||
*
|
||||
* The result is undefined if the size is 0.
|
||||
*
|
||||
* This function may be used to initialise variables with compile time
|
||||
* evaluations of constants.
|
||||
*/
|
||||
#define get_order(n) \
|
||||
( \
|
||||
__builtin_constant_p(n) ? ( \
|
||||
((n) == 0UL) ? BITS_PER_LONG - PAGE_SHIFT : \
|
||||
(((n) < (1UL << PAGE_SHIFT)) ? 0 : \
|
||||
ilog2((n) - 1) - PAGE_SHIFT + 1) \
|
||||
) : \
|
||||
__get_order(n) \
|
||||
)
|
||||
static inline __attribute_const__ int get_order(unsigned long size)
|
||||
{
|
||||
if (__builtin_constant_p(size)) {
|
||||
if (!size)
|
||||
return BITS_PER_LONG - PAGE_SHIFT;
|
||||
|
||||
if (size < (1UL << PAGE_SHIFT))
|
||||
return 0;
|
||||
|
||||
return ilog2((size) - 1) - PAGE_SHIFT + 1;
|
||||
}
|
||||
|
||||
size--;
|
||||
size >>= PAGE_SHIFT;
|
||||
#if BITS_PER_LONG == 32
|
||||
return fls(size);
|
||||
#else
|
||||
return fls64(size);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
|
||||
@@ -599,6 +599,7 @@ void bpf_warn_invalid_xdp_action(u32 act);
|
||||
#ifdef CONFIG_BPF_JIT
|
||||
extern int bpf_jit_enable;
|
||||
extern int bpf_jit_harden;
|
||||
extern long bpf_jit_limit;
|
||||
|
||||
typedef void (*bpf_jit_fill_hole_t)(void *area, unsigned int size);
|
||||
|
||||
|
||||
145
include/linux/siphash.h
Normal file
145
include/linux/siphash.h
Normal file
@@ -0,0 +1,145 @@
|
||||
/* Copyright (C) 2016 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
|
||||
*
|
||||
* This file is provided under a dual BSD/GPLv2 license.
|
||||
*
|
||||
* SipHash: a fast short-input PRF
|
||||
* https://131002.net/siphash/
|
||||
*
|
||||
* This implementation is specifically for SipHash2-4 for a secure PRF
|
||||
* and HalfSipHash1-3/SipHash1-3 for an insecure PRF only suitable for
|
||||
* hashtables.
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_SIPHASH_H
|
||||
#define _LINUX_SIPHASH_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/kernel.h>
|
||||
|
||||
#define SIPHASH_ALIGNMENT __alignof__(u64)
|
||||
typedef struct {
|
||||
u64 key[2];
|
||||
} siphash_key_t;
|
||||
|
||||
static inline bool siphash_key_is_zero(const siphash_key_t *key)
|
||||
{
|
||||
return !(key->key[0] | key->key[1]);
|
||||
}
|
||||
|
||||
u64 __siphash_aligned(const void *data, size_t len, const siphash_key_t *key);
|
||||
#ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
|
||||
u64 __siphash_unaligned(const void *data, size_t len, const siphash_key_t *key);
|
||||
#endif
|
||||
|
||||
u64 siphash_1u64(const u64 a, const siphash_key_t *key);
|
||||
u64 siphash_2u64(const u64 a, const u64 b, const siphash_key_t *key);
|
||||
u64 siphash_3u64(const u64 a, const u64 b, const u64 c,
|
||||
const siphash_key_t *key);
|
||||
u64 siphash_4u64(const u64 a, const u64 b, const u64 c, const u64 d,
|
||||
const siphash_key_t *key);
|
||||
u64 siphash_1u32(const u32 a, const siphash_key_t *key);
|
||||
u64 siphash_3u32(const u32 a, const u32 b, const u32 c,
|
||||
const siphash_key_t *key);
|
||||
|
||||
static inline u64 siphash_2u32(const u32 a, const u32 b,
|
||||
const siphash_key_t *key)
|
||||
{
|
||||
return siphash_1u64((u64)b << 32 | a, key);
|
||||
}
|
||||
static inline u64 siphash_4u32(const u32 a, const u32 b, const u32 c,
|
||||
const u32 d, const siphash_key_t *key)
|
||||
{
|
||||
return siphash_2u64((u64)b << 32 | a, (u64)d << 32 | c, key);
|
||||
}
|
||||
|
||||
|
||||
static inline u64 ___siphash_aligned(const __le64 *data, size_t len,
|
||||
const siphash_key_t *key)
|
||||
{
|
||||
if (__builtin_constant_p(len) && len == 4)
|
||||
return siphash_1u32(le32_to_cpup((const __le32 *)data), key);
|
||||
if (__builtin_constant_p(len) && len == 8)
|
||||
return siphash_1u64(le64_to_cpu(data[0]), key);
|
||||
if (__builtin_constant_p(len) && len == 16)
|
||||
return siphash_2u64(le64_to_cpu(data[0]), le64_to_cpu(data[1]),
|
||||
key);
|
||||
if (__builtin_constant_p(len) && len == 24)
|
||||
return siphash_3u64(le64_to_cpu(data[0]), le64_to_cpu(data[1]),
|
||||
le64_to_cpu(data[2]), key);
|
||||
if (__builtin_constant_p(len) && len == 32)
|
||||
return siphash_4u64(le64_to_cpu(data[0]), le64_to_cpu(data[1]),
|
||||
le64_to_cpu(data[2]), le64_to_cpu(data[3]),
|
||||
key);
|
||||
return __siphash_aligned(data, len, key);
|
||||
}
|
||||
|
||||
/**
|
||||
* siphash - compute 64-bit siphash PRF value
|
||||
* @data: buffer to hash
|
||||
* @size: size of @data
|
||||
* @key: the siphash key
|
||||
*/
|
||||
static inline u64 siphash(const void *data, size_t len,
|
||||
const siphash_key_t *key)
|
||||
{
|
||||
#ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
|
||||
if (!IS_ALIGNED((unsigned long)data, SIPHASH_ALIGNMENT))
|
||||
return __siphash_unaligned(data, len, key);
|
||||
#endif
|
||||
return ___siphash_aligned(data, len, key);
|
||||
}
|
||||
|
||||
#define HSIPHASH_ALIGNMENT __alignof__(unsigned long)
|
||||
typedef struct {
|
||||
unsigned long key[2];
|
||||
} hsiphash_key_t;
|
||||
|
||||
u32 __hsiphash_aligned(const void *data, size_t len,
|
||||
const hsiphash_key_t *key);
|
||||
#ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
|
||||
u32 __hsiphash_unaligned(const void *data, size_t len,
|
||||
const hsiphash_key_t *key);
|
||||
#endif
|
||||
|
||||
u32 hsiphash_1u32(const u32 a, const hsiphash_key_t *key);
|
||||
u32 hsiphash_2u32(const u32 a, const u32 b, const hsiphash_key_t *key);
|
||||
u32 hsiphash_3u32(const u32 a, const u32 b, const u32 c,
|
||||
const hsiphash_key_t *key);
|
||||
u32 hsiphash_4u32(const u32 a, const u32 b, const u32 c, const u32 d,
|
||||
const hsiphash_key_t *key);
|
||||
|
||||
static inline u32 ___hsiphash_aligned(const __le32 *data, size_t len,
|
||||
const hsiphash_key_t *key)
|
||||
{
|
||||
if (__builtin_constant_p(len) && len == 4)
|
||||
return hsiphash_1u32(le32_to_cpu(data[0]), key);
|
||||
if (__builtin_constant_p(len) && len == 8)
|
||||
return hsiphash_2u32(le32_to_cpu(data[0]), le32_to_cpu(data[1]),
|
||||
key);
|
||||
if (__builtin_constant_p(len) && len == 12)
|
||||
return hsiphash_3u32(le32_to_cpu(data[0]), le32_to_cpu(data[1]),
|
||||
le32_to_cpu(data[2]), key);
|
||||
if (__builtin_constant_p(len) && len == 16)
|
||||
return hsiphash_4u32(le32_to_cpu(data[0]), le32_to_cpu(data[1]),
|
||||
le32_to_cpu(data[2]), le32_to_cpu(data[3]),
|
||||
key);
|
||||
return __hsiphash_aligned(data, len, key);
|
||||
}
|
||||
|
||||
/**
|
||||
* hsiphash - compute 32-bit hsiphash PRF value
|
||||
* @data: buffer to hash
|
||||
* @size: size of @data
|
||||
* @key: the hsiphash key
|
||||
*/
|
||||
static inline u32 hsiphash(const void *data, size_t len,
|
||||
const hsiphash_key_t *key)
|
||||
{
|
||||
#ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
|
||||
if (!IS_ALIGNED((unsigned long)data, HSIPHASH_ALIGNMENT))
|
||||
return __hsiphash_unaligned(data, len, key);
|
||||
#endif
|
||||
return ___hsiphash_aligned(data, len, key);
|
||||
}
|
||||
|
||||
#endif /* _LINUX_SIPHASH_H */
|
||||
@@ -336,6 +336,8 @@ struct nf_conn *nf_ct_tmpl_alloc(struct net *net,
|
||||
gfp_t flags);
|
||||
void nf_ct_tmpl_free(struct nf_conn *tmpl);
|
||||
|
||||
u32 nf_ct_get_id(const struct nf_conn *ct);
|
||||
|
||||
#define NF_CT_STAT_INC(net, count) __this_cpu_inc((net)->ct.stat->count)
|
||||
#define NF_CT_STAT_INC_ATOMIC(net, count) this_cpu_inc((net)->ct.stat->count)
|
||||
#define NF_CT_STAT_ADD_ATOMIC(net, count, v) this_cpu_add((net)->ct.stat->count, (v))
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <linux/uidgid.h>
|
||||
#include <net/inet_frag.h>
|
||||
#include <linux/rcupdate.h>
|
||||
#include <linux/siphash.h>
|
||||
|
||||
struct tcpm_hash_bucket;
|
||||
struct ctl_table_header;
|
||||
@@ -137,5 +138,6 @@ struct netns_ipv4 {
|
||||
int sysctl_fib_multipath_use_neigh;
|
||||
#endif
|
||||
atomic_t rt_genid;
|
||||
siphash_key_t ip_id_key;
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -185,10 +185,7 @@ static inline void snd_compr_drain_notify(struct snd_compr_stream *stream)
|
||||
if (snd_BUG_ON(!stream))
|
||||
return;
|
||||
|
||||
if (stream->direction == SND_COMPRESS_PLAYBACK)
|
||||
stream->runtime->state = SNDRV_PCM_STATE_SETUP;
|
||||
else
|
||||
stream->runtime->state = SNDRV_PCM_STATE_PREPARED;
|
||||
stream->runtime->state = SNDRV_PCM_STATE_SETUP;
|
||||
|
||||
wake_up(&stream->runtime->sleep);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user