aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/acpi.h3
-rw-r--r--include/linux/atmdev.h15
-rw-r--r--include/linux/backing-dev-defs.h2
-rw-r--r--include/linux/blk-mq.h14
-rw-r--r--include/linux/blkdev.h4
-rw-r--r--include/linux/bpf-cgroup.h27
-rw-r--r--include/linux/bpf.h20
-rw-r--r--include/linux/bpf_lirc.h5
-rw-r--r--include/linux/bpfilter.h6
-rw-r--r--include/linux/compat.h8
-rw-r--r--include/linux/compiler-gcc.h54
-rw-r--r--include/linux/compiler_types.h18
-rw-r--r--include/linux/cpu.h2
-rw-r--r--include/linux/dax.h2
-rw-r--r--include/linux/delayacct.h2
-rw-r--r--include/linux/dma-contiguous.h2
-rw-r--r--include/linux/eventfd.h1
-rw-r--r--include/linux/filter.h61
-rw-r--r--include/linux/fs.h3
-rw-r--r--include/linux/fsl/guts.h1
-rw-r--r--include/linux/ftrace.h2
-rw-r--r--include/linux/hid.h3
-rw-r--r--include/linux/if_bridge.h4
-rw-r--r--include/linux/igmp.h2
-rw-r--r--include/linux/iio/buffer-dma.h2
-rw-r--r--include/linux/input/mt.h2
-rw-r--r--include/linux/intel-iommu.h1
-rw-r--r--include/linux/irq.h1
-rw-r--r--include/linux/irqdesc.h5
-rw-r--r--include/linux/kernel.h2
-rw-r--r--include/linux/kthread.h1
-rw-r--r--include/linux/libata.h24
-rw-r--r--include/linux/marvell_phy.h2
-rw-r--r--include/linux/memory.h1
-rw-r--r--include/linux/mlx5/driver.h18
-rw-r--r--include/linux/mlx5/eswitch.h2
-rw-r--r--include/linux/mlx5/mlx5_ifc.h2
-rw-r--r--include/linux/mm.h23
-rw-r--r--include/linux/mod_devicetable.h1
-rw-r--r--include/linux/net.h1
-rw-r--r--include/linux/netdevice.h20
-rw-r--r--include/linux/nfs_xdr.h2
-rw-r--r--include/linux/pci.h3
-rw-r--r--include/linux/perf_event.h1
-rw-r--r--include/linux/pm_domain.h6
-rw-r--r--include/linux/poll.h12
-rw-r--r--include/linux/refcount.h4
-rw-r--r--include/linux/ring_buffer.h1
-rw-r--r--include/linux/rmi.h2
-rw-r--r--include/linux/rtmutex.h7
-rw-r--r--include/linux/scatterlist.h18
-rw-r--r--include/linux/sched.h25
-rw-r--r--include/linux/sched/task.h2
-rw-r--r--include/linux/skbuff.h13
-rw-r--r--include/linux/slub_def.h4
-rw-r--r--include/linux/spinlock.h5
-rw-r--r--include/linux/syscalls.h5
-rw-r--r--include/linux/uio_driver.h2
58 files changed, 357 insertions, 124 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 4b35a66383f9..e54f40974eb0 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -443,6 +443,9 @@ int acpi_check_resource_conflict(const struct resource *res);
443int acpi_check_region(resource_size_t start, resource_size_t n, 443int acpi_check_region(resource_size_t start, resource_size_t n,
444 const char *name); 444 const char *name);
445 445
446acpi_status acpi_release_memory(acpi_handle handle, struct resource *res,
447 u32 level);
448
446int acpi_resources_are_enforced(void); 449int acpi_resources_are_enforced(void);
447 450
448#ifdef CONFIG_HIBERNATION 451#ifdef CONFIG_HIBERNATION
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index 0c27515d2cf6..8124815eb121 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -214,6 +214,7 @@ struct atmphy_ops {
214struct atm_skb_data { 214struct atm_skb_data {
215 struct atm_vcc *vcc; /* ATM VCC */ 215 struct atm_vcc *vcc; /* ATM VCC */
216 unsigned long atm_options; /* ATM layer options */ 216 unsigned long atm_options; /* ATM layer options */
217 unsigned int acct_truesize; /* truesize accounted to vcc */
217}; 218};
218 219
219#define VCC_HTABLE_SIZE 32 220#define VCC_HTABLE_SIZE 32
@@ -241,6 +242,20 @@ void vcc_insert_socket(struct sock *sk);
241 242
242void atm_dev_release_vccs(struct atm_dev *dev); 243void atm_dev_release_vccs(struct atm_dev *dev);
243 244
245static inline void atm_account_tx(struct atm_vcc *vcc, struct sk_buff *skb)
246{
247 /*
248 * Because ATM skbs may not belong to a sock (and we don't
249 * necessarily want to), skb->truesize may be adjusted,
250 * escaping the hack in pskb_expand_head() which avoids
251 * doing so for some cases. So stash the value of truesize
252 * at the time we accounted it, and atm_pop_raw() can use
253 * that value later, in case it changes.
254 */
255 refcount_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc);
256 ATM_SKB(skb)->acct_truesize = skb->truesize;
257 ATM_SKB(skb)->atm_options = vcc->atm_options;
258}
244 259
245static inline void atm_force_charge(struct atm_vcc *vcc,int truesize) 260static inline void atm_force_charge(struct atm_vcc *vcc,int truesize)
246{ 261{
diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h
index 0bd432a4d7bd..24251762c20c 100644
--- a/include/linux/backing-dev-defs.h
+++ b/include/linux/backing-dev-defs.h
@@ -22,7 +22,6 @@ struct dentry;
22 */ 22 */
23enum wb_state { 23enum wb_state {
24 WB_registered, /* bdi_register() was done */ 24 WB_registered, /* bdi_register() was done */
25 WB_shutting_down, /* wb_shutdown() in progress */
26 WB_writeback_running, /* Writeback is in progress */ 25 WB_writeback_running, /* Writeback is in progress */
27 WB_has_dirty_io, /* Dirty inodes on ->b_{dirty|io|more_io} */ 26 WB_has_dirty_io, /* Dirty inodes on ->b_{dirty|io|more_io} */
28 WB_start_all, /* nr_pages == 0 (all) work pending */ 27 WB_start_all, /* nr_pages == 0 (all) work pending */
@@ -189,6 +188,7 @@ struct backing_dev_info {
189#ifdef CONFIG_CGROUP_WRITEBACK 188#ifdef CONFIG_CGROUP_WRITEBACK
190 struct radix_tree_root cgwb_tree; /* radix tree of active cgroup wbs */ 189 struct radix_tree_root cgwb_tree; /* radix tree of active cgroup wbs */
191 struct rb_root cgwb_congested_tree; /* their congested states */ 190 struct rb_root cgwb_congested_tree; /* their congested states */
191 struct mutex cgwb_release_mutex; /* protect shutdown of wb structs */
192#else 192#else
193 struct bdi_writeback_congested *wb_congested; 193 struct bdi_writeback_congested *wb_congested;
194#endif 194#endif
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index e3147eb74222..ca3f2c2edd85 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -287,6 +287,20 @@ void blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set, int nr_hw_queues);
287 287
288void blk_mq_quiesce_queue_nowait(struct request_queue *q); 288void blk_mq_quiesce_queue_nowait(struct request_queue *q);
289 289
290/**
291 * blk_mq_mark_complete() - Set request state to complete
292 * @rq: request to set to complete state
293 *
294 * Returns true if request state was successfully set to complete. If
295 * successful, the caller is responsibile for seeing this request is ended, as
296 * blk_mq_complete_request will not work again.
297 */
298static inline bool blk_mq_mark_complete(struct request *rq)
299{
300 return cmpxchg(&rq->state, MQ_RQ_IN_FLIGHT, MQ_RQ_COMPLETE) ==
301 MQ_RQ_IN_FLIGHT;
302}
303
290/* 304/*
291 * Driver command data is immediately after the request. So subtract request 305 * Driver command data is immediately after the request. So subtract request
292 * size to get back to the original request, add request size to get the PDU. 306 * size to get back to the original request, add request size to get the PDU.
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 9154570edf29..79226ca8f80f 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1119,8 +1119,8 @@ static inline unsigned int blk_max_size_offset(struct request_queue *q,
1119 if (!q->limits.chunk_sectors) 1119 if (!q->limits.chunk_sectors)
1120 return q->limits.max_sectors; 1120 return q->limits.max_sectors;
1121 1121
1122 return q->limits.chunk_sectors - 1122 return min(q->limits.max_sectors, (unsigned int)(q->limits.chunk_sectors -
1123 (offset & (q->limits.chunk_sectors - 1)); 1123 (offset & (q->limits.chunk_sectors - 1))));
1124} 1124}
1125 1125
1126static inline unsigned int blk_rq_get_max_sectors(struct request *rq, 1126static inline unsigned int blk_rq_get_max_sectors(struct request *rq,
diff --git a/include/linux/bpf-cgroup.h b/include/linux/bpf-cgroup.h
index 975fb4cf1bb7..d50c2f0a655a 100644
--- a/include/linux/bpf-cgroup.h
+++ b/include/linux/bpf-cgroup.h
@@ -2,6 +2,7 @@
2#ifndef _BPF_CGROUP_H 2#ifndef _BPF_CGROUP_H
3#define _BPF_CGROUP_H 3#define _BPF_CGROUP_H
4 4
5#include <linux/errno.h>
5#include <linux/jump_label.h> 6#include <linux/jump_label.h>
6#include <uapi/linux/bpf.h> 7#include <uapi/linux/bpf.h>
7 8
@@ -188,12 +189,38 @@ int __cgroup_bpf_check_dev_permission(short dev_type, u32 major, u32 minor,
188 \ 189 \
189 __ret; \ 190 __ret; \
190}) 191})
192int cgroup_bpf_prog_attach(const union bpf_attr *attr,
193 enum bpf_prog_type ptype, struct bpf_prog *prog);
194int cgroup_bpf_prog_detach(const union bpf_attr *attr,
195 enum bpf_prog_type ptype);
196int cgroup_bpf_prog_query(const union bpf_attr *attr,
197 union bpf_attr __user *uattr);
191#else 198#else
192 199
200struct bpf_prog;
193struct cgroup_bpf {}; 201struct cgroup_bpf {};
194static inline void cgroup_bpf_put(struct cgroup *cgrp) {} 202static inline void cgroup_bpf_put(struct cgroup *cgrp) {}
195static inline int cgroup_bpf_inherit(struct cgroup *cgrp) { return 0; } 203static inline int cgroup_bpf_inherit(struct cgroup *cgrp) { return 0; }
196 204
205static inline int cgroup_bpf_prog_attach(const union bpf_attr *attr,
206 enum bpf_prog_type ptype,
207 struct bpf_prog *prog)
208{
209 return -EINVAL;
210}
211
212static inline int cgroup_bpf_prog_detach(const union bpf_attr *attr,
213 enum bpf_prog_type ptype)
214{
215 return -EINVAL;
216}
217
218static inline int cgroup_bpf_prog_query(const union bpf_attr *attr,
219 union bpf_attr __user *uattr)
220{
221 return -EINVAL;
222}
223
197#define cgroup_bpf_enabled (0) 224#define cgroup_bpf_enabled (0)
198#define BPF_CGROUP_PRE_CONNECT_ENABLED(sk) (0) 225#define BPF_CGROUP_PRE_CONNECT_ENABLED(sk) (0)
199#define BPF_CGROUP_RUN_PROG_INET_INGRESS(sk,skb) ({ 0; }) 226#define BPF_CGROUP_RUN_PROG_INET_INGRESS(sk,skb) ({ 0; })
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 995c3b1e59bf..8827e797ff97 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -488,12 +488,15 @@ void bpf_patch_call_args(struct bpf_insn *insn, u32 stack_depth);
488 488
489/* Map specifics */ 489/* Map specifics */
490struct xdp_buff; 490struct xdp_buff;
491struct sk_buff;
491 492
492struct bpf_dtab_netdev *__dev_map_lookup_elem(struct bpf_map *map, u32 key); 493struct bpf_dtab_netdev *__dev_map_lookup_elem(struct bpf_map *map, u32 key);
493void __dev_map_insert_ctx(struct bpf_map *map, u32 index); 494void __dev_map_insert_ctx(struct bpf_map *map, u32 index);
494void __dev_map_flush(struct bpf_map *map); 495void __dev_map_flush(struct bpf_map *map);
495int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp, 496int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp,
496 struct net_device *dev_rx); 497 struct net_device *dev_rx);
498int dev_map_generic_redirect(struct bpf_dtab_netdev *dst, struct sk_buff *skb,
499 struct bpf_prog *xdp_prog);
497 500
498struct bpf_cpu_map_entry *__cpu_map_lookup_elem(struct bpf_map *map, u32 key); 501struct bpf_cpu_map_entry *__cpu_map_lookup_elem(struct bpf_map *map, u32 key);
499void __cpu_map_insert_ctx(struct bpf_map *map, u32 index); 502void __cpu_map_insert_ctx(struct bpf_map *map, u32 index);
@@ -586,6 +589,15 @@ int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp,
586 return 0; 589 return 0;
587} 590}
588 591
592struct sk_buff;
593
594static inline int dev_map_generic_redirect(struct bpf_dtab_netdev *dst,
595 struct sk_buff *skb,
596 struct bpf_prog *xdp_prog)
597{
598 return 0;
599}
600
589static inline 601static inline
590struct bpf_cpu_map_entry *__cpu_map_lookup_elem(struct bpf_map *map, u32 key) 602struct bpf_cpu_map_entry *__cpu_map_lookup_elem(struct bpf_map *map, u32 key)
591{ 603{
@@ -684,6 +696,8 @@ static inline void bpf_map_offload_map_free(struct bpf_map *map)
684struct sock *__sock_map_lookup_elem(struct bpf_map *map, u32 key); 696struct sock *__sock_map_lookup_elem(struct bpf_map *map, u32 key);
685struct sock *__sock_hash_lookup_elem(struct bpf_map *map, void *key); 697struct sock *__sock_hash_lookup_elem(struct bpf_map *map, void *key);
686int sock_map_prog(struct bpf_map *map, struct bpf_prog *prog, u32 type); 698int sock_map_prog(struct bpf_map *map, struct bpf_prog *prog, u32 type);
699int sockmap_get_from_fd(const union bpf_attr *attr, int type,
700 struct bpf_prog *prog);
687#else 701#else
688static inline struct sock *__sock_map_lookup_elem(struct bpf_map *map, u32 key) 702static inline struct sock *__sock_map_lookup_elem(struct bpf_map *map, u32 key)
689{ 703{
@@ -702,6 +716,12 @@ static inline int sock_map_prog(struct bpf_map *map,
702{ 716{
703 return -EOPNOTSUPP; 717 return -EOPNOTSUPP;
704} 718}
719
720static inline int sockmap_get_from_fd(const union bpf_attr *attr, int type,
721 struct bpf_prog *prog)
722{
723 return -EINVAL;
724}
705#endif 725#endif
706 726
707#if defined(CONFIG_XDP_SOCKETS) 727#if defined(CONFIG_XDP_SOCKETS)
diff --git a/include/linux/bpf_lirc.h b/include/linux/bpf_lirc.h
index 5f8a4283092d..9d9ff755ec29 100644
--- a/include/linux/bpf_lirc.h
+++ b/include/linux/bpf_lirc.h
@@ -5,11 +5,12 @@
5#include <uapi/linux/bpf.h> 5#include <uapi/linux/bpf.h>
6 6
7#ifdef CONFIG_BPF_LIRC_MODE2 7#ifdef CONFIG_BPF_LIRC_MODE2
8int lirc_prog_attach(const union bpf_attr *attr); 8int lirc_prog_attach(const union bpf_attr *attr, struct bpf_prog *prog);
9int lirc_prog_detach(const union bpf_attr *attr); 9int lirc_prog_detach(const union bpf_attr *attr);
10int lirc_prog_query(const union bpf_attr *attr, union bpf_attr __user *uattr); 10int lirc_prog_query(const union bpf_attr *attr, union bpf_attr __user *uattr);
11#else 11#else
12static inline int lirc_prog_attach(const union bpf_attr *attr) 12static inline int lirc_prog_attach(const union bpf_attr *attr,
13 struct bpf_prog *prog)
13{ 14{
14 return -EINVAL; 15 return -EINVAL;
15} 16}
diff --git a/include/linux/bpfilter.h b/include/linux/bpfilter.h
index 687b1760bb9f..f02cee0225d4 100644
--- a/include/linux/bpfilter.h
+++ b/include/linux/bpfilter.h
@@ -5,10 +5,10 @@
5#include <uapi/linux/bpfilter.h> 5#include <uapi/linux/bpfilter.h>
6 6
7struct sock; 7struct sock;
8int bpfilter_ip_set_sockopt(struct sock *sk, int optname, char *optval, 8int bpfilter_ip_set_sockopt(struct sock *sk, int optname, char __user *optval,
9 unsigned int optlen); 9 unsigned int optlen);
10int bpfilter_ip_get_sockopt(struct sock *sk, int optname, char *optval, 10int bpfilter_ip_get_sockopt(struct sock *sk, int optname, char __user *optval,
11 int *optlen); 11 int __user *optlen);
12extern int (*bpfilter_process_sockopt)(struct sock *sk, int optname, 12extern int (*bpfilter_process_sockopt)(struct sock *sk, int optname,
13 char __user *optval, 13 char __user *optval,
14 unsigned int optlen, bool is_set); 14 unsigned int optlen, bool is_set);
diff --git a/include/linux/compat.h b/include/linux/compat.h
index b1a5562b3215..c68acc47da57 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -72,6 +72,9 @@
72 */ 72 */
73#ifndef COMPAT_SYSCALL_DEFINEx 73#ifndef COMPAT_SYSCALL_DEFINEx
74#define COMPAT_SYSCALL_DEFINEx(x, name, ...) \ 74#define COMPAT_SYSCALL_DEFINEx(x, name, ...) \
75 __diag_push(); \
76 __diag_ignore(GCC, 8, "-Wattribute-alias", \
77 "Type aliasing is used to sanitize syscall arguments");\
75 asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \ 78 asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \
76 asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \ 79 asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \
77 __attribute__((alias(__stringify(__se_compat_sys##name)))); \ 80 __attribute__((alias(__stringify(__se_compat_sys##name)))); \
@@ -80,8 +83,11 @@
80 asmlinkage long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \ 83 asmlinkage long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \
81 asmlinkage long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \ 84 asmlinkage long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \
82 { \ 85 { \
83 return __do_compat_sys##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__));\ 86 long ret = __do_compat_sys##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__));\
87 __MAP(x,__SC_TEST,__VA_ARGS__); \
88 return ret; \
84 } \ 89 } \
90 __diag_pop(); \
85 static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) 91 static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
86#endif /* COMPAT_SYSCALL_DEFINEx */ 92#endif /* COMPAT_SYSCALL_DEFINEx */
87 93
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index f1a7492a5cc8..573f5a7d42d4 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -66,25 +66,40 @@
66#endif 66#endif
67 67
68/* 68/*
69 * Feature detection for gnu_inline (gnu89 extern inline semantics). Either
70 * __GNUC_STDC_INLINE__ is defined (not using gnu89 extern inline semantics,
71 * and we opt in to the gnu89 semantics), or __GNUC_STDC_INLINE__ is not
72 * defined so the gnu89 semantics are the default.
73 */
74#ifdef __GNUC_STDC_INLINE__
75# define __gnu_inline __attribute__((gnu_inline))
76#else
77# define __gnu_inline
78#endif
79
80/*
69 * Force always-inline if the user requests it so via the .config, 81 * Force always-inline if the user requests it so via the .config,
70 * or if gcc is too old. 82 * or if gcc is too old.
71 * GCC does not warn about unused static inline functions for 83 * GCC does not warn about unused static inline functions for
72 * -Wunused-function. This turns out to avoid the need for complex #ifdef 84 * -Wunused-function. This turns out to avoid the need for complex #ifdef
73 * directives. Suppress the warning in clang as well by using "unused" 85 * directives. Suppress the warning in clang as well by using "unused"
74 * function attribute, which is redundant but not harmful for gcc. 86 * function attribute, which is redundant but not harmful for gcc.
87 * Prefer gnu_inline, so that extern inline functions do not emit an
88 * externally visible function. This makes extern inline behave as per gnu89
89 * semantics rather than c99. This prevents multiple symbol definition errors
90 * of extern inline functions at link time.
91 * A lot of inline functions can cause havoc with function tracing.
75 */ 92 */
76#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \ 93#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \
77 !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) 94 !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4)
78#define inline inline __attribute__((always_inline,unused)) notrace 95#define inline \
79#define __inline__ __inline__ __attribute__((always_inline,unused)) notrace 96 inline __attribute__((always_inline, unused)) notrace __gnu_inline
80#define __inline __inline __attribute__((always_inline,unused)) notrace
81#else 97#else
82/* A lot of inline functions can cause havoc with function tracing */ 98#define inline inline __attribute__((unused)) notrace __gnu_inline
83#define inline inline __attribute__((unused)) notrace
84#define __inline__ __inline__ __attribute__((unused)) notrace
85#define __inline __inline __attribute__((unused)) notrace
86#endif 99#endif
87 100
101#define __inline__ inline
102#define __inline inline
88#define __always_inline inline __attribute__((always_inline)) 103#define __always_inline inline __attribute__((always_inline))
89#define noinline __attribute__((noinline)) 104#define noinline __attribute__((noinline))
90 105
@@ -347,3 +362,28 @@
347#if GCC_VERSION >= 50100 362#if GCC_VERSION >= 50100
348#define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1 363#define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1
349#endif 364#endif
365
366/*
367 * Turn individual warnings and errors on and off locally, depending
368 * on version.
369 */
370#define __diag_GCC(version, severity, s) \
371 __diag_GCC_ ## version(__diag_GCC_ ## severity s)
372
373/* Severity used in pragma directives */
374#define __diag_GCC_ignore ignored
375#define __diag_GCC_warn warning
376#define __diag_GCC_error error
377
378/* Compilers before gcc-4.6 do not understand "#pragma GCC diagnostic push" */
379#if GCC_VERSION >= 40600
380#define __diag_str1(s) #s
381#define __diag_str(s) __diag_str1(s)
382#define __diag(s) _Pragma(__diag_str(GCC diagnostic s))
383#endif
384
385#if GCC_VERSION >= 80000
386#define __diag_GCC_8(s) __diag(s)
387#else
388#define __diag_GCC_8(s)
389#endif
diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h
index 6b79a9bba9a7..a8ba6b04152c 100644
--- a/include/linux/compiler_types.h
+++ b/include/linux/compiler_types.h
@@ -271,4 +271,22 @@ struct ftrace_likely_data {
271# define __native_word(t) (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long)) 271# define __native_word(t) (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long))
272#endif 272#endif
273 273
274#ifndef __diag
275#define __diag(string)
276#endif
277
278#ifndef __diag_GCC
279#define __diag_GCC(version, severity, string)
280#endif
281
282#define __diag_push() __diag(push)
283#define __diag_pop() __diag(pop)
284
285#define __diag_ignore(compiler, version, option, comment) \
286 __diag_ ## compiler(version, ignore, option)
287#define __diag_warn(compiler, version, option, comment) \
288 __diag_ ## compiler(version, warn, option)
289#define __diag_error(compiler, version, option, comment) \
290 __diag_ ## compiler(version, error, option)
291
274#endif /* __LINUX_COMPILER_TYPES_H */ 292#endif /* __LINUX_COMPILER_TYPES_H */
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index a97a63eef59f..3233fbe23594 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -30,7 +30,7 @@ struct cpu {
30}; 30};
31 31
32extern void boot_cpu_init(void); 32extern void boot_cpu_init(void);
33extern void boot_cpu_state_init(void); 33extern void boot_cpu_hotplug_init(void);
34extern void cpu_init(void); 34extern void cpu_init(void);
35extern void trap_init(void); 35extern void trap_init(void);
36 36
diff --git a/include/linux/dax.h b/include/linux/dax.h
index 3855e3800f48..deb0f663252f 100644
--- a/include/linux/dax.h
+++ b/include/linux/dax.h
@@ -135,7 +135,7 @@ void dax_flush(struct dax_device *dax_dev, void *addr, size_t size);
135 135
136ssize_t dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter, 136ssize_t dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter,
137 const struct iomap_ops *ops); 137 const struct iomap_ops *ops);
138int dax_iomap_fault(struct vm_fault *vmf, enum page_entry_size pe_size, 138vm_fault_t dax_iomap_fault(struct vm_fault *vmf, enum page_entry_size pe_size,
139 pfn_t *pfnp, int *errp, const struct iomap_ops *ops); 139 pfn_t *pfnp, int *errp, const struct iomap_ops *ops);
140vm_fault_t dax_finish_sync_fault(struct vm_fault *vmf, 140vm_fault_t dax_finish_sync_fault(struct vm_fault *vmf,
141 enum page_entry_size pe_size, pfn_t pfn); 141 enum page_entry_size pe_size, pfn_t pfn);
diff --git a/include/linux/delayacct.h b/include/linux/delayacct.h
index e6c0448ebcc7..31c865d1842e 100644
--- a/include/linux/delayacct.h
+++ b/include/linux/delayacct.h
@@ -124,7 +124,7 @@ static inline void delayacct_blkio_start(void)
124 124
125static inline void delayacct_blkio_end(struct task_struct *p) 125static inline void delayacct_blkio_end(struct task_struct *p)
126{ 126{
127 if (current->delays) 127 if (p->delays)
128 __delayacct_blkio_end(p); 128 __delayacct_blkio_end(p);
129 delayacct_clear_flag(DELAYACCT_PF_BLKIO); 129 delayacct_clear_flag(DELAYACCT_PF_BLKIO);
130} 130}
diff --git a/include/linux/dma-contiguous.h b/include/linux/dma-contiguous.h
index b67bf6ac907d..3c5a4cb3eb95 100644
--- a/include/linux/dma-contiguous.h
+++ b/include/linux/dma-contiguous.h
@@ -48,7 +48,7 @@
48 * CMA should not be used by the device drivers directly. It is 48 * CMA should not be used by the device drivers directly. It is
49 * only a helper framework for dma-mapping subsystem. 49 * only a helper framework for dma-mapping subsystem.
50 * 50 *
51 * For more information, see kernel-docs in drivers/base/dma-contiguous.c 51 * For more information, see kernel-docs in kernel/dma/contiguous.c
52 */ 52 */
53 53
54#ifdef __KERNEL__ 54#ifdef __KERNEL__
diff --git a/include/linux/eventfd.h b/include/linux/eventfd.h
index 7094718b653b..ffcc7724ca21 100644
--- a/include/linux/eventfd.h
+++ b/include/linux/eventfd.h
@@ -11,6 +11,7 @@
11 11
12#include <linux/fcntl.h> 12#include <linux/fcntl.h>
13#include <linux/wait.h> 13#include <linux/wait.h>
14#include <linux/err.h>
14 15
15/* 16/*
16 * CAREFUL: Check include/uapi/asm-generic/fcntl.h when defining 17 * CAREFUL: Check include/uapi/asm-generic/fcntl.h when defining
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 45fc0f5000d8..c73dd7396886 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -19,6 +19,7 @@
19#include <linux/cryptohash.h> 19#include <linux/cryptohash.h>
20#include <linux/set_memory.h> 20#include <linux/set_memory.h>
21#include <linux/kallsyms.h> 21#include <linux/kallsyms.h>
22#include <linux/if_vlan.h>
22 23
23#include <net/sch_generic.h> 24#include <net/sch_generic.h>
24 25
@@ -469,15 +470,16 @@ struct sock_fprog_kern {
469}; 470};
470 471
471struct bpf_binary_header { 472struct bpf_binary_header {
472 unsigned int pages; 473 u32 pages;
473 u8 image[]; 474 /* Some arches need word alignment for their instructions */
475 u8 image[] __aligned(4);
474}; 476};
475 477
476struct bpf_prog { 478struct bpf_prog {
477 u16 pages; /* Number of allocated pages */ 479 u16 pages; /* Number of allocated pages */
478 u16 jited:1, /* Is our filter JIT'ed? */ 480 u16 jited:1, /* Is our filter JIT'ed? */
479 jit_requested:1,/* archs need to JIT the prog */ 481 jit_requested:1,/* archs need to JIT the prog */
480 locked:1, /* Program image locked? */ 482 undo_set_mem:1, /* Passed set_memory_ro() checkpoint */
481 gpl_compatible:1, /* Is filter GPL compatible? */ 483 gpl_compatible:1, /* Is filter GPL compatible? */
482 cb_access:1, /* Is control block accessed? */ 484 cb_access:1, /* Is control block accessed? */
483 dst_needed:1, /* Do we need dst entry? */ 485 dst_needed:1, /* Do we need dst entry? */
@@ -671,50 +673,27 @@ bpf_ctx_narrow_access_ok(u32 off, u32 size, u32 size_default)
671 673
672#define bpf_classic_proglen(fprog) (fprog->len * sizeof(fprog->filter[0])) 674#define bpf_classic_proglen(fprog) (fprog->len * sizeof(fprog->filter[0]))
673 675
674#ifdef CONFIG_ARCH_HAS_SET_MEMORY
675static inline void bpf_prog_lock_ro(struct bpf_prog *fp)
676{
677 fp->locked = 1;
678 WARN_ON_ONCE(set_memory_ro((unsigned long)fp, fp->pages));
679}
680
681static inline void bpf_prog_unlock_ro(struct bpf_prog *fp)
682{
683 if (fp->locked) {
684 WARN_ON_ONCE(set_memory_rw((unsigned long)fp, fp->pages));
685 /* In case set_memory_rw() fails, we want to be the first
686 * to crash here instead of some random place later on.
687 */
688 fp->locked = 0;
689 }
690}
691
692static inline void bpf_jit_binary_lock_ro(struct bpf_binary_header *hdr)
693{
694 WARN_ON_ONCE(set_memory_ro((unsigned long)hdr, hdr->pages));
695}
696
697static inline void bpf_jit_binary_unlock_ro(struct bpf_binary_header *hdr)
698{
699 WARN_ON_ONCE(set_memory_rw((unsigned long)hdr, hdr->pages));
700}
701#else
702static inline void bpf_prog_lock_ro(struct bpf_prog *fp) 676static inline void bpf_prog_lock_ro(struct bpf_prog *fp)
703{ 677{
678 fp->undo_set_mem = 1;
679 set_memory_ro((unsigned long)fp, fp->pages);
704} 680}
705 681
706static inline void bpf_prog_unlock_ro(struct bpf_prog *fp) 682static inline void bpf_prog_unlock_ro(struct bpf_prog *fp)
707{ 683{
684 if (fp->undo_set_mem)
685 set_memory_rw((unsigned long)fp, fp->pages);
708} 686}
709 687
710static inline void bpf_jit_binary_lock_ro(struct bpf_binary_header *hdr) 688static inline void bpf_jit_binary_lock_ro(struct bpf_binary_header *hdr)
711{ 689{
690 set_memory_ro((unsigned long)hdr, hdr->pages);
712} 691}
713 692
714static inline void bpf_jit_binary_unlock_ro(struct bpf_binary_header *hdr) 693static inline void bpf_jit_binary_unlock_ro(struct bpf_binary_header *hdr)
715{ 694{
695 set_memory_rw((unsigned long)hdr, hdr->pages);
716} 696}
717#endif /* CONFIG_ARCH_HAS_SET_MEMORY */
718 697
719static inline struct bpf_binary_header * 698static inline struct bpf_binary_header *
720bpf_jit_binary_hdr(const struct bpf_prog *fp) 699bpf_jit_binary_hdr(const struct bpf_prog *fp)
@@ -786,6 +765,21 @@ static inline bool bpf_dump_raw_ok(void)
786struct bpf_prog *bpf_patch_insn_single(struct bpf_prog *prog, u32 off, 765struct bpf_prog *bpf_patch_insn_single(struct bpf_prog *prog, u32 off,
787 const struct bpf_insn *patch, u32 len); 766 const struct bpf_insn *patch, u32 len);
788 767
768static inline int xdp_ok_fwd_dev(const struct net_device *fwd,
769 unsigned int pktlen)
770{
771 unsigned int len;
772
773 if (unlikely(!(fwd->flags & IFF_UP)))
774 return -ENETDOWN;
775
776 len = fwd->mtu + fwd->hard_header_len + VLAN_HLEN;
777 if (pktlen > len)
778 return -EMSGSIZE;
779
780 return 0;
781}
782
789/* The pair of xdp_do_redirect and xdp_do_flush_map MUST be called in the 783/* The pair of xdp_do_redirect and xdp_do_flush_map MUST be called in the
790 * same cpu context. Further for best results no more than a single map 784 * same cpu context. Further for best results no more than a single map
791 * for the do_redirect/do_flush pair should be used. This limitation is 785 * for the do_redirect/do_flush pair should be used. This limitation is
@@ -961,6 +955,9 @@ static inline void bpf_prog_kallsyms_del(struct bpf_prog *fp)
961} 955}
962#endif /* CONFIG_BPF_JIT */ 956#endif /* CONFIG_BPF_JIT */
963 957
958void bpf_prog_kallsyms_del_subprogs(struct bpf_prog *fp);
959void bpf_prog_kallsyms_del_all(struct bpf_prog *fp);
960
964#define BPF_ANC BIT(15) 961#define BPF_ANC BIT(15)
965 962
966static inline bool bpf_needs_clear_a(const struct sock_filter *first) 963static inline bool bpf_needs_clear_a(const struct sock_filter *first)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 5c91108846db..805bf22898cf 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1720,8 +1720,6 @@ struct file_operations {
1720 int (*iterate) (struct file *, struct dir_context *); 1720 int (*iterate) (struct file *, struct dir_context *);
1721 int (*iterate_shared) (struct file *, struct dir_context *); 1721 int (*iterate_shared) (struct file *, struct dir_context *);
1722 __poll_t (*poll) (struct file *, struct poll_table_struct *); 1722 __poll_t (*poll) (struct file *, struct poll_table_struct *);
1723 struct wait_queue_head * (*get_poll_head)(struct file *, __poll_t);
1724 __poll_t (*poll_mask) (struct file *, __poll_t);
1725 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); 1723 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
1726 long (*compat_ioctl) (struct file *, unsigned int, unsigned long); 1724 long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
1727 int (*mmap) (struct file *, struct vm_area_struct *); 1725 int (*mmap) (struct file *, struct vm_area_struct *);
@@ -2422,6 +2420,7 @@ extern struct file *filp_open(const char *, int, umode_t);
2422extern struct file *file_open_root(struct dentry *, struct vfsmount *, 2420extern struct file *file_open_root(struct dentry *, struct vfsmount *,
2423 const char *, int, umode_t); 2421 const char *, int, umode_t);
2424extern struct file * dentry_open(const struct path *, int, const struct cred *); 2422extern struct file * dentry_open(const struct path *, int, const struct cred *);
2423extern struct file *filp_clone_open(struct file *);
2425extern int filp_close(struct file *, fl_owner_t id); 2424extern int filp_close(struct file *, fl_owner_t id);
2426 2425
2427extern struct filename *getname_flags(const char __user *, int, int *); 2426extern struct filename *getname_flags(const char __user *, int, int *);
diff --git a/include/linux/fsl/guts.h b/include/linux/fsl/guts.h
index 3efa3b861d44..941b11811f85 100644
--- a/include/linux/fsl/guts.h
+++ b/include/linux/fsl/guts.h
@@ -16,6 +16,7 @@
16#define __FSL_GUTS_H__ 16#define __FSL_GUTS_H__
17 17
18#include <linux/types.h> 18#include <linux/types.h>
19#include <linux/io.h>
19 20
20/** 21/**
21 * Global Utility Registers. 22 * Global Utility Registers.
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 8154f4920fcb..ebb77674be90 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -223,7 +223,6 @@ extern enum ftrace_tracing_type_t ftrace_tracing_type;
223 */ 223 */
224int register_ftrace_function(struct ftrace_ops *ops); 224int register_ftrace_function(struct ftrace_ops *ops);
225int unregister_ftrace_function(struct ftrace_ops *ops); 225int unregister_ftrace_function(struct ftrace_ops *ops);
226void clear_ftrace_function(void);
227 226
228extern void ftrace_stub(unsigned long a0, unsigned long a1, 227extern void ftrace_stub(unsigned long a0, unsigned long a1,
229 struct ftrace_ops *op, struct pt_regs *regs); 228 struct ftrace_ops *op, struct pt_regs *regs);
@@ -239,7 +238,6 @@ static inline int ftrace_nr_registered_ops(void)
239{ 238{
240 return 0; 239 return 0;
241} 240}
242static inline void clear_ftrace_function(void) { }
243static inline void ftrace_kill(void) { } 241static inline void ftrace_kill(void) { }
244static inline void ftrace_free_init_mem(void) { } 242static inline void ftrace_free_init_mem(void) { }
245static inline void ftrace_free_mem(struct module *mod, void *start, void *end) { } 243static inline void ftrace_free_mem(struct module *mod, void *start, void *end) { }
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 41a3d5775394..773bcb1d4044 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -511,6 +511,7 @@ struct hid_output_fifo {
511#define HID_STAT_ADDED BIT(0) 511#define HID_STAT_ADDED BIT(0)
512#define HID_STAT_PARSED BIT(1) 512#define HID_STAT_PARSED BIT(1)
513#define HID_STAT_DUP_DETECTED BIT(2) 513#define HID_STAT_DUP_DETECTED BIT(2)
514#define HID_STAT_REPROBED BIT(3)
514 515
515struct hid_input { 516struct hid_input {
516 struct list_head list; 517 struct list_head list;
@@ -579,7 +580,7 @@ struct hid_device { /* device report descriptor */
579 bool battery_avoid_query; 580 bool battery_avoid_query;
580#endif 581#endif
581 582
582 unsigned int status; /* see STAT flags above */ 583 unsigned long status; /* see STAT flags above */
583 unsigned claimed; /* Claimed by hidinput, hiddev? */ 584 unsigned claimed; /* Claimed by hidinput, hiddev? */
584 unsigned quirks; /* Various quirks the device can pull on us */ 585 unsigned quirks; /* Various quirks the device can pull on us */
585 bool io_started; /* If IO has started */ 586 bool io_started; /* If IO has started */
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
index 7843b98e1c6e..c20c7e197d07 100644
--- a/include/linux/if_bridge.h
+++ b/include/linux/if_bridge.h
@@ -105,13 +105,13 @@ static inline bool br_vlan_enabled(const struct net_device *dev)
105 105
106static inline int br_vlan_get_pvid(const struct net_device *dev, u16 *p_pvid) 106static inline int br_vlan_get_pvid(const struct net_device *dev, u16 *p_pvid)
107{ 107{
108 return -1; 108 return -EINVAL;
109} 109}
110 110
111static inline int br_vlan_get_info(const struct net_device *dev, u16 vid, 111static inline int br_vlan_get_info(const struct net_device *dev, u16 vid,
112 struct bridge_vlan_info *p_vinfo) 112 struct bridge_vlan_info *p_vinfo)
113{ 113{
114 return -1; 114 return -EINVAL;
115} 115}
116#endif 116#endif
117 117
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index f8231854b5d6..119f53941c12 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -109,6 +109,8 @@ struct ip_mc_list {
109extern int ip_check_mc_rcu(struct in_device *dev, __be32 mc_addr, __be32 src_addr, u8 proto); 109extern int ip_check_mc_rcu(struct in_device *dev, __be32 mc_addr, __be32 src_addr, u8 proto);
110extern int igmp_rcv(struct sk_buff *); 110extern int igmp_rcv(struct sk_buff *);
111extern int ip_mc_join_group(struct sock *sk, struct ip_mreqn *imr); 111extern int ip_mc_join_group(struct sock *sk, struct ip_mreqn *imr);
112extern int ip_mc_join_group_ssm(struct sock *sk, struct ip_mreqn *imr,
113 unsigned int mode);
112extern int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr); 114extern int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr);
113extern void ip_mc_drop_socket(struct sock *sk); 115extern void ip_mc_drop_socket(struct sock *sk);
114extern int ip_mc_source(int add, int omode, struct sock *sk, 116extern int ip_mc_source(int add, int omode, struct sock *sk,
diff --git a/include/linux/iio/buffer-dma.h b/include/linux/iio/buffer-dma.h
index 767467d886de..67c75372b691 100644
--- a/include/linux/iio/buffer-dma.h
+++ b/include/linux/iio/buffer-dma.h
@@ -141,7 +141,7 @@ int iio_dma_buffer_read(struct iio_buffer *buffer, size_t n,
141 char __user *user_buffer); 141 char __user *user_buffer);
142size_t iio_dma_buffer_data_available(struct iio_buffer *buffer); 142size_t iio_dma_buffer_data_available(struct iio_buffer *buffer);
143int iio_dma_buffer_set_bytes_per_datum(struct iio_buffer *buffer, size_t bpd); 143int iio_dma_buffer_set_bytes_per_datum(struct iio_buffer *buffer, size_t bpd);
144int iio_dma_buffer_set_length(struct iio_buffer *buffer, int length); 144int iio_dma_buffer_set_length(struct iio_buffer *buffer, unsigned int length);
145int iio_dma_buffer_request_update(struct iio_buffer *buffer); 145int iio_dma_buffer_request_update(struct iio_buffer *buffer);
146 146
147int iio_dma_buffer_init(struct iio_dma_buffer_queue *queue, 147int iio_dma_buffer_init(struct iio_dma_buffer_queue *queue,
diff --git a/include/linux/input/mt.h b/include/linux/input/mt.h
index d7188de4db96..3f4bf60b0bb5 100644
--- a/include/linux/input/mt.h
+++ b/include/linux/input/mt.h
@@ -100,7 +100,7 @@ static inline bool input_is_mt_axis(int axis)
100 return axis == ABS_MT_SLOT || input_is_mt_value(axis); 100 return axis == ABS_MT_SLOT || input_is_mt_value(axis);
101} 101}
102 102
103void input_mt_report_slot_state(struct input_dev *dev, 103bool input_mt_report_slot_state(struct input_dev *dev,
104 unsigned int tool_type, bool active); 104 unsigned int tool_type, bool active);
105 105
106void input_mt_report_finger_count(struct input_dev *dev, int count); 106void input_mt_report_finger_count(struct input_dev *dev, int count);
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
index 1df940196ab2..ef169d67df92 100644
--- a/include/linux/intel-iommu.h
+++ b/include/linux/intel-iommu.h
@@ -121,6 +121,7 @@
121#define ecap_srs(e) ((e >> 31) & 0x1) 121#define ecap_srs(e) ((e >> 31) & 0x1)
122#define ecap_ers(e) ((e >> 30) & 0x1) 122#define ecap_ers(e) ((e >> 30) & 0x1)
123#define ecap_prs(e) ((e >> 29) & 0x1) 123#define ecap_prs(e) ((e >> 29) & 0x1)
124#define ecap_broken_pasid(e) ((e >> 28) & 0x1)
124#define ecap_dis(e) ((e >> 27) & 0x1) 125#define ecap_dis(e) ((e >> 27) & 0x1)
125#define ecap_nest(e) ((e >> 26) & 0x1) 126#define ecap_nest(e) ((e >> 26) & 0x1)
126#define ecap_mts(e) ((e >> 25) & 0x1) 127#define ecap_mts(e) ((e >> 25) & 0x1)
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 4bd2f34947f4..201de12a9957 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -503,6 +503,7 @@ struct irq_chip {
503 * IRQCHIP_SKIP_SET_WAKE: Skip chip.irq_set_wake(), for this irq chip 503 * IRQCHIP_SKIP_SET_WAKE: Skip chip.irq_set_wake(), for this irq chip
504 * IRQCHIP_ONESHOT_SAFE: One shot does not require mask/unmask 504 * IRQCHIP_ONESHOT_SAFE: One shot does not require mask/unmask
505 * IRQCHIP_EOI_THREADED: Chip requires eoi() on unmask in threaded mode 505 * IRQCHIP_EOI_THREADED: Chip requires eoi() on unmask in threaded mode
506 * IRQCHIP_SUPPORTS_LEVEL_MSI Chip can provide two doorbells for Level MSIs
506 */ 507 */
507enum { 508enum {
508 IRQCHIP_SET_TYPE_MASKED = (1 << 0), 509 IRQCHIP_SET_TYPE_MASKED = (1 << 0),
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index 25b33b664537..dd1e40ddac7d 100644
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
@@ -145,11 +145,6 @@ static inline void *irq_desc_get_handler_data(struct irq_desc *desc)
145 return desc->irq_common_data.handler_data; 145 return desc->irq_common_data.handler_data;
146} 146}
147 147
148static inline struct msi_desc *irq_desc_get_msi_desc(struct irq_desc *desc)
149{
150 return desc->irq_common_data.msi_desc;
151}
152
153/* 148/*
154 * Architectures call this to let the generic IRQ layer 149 * Architectures call this to let the generic IRQ layer
155 * handle an interrupt. 150 * handle an interrupt.
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index d23123238534..941dc0a5a877 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -666,7 +666,7 @@ do { \
666 * your code. (Extra memory is used for special buffers that are 666 * your code. (Extra memory is used for special buffers that are
667 * allocated when trace_printk() is used.) 667 * allocated when trace_printk() is used.)
668 * 668 *
669 * A little optization trick is done here. If there's only one 669 * A little optimization trick is done here. If there's only one
670 * argument, there's no need to scan the string for printf formats. 670 * argument, there's no need to scan the string for printf formats.
671 * The trace_puts() will suffice. But how can we take advantage of 671 * The trace_puts() will suffice. But how can we take advantage of
672 * using trace_puts() when trace_printk() has only one argument? 672 * using trace_puts() when trace_printk() has only one argument?
diff --git a/include/linux/kthread.h b/include/linux/kthread.h
index 2803264c512f..c1961761311d 100644
--- a/include/linux/kthread.h
+++ b/include/linux/kthread.h
@@ -62,7 +62,6 @@ void *kthread_probe_data(struct task_struct *k);
62int kthread_park(struct task_struct *k); 62int kthread_park(struct task_struct *k);
63void kthread_unpark(struct task_struct *k); 63void kthread_unpark(struct task_struct *k);
64void kthread_parkme(void); 64void kthread_parkme(void);
65void kthread_park_complete(struct task_struct *k);
66 65
67int kthreadd(void *unused); 66int kthreadd(void *unused);
68extern struct task_struct *kthreadd_task; 67extern struct task_struct *kthreadd_task;
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 8b8946dd63b9..32f247cb5e9e 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -210,6 +210,7 @@ enum {
210 ATA_FLAG_SLAVE_POSS = (1 << 0), /* host supports slave dev */ 210 ATA_FLAG_SLAVE_POSS = (1 << 0), /* host supports slave dev */
211 /* (doesn't imply presence) */ 211 /* (doesn't imply presence) */
212 ATA_FLAG_SATA = (1 << 1), 212 ATA_FLAG_SATA = (1 << 1),
213 ATA_FLAG_NO_LPM = (1 << 2), /* host not happy with LPM */
213 ATA_FLAG_NO_LOG_PAGE = (1 << 5), /* do not issue log page read */ 214 ATA_FLAG_NO_LOG_PAGE = (1 << 5), /* do not issue log page read */
214 ATA_FLAG_NO_ATAPI = (1 << 6), /* No ATAPI support */ 215 ATA_FLAG_NO_ATAPI = (1 << 6), /* No ATAPI support */
215 ATA_FLAG_PIO_DMA = (1 << 7), /* PIO cmds via DMA */ 216 ATA_FLAG_PIO_DMA = (1 << 7), /* PIO cmds via DMA */
@@ -1495,6 +1496,29 @@ static inline bool ata_tag_valid(unsigned int tag)
1495 return tag < ATA_MAX_QUEUE || ata_tag_internal(tag); 1496 return tag < ATA_MAX_QUEUE || ata_tag_internal(tag);
1496} 1497}
1497 1498
1499#define __ata_qc_for_each(ap, qc, tag, max_tag, fn) \
1500 for ((tag) = 0; (tag) < (max_tag) && \
1501 ({ qc = fn((ap), (tag)); 1; }); (tag)++) \
1502
1503/*
1504 * Internal use only, iterate commands ignoring error handling and
1505 * status of 'qc'.
1506 */
1507#define ata_qc_for_each_raw(ap, qc, tag) \
1508 __ata_qc_for_each(ap, qc, tag, ATA_MAX_QUEUE, __ata_qc_from_tag)
1509
1510/*
1511 * Iterate all potential commands that can be queued
1512 */
1513#define ata_qc_for_each(ap, qc, tag) \
1514 __ata_qc_for_each(ap, qc, tag, ATA_MAX_QUEUE, ata_qc_from_tag)
1515
1516/*
1517 * Like ata_qc_for_each, but with the internal tag included
1518 */
1519#define ata_qc_for_each_with_internal(ap, qc, tag) \
1520 __ata_qc_for_each(ap, qc, tag, ATA_MAX_QUEUE + 1, ata_qc_from_tag)
1521
1498/* 1522/*
1499 * device helpers 1523 * device helpers
1500 */ 1524 */
diff --git a/include/linux/marvell_phy.h b/include/linux/marvell_phy.h
index 4f5f8c21e283..1eb6f244588d 100644
--- a/include/linux/marvell_phy.h
+++ b/include/linux/marvell_phy.h
@@ -27,6 +27,8 @@
27 */ 27 */
28#define MARVELL_PHY_ID_88E6390 0x01410f90 28#define MARVELL_PHY_ID_88E6390 0x01410f90
29 29
30#define MARVELL_PHY_FAMILY_ID(id) ((id) >> 4)
31
30/* struct phy_device dev_flags definitions */ 32/* struct phy_device dev_flags definitions */
31#define MARVELL_PHY_M1145_FLAGS_RESISTANCE 0x00000001 33#define MARVELL_PHY_M1145_FLAGS_RESISTANCE 0x00000001
32#define MARVELL_PHY_M1118_DNS323_LEDS 0x00000002 34#define MARVELL_PHY_M1118_DNS323_LEDS 0x00000002
diff --git a/include/linux/memory.h b/include/linux/memory.h
index 31ca3e28b0eb..a6ddefc60517 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -38,6 +38,7 @@ struct memory_block {
38 38
39int arch_get_memory_phys_device(unsigned long start_pfn); 39int arch_get_memory_phys_device(unsigned long start_pfn);
40unsigned long memory_block_size_bytes(void); 40unsigned long memory_block_size_bytes(void);
41int set_memory_block_size_order(unsigned int order);
41 42
42/* These states are exposed to userspace as text strings in sysfs */ 43/* These states are exposed to userspace as text strings in sysfs */
43#define MEM_ONLINE (1<<0) /* exposed to userspace */ 44#define MEM_ONLINE (1<<0) /* exposed to userspace */
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index 96498ff6beb6..3723f6d4e2b7 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -363,6 +363,7 @@ struct mlx5_frag_buf_ctrl {
363 struct mlx5_frag_buf frag_buf; 363 struct mlx5_frag_buf frag_buf;
364 u32 sz_m1; 364 u32 sz_m1;
365 u32 frag_sz_m1; 365 u32 frag_sz_m1;
366 u32 strides_offset;
366 u8 log_sz; 367 u8 log_sz;
367 u8 log_stride; 368 u8 log_stride;
368 u8 log_frag_strides; 369 u8 log_frag_strides;
@@ -988,14 +989,22 @@ static inline u32 mlx5_base_mkey(const u32 key)
988 return key & 0xffffff00u; 989 return key & 0xffffff00u;
989} 990}
990 991
991static inline void mlx5_fill_fbc(u8 log_stride, u8 log_sz, 992static inline void mlx5_fill_fbc_offset(u8 log_stride, u8 log_sz,
992 struct mlx5_frag_buf_ctrl *fbc) 993 u32 strides_offset,
994 struct mlx5_frag_buf_ctrl *fbc)
993{ 995{
994 fbc->log_stride = log_stride; 996 fbc->log_stride = log_stride;
995 fbc->log_sz = log_sz; 997 fbc->log_sz = log_sz;
996 fbc->sz_m1 = (1 << fbc->log_sz) - 1; 998 fbc->sz_m1 = (1 << fbc->log_sz) - 1;
997 fbc->log_frag_strides = PAGE_SHIFT - fbc->log_stride; 999 fbc->log_frag_strides = PAGE_SHIFT - fbc->log_stride;
998 fbc->frag_sz_m1 = (1 << fbc->log_frag_strides) - 1; 1000 fbc->frag_sz_m1 = (1 << fbc->log_frag_strides) - 1;
1001 fbc->strides_offset = strides_offset;
1002}
1003
1004static inline void mlx5_fill_fbc(u8 log_stride, u8 log_sz,
1005 struct mlx5_frag_buf_ctrl *fbc)
1006{
1007 mlx5_fill_fbc_offset(log_stride, log_sz, 0, fbc);
999} 1008}
1000 1009
1001static inline void mlx5_core_init_cq_frag_buf(struct mlx5_frag_buf_ctrl *fbc, 1010static inline void mlx5_core_init_cq_frag_buf(struct mlx5_frag_buf_ctrl *fbc,
@@ -1009,7 +1018,10 @@ static inline void mlx5_core_init_cq_frag_buf(struct mlx5_frag_buf_ctrl *fbc,
1009static inline void *mlx5_frag_buf_get_wqe(struct mlx5_frag_buf_ctrl *fbc, 1018static inline void *mlx5_frag_buf_get_wqe(struct mlx5_frag_buf_ctrl *fbc,
1010 u32 ix) 1019 u32 ix)
1011{ 1020{
1012 unsigned int frag = (ix >> fbc->log_frag_strides); 1021 unsigned int frag;
1022
1023 ix += fbc->strides_offset;
1024 frag = ix >> fbc->log_frag_strides;
1013 1025
1014 return fbc->frag_buf.frags[frag].buf + 1026 return fbc->frag_buf.frags[frag].buf +
1015 ((fbc->frag_sz_m1 & ix) << fbc->log_stride); 1027 ((fbc->frag_sz_m1 & ix) << fbc->log_stride);
diff --git a/include/linux/mlx5/eswitch.h b/include/linux/mlx5/eswitch.h
index d3c9db492b30..fab5121ffb8f 100644
--- a/include/linux/mlx5/eswitch.h
+++ b/include/linux/mlx5/eswitch.h
@@ -8,6 +8,8 @@
8 8
9#include <linux/mlx5/driver.h> 9#include <linux/mlx5/driver.h>
10 10
11#define MLX5_ESWITCH_MANAGER(mdev) MLX5_CAP_GEN(mdev, eswitch_manager)
12
11enum { 13enum {
12 SRIOV_NONE, 14 SRIOV_NONE,
13 SRIOV_LEGACY, 15 SRIOV_LEGACY,
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index 5e04e2053fd7..c2a5b480b156 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -942,7 +942,7 @@ struct mlx5_ifc_cmd_hca_cap_bits {
942 u8 vnic_env_queue_counters[0x1]; 942 u8 vnic_env_queue_counters[0x1];
943 u8 ets[0x1]; 943 u8 ets[0x1];
944 u8 nic_flow_table[0x1]; 944 u8 nic_flow_table[0x1];
945 u8 eswitch_flow_table[0x1]; 945 u8 eswitch_manager[0x1];
946 u8 device_memory[0x1]; 946 u8 device_memory[0x1];
947 u8 mcam_reg[0x1]; 947 u8 mcam_reg[0x1];
948 u8 pcam_reg[0x1]; 948 u8 pcam_reg[0x1];
diff --git a/include/linux/mm.h b/include/linux/mm.h
index a0fbb9ffe380..68a5121694ef 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -155,7 +155,9 @@ extern int overcommit_kbytes_handler(struct ctl_table *, int, void __user *,
155 * mmap() functions). 155 * mmap() functions).
156 */ 156 */
157 157
158extern struct kmem_cache *vm_area_cachep; 158struct vm_area_struct *vm_area_alloc(struct mm_struct *);
159struct vm_area_struct *vm_area_dup(struct vm_area_struct *);
160void vm_area_free(struct vm_area_struct *);
159 161
160#ifndef CONFIG_MMU 162#ifndef CONFIG_MMU
161extern struct rb_root nommu_region_tree; 163extern struct rb_root nommu_region_tree;
@@ -450,6 +452,23 @@ struct vm_operations_struct {
450 unsigned long addr); 452 unsigned long addr);
451}; 453};
452 454
455static inline void vma_init(struct vm_area_struct *vma, struct mm_struct *mm)
456{
457 static const struct vm_operations_struct dummy_vm_ops = {};
458
459 vma->vm_mm = mm;
460 vma->vm_ops = &dummy_vm_ops;
461 INIT_LIST_HEAD(&vma->anon_vma_chain);
462}
463
464static inline void vma_set_anonymous(struct vm_area_struct *vma)
465{
466 vma->vm_ops = NULL;
467}
468
469/* flush_tlb_range() takes a vma, not a mm, and can care about flags */
470#define TLB_FLUSH_VMA(mm,flags) { .vm_mm = (mm), .vm_flags = (flags) }
471
453struct mmu_gather; 472struct mmu_gather;
454struct inode; 473struct inode;
455 474
@@ -2132,7 +2151,7 @@ extern int __meminit __early_pfn_to_nid(unsigned long pfn,
2132 struct mminit_pfnnid_cache *state); 2151 struct mminit_pfnnid_cache *state);
2133#endif 2152#endif
2134 2153
2135#ifdef CONFIG_HAVE_MEMBLOCK 2154#if defined(CONFIG_HAVE_MEMBLOCK) && !defined(CONFIG_FLAT_NODE_MEM_MAP)
2136void zero_resv_unavail(void); 2155void zero_resv_unavail(void);
2137#else 2156#else
2138static inline void zero_resv_unavail(void) {} 2157static inline void zero_resv_unavail(void) {}
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 2014bd19f28e..96a71a648eed 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -501,6 +501,7 @@ enum dmi_field {
501 DMI_PRODUCT_VERSION, 501 DMI_PRODUCT_VERSION,
502 DMI_PRODUCT_SERIAL, 502 DMI_PRODUCT_SERIAL,
503 DMI_PRODUCT_UUID, 503 DMI_PRODUCT_UUID,
504 DMI_PRODUCT_SKU,
504 DMI_PRODUCT_FAMILY, 505 DMI_PRODUCT_FAMILY,
505 DMI_BOARD_VENDOR, 506 DMI_BOARD_VENDOR,
506 DMI_BOARD_NAME, 507 DMI_BOARD_NAME,
diff --git a/include/linux/net.h b/include/linux/net.h
index 08b6eb964dd6..6554d3ba4396 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -147,7 +147,6 @@ struct proto_ops {
147 int (*getname) (struct socket *sock, 147 int (*getname) (struct socket *sock,
148 struct sockaddr *addr, 148 struct sockaddr *addr,
149 int peer); 149 int peer);
150 __poll_t (*poll_mask) (struct socket *sock, __poll_t events);
151 __poll_t (*poll) (struct file *file, struct socket *sock, 150 __poll_t (*poll) (struct file *file, struct socket *sock,
152 struct poll_table_struct *wait); 151 struct poll_table_struct *wait);
153 int (*ioctl) (struct socket *sock, unsigned int cmd, 152 int (*ioctl) (struct socket *sock, unsigned int cmd,
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 3ec9850c7936..3d0cc0b5cec2 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2789,11 +2789,31 @@ static inline void skb_gro_flush_final(struct sk_buff *skb, struct sk_buff **pp,
2789 if (PTR_ERR(pp) != -EINPROGRESS) 2789 if (PTR_ERR(pp) != -EINPROGRESS)
2790 NAPI_GRO_CB(skb)->flush |= flush; 2790 NAPI_GRO_CB(skb)->flush |= flush;
2791} 2791}
2792static inline void skb_gro_flush_final_remcsum(struct sk_buff *skb,
2793 struct sk_buff **pp,
2794 int flush,
2795 struct gro_remcsum *grc)
2796{
2797 if (PTR_ERR(pp) != -EINPROGRESS) {
2798 NAPI_GRO_CB(skb)->flush |= flush;
2799 skb_gro_remcsum_cleanup(skb, grc);
2800 skb->remcsum_offload = 0;
2801 }
2802}
2792#else 2803#else
2793static inline void skb_gro_flush_final(struct sk_buff *skb, struct sk_buff **pp, int flush) 2804static inline void skb_gro_flush_final(struct sk_buff *skb, struct sk_buff **pp, int flush)
2794{ 2805{
2795 NAPI_GRO_CB(skb)->flush |= flush; 2806 NAPI_GRO_CB(skb)->flush |= flush;
2796} 2807}
2808static inline void skb_gro_flush_final_remcsum(struct sk_buff *skb,
2809 struct sk_buff **pp,
2810 int flush,
2811 struct gro_remcsum *grc)
2812{
2813 NAPI_GRO_CB(skb)->flush |= flush;
2814 skb_gro_remcsum_cleanup(skb, grc);
2815 skb->remcsum_offload = 0;
2816}
2797#endif 2817#endif
2798 2818
2799static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, 2819static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev,
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 9dee3c23895d..712eed156d09 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1438,6 +1438,8 @@ enum {
1438 NFS_IOHDR_EOF, 1438 NFS_IOHDR_EOF,
1439 NFS_IOHDR_REDO, 1439 NFS_IOHDR_REDO,
1440 NFS_IOHDR_STAT, 1440 NFS_IOHDR_STAT,
1441 NFS_IOHDR_RESEND_PNFS,
1442 NFS_IOHDR_RESEND_MDS,
1441}; 1443};
1442 1444
1443struct nfs_io_completion; 1445struct nfs_io_completion;
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 340029b2fb38..c133ccfa002e 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -368,7 +368,6 @@ struct pci_dev {
368 unsigned int transparent:1; /* Subtractive decode bridge */ 368 unsigned int transparent:1; /* Subtractive decode bridge */
369 unsigned int multifunction:1; /* Multi-function device */ 369 unsigned int multifunction:1; /* Multi-function device */
370 370
371 unsigned int is_added:1;
372 unsigned int is_busmaster:1; /* Is busmaster */ 371 unsigned int is_busmaster:1; /* Is busmaster */
373 unsigned int no_msi:1; /* May not use MSI */ 372 unsigned int no_msi:1; /* May not use MSI */
374 unsigned int no_64bit_msi:1; /* May only use 32-bit MSIs */ 373 unsigned int no_64bit_msi:1; /* May only use 32-bit MSIs */
@@ -1240,6 +1239,8 @@ int pci_register_io_range(struct fwnode_handle *fwnode, phys_addr_t addr,
1240unsigned long pci_address_to_pio(phys_addr_t addr); 1239unsigned long pci_address_to_pio(phys_addr_t addr);
1241phys_addr_t pci_pio_to_address(unsigned long pio); 1240phys_addr_t pci_pio_to_address(unsigned long pio);
1242int pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr); 1241int pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr);
1242int devm_pci_remap_iospace(struct device *dev, const struct resource *res,
1243 phys_addr_t phys_addr);
1243void pci_unmap_iospace(struct resource *res); 1244void pci_unmap_iospace(struct resource *res);
1244void __iomem *devm_pci_remap_cfgspace(struct device *dev, 1245void __iomem *devm_pci_remap_cfgspace(struct device *dev,
1245 resource_size_t offset, 1246 resource_size_t offset,
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 1fa12887ec02..87f6db437e4a 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -1130,6 +1130,7 @@ extern void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct
1130extern struct perf_callchain_entry * 1130extern struct perf_callchain_entry *
1131get_perf_callchain(struct pt_regs *regs, u32 init_nr, bool kernel, bool user, 1131get_perf_callchain(struct pt_regs *regs, u32 init_nr, bool kernel, bool user,
1132 u32 max_stack, bool crosstask, bool add_mark); 1132 u32 max_stack, bool crosstask, bool add_mark);
1133extern struct perf_callchain_entry *perf_callchain(struct perf_event *event, struct pt_regs *regs);
1133extern int get_callchain_buffers(int max_stack); 1134extern int get_callchain_buffers(int max_stack);
1134extern void put_callchain_buffers(void); 1135extern void put_callchain_buffers(void);
1135 1136
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 9206a4fef9ac..cb8d84090cfb 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -234,7 +234,7 @@ struct generic_pm_domain *of_genpd_remove_last(struct device_node *np);
234int of_genpd_parse_idle_states(struct device_node *dn, 234int of_genpd_parse_idle_states(struct device_node *dn,
235 struct genpd_power_state **states, int *n); 235 struct genpd_power_state **states, int *n);
236unsigned int of_genpd_opp_to_performance_state(struct device *dev, 236unsigned int of_genpd_opp_to_performance_state(struct device *dev,
237 struct device_node *opp_node); 237 struct device_node *np);
238 238
239int genpd_dev_pm_attach(struct device *dev); 239int genpd_dev_pm_attach(struct device *dev);
240struct device *genpd_dev_pm_attach_by_id(struct device *dev, 240struct device *genpd_dev_pm_attach_by_id(struct device *dev,
@@ -274,9 +274,9 @@ static inline int of_genpd_parse_idle_states(struct device_node *dn,
274 274
275static inline unsigned int 275static inline unsigned int
276of_genpd_opp_to_performance_state(struct device *dev, 276of_genpd_opp_to_performance_state(struct device *dev,
277 struct device_node *opp_node) 277 struct device_node *np)
278{ 278{
279 return -ENODEV; 279 return 0;
280} 280}
281 281
282static inline int genpd_dev_pm_attach(struct device *dev) 282static inline int genpd_dev_pm_attach(struct device *dev)
diff --git a/include/linux/poll.h b/include/linux/poll.h
index fdf86b4cbc71..7e0fdcf905d2 100644
--- a/include/linux/poll.h
+++ b/include/linux/poll.h
@@ -74,18 +74,18 @@ static inline void init_poll_funcptr(poll_table *pt, poll_queue_proc qproc)
74 pt->_key = ~(__poll_t)0; /* all events enabled */ 74 pt->_key = ~(__poll_t)0; /* all events enabled */
75} 75}
76 76
77static inline bool file_has_poll_mask(struct file *file) 77static inline bool file_can_poll(struct file *file)
78{ 78{
79 return file->f_op->get_poll_head && file->f_op->poll_mask; 79 return file->f_op->poll;
80} 80}
81 81
82static inline bool file_can_poll(struct file *file) 82static inline __poll_t vfs_poll(struct file *file, struct poll_table_struct *pt)
83{ 83{
84 return file->f_op->poll || file_has_poll_mask(file); 84 if (unlikely(!file->f_op->poll))
85 return DEFAULT_POLLMASK;
86 return file->f_op->poll(file, pt);
85} 87}
86 88
87__poll_t vfs_poll(struct file *file, struct poll_table_struct *pt);
88
89struct poll_table_entry { 89struct poll_table_entry {
90 struct file *filp; 90 struct file *filp;
91 __poll_t key; 91 __poll_t key;
diff --git a/include/linux/refcount.h b/include/linux/refcount.h
index 4193c41e383a..a685da2c4522 100644
--- a/include/linux/refcount.h
+++ b/include/linux/refcount.h
@@ -98,5 +98,7 @@ extern __must_check bool refcount_dec_if_one(refcount_t *r);
98extern __must_check bool refcount_dec_not_one(refcount_t *r); 98extern __must_check bool refcount_dec_not_one(refcount_t *r);
99extern __must_check bool refcount_dec_and_mutex_lock(refcount_t *r, struct mutex *lock); 99extern __must_check bool refcount_dec_and_mutex_lock(refcount_t *r, struct mutex *lock);
100extern __must_check bool refcount_dec_and_lock(refcount_t *r, spinlock_t *lock); 100extern __must_check bool refcount_dec_and_lock(refcount_t *r, spinlock_t *lock);
101 101extern __must_check bool refcount_dec_and_lock_irqsave(refcount_t *r,
102 spinlock_t *lock,
103 unsigned long *flags);
102#endif /* _LINUX_REFCOUNT_H */ 104#endif /* _LINUX_REFCOUNT_H */
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h
index b72ebdff0b77..003d09ab308d 100644
--- a/include/linux/ring_buffer.h
+++ b/include/linux/ring_buffer.h
@@ -165,6 +165,7 @@ void ring_buffer_record_enable(struct ring_buffer *buffer);
165void ring_buffer_record_off(struct ring_buffer *buffer); 165void ring_buffer_record_off(struct ring_buffer *buffer);
166void ring_buffer_record_on(struct ring_buffer *buffer); 166void ring_buffer_record_on(struct ring_buffer *buffer);
167int ring_buffer_record_is_on(struct ring_buffer *buffer); 167int ring_buffer_record_is_on(struct ring_buffer *buffer);
168int ring_buffer_record_is_set_on(struct ring_buffer *buffer);
168void ring_buffer_record_disable_cpu(struct ring_buffer *buffer, int cpu); 169void ring_buffer_record_disable_cpu(struct ring_buffer *buffer, int cpu);
169void ring_buffer_record_enable_cpu(struct ring_buffer *buffer, int cpu); 170void ring_buffer_record_enable_cpu(struct ring_buffer *buffer, int cpu);
170 171
diff --git a/include/linux/rmi.h b/include/linux/rmi.h
index 64125443f8a6..5ef5c7c412a7 100644
--- a/include/linux/rmi.h
+++ b/include/linux/rmi.h
@@ -354,6 +354,8 @@ struct rmi_driver_data {
354 struct mutex irq_mutex; 354 struct mutex irq_mutex;
355 struct input_dev *input; 355 struct input_dev *input;
356 356
357 struct irq_domain *irqdomain;
358
357 u8 pdt_props; 359 u8 pdt_props;
358 360
359 u8 num_rx_electrodes; 361 u8 num_rx_electrodes;
diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h
index 1b92a28dd672..6fd615a0eea9 100644
--- a/include/linux/rtmutex.h
+++ b/include/linux/rtmutex.h
@@ -106,7 +106,14 @@ static inline int rt_mutex_is_locked(struct rt_mutex *lock)
106extern void __rt_mutex_init(struct rt_mutex *lock, const char *name, struct lock_class_key *key); 106extern void __rt_mutex_init(struct rt_mutex *lock, const char *name, struct lock_class_key *key);
107extern void rt_mutex_destroy(struct rt_mutex *lock); 107extern void rt_mutex_destroy(struct rt_mutex *lock);
108 108
109#ifdef CONFIG_DEBUG_LOCK_ALLOC
110extern void rt_mutex_lock_nested(struct rt_mutex *lock, unsigned int subclass);
111#define rt_mutex_lock(lock) rt_mutex_lock_nested(lock, 0)
112#else
109extern void rt_mutex_lock(struct rt_mutex *lock); 113extern void rt_mutex_lock(struct rt_mutex *lock);
114#define rt_mutex_lock_nested(lock, subclass) rt_mutex_lock(lock)
115#endif
116
110extern int rt_mutex_lock_interruptible(struct rt_mutex *lock); 117extern int rt_mutex_lock_interruptible(struct rt_mutex *lock);
111extern int rt_mutex_timed_lock(struct rt_mutex *lock, 118extern int rt_mutex_timed_lock(struct rt_mutex *lock,
112 struct hrtimer_sleeper *timeout); 119 struct hrtimer_sleeper *timeout);
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 51f52020ad5f..093aa57120b0 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -9,9 +9,6 @@
9#include <asm/io.h> 9#include <asm/io.h>
10 10
11struct scatterlist { 11struct scatterlist {
12#ifdef CONFIG_DEBUG_SG
13 unsigned long sg_magic;
14#endif
15 unsigned long page_link; 12 unsigned long page_link;
16 unsigned int offset; 13 unsigned int offset;
17 unsigned int length; 14 unsigned int length;
@@ -64,7 +61,6 @@ struct sg_table {
64 * 61 *
65 */ 62 */
66 63
67#define SG_MAGIC 0x87654321
68#define SG_CHAIN 0x01UL 64#define SG_CHAIN 0x01UL
69#define SG_END 0x02UL 65#define SG_END 0x02UL
70 66
@@ -98,7 +94,6 @@ static inline void sg_assign_page(struct scatterlist *sg, struct page *page)
98 */ 94 */
99 BUG_ON((unsigned long) page & (SG_CHAIN | SG_END)); 95 BUG_ON((unsigned long) page & (SG_CHAIN | SG_END));
100#ifdef CONFIG_DEBUG_SG 96#ifdef CONFIG_DEBUG_SG
101 BUG_ON(sg->sg_magic != SG_MAGIC);
102 BUG_ON(sg_is_chain(sg)); 97 BUG_ON(sg_is_chain(sg));
103#endif 98#endif
104 sg->page_link = page_link | (unsigned long) page; 99 sg->page_link = page_link | (unsigned long) page;
@@ -129,7 +124,6 @@ static inline void sg_set_page(struct scatterlist *sg, struct page *page,
129static inline struct page *sg_page(struct scatterlist *sg) 124static inline struct page *sg_page(struct scatterlist *sg)
130{ 125{
131#ifdef CONFIG_DEBUG_SG 126#ifdef CONFIG_DEBUG_SG
132 BUG_ON(sg->sg_magic != SG_MAGIC);
133 BUG_ON(sg_is_chain(sg)); 127 BUG_ON(sg_is_chain(sg));
134#endif 128#endif
135 return (struct page *)((sg)->page_link & ~(SG_CHAIN | SG_END)); 129 return (struct page *)((sg)->page_link & ~(SG_CHAIN | SG_END));
@@ -195,9 +189,6 @@ static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents,
195 **/ 189 **/
196static inline void sg_mark_end(struct scatterlist *sg) 190static inline void sg_mark_end(struct scatterlist *sg)
197{ 191{
198#ifdef CONFIG_DEBUG_SG
199 BUG_ON(sg->sg_magic != SG_MAGIC);
200#endif
201 /* 192 /*
202 * Set termination bit, clear potential chain bit 193 * Set termination bit, clear potential chain bit
203 */ 194 */
@@ -215,9 +206,6 @@ static inline void sg_mark_end(struct scatterlist *sg)
215 **/ 206 **/
216static inline void sg_unmark_end(struct scatterlist *sg) 207static inline void sg_unmark_end(struct scatterlist *sg)
217{ 208{
218#ifdef CONFIG_DEBUG_SG
219 BUG_ON(sg->sg_magic != SG_MAGIC);
220#endif
221 sg->page_link &= ~SG_END; 209 sg->page_link &= ~SG_END;
222} 210}
223 211
@@ -260,12 +248,6 @@ static inline void *sg_virt(struct scatterlist *sg)
260static inline void sg_init_marker(struct scatterlist *sgl, 248static inline void sg_init_marker(struct scatterlist *sgl,
261 unsigned int nents) 249 unsigned int nents)
262{ 250{
263#ifdef CONFIG_DEBUG_SG
264 unsigned int i;
265
266 for (i = 0; i < nents; i++)
267 sgl[i].sg_magic = SG_MAGIC;
268#endif
269 sg_mark_end(&sgl[nents - 1]); 251 sg_mark_end(&sgl[nents - 1]);
270} 252}
271 253
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 87bf02d93a27..43731fe51c97 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -118,7 +118,7 @@ struct task_group;
118 * the comment with set_special_state(). 118 * the comment with set_special_state().
119 */ 119 */
120#define is_special_task_state(state) \ 120#define is_special_task_state(state) \
121 ((state) & (__TASK_STOPPED | __TASK_TRACED | TASK_DEAD)) 121 ((state) & (__TASK_STOPPED | __TASK_TRACED | TASK_PARKED | TASK_DEAD))
122 122
123#define __set_current_state(state_value) \ 123#define __set_current_state(state_value) \
124 do { \ 124 do { \
@@ -1799,20 +1799,22 @@ static inline void rseq_set_notify_resume(struct task_struct *t)
1799 set_tsk_thread_flag(t, TIF_NOTIFY_RESUME); 1799 set_tsk_thread_flag(t, TIF_NOTIFY_RESUME);
1800} 1800}
1801 1801
1802void __rseq_handle_notify_resume(struct pt_regs *regs); 1802void __rseq_handle_notify_resume(struct ksignal *sig, struct pt_regs *regs);
1803 1803
1804static inline void rseq_handle_notify_resume(struct pt_regs *regs) 1804static inline void rseq_handle_notify_resume(struct ksignal *ksig,
1805 struct pt_regs *regs)
1805{ 1806{
1806 if (current->rseq) 1807 if (current->rseq)
1807 __rseq_handle_notify_resume(regs); 1808 __rseq_handle_notify_resume(ksig, regs);
1808} 1809}
1809 1810
1810static inline void rseq_signal_deliver(struct pt_regs *regs) 1811static inline void rseq_signal_deliver(struct ksignal *ksig,
1812 struct pt_regs *regs)
1811{ 1813{
1812 preempt_disable(); 1814 preempt_disable();
1813 __set_bit(RSEQ_EVENT_SIGNAL_BIT, &current->rseq_event_mask); 1815 __set_bit(RSEQ_EVENT_SIGNAL_BIT, &current->rseq_event_mask);
1814 preempt_enable(); 1816 preempt_enable();
1815 rseq_handle_notify_resume(regs); 1817 rseq_handle_notify_resume(ksig, regs);
1816} 1818}
1817 1819
1818/* rseq_preempt() requires preemption to be disabled. */ 1820/* rseq_preempt() requires preemption to be disabled. */
@@ -1831,9 +1833,7 @@ static inline void rseq_migrate(struct task_struct *t)
1831 1833
1832/* 1834/*
1833 * If parent process has a registered restartable sequences area, the 1835 * If parent process has a registered restartable sequences area, the
1834 * child inherits. Only applies when forking a process, not a thread. In 1836 * child inherits. Only applies when forking a process, not a thread.
1835 * case a parent fork() in the middle of a restartable sequence, set the
1836 * resume notifier to force the child to retry.
1837 */ 1837 */
1838static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags) 1838static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags)
1839{ 1839{
@@ -1847,7 +1847,6 @@ static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags)
1847 t->rseq_len = current->rseq_len; 1847 t->rseq_len = current->rseq_len;
1848 t->rseq_sig = current->rseq_sig; 1848 t->rseq_sig = current->rseq_sig;
1849 t->rseq_event_mask = current->rseq_event_mask; 1849 t->rseq_event_mask = current->rseq_event_mask;
1850 rseq_preempt(t);
1851 } 1850 }
1852} 1851}
1853 1852
@@ -1864,10 +1863,12 @@ static inline void rseq_execve(struct task_struct *t)
1864static inline void rseq_set_notify_resume(struct task_struct *t) 1863static inline void rseq_set_notify_resume(struct task_struct *t)
1865{ 1864{
1866} 1865}
1867static inline void rseq_handle_notify_resume(struct pt_regs *regs) 1866static inline void rseq_handle_notify_resume(struct ksignal *ksig,
1867 struct pt_regs *regs)
1868{ 1868{
1869} 1869}
1870static inline void rseq_signal_deliver(struct pt_regs *regs) 1870static inline void rseq_signal_deliver(struct ksignal *ksig,
1871 struct pt_regs *regs)
1871{ 1872{
1872} 1873}
1873static inline void rseq_preempt(struct task_struct *t) 1874static inline void rseq_preempt(struct task_struct *t)
diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h
index 5be31eb7b266..108ede99e533 100644
--- a/include/linux/sched/task.h
+++ b/include/linux/sched/task.h
@@ -75,7 +75,7 @@ extern long _do_fork(unsigned long, unsigned long, unsigned long, int __user *,
75extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *); 75extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *);
76struct task_struct *fork_idle(int); 76struct task_struct *fork_idle(int);
77extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); 77extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
78extern long kernel_wait4(pid_t, int *, int, struct rusage *); 78extern long kernel_wait4(pid_t, int __user *, int, struct rusage *);
79 79
80extern void free_task(struct task_struct *tsk); 80extern void free_task(struct task_struct *tsk);
81 81
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index c86885954994..610a201126ee 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -630,6 +630,7 @@ typedef unsigned char *sk_buff_data_t;
630 * @hash: the packet hash 630 * @hash: the packet hash
631 * @queue_mapping: Queue mapping for multiqueue devices 631 * @queue_mapping: Queue mapping for multiqueue devices
632 * @xmit_more: More SKBs are pending for this queue 632 * @xmit_more: More SKBs are pending for this queue
633 * @pfmemalloc: skbuff was allocated from PFMEMALLOC reserves
633 * @ndisc_nodetype: router type (from link layer) 634 * @ndisc_nodetype: router type (from link layer)
634 * @ooo_okay: allow the mapping of a socket to a queue to be changed 635 * @ooo_okay: allow the mapping of a socket to a queue to be changed
635 * @l4_hash: indicate hash is a canonical 4-tuple hash over transport 636 * @l4_hash: indicate hash is a canonical 4-tuple hash over transport
@@ -735,7 +736,7 @@ struct sk_buff {
735 peeked:1, 736 peeked:1,
736 head_frag:1, 737 head_frag:1,
737 xmit_more:1, 738 xmit_more:1,
738 __unused:1; /* one bit hole */ 739 pfmemalloc:1;
739 740
740 /* fields enclosed in headers_start/headers_end are copied 741 /* fields enclosed in headers_start/headers_end are copied
741 * using a single memcpy() in __copy_skb_header() 742 * using a single memcpy() in __copy_skb_header()
@@ -754,31 +755,30 @@ struct sk_buff {
754 755
755 __u8 __pkt_type_offset[0]; 756 __u8 __pkt_type_offset[0];
756 __u8 pkt_type:3; 757 __u8 pkt_type:3;
757 __u8 pfmemalloc:1;
758 __u8 ignore_df:1; 758 __u8 ignore_df:1;
759
760 __u8 nf_trace:1; 759 __u8 nf_trace:1;
761 __u8 ip_summed:2; 760 __u8 ip_summed:2;
762 __u8 ooo_okay:1; 761 __u8 ooo_okay:1;
762
763 __u8 l4_hash:1; 763 __u8 l4_hash:1;
764 __u8 sw_hash:1; 764 __u8 sw_hash:1;
765 __u8 wifi_acked_valid:1; 765 __u8 wifi_acked_valid:1;
766 __u8 wifi_acked:1; 766 __u8 wifi_acked:1;
767
768 __u8 no_fcs:1; 767 __u8 no_fcs:1;
769 /* Indicates the inner headers are valid in the skbuff. */ 768 /* Indicates the inner headers are valid in the skbuff. */
770 __u8 encapsulation:1; 769 __u8 encapsulation:1;
771 __u8 encap_hdr_csum:1; 770 __u8 encap_hdr_csum:1;
772 __u8 csum_valid:1; 771 __u8 csum_valid:1;
772
773 __u8 csum_complete_sw:1; 773 __u8 csum_complete_sw:1;
774 __u8 csum_level:2; 774 __u8 csum_level:2;
775 __u8 csum_not_inet:1; 775 __u8 csum_not_inet:1;
776
777 __u8 dst_pending_confirm:1; 776 __u8 dst_pending_confirm:1;
778#ifdef CONFIG_IPV6_NDISC_NODETYPE 777#ifdef CONFIG_IPV6_NDISC_NODETYPE
779 __u8 ndisc_nodetype:2; 778 __u8 ndisc_nodetype:2;
780#endif 779#endif
781 __u8 ipvs_property:1; 780 __u8 ipvs_property:1;
781
782 __u8 inner_protocol_type:1; 782 __u8 inner_protocol_type:1;
783 __u8 remcsum_offload:1; 783 __u8 remcsum_offload:1;
784#ifdef CONFIG_NET_SWITCHDEV 784#ifdef CONFIG_NET_SWITCHDEV
@@ -3252,7 +3252,8 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags,
3252 int *peeked, int *off, int *err); 3252 int *peeked, int *off, int *err);
3253struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock, 3253struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock,
3254 int *err); 3254 int *err);
3255__poll_t datagram_poll_mask(struct socket *sock, __poll_t events); 3255__poll_t datagram_poll(struct file *file, struct socket *sock,
3256 struct poll_table_struct *wait);
3256int skb_copy_datagram_iter(const struct sk_buff *from, int offset, 3257int skb_copy_datagram_iter(const struct sk_buff *from, int offset,
3257 struct iov_iter *to, int size); 3258 struct iov_iter *to, int size);
3258static inline int skb_copy_datagram_msg(const struct sk_buff *from, int offset, 3259static inline int skb_copy_datagram_msg(const struct sk_buff *from, int offset,
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 09fa2c6f0e68..3a1a1dbc6f49 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -155,8 +155,12 @@ struct kmem_cache {
155 155
156#ifdef CONFIG_SYSFS 156#ifdef CONFIG_SYSFS
157#define SLAB_SUPPORTS_SYSFS 157#define SLAB_SUPPORTS_SYSFS
158void sysfs_slab_unlink(struct kmem_cache *);
158void sysfs_slab_release(struct kmem_cache *); 159void sysfs_slab_release(struct kmem_cache *);
159#else 160#else
161static inline void sysfs_slab_unlink(struct kmem_cache *s)
162{
163}
160static inline void sysfs_slab_release(struct kmem_cache *s) 164static inline void sysfs_slab_release(struct kmem_cache *s)
161{ 165{
162} 166}
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 1e8a46435838..fd57888d4942 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -427,6 +427,11 @@ extern int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock);
427#define atomic_dec_and_lock(atomic, lock) \ 427#define atomic_dec_and_lock(atomic, lock) \
428 __cond_lock(lock, _atomic_dec_and_lock(atomic, lock)) 428 __cond_lock(lock, _atomic_dec_and_lock(atomic, lock))
429 429
430extern int _atomic_dec_and_lock_irqsave(atomic_t *atomic, spinlock_t *lock,
431 unsigned long *flags);
432#define atomic_dec_and_lock_irqsave(atomic, lock, flags) \
433 __cond_lock(lock, _atomic_dec_and_lock_irqsave(atomic, lock, &(flags)))
434
430int alloc_bucket_spinlocks(spinlock_t **locks, unsigned int *lock_mask, 435int alloc_bucket_spinlocks(spinlock_t **locks, unsigned int *lock_mask,
431 size_t max_size, unsigned int cpu_mult, 436 size_t max_size, unsigned int cpu_mult,
432 gfp_t gfp); 437 gfp_t gfp);
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 73810808cdf2..5c1a0933768e 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -11,6 +11,7 @@
11#ifndef _LINUX_SYSCALLS_H 11#ifndef _LINUX_SYSCALLS_H
12#define _LINUX_SYSCALLS_H 12#define _LINUX_SYSCALLS_H
13 13
14struct __aio_sigset;
14struct epoll_event; 15struct epoll_event;
15struct iattr; 16struct iattr;
16struct inode; 17struct inode;
@@ -231,6 +232,9 @@ static inline int is_syscall_trace_event(struct trace_event_call *tp_event)
231 */ 232 */
232#ifndef __SYSCALL_DEFINEx 233#ifndef __SYSCALL_DEFINEx
233#define __SYSCALL_DEFINEx(x, name, ...) \ 234#define __SYSCALL_DEFINEx(x, name, ...) \
235 __diag_push(); \
236 __diag_ignore(GCC, 8, "-Wattribute-alias", \
237 "Type aliasing is used to sanitize syscall arguments");\
234 asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \ 238 asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \
235 __attribute__((alias(__stringify(__se_sys##name)))); \ 239 __attribute__((alias(__stringify(__se_sys##name)))); \
236 ALLOW_ERROR_INJECTION(sys##name, ERRNO); \ 240 ALLOW_ERROR_INJECTION(sys##name, ERRNO); \
@@ -243,6 +247,7 @@ static inline int is_syscall_trace_event(struct trace_event_call *tp_event)
243 __PROTECT(x, ret,__MAP(x,__SC_ARGS,__VA_ARGS__)); \ 247 __PROTECT(x, ret,__MAP(x,__SC_ARGS,__VA_ARGS__)); \
244 return ret; \ 248 return ret; \
245 } \ 249 } \
250 __diag_pop(); \
246 static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) 251 static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
247#endif /* __SYSCALL_DEFINEx */ 252#endif /* __SYSCALL_DEFINEx */
248 253
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h
index 6c5f2074e14f..6f8b68cd460f 100644
--- a/include/linux/uio_driver.h
+++ b/include/linux/uio_driver.h
@@ -75,7 +75,7 @@ struct uio_device {
75 struct fasync_struct *async_queue; 75 struct fasync_struct *async_queue;
76 wait_queue_head_t wait; 76 wait_queue_head_t wait;
77 struct uio_info *info; 77 struct uio_info *info;
78 spinlock_t info_lock; 78 struct mutex info_lock;
79 struct kobject *map_dir; 79 struct kobject *map_dir;
80 struct kobject *portio_dir; 80 struct kobject *portio_dir;
81}; 81};