History

Merge branches 'for-4.20/upstream-fixes', 'for-4.21/core', 'for-4.21/hid-asus', 'for-4.21/hid-core', 'for-4.21/hid-cougar', 'for-4.21/hidraw', 'for-4.21/highres-wheel' and 'for-4.21/ish' into for-linus

Jiri Kosina committed 7 years ago

Commit bd8879f8 parents f8f8074 8c32d47 0e1f37d 7f55927 aeed35f 31a8b3e 1676722 74fbc7d1847 files · +37230 −12355Browse files

Showing the changes to include/linux (63 of 1847 files). Show all

Unified · Split

63 files
  1. include/linux/adxl.h +5 −0
  2. include/linux/avf/virtchnl.h +9 −3
  3. include/linux/bio.h +9 −17
  4. include/linux/blk-cgroup.h +45 −100
  5. include/linux/blk_types.h +1 −0
  6. include/linux/bpf_verifier.h +3 −0
  7. include/linux/can/dev.h +1 −0
  8. include/linux/can/rx-offload.h +6 −1
  9. include/linux/ceph/ceph_features.h +1 −7
  10. include/linux/cgroup.h +0 −2
  11. include/linux/compat.h +2 −2
  12. include/linux/compiler-clang.h +0 −5
  13. include/linux/compiler-gcc.h +4 −77
  14. include/linux/compiler-intel.h +0 −9
  15. include/linux/compiler.h +14 −12
  16. include/linux/compiler_attributes.h +262 −0
  17. include/linux/compiler_types.h +17 −83
  18. include/linux/cpuhotplug.h +1 −0
  19. include/linux/dax.h +8 −6
  20. include/linux/dma-direct.h +1 −1
  21. include/linux/efi.h +7 −0
  22. include/linux/filter.h +11 −0
  23. include/linux/fs.h +38 −17
  24. include/linux/fscache-cache.h +1 −2
  25. include/linux/ftrace.h +2 −2
  26. include/linux/gfp.h +2 −2
  27. include/linux/hid-sensor-hub.h +3 −1
  28. include/linux/hid.h +16 −1
  29. include/linux/hyperv.h +7 −0
  30. include/linux/i8253.h +1 −0
  31. include/linux/inetdevice.h +3 −1
  32. include/linux/key-type.h +11 −0
  33. include/linux/keyctl.h +46 −0
  34. include/linux/mlx5/mlx5_ifc.h +8 −4
  35. include/linux/mm.h +8 −0
  36. include/linux/mtd/nand.h +3 −4
  37. include/linux/net_dim.h +2 −0
  38. include/linux/netdevice.h +20 −0
  39. include/linux/netfilter/ipset/ip_set.h +1 −1
  40. include/linux/netfilter/ipset/ip_set_comment.h +2 −2
  41. include/linux/netfilter/nf_conntrack_proto_gre.h +13 −0
  42. include/linux/nmi.h +2 −0
  43. include/linux/notifier.h +1 −2
  44. include/linux/platform_data/gpio-davinci.h +2 −0
  45. include/linux/psi.h +2 −1
  46. include/linux/pstore.h +4 −1
  47. include/linux/ptrace.h +0 −17
  48. include/linux/sched.h +15 −0
  49. include/linux/sched/smt.h +20 −0
  50. include/linux/sfp.h +1 −1
  51. include/linux/skbuff.h +17 −1
  52. include/linux/stackleak.h +35 −0
  53. include/linux/sunrpc/gss_krb5.h +2 −5
  54. include/linux/sunrpc/xdr.h +0 −1
  55. include/linux/tcp.h +1 −0
  56. include/linux/tracehook.h +2 −2
  57. include/linux/tracepoint.h +3 −3
  58. include/linux/tty.h +1 −0
  59. include/linux/uio.h +45 −20
  60. include/linux/usb.h +2 −2
  61. include/linux/usb/quirks.h +3 −0
  62. include/linux/writeback.h +2 −3
  63. include/linux/xarray.h +203 −64
include/linux/adxl.h+5−0
@@ -7,7 +7,12 @@ · 6 unmodified lines
77 #ifndef _LINUX_ADXL_H
88 #define _LINUX_ADXL_H
99
10+#ifdef CONFIG_ACPI_ADXL
1011 const char * const *adxl_get_component_names(void);
1112 int adxl_decode(u64 addr, u64 component_values[]);
13+#else
14+static inline const char * const *adxl_get_component_names(void) { return NULL; }
15+static inline int adxl_decode(u64 addr, u64 component_values[]) { return -EOPNOTSUPP; }
16+#endif
1217
1318 #endif /* _LINUX_ADXL_H */
include/linux/avf/virtchnl.h+9−3
@@ -62,13 +62,19 @@ · 61 unmodified lines
6262 /* Error Codes */
6363 enum virtchnl_status_code {
6464 VIRTCHNL_STATUS_SUCCESS = 0,
65− VIRTCHNL_ERR_PARAM = -5,
65+ VIRTCHNL_STATUS_ERR_PARAM = -5,
66+ VIRTCHNL_STATUS_ERR_NO_MEMORY = -18,
6667 VIRTCHNL_STATUS_ERR_OPCODE_MISMATCH = -38,
6768 VIRTCHNL_STATUS_ERR_CQP_COMPL_ERROR = -39,
6869 VIRTCHNL_STATUS_ERR_INVALID_VF_ID = -40,
69− VIRTCHNL_STATUS_NOT_SUPPORTED = -64,
70+ VIRTCHNL_STATUS_ERR_ADMIN_QUEUE_ERROR = -53,
71+ VIRTCHNL_STATUS_ERR_NOT_SUPPORTED = -64,
7072 };
7173
74+/* Backward compatibility */
75+#define VIRTCHNL_ERR_PARAM VIRTCHNL_STATUS_ERR_PARAM
76+#define VIRTCHNL_STATUS_NOT_SUPPORTED VIRTCHNL_STATUS_ERR_NOT_SUPPORTED
77+
7278 #define VIRTCHNL_LINK_SPEED_100MB_SHIFT 0x1
7379 #define VIRTCHNL_LINK_SPEED_1000MB_SHIFT 0x2
7480 #define VIRTCHNL_LINK_SPEED_10GB_SHIFT 0x3
@@ -831,7 +837,7 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode, · 756 unmodified lines
831837 case VIRTCHNL_OP_EVENT:
832838 case VIRTCHNL_OP_UNKNOWN:
833839 default:
834− return VIRTCHNL_ERR_PARAM;
840+ return VIRTCHNL_STATUS_ERR_PARAM;
835841 }
836842 /* few more checks */
837843 if (err_msg_format || valid_len != msglen)
include/linux/bio.h+9−17
@@ -503,31 +503,23 @@ do { \ · 502 unmodified lines
503503 disk_devt((bio)->bi_disk)
504504
505505 #if defined(CONFIG_MEMCG) && defined(CONFIG_BLK_CGROUP)
506−int bio_associate_blkg_from_page(struct bio *bio, struct page *page);
506+int bio_associate_blkcg_from_page(struct bio *bio, struct page *page);
507507 #else
508−static inline int bio_associate_blkg_from_page(struct bio *bio,
509− struct page *page) { return 0; }
508+static inline int bio_associate_blkcg_from_page(struct bio *bio,
509+ struct page *page) { return 0; }
510510 #endif
511511
512512 #ifdef CONFIG_BLK_CGROUP
513+int bio_associate_blkcg(struct bio *bio, struct cgroup_subsys_state *blkcg_css);
513514 int bio_associate_blkg(struct bio *bio, struct blkcg_gq *blkg);
514−int bio_associate_blkg_from_css(struct bio *bio,
515− struct cgroup_subsys_state *css);
516−int bio_associate_create_blkg(struct request_queue *q, struct bio *bio);
517−int bio_reassociate_blkg(struct request_queue *q, struct bio *bio);
518515 void bio_disassociate_task(struct bio *bio);
519−void bio_clone_blkg_association(struct bio *dst, struct bio *src);
516+void bio_clone_blkcg_association(struct bio *dst, struct bio *src);
520517 #else /* CONFIG_BLK_CGROUP */
521−static inline int bio_associate_blkg_from_css(struct bio *bio,
522− struct cgroup_subsys_state *css)
523−{ return 0; }
524−static inline int bio_associate_create_blkg(struct request_queue *q,
525− struct bio *bio) { return 0; }
526−static inline int bio_reassociate_blkg(struct request_queue *q, struct bio *bio)
527−{ return 0; }
518+static inline int bio_associate_blkcg(struct bio *bio,
519+ struct cgroup_subsys_state *blkcg_css) { return 0; }
528520 static inline void bio_disassociate_task(struct bio *bio) { }
529−static inline void bio_clone_blkg_association(struct bio *dst,
530− struct bio *src) { }
521+static inline void bio_clone_blkcg_association(struct bio *dst,
522+ struct bio *src) { }
531523 #endif /* CONFIG_BLK_CGROUP */
532524
533525 #ifdef CONFIG_HIGHMEM
include/linux/blk-cgroup.h+45−100
@@ -126,7 +126,7 @@ struct blkcg_gq { · 125 unmodified lines
126126 struct request_list rl;
127127
128128 /* reference count */
129− struct percpu_ref refcnt;
129+ atomic_t refcnt;
130130
131131 /* is this blkg online? protected by both blkcg and q locks */
132132 bool online;
@@ -184,8 +184,6 @@ extern struct cgroup_subsys_state * const blkcg_root_css; · 51 unmodified lines
184184
185185 struct blkcg_gq *blkg_lookup_slowpath(struct blkcg *blkcg,
186186 struct request_queue *q, bool update_hint);
187−struct blkcg_gq *__blkg_lookup_create(struct blkcg *blkcg,
188− struct request_queue *q);
189187 struct blkcg_gq *blkg_lookup_create(struct blkcg *blkcg,
190188 struct request_queue *q);
191189 int blkcg_init_queue(struct request_queue *q);
@@ -232,59 +230,22 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol, · 40 unmodified lines
232230 char *input, struct blkg_conf_ctx *ctx);
233231 void blkg_conf_finish(struct blkg_conf_ctx *ctx);
234232
235−/**
236− * blkcg_css - find the current css
237− *
238− * Find the css associated with either the kthread or the current task.
239− * This may return a dying css, so it is up to the caller to use tryget logic
240− * to confirm it is alive and well.
241− */
242−static inline struct cgroup_subsys_state *blkcg_css(void)
243−{
244− struct cgroup_subsys_state *css;
245−
246− css = kthread_blkcg();
247− if (css)
248− return css;
249− return task_css(current, io_cgrp_id);
250−}
251233
252234 static inline struct blkcg *css_to_blkcg(struct cgroup_subsys_state *css)
253235 {
254236 return css ? container_of(css, struct blkcg, css) : NULL;
255237 }
256238
257−/**
258− * __bio_blkcg - internal version of bio_blkcg for bfq and cfq
259− *
260− * DO NOT USE.
261− * There is a flaw using this version of the function. In particular, this was
262− * used in a broken paradigm where association was called on the given css. It
263− * is possible though that the returned css from task_css() is in the process
264− * of dying due to migration of the current task. So it is improper to assume
265− * *_get() is going to succeed. Both BFQ and CFQ rely on this logic and will
266− * take additional work to handle more gracefully.
267− */
268−static inline struct blkcg *__bio_blkcg(struct bio *bio)
269−{
270− if (bio && bio->bi_blkg)
271− return bio->bi_blkg->blkcg;
272− return css_to_blkcg(blkcg_css());
273−}
274−
275−/**
276− * bio_blkcg - grab the blkcg associated with a bio
277− * @bio: target bio
278− *
279− * This returns the blkcg associated with a bio, NULL if not associated.
280− * Callers are expected to either handle NULL or know association has been
281− * done prior to calling this.
282− */
283239 static inline struct blkcg *bio_blkcg(struct bio *bio)
284240 {
285− if (bio && bio->bi_blkg)
286− return bio->bi_blkg->blkcg;
287− return NULL;
241+ struct cgroup_subsys_state *css;
242+
243+ if (bio && bio->bi_css)
244+ return css_to_blkcg(bio->bi_css);
245+ css = kthread_blkcg();
246+ if (css)
247+ return css_to_blkcg(css);
248+ return css_to_blkcg(task_css(current, io_cgrp_id));
288249 }
289250
290251 static inline bool blk_cgroup_congested(void)
@@ -490,35 +451,26 @@ static inline int blkg_path(struct blkcg_gq *blkg, char *buf, int buflen) · 199 unmodified lines
490451 */
491452 static inline void blkg_get(struct blkcg_gq *blkg)
492453 {
493− percpu_ref_get(&blkg->refcnt);
454+ WARN_ON_ONCE(atomic_read(&blkg->refcnt) <= 0);
455+ atomic_inc(&blkg->refcnt);
494456 }
495457
496458 /**
497− * blkg_tryget - try and get a blkg reference
459+ * blkg_try_get - try and get a blkg reference
498460 * @blkg: blkg to get
499461 *
500462 * This is for use when doing an RCU lookup of the blkg. We may be in the midst
501463 * of freeing this blkg, so we can only use it if the refcnt is not zero.
502464 */
503−static inline bool blkg_tryget(struct blkcg_gq *blkg)
465+static inline struct blkcg_gq *blkg_try_get(struct blkcg_gq *blkg)
504466 {
505− return percpu_ref_tryget(&blkg->refcnt);
467+ if (atomic_inc_not_zero(&blkg->refcnt))
468+ return blkg;
469+ return NULL;
506470 }
507471
508−/**
509− * blkg_tryget_closest - try and get a blkg ref on the closet blkg
510− * @blkg: blkg to get
511− *
512− * This walks up the blkg tree to find the closest non-dying blkg and returns
513− * the blkg that it did association with as it may not be the passed in blkg.
514− */
515−static inline struct blkcg_gq *blkg_tryget_closest(struct blkcg_gq *blkg)
516−{
517− while (!percpu_ref_tryget(&blkg->refcnt))
518− blkg = blkg->parent;
519472
520− return blkg;
521−}
473+void __blkg_release_rcu(struct rcu_head *rcu);
522474
523475 /**
524476 * blkg_put - put a blkg reference
@@ -526,7 +478,9 @@ static inline struct blkcg_gq *blkg_tryget_closest(struct blkcg_gq *blkg) · 1 unmodified line
526478 */
527479 static inline void blkg_put(struct blkcg_gq *blkg)
528480 {
529− percpu_ref_put(&blkg->refcnt);
481+ WARN_ON_ONCE(atomic_read(&blkg->refcnt) <= 0);
482+ if (atomic_dec_and_test(&blkg->refcnt))
483+ call_rcu(&blkg->rcu_head, __blkg_release_rcu);
530484 }
531485
532486 /**
@@ -579,36 +533,25 @@ static inline struct request_list *blk_get_rl(struct request_queue *q, · 46 unmodified lines
579533
580534 rcu_read_lock();
581535
582− if (bio && bio->bi_blkg) {
583− blkcg = bio->bi_blkg->blkcg;
584− if (blkcg == &blkcg_root)
585− goto rl_use_root;
586−
587− blkg_get(bio->bi_blkg);
588− rcu_read_unlock();
589− return &bio->bi_blkg->rl;
590− }
536+ blkcg = bio_blkcg(bio);
591537
592− blkcg = css_to_blkcg(blkcg_css());
538+ /* bypass blkg lookup and use @q->root_rl directly for root */
593539 if (blkcg == &blkcg_root)
594− goto rl_use_root;
540+ goto root_rl;
595541
542+ /*
543+ * Try to use blkg->rl. blkg lookup may fail under memory pressure
544+ * or if either the blkcg or queue is going away. Fall back to
545+ * root_rl in such cases.
546+ */
596547 blkg = blkg_lookup(blkcg, q);
597548 if (unlikely(!blkg))
598− blkg = __blkg_lookup_create(blkcg, q);
599−
600− if (blkg->blkcg == &blkcg_root || !blkg_tryget(blkg))
601− goto rl_use_root;
549+ goto root_rl;
602550
551+ blkg_get(blkg);
603552 rcu_read_unlock();
604553 return &blkg->rl;
605−
606− /*
607− * Each blkg has its own request_list, however, the root blkcg
608− * uses the request_queue's root_rl. This is to avoid most
609− * overhead for the root blkcg.
610− */
611−rl_use_root:
554+root_rl:
612555 rcu_read_unlock();
613556 return &q->root_rl;
614557 }
@@ -854,26 +797,32 @@ static inline bool blk_throtl_bio(struct request_queue *q, struct blkcg_gq *blkg · 239 unmodified lines
854797 struct bio *bio) { return false; }
855798 #endif
856799
857−
858−static inline void blkcg_bio_issue_init(struct bio *bio)
859−{
860− bio_issue_init(&bio->bi_issue, bio_sectors(bio));
861−}
862−
863800 static inline bool blkcg_bio_issue_check(struct request_queue *q,
864801 struct bio *bio)
865802 {
803+ struct blkcg *blkcg;
866804 struct blkcg_gq *blkg;
867805 bool throtl = false;
868806
869807 rcu_read_lock();
808+ blkcg = bio_blkcg(bio);
809+
810+ /* associate blkcg if bio hasn't attached one */
811+ bio_associate_blkcg(bio, &blkcg->css);
870812
871− bio_associate_create_blkg(q, bio);
872− blkg = bio->bi_blkg;
813+ blkg = blkg_lookup(blkcg, q);
814+ if (unlikely(!blkg)) {
815+ spin_lock_irq(q->queue_lock);
816+ blkg = blkg_lookup_create(blkcg, q);
817+ if (IS_ERR(blkg))
818+ blkg = NULL;
819+ spin_unlock_irq(q->queue_lock);
820+ }
873821
874822 throtl = blk_throtl_bio(q, blkg, bio);
875823
876824 if (!throtl) {
825+ blkg = blkg ?: q->root_blkg;
877826 /*
878827 * If the bio is flagged with BIO_QUEUE_ENTERED it means this
879828 * is a split bio and we would have already accounted for the
@@ -885,8 +834,6 @@ static inline bool blkcg_bio_issue_check(struct request_queue *q, · 5 unmodified lines
885834 blkg_rwstat_add(&blkg->stat_ios, bio->bi_opf, 1);
886835 }
887836
888− blkcg_bio_issue_init(bio);
889−
890837 rcu_read_unlock();
891838 return !throtl;
892839 }
@@ -983,7 +930,6 @@ static inline int blkcg_activate_policy(struct request_queue *q, · 90 unmodified lines
983930 static inline void blkcg_deactivate_policy(struct request_queue *q,
984931 const struct blkcg_policy *pol) { }
985932
986−static inline struct blkcg *__bio_blkcg(struct bio *bio) { return NULL; }
987933 static inline struct blkcg *bio_blkcg(struct bio *bio) { return NULL; }
988934
989935 static inline struct blkg_policy_data *blkg_to_pd(struct blkcg_gq *blkg,
@@ -999,7 +945,6 @@ static inline void blk_put_rl(struct request_list *rl) { } · 9 unmodified lines
999945 static inline void blk_rq_set_rl(struct request *rq, struct request_list *rl) { }
1000946 static inline struct request_list *blk_rq_rl(struct request *rq) { return &rq->q->root_rl; }
1001947
1002−static inline void blkcg_bio_issue_init(struct bio *bio) { }
1003948 static inline bool blkcg_bio_issue_check(struct request_queue *q,
1004949 struct bio *bio) { return true; }
1005950
include/linux/blk_types.h+1−0
@@ -178,6 +178,7 @@ struct bio { · 177 unmodified lines
178178 * release. Read comment on top of bio_associate_current().
179179 */
180180 struct io_context *bi_ioc;
181+ struct cgroup_subsys_state *bi_css;
181182 struct blkcg_gq *bi_blkg;
182183 struct bio_issue bi_issue;
183184 #endif
include/linux/bpf_verifier.h+3−0
@@ -51,6 +51,9 @@ struct bpf_reg_state { · 50 unmodified lines
5151 * PTR_TO_MAP_VALUE_OR_NULL
5252 */
5353 struct bpf_map *map_ptr;
54+
55+ /* Max size from any of the above. */
56+ unsigned long raw;
5457 };
5558 /* Fixed part of pointer offset, pointer types only */
5659 s32 off;
include/linux/can/dev.h+1−0
@@ -169,6 +169,7 @@ void can_change_state(struct net_device *dev, struct can_frame *cf, · 168 unmodified lines
169169
170170 void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev,
171171 unsigned int idx);
172+struct sk_buff *__can_get_echo_skb(struct net_device *dev, unsigned int idx, u8 *len_ptr);
172173 unsigned int can_get_echo_skb(struct net_device *dev, unsigned int idx);
173174 void can_free_echo_skb(struct net_device *dev, unsigned int idx);
174175
include/linux/can/rx-offload.h+6−1
@@ -41,7 +41,12 @@ int can_rx_offload_add_timestamp(struct net_device *dev, struct can_rx_offload * · 40 unmodified lines
4141 int can_rx_offload_add_fifo(struct net_device *dev, struct can_rx_offload *offload, unsigned int weight);
4242 int can_rx_offload_irq_offload_timestamp(struct can_rx_offload *offload, u64 reg);
4343 int can_rx_offload_irq_offload_fifo(struct can_rx_offload *offload);
44−int can_rx_offload_irq_queue_err_skb(struct can_rx_offload *offload, struct sk_buff *skb);
44+int can_rx_offload_queue_sorted(struct can_rx_offload *offload,
45+ struct sk_buff *skb, u32 timestamp);
46+unsigned int can_rx_offload_get_echo_skb(struct can_rx_offload *offload,
47+ unsigned int idx, u32 timestamp);
48+int can_rx_offload_queue_tail(struct can_rx_offload *offload,
49+ struct sk_buff *skb);
4550 void can_rx_offload_reset(struct can_rx_offload *offload);
4651 void can_rx_offload_del(struct can_rx_offload *offload);
4752 void can_rx_offload_enable(struct can_rx_offload *offload);
include/linux/ceph/ceph_features.h+1−7
@@ -213,12 +213,6 @@ DEFINE_CEPH_FEATURE_DEPRECATED(63, 1, RESERVED_BROKEN, LUMINOUS) // client-facin · 212 unmodified lines
213213 CEPH_FEATURE_NEW_OSDOPREPLY_ENCODING | \
214214 CEPH_FEATURE_CEPHX_V2)
215215
216−#define CEPH_FEATURES_REQUIRED_DEFAULT \
217− (CEPH_FEATURE_NOSRCADDR | \
218− CEPH_FEATURE_SUBSCRIBE2 | \
219− CEPH_FEATURE_RECONNECT_SEQ | \
220− CEPH_FEATURE_PGID64 | \
221− CEPH_FEATURE_PGPOOL3 | \
222− CEPH_FEATURE_OSDENC)
216+#define CEPH_FEATURES_REQUIRED_DEFAULT 0
223217
224218 #endif
include/linux/cgroup.h+0−2
@@ -93,8 +93,6 @@ extern struct css_set init_css_set; · 92 unmodified lines
9393
9494 bool css_has_online_children(struct cgroup_subsys_state *css);
9595 struct cgroup_subsys_state *css_from_id(int id, struct cgroup_subsys *ss);
96−struct cgroup_subsys_state *cgroup_e_css(struct cgroup *cgroup,
97− struct cgroup_subsys *ss);
9896 struct cgroup_subsys_state *cgroup_get_e_css(struct cgroup *cgroup,
9997 struct cgroup_subsys *ss);
10098 struct cgroup_subsys_state *css_tryget_online_from_dir(struct dentry *dentry,
include/linux/compat.h+2−2
@@ -1032,9 +1032,9 @@ int kcompat_sys_fstatfs64(unsigned int fd, compat_size_t sz, · 1031 unmodified lines
10321032 #else /* !CONFIG_COMPAT */
10331033
10341034 #define is_compat_task() (0)
1035−#ifndef in_compat_syscall
1035+/* Ensure no one redefines in_compat_syscall() under !CONFIG_COMPAT */
1036+#define in_compat_syscall in_compat_syscall
10361037 static inline bool in_compat_syscall(void) { return false; }
1037−#endif
10381038
10391039 #endif /* CONFIG_COMPAT */
10401040
include/linux/compiler-clang.h+0−5
@@ -21,8 +21,6 @@ · 20 unmodified lines
2121 #define __SANITIZE_ADDRESS__
2222 #endif
2323
24−#define __no_sanitize_address __attribute__((no_sanitize("address")))
25−
2624 /*
2725 * Not all versions of clang implement the the type-generic versions
2826 * of the builtin overflow checkers. Fortunately, clang implements
@@ -41,6 +39,3 @@ · 12 unmodified lines
4139 * compilers, like ICC.
4240 */
4341 #define barrier() __asm__ __volatile__("" : : : "memory")
44−#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
45−#define __assume_aligned(a, ...) \
46− __attribute__((__assume_aligned__(a, ## __VA_ARGS__)))
include/linux/compiler-gcc.h+4−77
@@ -68,31 +68,20 @@ · 67 unmodified lines
6868 */
6969 #define uninitialized_var(x) x = x
7070
71−#ifdef __CHECKER__
72−#define __must_be_array(a) 0
73−#else
74−/* &a[0] degrades to a pointer: a different type from an array */
75−#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
76−#endif
77−
7871 #ifdef RETPOLINE
79−#define __noretpoline __attribute__((indirect_branch("keep")))
72+#define __noretpoline __attribute__((__indirect_branch__("keep")))
8073 #endif
8174
8275 #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
8376
84−#define __optimize(level) __attribute__((__optimize__(level)))
85−
8677 #define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
8778
88−#ifndef __CHECKER__
89−#define __compiletime_warning(message) __attribute__((warning(message)))
90−#define __compiletime_error(message) __attribute__((error(message)))
79+#define __compiletime_warning(message) __attribute__((__warning__(message)))
80+#define __compiletime_error(message) __attribute__((__error__(message)))
9181
92−#ifdef LATENT_ENTROPY_PLUGIN
82+#if defined(LATENT_ENTROPY_PLUGIN) && !defined(__CHECKER__)
9383 #define __latent_entropy __attribute__((latent_entropy))
9484 #endif
95−#endif /* __CHECKER__ */
9685
9786 /*
9887 * calling noreturn functions, __builtin_unreachable() and __builtin_trap()
@@ -107,10 +96,6 @@ · 8 unmodified lines
10796 * Mark a position in code as unreachable. This can be used to
10897 * suppress control flow warnings after asm blocks that transfer
10998 * control elsewhere.
110− *
111− * Early snapshots of gcc 4.5 don't support this and we can't detect
112− * this in the preprocessor, but we can live with this because they're
113− * unreleased. Really, we need to have autoconf for the kernel.
11499 */
115100 #define unreachable() \
116101 do { \
@@ -119,9 +104,6 @@ · 2 unmodified lines
119104 __builtin_unreachable(); \
120105 } while (0)
121106
122−/* Mark a function definition as prohibited from being cloned. */
123−#define __noclone __attribute__((__noclone__, __optimize__("no-tracer")))
124−
125107 #if defined(RANDSTRUCT_PLUGIN) && !defined(__CHECKER__)
126108 #define __randomize_layout __attribute__((randomize_layout))
127109 #define __no_randomize_layout __attribute__((no_randomize_layout))
@@ -130,32 +112,6 @@ · 2 unmodified lines
130112 #define randomized_struct_fields_end } __randomize_layout;
131113 #endif
132114
133−/*
134− * When used with Link Time Optimization, gcc can optimize away C functions or
135− * variables which are referenced only from assembly code. __visible tells the
136− * optimizer that something else uses this function or variable, thus preventing
137− * this.
138− */
139−#define __visible __attribute__((externally_visible))
140−
141−/* gcc version specific checks */
142−
143−#if GCC_VERSION >= 40900 && !defined(__CHECKER__)
144−/*
145− * __assume_aligned(n, k): Tell the optimizer that the returned
146− * pointer can be assumed to be k modulo n. The second argument is
147− * optional (default 0), so we use a variadic macro to make the
148− * shorthand.
149− *
150− * Beware: Do not apply this to functions which may return
151− * ERR_PTRs. Also, it is probably unwise to apply it to functions
152− * returning extra information in the low bits (but in that case the
153− * compiler should see some alignment anyway, when the return value is
154− * massaged by 'flags = ptr & 3; ptr &= ~3;').
155− */
156−#define __assume_aligned(a, ...) __attribute__((__assume_aligned__(a, ## __VA_ARGS__)))
157−#endif
158−
159115 /*
160116 * GCC 'asm goto' miscompiles certain code sequences:
161117 *
@@ -187,39 +143,10 @@ · 25 unmodified lines
187143 #define KASAN_ABI_VERSION 3
188144 #endif
189145
190−#if GCC_VERSION >= 40902
191−/*
192− * Tell the compiler that address safety instrumentation (KASAN)
193− * should not be applied to that function.
194− * Conflicts with inlining: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368
195− */
196−#define __no_sanitize_address __attribute__((no_sanitize_address))
197−#ifdef CONFIG_KASAN
198−#define __no_sanitize_address_or_inline \
199− __no_sanitize_address __maybe_unused notrace
200−#else
201−#define __no_sanitize_address_or_inline inline
202−#endif
203−#endif
204−
205146 #if GCC_VERSION >= 50100
206−/*
207− * Mark structures as requiring designated initializers.
208− * https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html
209− */
210−#define __designated_init __attribute__((designated_init))
211147 #define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1
212148 #endif
213149
214−#if !defined(__noclone)
215−#define __noclone /* not needed */
216−#endif
217−
218−#if !defined(__no_sanitize_address)
219−#define __no_sanitize_address
220−#define __no_sanitize_address_or_inline inline
221−#endif
222−
223150 /*
224151 * Turn individual warnings and errors on and off locally, depending
225152 * on version.
include/linux/compiler-intel.h+0−9
@@ -29,17 +29,8 @@ · 28 unmodified lines
2929 */
3030 #define OPTIMIZER_HIDE_VAR(var) barrier()
3131
32−/* Intel ECC compiler doesn't support __builtin_types_compatible_p() */
33−#define __must_be_array(a) 0
34−
3532 #endif
3633
3734 /* icc has this, but it's called _bswap16 */
3835 #define __HAVE_BUILTIN_BSWAP16__
3936 #define __builtin_bswap16 _bswap16
40−
41−/* The following are for compatibility with GCC, from compiler-gcc.h,
42− * and may be redefined here because they should not be shared with other
43− * compilers, like clang.
44− */
45−#define __visible __attribute__((externally_visible))
include/linux/compiler.h+14−12
@@ -23,8 +23,8 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, · 22 unmodified lines
2323 #define __branch_check__(x, expect, is_constant) ({ \
2424 long ______r; \
2525 static struct ftrace_likely_data \
26− __attribute__((__aligned__(4))) \
27− __attribute__((section("_ftrace_annotated_branch"))) \
26+ __aligned(4) \
27+ __section("_ftrace_annotated_branch") \
2828 ______f = { \
2929 .data.func = __func__, \
3030 .data.file = __FILE__, \
@@ -59,8 +59,8 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, · 28 unmodified lines
5959 ({ \
6060 int ______r; \
6161 static struct ftrace_branch_data \
62− __attribute__((__aligned__(4))) \
63− __attribute__((section("_ftrace_branch"))) \
62+ __aligned(4) \
63+ __section("_ftrace_branch") \
6464 ______f = { \
6565 .func = __func__, \
6666 .file = __FILE__, \
@@ -115,7 +115,10 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, · 48 unmodified lines
115115 # define ASM_UNREACHABLE
116116 #endif
117117 #ifndef unreachable
118−# define unreachable() do { annotate_reachable(); do { } while (1); } while (0)
118+# define unreachable() do { \
119+ annotate_unreachable(); \
120+ __builtin_unreachable(); \
121+} while (0)
119122 #endif
120123
121124 /*
@@ -137,7 +140,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, · 15 unmodified lines
137140 extern typeof(sym) sym; \
138141 static const unsigned long __kentry_##sym \
139142 __used \
140− __attribute__((section("___kentry" "+" #sym ), used)) \
143+ __section("___kentry" "+" #sym ) \
141144 = (unsigned long)&sym;
142145 #endif
143146
@@ -186,7 +189,7 @@ void __read_once_size(const volatile void *p, void *res, int size) · 42 unmodified lines
186189 * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368
187190 * '__maybe_unused' allows us to avoid defined-but-not-used warnings.
188191 */
189−# define __no_kasan_or_inline __no_sanitize_address __maybe_unused
192+# define __no_kasan_or_inline __no_sanitize_address notrace __maybe_unused
190193 #else
191194 # define __no_kasan_or_inline __always_inline
192195 #endif
@@ -278,7 +281,7 @@ unsigned long read_word_at_a_time(const void *addr) · 85 unmodified lines
278281 * visible to the compiler.
279282 */
280283 #define __ADDRESSABLE(sym) \
281− static void * __attribute__((section(".discard.addressable"), used)) \
284+ static void * __section(".discard.addressable") __used \
282285 __PASTE(__addressable_##sym, __LINE__) = (void *)&sym;
283286
284287 /**
@@ -331,10 +334,6 @@ static inline void *offset_to_ptr(const int *off) · 46 unmodified lines
331334 #endif /* __KERNEL__ */
332335 #endif /* __ASSEMBLY__ */
333336
334−#ifndef __optimize
335−# define __optimize(level)
336−#endif
337−
338337 /* Compile time object size, -1 for unknown */
339338 #ifndef __compiletime_object_size
340339 # define __compiletime_object_size(obj) -1
@@ -376,4 +375,7 @@ static inline void *offset_to_ptr(const int *off) · 35 unmodified lines
376375 compiletime_assert(__native_word(t), \
377376 "Need native word sized stores/loads for atomicity.")
378377
378+/* &a[0] degrades to a pointer: a different type from an array */
379+#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
380+
379381 #endif /* __LINUX_COMPILER_H */
include/linux/compiler_attributes.h+262−0
@@ -0,0 +1,262 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef __LINUX_COMPILER_ATTRIBUTES_H
3+#define __LINUX_COMPILER_ATTRIBUTES_H
4+
5+/*
6+ * The attributes in this file are unconditionally defined and they directly
7+ * map to compiler attribute(s), unless one of the compilers does not support
8+ * the attribute. In that case, __has_attribute is used to check for support
9+ * and the reason is stated in its comment ("Optional: ...").
10+ *
11+ * Any other "attributes" (i.e. those that depend on a configuration option,
12+ * on a compiler, on an architecture, on plugins, on other attributes...)
13+ * should be defined elsewhere (e.g. compiler_types.h or compiler-*.h).
14+ * The intention is to keep this file as simple as possible, as well as
15+ * compiler- and version-agnostic (e.g. avoiding GCC_VERSION checks).
16+ *
17+ * This file is meant to be sorted (by actual attribute name,
18+ * not by #define identifier). Use the __attribute__((__name__)) syntax
19+ * (i.e. with underscores) to avoid future collisions with other macros.
20+ * Provide links to the documentation of each supported compiler, if it exists.
21+ */
22+
23+/*
24+ * __has_attribute is supported on gcc >= 5, clang >= 2.9 and icc >= 17.
25+ * In the meantime, to support 4.6 <= gcc < 5, we implement __has_attribute
26+ * by hand.
27+ *
28+ * sparse does not support __has_attribute (yet) and defines __GNUC_MINOR__
29+ * depending on the compiler used to build it; however, these attributes have
30+ * no semantic effects for sparse, so it does not matter. Also note that,
31+ * in order to avoid sparse's warnings, even the unsupported ones must be
32+ * defined to 0.
33+ */
34+#ifndef __has_attribute
35+# define __has_attribute(x) __GCC4_has_attribute_##x
36+# define __GCC4_has_attribute___assume_aligned__ (__GNUC_MINOR__ >= 9)
37+# define __GCC4_has_attribute___designated_init__ 0
38+# define __GCC4_has_attribute___externally_visible__ 1
39+# define __GCC4_has_attribute___noclone__ 1
40+# define __GCC4_has_attribute___optimize__ 1
41+# define __GCC4_has_attribute___nonstring__ 0
42+# define __GCC4_has_attribute___no_sanitize_address__ (__GNUC_MINOR__ >= 8)
43+#endif
44+
45+/*
46+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-alias-function-attribute
47+ */
48+#define __alias(symbol) __attribute__((__alias__(#symbol)))
49+
50+/*
51+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-aligned-function-attribute
52+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Type-Attributes.html#index-aligned-type-attribute
53+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-aligned-variable-attribute
54+ */
55+#define __aligned(x) __attribute__((__aligned__(x)))
56+#define __aligned_largest __attribute__((__aligned__))
57+
58+/*
59+ * Note: users of __always_inline currently do not write "inline" themselves,
60+ * which seems to be required by gcc to apply the attribute according
61+ * to its docs (and also "warning: always_inline function might not be
62+ * inlinable [-Wattributes]" is emitted).
63+ *
64+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-always_005finline-function-attribute
65+ * clang: mentioned
66+ */
67+#define __always_inline inline __attribute__((__always_inline__))
68+
69+/*
70+ * The second argument is optional (default 0), so we use a variadic macro
71+ * to make the shorthand.
72+ *
73+ * Beware: Do not apply this to functions which may return
74+ * ERR_PTRs. Also, it is probably unwise to apply it to functions
75+ * returning extra information in the low bits (but in that case the
76+ * compiler should see some alignment anyway, when the return value is
77+ * massaged by 'flags = ptr & 3; ptr &= ~3;').
78+ *
79+ * Optional: only supported since gcc >= 4.9
80+ * Optional: not supported by icc
81+ *
82+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-assume_005faligned-function-attribute
83+ * clang: https://clang.llvm.org/docs/AttributeReference.html#assume-aligned
84+ */
85+#if __has_attribute(__assume_aligned__)
86+# define __assume_aligned(a, ...) __attribute__((__assume_aligned__(a, ## __VA_ARGS__)))
87+#else
88+# define __assume_aligned(a, ...)
89+#endif
90+
91+/*
92+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-cold-function-attribute
93+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Label-Attributes.html#index-cold-label-attribute
94+ */
95+#define __cold __attribute__((__cold__))
96+
97+/*
98+ * Note the long name.
99+ *
100+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-const-function-attribute
101+ */
102+#define __attribute_const__ __attribute__((__const__))
103+
104+/*
105+ * Don't. Just don't. See commit 771c035372a0 ("deprecate the '__deprecated'
106+ * attribute warnings entirely and for good") for more information.
107+ *
108+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-deprecated-function-attribute
109+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Type-Attributes.html#index-deprecated-type-attribute
110+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-deprecated-variable-attribute
111+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Enumerator-Attributes.html#index-deprecated-enumerator-attribute
112+ * clang: https://clang.llvm.org/docs/AttributeReference.html#deprecated
113+ */
114+#define __deprecated
115+
116+/*
117+ * Optional: only supported since gcc >= 5.1
118+ * Optional: not supported by clang
119+ * Optional: not supported by icc
120+ *
121+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Type-Attributes.html#index-designated_005finit-type-attribute
122+ */
123+#if __has_attribute(__designated_init__)
124+# define __designated_init __attribute__((__designated_init__))
125+#else
126+# define __designated_init
127+#endif
128+
129+/*
130+ * Optional: not supported by clang
131+ *
132+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-externally_005fvisible-function-attribute
133+ */
134+#if __has_attribute(__externally_visible__)
135+# define __visible __attribute__((__externally_visible__))
136+#else
137+# define __visible
138+#endif
139+
140+/*
141+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-format-function-attribute
142+ * clang: https://clang.llvm.org/docs/AttributeReference.html#format
143+ */
144+#define __printf(a, b) __attribute__((__format__(printf, a, b)))
145+#define __scanf(a, b) __attribute__((__format__(scanf, a, b)))
146+
147+/*
148+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-gnu_005finline-function-attribute
149+ * clang: https://clang.llvm.org/docs/AttributeReference.html#gnu-inline
150+ */
151+#define __gnu_inline __attribute__((__gnu_inline__))
152+
153+/*
154+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-malloc-function-attribute
155+ */
156+#define __malloc __attribute__((__malloc__))
157+
158+/*
159+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Type-Attributes.html#index-mode-type-attribute
160+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-mode-variable-attribute
161+ */
162+#define __mode(x) __attribute__((__mode__(x)))
163+
164+/*
165+ * Optional: not supported by clang
166+ * Note: icc does not recognize gcc's no-tracer
167+ *
168+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-noclone-function-attribute
169+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-optimize-function-attribute
170+ */
171+#if __has_attribute(__noclone__)
172+# if __has_attribute(__optimize__)
173+# define __noclone __attribute__((__noclone__, __optimize__("no-tracer")))
174+# else
175+# define __noclone __attribute__((__noclone__))
176+# endif
177+#else
178+# define __noclone
179+#endif
180+
181+/*
182+ * Note the missing underscores.
183+ *
184+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-noinline-function-attribute
185+ * clang: mentioned
186+ */
187+#define noinline __attribute__((__noinline__))
188+
189+/*
190+ * Optional: only supported since gcc >= 8
191+ * Optional: not supported by clang
192+ * Optional: not supported by icc
193+ *
194+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-nonstring-variable-attribute
195+ */
196+#if __has_attribute(__nonstring__)
197+# define __nonstring __attribute__((__nonstring__))
198+#else
199+# define __nonstring
200+#endif
201+
202+/*
203+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-noreturn-function-attribute
204+ * clang: https://clang.llvm.org/docs/AttributeReference.html#noreturn
205+ * clang: https://clang.llvm.org/docs/AttributeReference.html#id1
206+ */
207+#define __noreturn __attribute__((__noreturn__))
208+
209+/*
210+ * Optional: only supported since gcc >= 4.8
211+ * Optional: not supported by icc
212+ *
213+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-no_005fsanitize_005faddress-function-attribute
214+ * clang: https://clang.llvm.org/docs/AttributeReference.html#no-sanitize-address-no-address-safety-analysis
215+ */
216+#if __has_attribute(__no_sanitize_address__)
217+# define __no_sanitize_address __attribute__((__no_sanitize_address__))
218+#else
219+# define __no_sanitize_address
220+#endif
221+
222+/*
223+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Type-Attributes.html#index-packed-type-attribute
224+ * clang: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-packed-variable-attribute
225+ */
226+#define __packed __attribute__((__packed__))
227+
228+/*
229+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-pure-function-attribute
230+ */
231+#define __pure __attribute__((__pure__))
232+
233+/*
234+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-section-function-attribute
235+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-section-variable-attribute
236+ * clang: https://clang.llvm.org/docs/AttributeReference.html#section-declspec-allocate
237+ */
238+#define __section(S) __attribute__((__section__(#S)))
239+
240+/*
241+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-unused-function-attribute
242+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Type-Attributes.html#index-unused-type-attribute
243+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-unused-variable-attribute
244+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Label-Attributes.html#index-unused-label-attribute
245+ * clang: https://clang.llvm.org/docs/AttributeReference.html#maybe-unused-unused
246+ */
247+#define __always_unused __attribute__((__unused__))
248+#define __maybe_unused __attribute__((__unused__))
249+
250+/*
251+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-used-function-attribute
252+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-used-variable-attribute
253+ */
254+#define __used __attribute__((__used__))
255+
256+/*
257+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-weak-function-attribute
258+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-weak-variable-attribute
259+ */
260+#define __weak __attribute__((__weak__))
261+
262+#endif /* __LINUX_COMPILER_ATTRIBUTES_H */
include/linux/compiler_types.h+17−83
@@ -1,3 +1,4 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
12 #ifndef __LINUX_COMPILER_TYPES_H
23 #define __LINUX_COMPILER_TYPES_H
34
@@ -54,6 +55,9 @@ extern void __chk_io_ptr(const volatile void __iomem *); · 50 unmodified lines
5455
5556 #ifdef __KERNEL__
5657
58+/* Attributes */
59+#include <linux/compiler_attributes.h>
60+
5761 /* Compiler specific macros. */
5862 #ifdef __clang__
5963 #include <linux/compiler-clang.h>
@@ -78,12 +82,6 @@ extern void __chk_io_ptr(const volatile void __iomem *); · 18 unmodified lines
7882 #include <asm/compiler.h>
7983 #endif
8084
81−/*
82− * Generic compiler-independent macros required for kernel
83− * build go below this comment. Actual compiler/compiler version
84− * specific implementations come from the above header files
85− */
86−
8785 struct ftrace_branch_data {
8886 const char *func;
8987 const char *file;
@@ -106,10 +104,6 @@ struct ftrace_likely_data { · 16 unmodified lines
106104 unsigned long constant;
107105 };
108106
109−/* Don't. Just don't. */
110−#define __deprecated
111−#define __deprecated_for_modules
112−
113107 #endif /* __KERNEL__ */
114108
115109 #endif /* __ASSEMBLY__ */
@@ -119,10 +113,6 @@ struct ftrace_likely_data { · 3 unmodified lines
119113 * compilers. We don't consider that to be an error, so set them to nothing.
120114 * For example, some of them are for compiler specific plugins.
121115 */
122−#ifndef __designated_init
123−# define __designated_init
124−#endif
125−
126116 #ifndef __latent_entropy
127117 # define __latent_entropy
128118 #endif
@@ -140,15 +130,8 @@ struct ftrace_likely_data { · 11 unmodified lines
140130 # define randomized_struct_fields_end
141131 #endif
142132
143−#ifndef __visible
144−#define __visible
145−#endif
146−
147−/*
148− * Assume alignment of return value.
149− */
150−#ifndef __assume_aligned
151−#define __assume_aligned(a, ...)
133+#ifndef asm_volatile_goto
134+#define asm_volatile_goto(x...) asm goto(x)
152135 #endif
153136
154137 /* Are two types/vars the same type (ignoring qualifiers)? */
@@ -159,14 +142,6 @@ struct ftrace_likely_data { · 4 unmodified lines
159142 (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || \
160143 sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long))
161144
162−#ifndef __attribute_const__
163−#define __attribute_const__ __attribute__((__const__))
164−#endif
165−
166−#ifndef __noclone
167−#define __noclone
168−#endif
169−
170145 /* Helpers for emitting diagnostics in pragmas. */
171146 #ifndef __diag
172147 #define __diag(string)
@@ -186,43 +161,16 @@ struct ftrace_likely_data { · 13 unmodified lines
186161 #define __diag_error(compiler, version, option, comment) \
187162 __diag_ ## compiler(version, error, option)
188163
189−/*
190− * From the GCC manual:
191− *
192− * Many functions have no effects except the return value and their
193− * return value depends only on the parameters and/or global
194− * variables. Such a function can be subject to common subexpression
195− * elimination and loop optimization just as an arithmetic operator
196− * would be.
197− * [...]
198− */
199−#define __pure __attribute__((pure))
200−#define __aligned(x) __attribute__((aligned(x)))
201−#define __printf(a, b) __attribute__((format(printf, a, b)))
202−#define __scanf(a, b) __attribute__((format(scanf, a, b)))
203−#define __maybe_unused __attribute__((unused))
204−#define __always_unused __attribute__((unused))
205−#define __mode(x) __attribute__((mode(x)))
206−#define __malloc __attribute__((__malloc__))
207−#define __used __attribute__((__used__))
208−#define __noreturn __attribute__((noreturn))
209−#define __packed __attribute__((packed))
210−#define __weak __attribute__((weak))
211−#define __alias(symbol) __attribute__((alias(#symbol)))
212−#define __cold __attribute__((cold))
213−#define __section(S) __attribute__((__section__(#S)))
214−
215−
216164 #ifdef CONFIG_ENABLE_MUST_CHECK
217−#define __must_check __attribute__((warn_unused_result))
165+#define __must_check __attribute__((__warn_unused_result__))
218166 #else
219167 #define __must_check
220168 #endif
221169
222−#if defined(CC_USING_HOTPATCH) && !defined(__CHECKER__)
170+#if defined(CC_USING_HOTPATCH)
223171 #define notrace __attribute__((hotpatch(0, 0)))
224172 #else
225−#define notrace __attribute__((no_instrument_function))
173+#define notrace __attribute__((__no_instrument_function__))
226174 #endif
227175
228176 /*
@@ -231,22 +179,10 @@ struct ftrace_likely_data { · 2 unmodified lines
231179 * stack and frame pointer being set up and there is no chance to
232180 * restore the lr register to the value before mcount was called.
233181 */
234−#define __naked __attribute__((naked)) notrace
182+#define __naked __attribute__((__naked__)) notrace
235183
236184 #define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
237185
238−/*
239− * Feature detection for gnu_inline (gnu89 extern inline semantics). Either
240− * __GNUC_STDC_INLINE__ is defined (not using gnu89 extern inline semantics,
241− * and we opt in to the gnu89 semantics), or __GNUC_STDC_INLINE__ is not
242− * defined so the gnu89 semantics are the default.
243− */
244−#ifdef __GNUC_STDC_INLINE__
245−# define __gnu_inline __attribute__((gnu_inline))
246−#else
247−# define __gnu_inline
248−#endif
249−
250186 /*
251187 * Force always-inline if the user requests it so via the .config.
252188 * GCC does not warn about unused static inline functions for
@@ -258,22 +194,20 @@ struct ftrace_likely_data { · 5 unmodified lines
258194 * semantics rather than c99. This prevents multiple symbol definition errors
259195 * of extern inline functions at link time.
260196 * A lot of inline functions can cause havoc with function tracing.
197+ * Do not use __always_inline here, since currently it expands to inline again
198+ * (which would break users of __always_inline).
261199 */
262200 #if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \
263201 !defined(CONFIG_OPTIMIZE_INLINING)
264−#define inline \
265− inline __attribute__((always_inline, unused)) notrace __gnu_inline
202+#define inline inline __attribute__((__always_inline__)) __gnu_inline \
203+ __maybe_unused notrace
266204 #else
267−#define inline inline __attribute__((unused)) notrace __gnu_inline
205+#define inline inline __gnu_inline \
206+ __maybe_unused notrace
268207 #endif
269208
270209 #define __inline__ inline
271−#define __inline inline
272−#define noinline __attribute__((noinline))
273−
274−#ifndef __always_inline
275−#define __always_inline inline __attribute__((always_inline))
276−#endif
210+#define __inline inline
277211
278212 /*
279213 * Rather then using noinline to prevent stack consumption, use
include/linux/cpuhotplug.h+1−0
@@ -126,6 +126,7 @@ enum cpuhp_state { · 125 unmodified lines
126126 CPUHP_AP_MIPS_GIC_TIMER_STARTING,
127127 CPUHP_AP_ARC_TIMER_STARTING,
128128 CPUHP_AP_RISCV_TIMER_STARTING,
129+ CPUHP_AP_CSKY_TIMER_STARTING,
129130 CPUHP_AP_KVM_STARTING,
130131 CPUHP_AP_KVM_ARM_VGIC_INIT_STARTING,
131132 CPUHP_AP_KVM_ARM_VGIC_STARTING,
include/linux/dax.h+8−6
@@ -7,6 +7,8 @@ · 6 unmodified lines
77 #include <linux/radix-tree.h>
88 #include <asm/pgtable.h>
99
10+typedef unsigned long dax_entry_t;
11+
1012 struct iomap_ops;
1113 struct dax_device;
1214 struct dax_operations {
@@ -88,8 +90,8 @@ int dax_writeback_mapping_range(struct address_space *mapping, · 75 unmodified lines
8890 struct block_device *bdev, struct writeback_control *wbc);
8991
9092 struct page *dax_layout_busy_page(struct address_space *mapping);
91−bool dax_lock_mapping_entry(struct page *page);
92−void dax_unlock_mapping_entry(struct page *page);
93+dax_entry_t dax_lock_page(struct page *page);
94+void dax_unlock_page(struct page *page, dax_entry_t cookie);
9395 #else
9496 static inline bool bdev_dax_supported(struct block_device *bdev,
9597 int blocksize)
@@ -122,14 +124,14 @@ static inline int dax_writeback_mapping_range(struct address_space *mapping, · 26 unmodified lines
122124 return -EOPNOTSUPP;
123125 }
124126
125−static inline bool dax_lock_mapping_entry(struct page *page)
127+static inline dax_entry_t dax_lock_page(struct page *page)
126128 {
127129 if (IS_DAX(page->mapping->host))
128− return true;
129− return false;
130+ return ~0UL;
131+ return 0;
130132 }
131133
132−static inline void dax_unlock_mapping_entry(struct page *page)
134+static inline void dax_unlock_page(struct page *page, dax_entry_t cookie)
133135 {
134136 }
135137 #endif
include/linux/dma-direct.h+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
55 #include <linux/dma-mapping.h>
66 #include <linux/mem_encrypt.h>
77
8−#define DIRECT_MAPPING_ERROR 0
8+#define DIRECT_MAPPING_ERROR (~(dma_addr_t)0)
99
1010 #ifdef CONFIG_ARCH_HAS_PHYS_TO_DMA
1111 #include <asm/dma-direct.h>
include/linux/efi.h+7−0
@@ -1167,6 +1167,8 @@ static inline bool efi_enabled(int feature) · 1166 unmodified lines
11671167 extern void efi_reboot(enum reboot_mode reboot_mode, const char *__unused);
11681168
11691169 extern bool efi_is_table_address(unsigned long phys_addr);
1170+
1171+extern int efi_apply_persistent_mem_reservations(void);
11701172 #else
11711173 static inline bool efi_enabled(int feature)
11721174 {
@@ -1185,6 +1187,11 @@ static inline bool efi_is_table_address(unsigned long phys_addr) · 12 unmodified lines
11851187 {
11861188 return false;
11871189 }
1190+
1191+static inline int efi_apply_persistent_mem_reservations(void)
1192+{
1193+ return 0;
1194+}
11881195 #endif
11891196
11901197 extern int efi_status_to_err(efi_status_t status);
include/linux/filter.h+11−0
@@ -449,6 +449,13 @@ struct sock_reuseport; · 448 unmodified lines
449449 offsetof(TYPE, MEMBER) ... offsetofend(TYPE, MEMBER) - 1
450450 #define bpf_ctx_range_till(TYPE, MEMBER1, MEMBER2) \
451451 offsetof(TYPE, MEMBER1) ... offsetofend(TYPE, MEMBER2) - 1
452+#if BITS_PER_LONG == 64
453+# define bpf_ctx_range_ptr(TYPE, MEMBER) \
454+ offsetof(TYPE, MEMBER) ... offsetofend(TYPE, MEMBER) - 1
455+#else
456+# define bpf_ctx_range_ptr(TYPE, MEMBER) \
457+ offsetof(TYPE, MEMBER) ... offsetof(TYPE, MEMBER) + 8 - 1
458+#endif /* BITS_PER_LONG == 64 */
452459
453460 #define bpf_target_off(TYPE, MEMBER, SIZE, PTR_SIZE) \
454461 ({ \
@@ -866,6 +873,10 @@ void bpf_jit_binary_free(struct bpf_binary_header *hdr); · 411 unmodified lines
866873
867874 void bpf_jit_free(struct bpf_prog *fp);
868875
876+int bpf_jit_get_func_addr(const struct bpf_prog *prog,
877+ const struct bpf_insn *insn, bool extra_pass,
878+ u64 *func_addr, bool *func_addr_fixed);
879+
869880 struct bpf_prog *bpf_jit_blind_constants(struct bpf_prog *fp);
870881 void bpf_jit_prog_release_other(struct bpf_prog *fp, struct bpf_prog *fp_other);
871882
include/linux/fs.h+38−17
@@ -1752,6 +1752,25 @@ struct block_device_operations; · 1751 unmodified lines
17521752 #define NOMMU_VMFLAGS \
17531753 (NOMMU_MAP_READ | NOMMU_MAP_WRITE | NOMMU_MAP_EXEC)
17541754
1755+/*
1756+ * These flags control the behavior of the remap_file_range function pointer.
1757+ * If it is called with len == 0 that means "remap to end of source file".
1758+ * See Documentation/filesystems/vfs.txt for more details about this call.
1759+ *
1760+ * REMAP_FILE_DEDUP: only remap if contents identical (i.e. deduplicate)
1761+ * REMAP_FILE_CAN_SHORTEN: caller can handle a shortened request
1762+ */
1763+#define REMAP_FILE_DEDUP (1 << 0)
1764+#define REMAP_FILE_CAN_SHORTEN (1 << 1)
1765+
1766+/*
1767+ * These flags signal that the caller is ok with altering various aspects of
1768+ * the behavior of the remap operation. The changes must be made by the
1769+ * implementation; the vfs remap helper functions can take advantage of them.
1770+ * Flags in this category exist to preserve the quirky behavior of the hoisted
1771+ * btrfs clone/dedupe ioctls.
1772+ */
1773+#define REMAP_FILE_ADVISORY (REMAP_FILE_CAN_SHORTEN)
17551774
17561775 struct iov_iter;
17571776
@@ -1790,10 +1809,9 @@ struct file_operations { · 32 unmodified lines
17901809 #endif
17911810 ssize_t (*copy_file_range)(struct file *, loff_t, struct file *,
17921811 loff_t, size_t, unsigned int);
1793− int (*clone_file_range)(struct file *, loff_t, struct file *, loff_t,
1794− u64);
1795− int (*dedupe_file_range)(struct file *, loff_t, struct file *, loff_t,
1796− u64);
1812+ loff_t (*remap_file_range)(struct file *file_in, loff_t pos_in,
1813+ struct file *file_out, loff_t pos_out,
1814+ loff_t len, unsigned int remap_flags);
17971815 int (*fadvise)(struct file *, loff_t, loff_t, int);
17981816 } __randomize_layout;
17991817
@@ -1856,21 +1874,21 @@ extern ssize_t vfs_readv(struct file *, const struct iovec __user *, · 56 unmodified lines
18561874 unsigned long, loff_t *, rwf_t);
18571875 extern ssize_t vfs_copy_file_range(struct file *, loff_t , struct file *,
18581876 loff_t, size_t, unsigned int);
1859−extern int vfs_clone_file_prep_inodes(struct inode *inode_in, loff_t pos_in,
1860− struct inode *inode_out, loff_t pos_out,
1861− u64 *len, bool is_dedupe);
1862−extern int do_clone_file_range(struct file *file_in, loff_t pos_in,
1863− struct file *file_out, loff_t pos_out, u64 len);
1864−extern int vfs_clone_file_range(struct file *file_in, loff_t pos_in,
1865− struct file *file_out, loff_t pos_out, u64 len);
1866−extern int vfs_dedupe_file_range_compare(struct inode *src, loff_t srcoff,
1867− struct inode *dest, loff_t destoff,
1868− loff_t len, bool *is_same);
1877+extern int generic_remap_file_range_prep(struct file *file_in, loff_t pos_in,
1878+ struct file *file_out, loff_t pos_out,
1879+ loff_t *count,
1880+ unsigned int remap_flags);
1881+extern loff_t do_clone_file_range(struct file *file_in, loff_t pos_in,
1882+ struct file *file_out, loff_t pos_out,
1883+ loff_t len, unsigned int remap_flags);
1884+extern loff_t vfs_clone_file_range(struct file *file_in, loff_t pos_in,
1885+ struct file *file_out, loff_t pos_out,
1886+ loff_t len, unsigned int remap_flags);
18691887 extern int vfs_dedupe_file_range(struct file *file,
18701888 struct file_dedupe_range *same);
1871−extern int vfs_dedupe_file_range_one(struct file *src_file, loff_t src_pos,
1872− struct file *dst_file, loff_t dst_pos,
1873− u64 len);
1889+extern loff_t vfs_dedupe_file_range_one(struct file *src_file, loff_t src_pos,
1890+ struct file *dst_file, loff_t dst_pos,
1891+ loff_t len, unsigned int remap_flags);
18741892
18751893
18761894 struct super_operations {
@@ -2998,6 +3016,9 @@ extern int sb_min_blocksize(struct super_block *, int); · 1121 unmodified lines
29983016 extern int generic_file_mmap(struct file *, struct vm_area_struct *);
29993017 extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *);
30003018 extern ssize_t generic_write_checks(struct kiocb *, struct iov_iter *);
3019+extern int generic_remap_checks(struct file *file_in, loff_t pos_in,
3020+ struct file *file_out, loff_t pos_out,
3021+ loff_t *count, unsigned int remap_flags);
30013022 extern ssize_t generic_file_read_iter(struct kiocb *, struct iov_iter *);
30023023 extern ssize_t __generic_file_write_iter(struct kiocb *, struct iov_iter *);
30033024 extern ssize_t generic_file_write_iter(struct kiocb *, struct iov_iter *);
include/linux/fscache-cache.h+1−2
@@ -196,8 +196,7 @@ static inline void fscache_enqueue_retrieval(struct fscache_retrieval *op) · 195 unmodified lines
196196 static inline void fscache_retrieval_complete(struct fscache_retrieval *op,
197197 int n_pages)
198198 {
199− atomic_sub(n_pages, &op->n_pages);
200− if (atomic_read(&op->n_pages) <= 0)
199+ if (atomic_sub_return_relaxed(n_pages, &op->n_pages) <= 0)
201200 fscache_op_complete(&op->op, false);
202201 }
203202
include/linux/ftrace.h+2−2
@@ -777,8 +777,8 @@ struct ftrace_ret_stack { · 776 unmodified lines
777777 extern void return_to_handler(void);
778778
779779 extern int
780−ftrace_push_return_trace(unsigned long ret, unsigned long func, int *depth,
781− unsigned long frame_pointer, unsigned long *retp);
780+function_graph_enter(unsigned long ret, unsigned long func,
781+ unsigned long frame_pointer, unsigned long *retp);
782782
783783 unsigned long ftrace_graph_ret_addr(struct task_struct *task, int *idx,
784784 unsigned long ret, unsigned long *retp);
include/linux/gfp.h+2−2
@@ -511,14 +511,14 @@ alloc_pages(gfp_t gfp_mask, unsigned int order) · 510 unmodified lines
511511 extern struct page *alloc_pages_vma(gfp_t gfp_mask, int order,
512512 struct vm_area_struct *vma, unsigned long addr,
513513 int node, bool hugepage);
514−#define alloc_hugepage_vma(gfp_mask, vma, addr, order) \
514+#define alloc_hugepage_vma(gfp_mask, vma, addr, order) \
515515 alloc_pages_vma(gfp_mask, order, vma, addr, numa_node_id(), true)
516516 #else
517517 #define alloc_pages(gfp_mask, order) \
518518 alloc_pages_node(numa_node_id(), gfp_mask, order)
519519 #define alloc_pages_vma(gfp_mask, order, vma, addr, node, false)\
520520 alloc_pages(gfp_mask, order)
521−#define alloc_hugepage_vma(gfp_mask, vma, addr, order) \
521+#define alloc_hugepage_vma(gfp_mask, vma, addr, order) \
522522 alloc_pages(gfp_mask, order)
523523 #endif
524524 #define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0)
include/linux/hid-sensor-hub.h+3−1
@@ -177,6 +177,7 @@ int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev, · 176 unmodified lines
177177 * @attr_usage_id: Attribute usage id as per spec
178178 * @report_id: Report id to look for
179179 * @flag: Synchronous or asynchronous read
180+* @is_signed: If true then fields < 32 bits will be sign-extended
180181 *
181182 * Issues a synchronous or asynchronous read request for an input attribute.
182183 * Returns data upto 32 bits.
@@ -190,7 +191,8 @@ enum sensor_hub_read_flags { · 7 unmodified lines
190191 int sensor_hub_input_attr_get_raw_value(struct hid_sensor_hub_device *hsdev,
191192 u32 usage_id,
192193 u32 attr_usage_id, u32 report_id,
193− enum sensor_hub_read_flags flag
194+ enum sensor_hub_read_flags flag,
195+ bool is_signed
194196 );
195197
196198 /**
include/linux/hid.h+16−1
@@ -219,6 +219,7 @@ struct hid_item { · 218 unmodified lines
219219 #define HID_GD_VBRZ 0x00010045
220220 #define HID_GD_VNO 0x00010046
221221 #define HID_GD_FEATURE 0x00010047
222+#define HID_GD_RESOLUTION_MULTIPLIER 0x00010048
222223 #define HID_GD_SYSTEM_CONTROL 0x00010080
223224 #define HID_GD_UP 0x00010090
224225 #define HID_GD_DOWN 0x00010091
@@ -232,12 +233,14 @@ struct hid_item { · 7 unmodified lines
232233 #define HID_DC_BATTERYSTRENGTH 0x00060020
233234
234235 #define HID_CP_CONSUMER_CONTROL 0x000c0001
236+#define HID_CP_AC_PAN 0x000c0238
235237
236238 #define HID_DG_DIGITIZER 0x000d0001
237239 #define HID_DG_PEN 0x000d0002
238240 #define HID_DG_LIGHTPEN 0x000d0003
239241 #define HID_DG_TOUCHSCREEN 0x000d0004
240242 #define HID_DG_TOUCHPAD 0x000d0005
243+#define HID_DG_WHITEBOARD 0x000d0006
241244 #define HID_DG_STYLUS 0x000d0020
242245 #define HID_DG_PUCK 0x000d0021
243246 #define HID_DG_FINGER 0x000d0022
@@ -427,6 +430,7 @@ struct hid_local { · 183 unmodified lines
427430 */
428431
429432 struct hid_collection {
433+ struct hid_collection *parent;
430434 unsigned type;
431435 unsigned usage;
432436 unsigned level;
@@ -436,12 +440,16 @@ struct hid_usage { · 3 unmodified lines
436440 unsigned hid; /* hid usage code */
437441 unsigned collection_index; /* index into collection array */
438442 unsigned usage_index; /* index into usage array */
443+ __s8 resolution_multiplier;/* Effective Resolution Multiplier
444+ (HUT v1.12, 4.3.1), default: 1 */
439445 /* hidinput data */
446+ __s8 wheel_factor; /* 120/resolution_multiplier */
440447 __u16 code; /* input driver code */
441448 __u8 type; /* input driver type */
442449 __s8 hat_min; /* hat switch fun */
443450 __s8 hat_max; /* ditto */
444451 __s8 hat_dir; /* ditto */
452+ __s16 wheel_accumulated; /* hi-res wheel */
445453 };
446454
447455 struct hid_input;
@@ -650,6 +658,7 @@ struct hid_parser { · 202 unmodified lines
650658 unsigned int *collection_stack;
651659 unsigned int collection_stack_ptr;
652660 unsigned int collection_stack_size;
661+ struct hid_collection *active_collection;
653662 struct hid_device *device;
654663 unsigned int scan_flags;
655664 };
@@ -836,7 +845,11 @@ static inline bool hid_is_using_ll_driver(struct hid_device *hdev, · 180 unmodified lines
836845
837846 /* Applications from HID Usage Tables 4/8/99 Version 1.1 */
838847 /* We ignore a few input applications that are not widely used */
839−#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001) || ((a >= 0x000d0002) && (a <= 0x000d0006)))
848+#define IS_INPUT_APPLICATION(a) \
849+ (((a >= HID_UP_GENDESK) && (a <= HID_GD_MULTIAXIS)) \
850+ || ((a >= HID_DG_PEN) && (a <= HID_DG_WHITEBOARD)) \
851+ || (a == HID_GD_SYSTEM_CONTROL) || (a == HID_CP_CONSUMER_CONTROL) \
852+ || (a == HID_GD_WIRELESS_RADIO_CTLS))
840853
841854 /* HID core API */
842855
@@ -892,6 +905,8 @@ struct hid_report *hid_validate_values(struct hid_device *hid, · 49 unmodified lines
892905 unsigned int type, unsigned int id,
893906 unsigned int field_index,
894907 unsigned int report_counts);
908+
909+void hid_setup_resolution_multiplier(struct hid_device *hid);
895910 int hid_open_report(struct hid_device *device);
896911 int hid_check_keys_pressed(struct hid_device *hid);
897912 int hid_connect(struct hid_device *hid, unsigned int connect_mask);
include/linux/hyperv.h+7−0
@@ -905,6 +905,13 @@ struct vmbus_channel { · 904 unmodified lines
905905
906906 bool probe_done;
907907
908+ /*
909+ * We must offload the handling of the primary/sub channels
910+ * from the single-threaded vmbus_connection.work_queue to
911+ * two different workqueue, otherwise we can block
912+ * vmbus_connection.work_queue and hang: see vmbus_process_offer().
913+ */
914+ struct work_struct add_channel_work;
908915 };
909916
910917 static inline bool is_hvsock_channel(const struct vmbus_channel *c)
include/linux/i8253.h+1−0
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #define PIT_LATCH ((PIT_TICK_RATE + HZ/2) / HZ)
2222
2323 extern raw_spinlock_t i8253_lock;
24+extern bool i8253_clear_counter_on_shutdown;
2425 extern struct clock_event_device i8253_clockevent;
2526 extern void clockevent_i8253_init(bool oneshot);
2627
include/linux/inetdevice.h+3−1
@@ -37,7 +37,9 @@ struct in_device { · 36 unmodified lines
3737 unsigned long mr_v1_seen;
3838 unsigned long mr_v2_seen;
3939 unsigned long mr_maxdelay;
40− unsigned char mr_qrv;
40+ unsigned long mr_qi; /* Query Interval */
41+ unsigned long mr_qri; /* Query Response Interval */
42+ unsigned char mr_qrv; /* Query Robustness Variable */
4143 unsigned char mr_gq_running;
4244 unsigned char mr_ifc_count;
4345 struct timer_list mr_gq_timer; /* general query timer */
include/linux/key-type.h+11−0
@@ -17,6 +17,9 @@ · 16 unmodified lines
1717
1818 #ifdef CONFIG_KEYS
1919
20+struct kernel_pkey_query;
21+struct kernel_pkey_params;
22+
2023 /*
2124 * key under-construction record
2225 * - passed to the request_key actor if supplied
@@ -155,6 +158,14 @@ struct key_type { · 132 unmodified lines
155158 */
156159 struct key_restriction *(*lookup_restriction)(const char *params);
157160
161+ /* Asymmetric key accessor functions. */
162+ int (*asym_query)(const struct kernel_pkey_params *params,
163+ struct kernel_pkey_query *info);
164+ int (*asym_eds_op)(struct kernel_pkey_params *params,
165+ const void *in, void *out);
166+ int (*asym_verify_signature)(struct kernel_pkey_params *params,
167+ const void *in, const void *in2);
168+
158169 /* internal fields */
159170 struct list_head link; /* link in types list */
160171 struct lock_class_key lock_class; /* key->sem lock class */
include/linux/keyctl.h+46−0
@@ -0,0 +1,46 @@
1+/* keyctl kernel bits
2+ *
3+ * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved.
4+ * Written by David Howells (dhowells@redhat.com)
5+ *
6+ * This program is free software; you can redistribute it and/or
7+ * modify it under the terms of the GNU General Public Licence
8+ * as published by the Free Software Foundation; either version
9+ * 2 of the Licence, or (at your option) any later version.
10+ */
11+
12+#ifndef __LINUX_KEYCTL_H
13+#define __LINUX_KEYCTL_H
14+
15+#include <uapi/linux/keyctl.h>
16+
17+struct kernel_pkey_query {
18+ __u32 supported_ops; /* Which ops are supported */
19+ __u32 key_size; /* Size of the key in bits */
20+ __u16 max_data_size; /* Maximum size of raw data to sign in bytes */
21+ __u16 max_sig_size; /* Maximum size of signature in bytes */
22+ __u16 max_enc_size; /* Maximum size of encrypted blob in bytes */
23+ __u16 max_dec_size; /* Maximum size of decrypted blob in bytes */
24+};
25+
26+enum kernel_pkey_operation {
27+ kernel_pkey_encrypt,
28+ kernel_pkey_decrypt,
29+ kernel_pkey_sign,
30+ kernel_pkey_verify,
31+};
32+
33+struct kernel_pkey_params {
34+ struct key *key;
35+ const char *encoding; /* Encoding (eg. "oaep" or "raw" for none) */
36+ const char *hash_algo; /* Digest algorithm used (eg. "sha1") or NULL if N/A */
37+ char *info; /* Modified info string to be released later */
38+ __u32 in_len; /* Input data size */
39+ union {
40+ __u32 out_len; /* Output buffer size (enc/dec/sign) */
41+ __u32 in2_len; /* 2nd input data size (verify) */
42+ };
43+ enum kernel_pkey_operation op : 8;
44+};
45+
46+#endif /* __LINUX_KEYCTL_H */
include/linux/mlx5/mlx5_ifc.h+8−4
@@ -2473,14 +2473,15 @@ struct mlx5_ifc_xrc_srqc_bits { · 2472 unmodified lines
24732473
24742474 u8 wq_signature[0x1];
24752475 u8 cont_srq[0x1];
2476− u8 dbr_umem_valid[0x1];
2476+ u8 reserved_at_22[0x1];
24772477 u8 rlky[0x1];
24782478 u8 basic_cyclic_rcv_wqe[0x1];
24792479 u8 log_rq_stride[0x3];
24802480 u8 xrcd[0x18];
24812481
24822482 u8 page_offset[0x6];
2483− u8 reserved_at_46[0x2];
2483+ u8 reserved_at_46[0x1];
2484+ u8 dbr_umem_valid[0x1];
24842485 u8 cqn[0x18];
24852486
24862487 u8 reserved_at_60[0x20];
@@ -6689,9 +6690,12 @@ struct mlx5_ifc_create_xrc_srq_in_bits { · 4202 unmodified lines
66896690
66906691 struct mlx5_ifc_xrc_srqc_bits xrc_srq_context_entry;
66916692
6692− u8 reserved_at_280[0x40];
6693+ u8 reserved_at_280[0x60];
6694+
66936695 u8 xrc_srq_umem_valid[0x1];
6694− u8 reserved_at_2c1[0x5bf];
6696+ u8 reserved_at_2e1[0x1f];
6697+
6698+ u8 reserved_at_300[0x580];
66956699
66966700 u8 pas[0][0x40];
66976701 };
include/linux/mm.h+8−0
@@ -1744,11 +1744,15 @@ int __pud_alloc(struct mm_struct *mm, p4d_t *p4d, unsigned long address); · 1743 unmodified lines
17441744
17451745 static inline void mm_inc_nr_puds(struct mm_struct *mm)
17461746 {
1747+ if (mm_pud_folded(mm))
1748+ return;
17471749 atomic_long_add(PTRS_PER_PUD * sizeof(pud_t), &mm->pgtables_bytes);
17481750 }
17491751
17501752 static inline void mm_dec_nr_puds(struct mm_struct *mm)
17511753 {
1754+ if (mm_pud_folded(mm))
1755+ return;
17521756 atomic_long_sub(PTRS_PER_PUD * sizeof(pud_t), &mm->pgtables_bytes);
17531757 }
17541758 #endif
@@ -1768,11 +1772,15 @@ int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address); · 13 unmodified lines
17681772
17691773 static inline void mm_inc_nr_pmds(struct mm_struct *mm)
17701774 {
1775+ if (mm_pmd_folded(mm))
1776+ return;
17711777 atomic_long_add(PTRS_PER_PMD * sizeof(pmd_t), &mm->pgtables_bytes);
17721778 }
17731779
17741780 static inline void mm_dec_nr_pmds(struct mm_struct *mm)
17751781 {
1782+ if (mm_pmd_folded(mm))
1783+ return;
17761784 atomic_long_sub(PTRS_PER_PMD * sizeof(pmd_t), &mm->pgtables_bytes);
17771785 }
17781786 #endif
include/linux/mtd/nand.h+3−4
@@ -324,9 +324,8 @@ static inline unsigned int nanddev_ntargets(const struct nand_device *nand) · 323 unmodified lines
324324 */
325325 static inline unsigned int nanddev_neraseblocks(const struct nand_device *nand)
326326 {
327− return (u64)nand->memorg.luns_per_target *
328− nand->memorg.eraseblocks_per_lun *
329− nand->memorg.pages_per_eraseblock;
327+ return nand->memorg.ntargets * nand->memorg.luns_per_target *
328+ nand->memorg.eraseblocks_per_lun;
330329 }
331330
332331 /**
@@ -569,7 +568,7 @@ static inline void nanddev_pos_next_eraseblock(struct nand_device *nand, · 236 unmodified lines
569568 }
570569
571570 /**
572− * nanddev_pos_next_eraseblock() - Move a position to the next page
571+ * nanddev_pos_next_page() - Move a position to the next page
573572 * @nand: NAND device
574573 * @pos: the position to update
575574 *
include/linux/net_dim.h+2−0
@@ -406,6 +406,8 @@ static inline void net_dim(struct net_dim *dim, · 405 unmodified lines
406406 }
407407 /* fall through */
408408 case NET_DIM_START_MEASURE:
409+ net_dim_sample(end_sample.event_ctr, end_sample.pkt_ctr, end_sample.byte_ctr,
410+ &dim->start_sample);
409411 dim->state = NET_DIM_MEASURE_IN_PROGRESS;
410412 break;
411413 case NET_DIM_APPLY_NEW_PROFILE:
include/linux/netdevice.h+20−0
@@ -3190,6 +3190,26 @@ static inline void netdev_tx_sent_queue(struct netdev_queue *dev_queue, · 3189 unmodified lines
31903190 #endif
31913191 }
31923192
3193+/* Variant of netdev_tx_sent_queue() for drivers that are aware
3194+ * that they should not test BQL status themselves.
3195+ * We do want to change __QUEUE_STATE_STACK_XOFF only for the last
3196+ * skb of a batch.
3197+ * Returns true if the doorbell must be used to kick the NIC.
3198+ */
3199+static inline bool __netdev_tx_sent_queue(struct netdev_queue *dev_queue,
3200+ unsigned int bytes,
3201+ bool xmit_more)
3202+{
3203+ if (xmit_more) {
3204+#ifdef CONFIG_BQL
3205+ dql_queued(&dev_queue->dql, bytes);
3206+#endif
3207+ return netif_tx_queue_stopped(dev_queue);
3208+ }
3209+ netdev_tx_sent_queue(dev_queue, bytes);
3210+ return true;
3211+}
3212+
31933213 /**
31943214 * netdev_sent_queue - report the number of bytes queued to hardware
31953215 * @dev: network device
include/linux/netfilter/ipset/ip_set.h+1−1
@@ -314,7 +314,7 @@ enum { · 313 unmodified lines
314314 extern ip_set_id_t ip_set_get_byname(struct net *net,
315315 const char *name, struct ip_set **set);
316316 extern void ip_set_put_byindex(struct net *net, ip_set_id_t index);
317−extern const char *ip_set_name_byindex(struct net *net, ip_set_id_t index);
317+extern void ip_set_name_byindex(struct net *net, ip_set_id_t index, char *name);
318318 extern ip_set_id_t ip_set_nfnl_get_byindex(struct net *net, ip_set_id_t index);
319319 extern void ip_set_nfnl_put(struct net *net, ip_set_id_t index);
320320
include/linux/netfilter/ipset/ip_set_comment.h+2−2
@@ -43,11 +43,11 @@ ip_set_init_comment(struct ip_set *set, struct ip_set_comment *comment, · 42 unmodified lines
4343 rcu_assign_pointer(comment->c, c);
4444 }
4545
46−/* Used only when dumping a set, protected by rcu_read_lock_bh() */
46+/* Used only when dumping a set, protected by rcu_read_lock() */
4747 static inline int
4848 ip_set_put_comment(struct sk_buff *skb, const struct ip_set_comment *comment)
4949 {
50− struct ip_set_comment_rcu *c = rcu_dereference_bh(comment->c);
50+ struct ip_set_comment_rcu *c = rcu_dereference(comment->c);
5151
5252 if (!c)
5353 return 0;
include/linux/netfilter/nf_conntrack_proto_gre.h+13−0
@@ -21,6 +21,19 @@ struct nf_ct_gre_keymap { · 20 unmodified lines
2121 struct nf_conntrack_tuple tuple;
2222 };
2323
24+enum grep_conntrack {
25+ GRE_CT_UNREPLIED,
26+ GRE_CT_REPLIED,
27+ GRE_CT_MAX
28+};
29+
30+struct netns_proto_gre {
31+ struct nf_proto_net nf;
32+ rwlock_t keymap_lock;
33+ struct list_head keymap_list;
34+ unsigned int gre_timeouts[GRE_CT_MAX];
35+};
36+
2437 /* add new tuple->key_reply pair to keymap */
2538 int nf_ct_gre_keymap_add(struct nf_conn *ct, enum ip_conntrack_dir dir,
2639 struct nf_conntrack_tuple *t);
include/linux/nmi.h+2−0
@@ -119,6 +119,8 @@ static inline int hardlockup_detector_perf_init(void) { return 0; } · 118 unmodified lines
119119 void watchdog_nmi_stop(void);
120120 void watchdog_nmi_start(void);
121121 int watchdog_nmi_probe(void);
122+int watchdog_nmi_enable(unsigned int cpu);
123+void watchdog_nmi_disable(unsigned int cpu);
122124
123125 /**
124126 * touch_nmi_watchdog - restart NMI watchdog timeout.
include/linux/notifier.h+1−2
@@ -122,8 +122,7 @@ extern void srcu_init_notifier_head(struct srcu_notifier_head *nh); · 121 unmodified lines
122122
123123 #ifdef CONFIG_TREE_SRCU
124124 #define _SRCU_NOTIFIER_HEAD(name, mod) \
125− static DEFINE_PER_CPU(struct srcu_data, \
126− name##_head_srcu_data); \
125+ static DEFINE_PER_CPU(struct srcu_data, name##_head_srcu_data); \
127126 mod struct srcu_notifier_head name = \
128127 SRCU_NOTIFIER_INIT(name, name##_head_srcu_data)
129128
include/linux/platform_data/gpio-davinci.h+2−0
@@ -17,6 +17,8 @@ · 16 unmodified lines
1717 #define __DAVINCI_GPIO_PLATFORM_H
1818
1919 struct davinci_gpio_platform_data {
20+ bool no_auto_base;
21+ u32 base;
2022 u32 ngpio;
2123 u32 gpio_unbanked;
2224 };
include/linux/psi.h+2−1
@@ -1,6 +1,7 @@
11 #ifndef _LINUX_PSI_H
22 #define _LINUX_PSI_H
33
4+#include <linux/jump_label.h>
45 #include <linux/psi_types.h>
56 #include <linux/sched.h>
67
@@ -9,7 +10,7 @@ struct css_set; · 2 unmodified lines
910
1011 #ifdef CONFIG_PSI
1112
12−extern bool psi_disabled;
13+extern struct static_key_false psi_disabled;
1314
1415 void psi_init(void);
1516
include/linux/pstore.h+4−1
@@ -90,7 +90,10 @@ struct pstore_record { · 89 unmodified lines
9090 *
9191 * @buf_lock: spinlock to serialize access to @buf
9292 * @buf: preallocated crash dump buffer
93− * @bufsize: size of @buf available for crash dump writes
93+ * @bufsize: size of @buf available for crash dump bytes (must match
94+ * smallest number of bytes available for writing to a
95+ * backend entry, since compressed bytes don't take kindly
96+ * to being truncated)
9497 *
9598 * @read_mutex: serializes @open, @read, @close, and @erase callbacks
9699 * @flags: bitfield of frontends the backend can accept writes for
include/linux/ptrace.h+0−17
@@ -64,15 +64,12 @@ extern void exit_ptrace(struct task_struct *tracer, struct list_head *dead); · 63 unmodified lines
6464 #define PTRACE_MODE_NOAUDIT 0x04
6565 #define PTRACE_MODE_FSCREDS 0x08
6666 #define PTRACE_MODE_REALCREDS 0x10
67−#define PTRACE_MODE_SCHED 0x20
68−#define PTRACE_MODE_IBPB 0x40
6967
7068 /* shorthands for READ/ATTACH and FSCREDS/REALCREDS combinations */
7169 #define PTRACE_MODE_READ_FSCREDS (PTRACE_MODE_READ | PTRACE_MODE_FSCREDS)
7270 #define PTRACE_MODE_READ_REALCREDS (PTRACE_MODE_READ | PTRACE_MODE_REALCREDS)
7371 #define PTRACE_MODE_ATTACH_FSCREDS (PTRACE_MODE_ATTACH | PTRACE_MODE_FSCREDS)
7472 #define PTRACE_MODE_ATTACH_REALCREDS (PTRACE_MODE_ATTACH | PTRACE_MODE_REALCREDS)
75−#define PTRACE_MODE_SPEC_IBPB (PTRACE_MODE_ATTACH_REALCREDS | PTRACE_MODE_IBPB)
7673
7774 /**
7875 * ptrace_may_access - check whether the caller is permitted to access
@@ -90,20 +87,6 @@ extern void exit_ptrace(struct task_struct *tracer, struct list_head *dead); · 11 unmodified lines
9087 */
9188 extern bool ptrace_may_access(struct task_struct *task, unsigned int mode);
9289
93−/**
94− * ptrace_may_access - check whether the caller is permitted to access
95− * a target task.
96− * @task: target task
97− * @mode: selects type of access and caller credentials
98− *
99− * Returns true on success, false on denial.
100− *
101− * Similar to ptrace_may_access(). Only to be called from context switch
102− * code. Does not call into audit and the regular LSM hooks due to locking
103− * constraints.
104− */
105−extern bool ptrace_may_access_sched(struct task_struct *task, unsigned int mode);
106−
10790 static inline int ptrace_reparented(struct task_struct *child)
10891 {
10992 return !same_thread_group(child->real_parent, child->parent);
include/linux/sched.h+15−0
@@ -1116,6 +1116,7 @@ struct task_struct { · 1115 unmodified lines
11161116 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
11171117 /* Index of current stored address in ret_stack: */
11181118 int curr_ret_stack;
1119+ int curr_ret_depth;
11191120
11201121 /* Stack of return addresses for return function tracing: */
11211122 struct ftrace_ret_stack *ret_stack;
@@ -1200,6 +1201,11 @@ struct task_struct { · 78 unmodified lines
12001201 void *security;
12011202 #endif
12021203
1204+#ifdef CONFIG_GCC_PLUGIN_STACKLEAK
1205+ unsigned long lowest_stack;
1206+ unsigned long prev_lowest_stack;
1207+#endif
1208+
12031209 /*
12041210 * New fields for task_struct should be added above here, so that
12051211 * they are included in the randomized portion of task_struct.
@@ -1448,6 +1454,8 @@ static inline bool is_percpu_thread(void) · 242 unmodified lines
14481454 #define PFA_SPREAD_SLAB 2 /* Spread some slab caches over cpuset */
14491455 #define PFA_SPEC_SSB_DISABLE 3 /* Speculative Store Bypass disabled */
14501456 #define PFA_SPEC_SSB_FORCE_DISABLE 4 /* Speculative Store Bypass force disabled*/
1457+#define PFA_SPEC_IB_DISABLE 5 /* Indirect branch speculation restricted */
1458+#define PFA_SPEC_IB_FORCE_DISABLE 6 /* Indirect branch speculation permanently restricted */
14511459
14521460 #define TASK_PFA_TEST(name, func) \
14531461 static inline bool task_##func(struct task_struct *p) \
@@ -1479,6 +1487,13 @@ TASK_PFA_CLEAR(SPEC_SSB_DISABLE, spec_ssb_disable) · 25 unmodified lines
14791487 TASK_PFA_TEST(SPEC_SSB_FORCE_DISABLE, spec_ssb_force_disable)
14801488 TASK_PFA_SET(SPEC_SSB_FORCE_DISABLE, spec_ssb_force_disable)
14811489
1490+TASK_PFA_TEST(SPEC_IB_DISABLE, spec_ib_disable)
1491+TASK_PFA_SET(SPEC_IB_DISABLE, spec_ib_disable)
1492+TASK_PFA_CLEAR(SPEC_IB_DISABLE, spec_ib_disable)
1493+
1494+TASK_PFA_TEST(SPEC_IB_FORCE_DISABLE, spec_ib_force_disable)
1495+TASK_PFA_SET(SPEC_IB_FORCE_DISABLE, spec_ib_force_disable)
1496+
14821497 static inline void
14831498 current_restore_flags(unsigned long orig_flags, unsigned long flags)
14841499 {
include/linux/sched/smt.h+20−0
@@ -0,0 +1,20 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef _LINUX_SCHED_SMT_H
3+#define _LINUX_SCHED_SMT_H
4+
5+#include <linux/static_key.h>
6+
7+#ifdef CONFIG_SCHED_SMT
8+extern struct static_key_false sched_smt_present;
9+
10+static __always_inline bool sched_smt_active(void)
11+{
12+ return static_branch_likely(&sched_smt_present);
13+}
14+#else
15+static inline bool sched_smt_active(void) { return false; }
16+#endif
17+
18+void arch_smt_update(void);
19+
20+#endif
include/linux/sfp.h+1−1
@@ -224,7 +224,7 @@ struct sfp_eeprom_ext { · 223 unmodified lines
224224 *
225225 * See the SFF-8472 specification and related documents for the definition
226226 * of these structure members. This can be obtained from
227− * ftp://ftp.seagate.com/sff
227+ * https://www.snia.org/technology-communities/sff/specifications
228228 */
229229 struct sfp_eeprom_id {
230230 struct sfp_eeprom_base base;
include/linux/skbuff.h+17−1
@@ -1326,6 +1326,22 @@ static inline void skb_zcopy_set(struct sk_buff *skb, struct ubuf_info *uarg) · 1325 unmodified lines
13261326 }
13271327 }
13281328
1329+static inline void skb_zcopy_set_nouarg(struct sk_buff *skb, void *val)
1330+{
1331+ skb_shinfo(skb)->destructor_arg = (void *)((uintptr_t) val | 0x1UL);
1332+ skb_shinfo(skb)->tx_flags |= SKBTX_ZEROCOPY_FRAG;
1333+}
1334+
1335+static inline bool skb_zcopy_is_nouarg(struct sk_buff *skb)
1336+{
1337+ return (uintptr_t) skb_shinfo(skb)->destructor_arg & 0x1UL;
1338+}
1339+
1340+static inline void *skb_zcopy_get_nouarg(struct sk_buff *skb)
1341+{
1342+ return (void *)((uintptr_t) skb_shinfo(skb)->destructor_arg & ~0x1UL);
1343+}
1344+
13291345 /* Release a reference on a zerocopy structure */
13301346 static inline void skb_zcopy_clear(struct sk_buff *skb, bool zerocopy)
13311347 {
@@ -1335,7 +1351,7 @@ static inline void skb_zcopy_clear(struct sk_buff *skb, bool zerocopy) · 3 unmodified lines
13351351 if (uarg->callback == sock_zerocopy_callback) {
13361352 uarg->zerocopy = uarg->zerocopy && zerocopy;
13371353 sock_zerocopy_put(uarg);
1338− } else {
1354+ } else if (!skb_zcopy_is_nouarg(skb)) {
13391355 uarg->callback(uarg, zerocopy);
13401356 }
13411357
include/linux/stackleak.h+35−0
@@ -0,0 +1,35 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef _LINUX_STACKLEAK_H
3+#define _LINUX_STACKLEAK_H
4+
5+#include <linux/sched.h>
6+#include <linux/sched/task_stack.h>
7+
8+/*
9+ * Check that the poison value points to the unused hole in the
10+ * virtual memory map for your platform.
11+ */
12+#define STACKLEAK_POISON -0xBEEF
13+#define STACKLEAK_SEARCH_DEPTH 128
14+
15+#ifdef CONFIG_GCC_PLUGIN_STACKLEAK
16+#include <asm/stacktrace.h>
17+
18+static inline void stackleak_task_init(struct task_struct *t)
19+{
20+ t->lowest_stack = (unsigned long)end_of_stack(t) + sizeof(unsigned long);
21+# ifdef CONFIG_STACKLEAK_METRICS
22+ t->prev_lowest_stack = t->lowest_stack;
23+# endif
24+}
25+
26+#ifdef CONFIG_STACKLEAK_RUNTIME_DISABLE
27+int stack_erasing_sysctl(struct ctl_table *table, int write,
28+ void __user *buffer, size_t *lenp, loff_t *ppos);
29+#endif
30+
31+#else /* !CONFIG_GCC_PLUGIN_STACKLEAK */
32+static inline void stackleak_task_init(struct task_struct *t) { }
33+#endif
34+
35+#endif
include/linux/sunrpc/gss_krb5.h+2−5
@@ -107,8 +107,8 @@ struct krb5_ctx { · 106 unmodified lines
107107 u8 Ksess[GSS_KRB5_MAX_KEYLEN]; /* session key */
108108 u8 cksum[GSS_KRB5_MAX_KEYLEN];
109109 s32 endtime;
110− u32 seq_send;
111− u64 seq_send64;
110+ atomic_t seq_send;
111+ atomic64_t seq_send64;
112112 struct xdr_netobj mech_used;
113113 u8 initiator_sign[GSS_KRB5_MAX_KEYLEN];
114114 u8 acceptor_sign[GSS_KRB5_MAX_KEYLEN];
@@ -118,9 +118,6 @@ struct krb5_ctx { · 3 unmodified lines
118118 u8 acceptor_integ[GSS_KRB5_MAX_KEYLEN];
119119 };
120120
121−extern u32 gss_seq_send_fetch_and_inc(struct krb5_ctx *ctx);
122−extern u64 gss_seq_send64_fetch_and_inc(struct krb5_ctx *ctx);
123−
124121 /* The length of the Kerberos GSS token header */
125122 #define GSS_KRB5_TOK_HDR_LEN (16)
126123
include/linux/sunrpc/xdr.h+0−1
@@ -72,7 +72,6 @@ xdr_buf_init(struct xdr_buf *buf, void *start, size_t len) · 71 unmodified lines
7272 buf->head[0].iov_base = start;
7373 buf->head[0].iov_len = len;
7474 buf->tail[0].iov_len = 0;
75− buf->bvec = NULL;
7675 buf->pages = NULL;
7776 buf->page_len = 0;
7877 buf->flags = 0;
include/linux/tcp.h+1−0
@@ -196,6 +196,7 @@ struct tcp_sock { · 195 unmodified lines
196196 u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */
197197 u32 lsndtime; /* timestamp of last sent data packet (for restart window) */
198198 u32 last_oow_ack_time; /* timestamp of last out-of-window ACK */
199+ u32 compressed_ack_rcv_nxt;
199200
200201 u32 tsoffset; /* timestamp offset */
201202
include/linux/tracehook.h+2−2
@@ -83,8 +83,8 @@ static inline int ptrace_report_syscall(struct pt_regs *regs) · 82 unmodified lines
8383 * tracehook_report_syscall_entry - task is about to attempt a system call
8484 * @regs: user register state of current task
8585 *
86− * This will be called if %TIF_SYSCALL_TRACE has been set, when the
87− * current task has just entered the kernel for a system call.
86+ * This will be called if %TIF_SYSCALL_TRACE or %TIF_SYSCALL_EMU have been set,
87+ * when the current task has just entered the kernel for a system call.
8888 * Full user register state is available here. Changing the values
8989 * in @regs can affect the system call number and arguments to be tried.
9090 * It is safe to block here, preventing the system call from beginning.
include/linux/tracepoint.h+3−3
@@ -166,7 +166,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p) · 165 unmodified lines
166166 struct tracepoint_func *it_func_ptr; \
167167 void *it_func; \
168168 void *__data; \
169− int __maybe_unused idx = 0; \
169+ int __maybe_unused __idx = 0; \
170170 \
171171 if (!(cond)) \
172172 return; \
@@ -182,7 +182,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p) · 9 unmodified lines
182182 * doesn't work from the idle path. \
183183 */ \
184184 if (rcuidle) { \
185− idx = srcu_read_lock_notrace(&tracepoint_srcu); \
185+ __idx = srcu_read_lock_notrace(&tracepoint_srcu);\
186186 rcu_irq_enter_irqson(); \
187187 } \
188188 \
@@ -198,7 +198,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p) · 9 unmodified lines
198198 \
199199 if (rcuidle) { \
200200 rcu_irq_exit_irqson(); \
201− srcu_read_unlock_notrace(&tracepoint_srcu, idx);\
201+ srcu_read_unlock_notrace(&tracepoint_srcu, __idx);\
202202 } \
203203 \
204204 preempt_enable_notrace(); \
include/linux/tty.h+1−0
@@ -556,6 +556,7 @@ extern struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx); · 555 unmodified lines
556556 extern void tty_release_struct(struct tty_struct *tty, int idx);
557557 extern int tty_release(struct inode *inode, struct file *filp);
558558 extern void tty_init_termios(struct tty_struct *tty);
559+extern void tty_save_termios(struct tty_struct *tty);
559560 extern int tty_standard_install(struct tty_driver *driver,
560561 struct tty_struct *tty);
561562
include/linux/uio.h+45−20
@@ -21,15 +21,16 @@ struct kvec { · 20 unmodified lines
2121 size_t iov_len;
2222 };
2323
24−enum {
24+enum iter_type {
2525 ITER_IOVEC = 0,
2626 ITER_KVEC = 2,
2727 ITER_BVEC = 4,
2828 ITER_PIPE = 8,
29+ ITER_DISCARD = 16,
2930 };
3031
3132 struct iov_iter {
32− int type;
33+ unsigned int type;
3334 size_t iov_offset;
3435 size_t count;
3536 union {
@@ -47,6 +48,41 @@ struct iov_iter { · 11 unmodified lines
4748 };
4849 };
4950
51+static inline enum iter_type iov_iter_type(const struct iov_iter *i)
52+{
53+ return i->type & ~(READ | WRITE);
54+}
55+
56+static inline bool iter_is_iovec(const struct iov_iter *i)
57+{
58+ return iov_iter_type(i) == ITER_IOVEC;
59+}
60+
61+static inline bool iov_iter_is_kvec(const struct iov_iter *i)
62+{
63+ return iov_iter_type(i) == ITER_KVEC;
64+}
65+
66+static inline bool iov_iter_is_bvec(const struct iov_iter *i)
67+{
68+ return iov_iter_type(i) == ITER_BVEC;
69+}
70+
71+static inline bool iov_iter_is_pipe(const struct iov_iter *i)
72+{
73+ return iov_iter_type(i) == ITER_PIPE;
74+}
75+
76+static inline bool iov_iter_is_discard(const struct iov_iter *i)
77+{
78+ return iov_iter_type(i) == ITER_DISCARD;
79+}
80+
81+static inline unsigned char iov_iter_rw(const struct iov_iter *i)
82+{
83+ return i->type & (READ | WRITE);
84+}
85+
5086 /*
5187 * Total number of bytes covered by an iovec.
5288 *
@@ -74,7 +110,8 @@ static inline struct iovec iov_iter_iovec(const struct iov_iter *iter) · 21 unmodified lines
74110 }
75111
76112 #define iov_for_each(iov, iter, start) \
77− if (!((start).type & (ITER_BVEC | ITER_PIPE))) \
113+ if (iov_iter_type(start) == ITER_IOVEC || \
114+ iov_iter_type(start) == ITER_KVEC) \
78115 for (iter = (start); \
79116 (iter).count && \
80117 ((iov = iov_iter_iovec(&(iter))), 1); \
@@ -181,14 +218,15 @@ size_t copy_to_iter_mcsafe(void *addr, size_t bytes, struct iov_iter *i) · 100 unmodified lines
181218 size_t iov_iter_zero(size_t bytes, struct iov_iter *);
182219 unsigned long iov_iter_alignment(const struct iov_iter *i);
183220 unsigned long iov_iter_gap_alignment(const struct iov_iter *i);
184−void iov_iter_init(struct iov_iter *i, int direction, const struct iovec *iov,
221+void iov_iter_init(struct iov_iter *i, unsigned int direction, const struct iovec *iov,
185222 unsigned long nr_segs, size_t count);
186−void iov_iter_kvec(struct iov_iter *i, int direction, const struct kvec *kvec,
223+void iov_iter_kvec(struct iov_iter *i, unsigned int direction, const struct kvec *kvec,
187224 unsigned long nr_segs, size_t count);
188−void iov_iter_bvec(struct iov_iter *i, int direction, const struct bio_vec *bvec,
225+void iov_iter_bvec(struct iov_iter *i, unsigned int direction, const struct bio_vec *bvec,
189226 unsigned long nr_segs, size_t count);
190−void iov_iter_pipe(struct iov_iter *i, int direction, struct pipe_inode_info *pipe,
227+void iov_iter_pipe(struct iov_iter *i, unsigned int direction, struct pipe_inode_info *pipe,
191228 size_t count);
229+void iov_iter_discard(struct iov_iter *i, unsigned int direction, size_t count);
192230 ssize_t iov_iter_get_pages(struct iov_iter *i, struct page **pages,
193231 size_t maxsize, unsigned maxpages, size_t *start);
194232 ssize_t iov_iter_get_pages_alloc(struct iov_iter *i, struct page ***pages,
@@ -202,19 +240,6 @@ static inline size_t iov_iter_count(const struct iov_iter *i) · 7 unmodified lines
202240 return i->count;
203241 }
204242
205−static inline bool iter_is_iovec(const struct iov_iter *i)
206−{
207− return !(i->type & (ITER_BVEC | ITER_KVEC | ITER_PIPE));
208−}
209−
210−/*
211− * Get one of READ or WRITE out of iter->type without any other flags OR'd in
212− * with it.
213− *
214− * The ?: is just for type safety.
215− */
216−#define iov_iter_rw(i) ((0 ? (struct iov_iter *)0 : (i))->type & (READ | WRITE))
217−
218243 /*
219244 * Cap the iov_iter by given limit; note that the second argument is
220245 * *not* the new size - it's upper limit for such. Passing it a value
include/linux/usb.h+2−2
@@ -407,11 +407,11 @@ struct usb_host_bos { · 406 unmodified lines
407407 };
408408
409409 int __usb_get_extra_descriptor(char *buffer, unsigned size,
410− unsigned char type, void **ptr);
410+ unsigned char type, void **ptr, size_t min);
411411 #define usb_get_extra_descriptor(ifpoint, type, ptr) \
412412 __usb_get_extra_descriptor((ifpoint)->extra, \
413413 (ifpoint)->extralen, \
414− type, (void **)ptr)
414+ type, (void **)ptr, sizeof(**(ptr)))
415415
416416 /* ----------------------------------------------------------------------- */
417417
include/linux/usb/quirks.h+3−0
@@ -66,4 +66,7 @@ · 65 unmodified lines
6666 /* Device needs a pause after every control message. */
6767 #define USB_QUIRK_DELAY_CTRL_MSG BIT(13)
6868
69+/* Hub needs extra delay after resetting its port. */
70+#define USB_QUIRK_HUB_SLOW_RESET BIT(14)
71+
6972 #endif /* __LINUX_USB_QUIRKS_H */
include/linux/writeback.h+2−3
@@ -246,8 +246,7 @@ static inline void wbc_attach_fdatawrite_inode(struct writeback_control *wbc, · 245 unmodified lines
246246 *
247247 * @bio is a part of the writeback in progress controlled by @wbc. Perform
248248 * writeback specific initialization. This is used to apply the cgroup
249− * writeback context. Must be called after the bio has been associated with
250− * a device.
249+ * writeback context.
251250 */
252251 static inline void wbc_init_bio(struct writeback_control *wbc, struct bio *bio)
253252 {
@@ -258,7 +257,7 @@ static inline void wbc_init_bio(struct writeback_control *wbc, struct bio *bio) · 4 unmodified lines
258257 * regular writeback instead of writing things out itself.
259258 */
260259 if (wbc->wb)
261− bio_associate_blkg_from_css(bio, wbc->wb->blkcg_css);
260+ bio_associate_blkcg(bio, wbc->wb->blkcg_css);
262261 }
263262
264263 #else /* CONFIG_CGROUP_WRITEBACK */
include/linux/xarray.h+203−64
@@ -289,9 +289,7 @@ struct xarray { · 288 unmodified lines
289289 void xa_init_flags(struct xarray *, gfp_t flags);
290290 void *xa_load(struct xarray *, unsigned long index);
291291 void *xa_store(struct xarray *, unsigned long index, void *entry, gfp_t);
292−void *xa_cmpxchg(struct xarray *, unsigned long index,
293− void *old, void *entry, gfp_t);
294−int xa_reserve(struct xarray *, unsigned long index, gfp_t);
292+void *xa_erase(struct xarray *, unsigned long index);
295293 void *xa_store_range(struct xarray *, unsigned long first, unsigned long last,
296294 void *entry, gfp_t);
297295 bool xa_get_mark(struct xarray *, unsigned long index, xa_mark_t);
@@ -343,65 +341,6 @@ static inline bool xa_marked(const struct xarray *xa, xa_mark_t mark) · 45 unmodified lines
343341 return xa->xa_flags & XA_FLAGS_MARK(mark);
344342 }
345343
346−/**
347− * xa_erase() - Erase this entry from the XArray.
348− * @xa: XArray.
349− * @index: Index of entry.
350− *
351− * This function is the equivalent of calling xa_store() with %NULL as
352− * the third argument. The XArray does not need to allocate memory, so
353− * the user does not need to provide GFP flags.
354− *
355− * Context: Process context. Takes and releases the xa_lock.
356− * Return: The entry which used to be at this index.
357− */
358−static inline void *xa_erase(struct xarray *xa, unsigned long index)
359−{
360− return xa_store(xa, index, NULL, 0);
361−}
362−
363−/**
364− * xa_insert() - Store this entry in the XArray unless another entry is
365− * already present.
366− * @xa: XArray.
367− * @index: Index into array.
368− * @entry: New entry.
369− * @gfp: Memory allocation flags.
370− *
371− * If you would rather see the existing entry in the array, use xa_cmpxchg().
372− * This function is for users who don't care what the entry is, only that
373− * one is present.
374− *
375− * Context: Process context. Takes and releases the xa_lock.
376− * May sleep if the @gfp flags permit.
377− * Return: 0 if the store succeeded. -EEXIST if another entry was present.
378− * -ENOMEM if memory could not be allocated.
379− */
380−static inline int xa_insert(struct xarray *xa, unsigned long index,
381− void *entry, gfp_t gfp)
382−{
383− void *curr = xa_cmpxchg(xa, index, NULL, entry, gfp);
384− if (!curr)
385− return 0;
386− if (xa_is_err(curr))
387− return xa_err(curr);
388− return -EEXIST;
389−}
390−
391−/**
392− * xa_release() - Release a reserved entry.
393− * @xa: XArray.
394− * @index: Index of entry.
395− *
396− * After calling xa_reserve(), you can call this function to release the
397− * reservation. If the entry at @index has been stored to, this function
398− * will do nothing.
399− */
400−static inline void xa_release(struct xarray *xa, unsigned long index)
401−{
402− xa_cmpxchg(xa, index, NULL, NULL, 0);
403−}
404−
405344 /**
406345 * xa_for_each() - Iterate over a portion of an XArray.
407346 * @xa: XArray.
@@ -455,6 +394,7 @@ void *__xa_store(struct xarray *, unsigned long index, void *entry, gfp_t); · 47 unmodified lines
455394 void *__xa_cmpxchg(struct xarray *, unsigned long index, void *old,
456395 void *entry, gfp_t);
457396 int __xa_alloc(struct xarray *, u32 *id, u32 max, void *entry, gfp_t);
397+int __xa_reserve(struct xarray *, unsigned long index, gfp_t);
458398 void __xa_set_mark(struct xarray *, unsigned long index, xa_mark_t);
459399 void __xa_clear_mark(struct xarray *, unsigned long index, xa_mark_t);
460400
@@ -486,6 +426,58 @@ static inline int __xa_insert(struct xarray *xa, unsigned long index, · 25 unmodified lines
486426 return -EEXIST;
487427 }
488428
429+/**
430+ * xa_store_bh() - Store this entry in the XArray.
431+ * @xa: XArray.
432+ * @index: Index into array.
433+ * @entry: New entry.
434+ * @gfp: Memory allocation flags.
435+ *
436+ * This function is like calling xa_store() except it disables softirqs
437+ * while holding the array lock.
438+ *
439+ * Context: Any context. Takes and releases the xa_lock while
440+ * disabling softirqs.
441+ * Return: The entry which used to be at this index.
442+ */
443+static inline void *xa_store_bh(struct xarray *xa, unsigned long index,
444+ void *entry, gfp_t gfp)
445+{
446+ void *curr;
447+
448+ xa_lock_bh(xa);
449+ curr = __xa_store(xa, index, entry, gfp);
450+ xa_unlock_bh(xa);
451+
452+ return curr;
453+}
454+
455+/**
456+ * xa_store_irq() - Erase this entry from the XArray.
457+ * @xa: XArray.
458+ * @index: Index into array.
459+ * @entry: New entry.
460+ * @gfp: Memory allocation flags.
461+ *
462+ * This function is like calling xa_store() except it disables interrupts
463+ * while holding the array lock.
464+ *
465+ * Context: Process context. Takes and releases the xa_lock while
466+ * disabling interrupts.
467+ * Return: The entry which used to be at this index.
468+ */
469+static inline void *xa_store_irq(struct xarray *xa, unsigned long index,
470+ void *entry, gfp_t gfp)
471+{
472+ void *curr;
473+
474+ xa_lock_irq(xa);
475+ curr = __xa_store(xa, index, entry, gfp);
476+ xa_unlock_irq(xa);
477+
478+ return curr;
479+}
480+
489481 /**
490482 * xa_erase_bh() - Erase this entry from the XArray.
491483 * @xa: XArray.
@@ -495,7 +487,7 @@ static inline int __xa_insert(struct xarray *xa, unsigned long index, · 3 unmodified lines
495487 * the third argument. The XArray does not need to allocate memory, so
496488 * the user does not need to provide GFP flags.
497489 *
498− * Context: Process context. Takes and releases the xa_lock while
490+ * Context: Any context. Takes and releases the xa_lock while
499491 * disabling softirqs.
500492 * Return: The entry which used to be at this index.
501493 */
@@ -534,6 +526,61 @@ static inline void *xa_erase_irq(struct xarray *xa, unsigned long index) · 32 unmodified lines
534526 return entry;
535527 }
536528
529+/**
530+ * xa_cmpxchg() - Conditionally replace an entry in the XArray.
531+ * @xa: XArray.
532+ * @index: Index into array.
533+ * @old: Old value to test against.
534+ * @entry: New value to place in array.
535+ * @gfp: Memory allocation flags.
536+ *
537+ * If the entry at @index is the same as @old, replace it with @entry.
538+ * If the return value is equal to @old, then the exchange was successful.
539+ *
540+ * Context: Any context. Takes and releases the xa_lock. May sleep
541+ * if the @gfp flags permit.
542+ * Return: The old value at this index or xa_err() if an error happened.
543+ */
544+static inline void *xa_cmpxchg(struct xarray *xa, unsigned long index,
545+ void *old, void *entry, gfp_t gfp)
546+{
547+ void *curr;
548+
549+ xa_lock(xa);
550+ curr = __xa_cmpxchg(xa, index, old, entry, gfp);
551+ xa_unlock(xa);
552+
553+ return curr;
554+}
555+
556+/**
557+ * xa_insert() - Store this entry in the XArray unless another entry is
558+ * already present.
559+ * @xa: XArray.
560+ * @index: Index into array.
561+ * @entry: New entry.
562+ * @gfp: Memory allocation flags.
563+ *
564+ * If you would rather see the existing entry in the array, use xa_cmpxchg().
565+ * This function is for users who don't care what the entry is, only that
566+ * one is present.
567+ *
568+ * Context: Process context. Takes and releases the xa_lock.
569+ * May sleep if the @gfp flags permit.
570+ * Return: 0 if the store succeeded. -EEXIST if another entry was present.
571+ * -ENOMEM if memory could not be allocated.
572+ */
573+static inline int xa_insert(struct xarray *xa, unsigned long index,
574+ void *entry, gfp_t gfp)
575+{
576+ void *curr = xa_cmpxchg(xa, index, NULL, entry, gfp);
577+ if (!curr)
578+ return 0;
579+ if (xa_is_err(curr))
580+ return xa_err(curr);
581+ return -EEXIST;
582+}
583+
537584 /**
538585 * xa_alloc() - Find somewhere to store this entry in the XArray.
539586 * @xa: XArray.
@@ -575,7 +622,7 @@ static inline int xa_alloc(struct xarray *xa, u32 *id, u32 max, void *entry, · 35 unmodified lines
575622 * Updates the @id pointer with the index, then stores the entry at that
576623 * index. A concurrent lookup will not see an uninitialised @id.
577624 *
578− * Context: Process context. Takes and releases the xa_lock while
625+ * Context: Any context. Takes and releases the xa_lock while
579626 * disabling softirqs. May sleep if the @gfp flags permit.
580627 * Return: 0 on success, -ENOMEM if memory allocation fails or -ENOSPC if
581628 * there is no more space in the XArray.
@@ -621,6 +668,98 @@ static inline int xa_alloc_irq(struct xarray *xa, u32 *id, u32 max, void *entry, · 39 unmodified lines
621668 return err;
622669 }
623670
671+/**
672+ * xa_reserve() - Reserve this index in the XArray.
673+ * @xa: XArray.
674+ * @index: Index into array.
675+ * @gfp: Memory allocation flags.
676+ *
677+ * Ensures there is somewhere to store an entry at @index in the array.
678+ * If there is already something stored at @index, this function does
679+ * nothing. If there was nothing there, the entry is marked as reserved.
680+ * Loading from a reserved entry returns a %NULL pointer.
681+ *
682+ * If you do not use the entry that you have reserved, call xa_release()
683+ * or xa_erase() to free any unnecessary memory.
684+ *
685+ * Context: Any context. Takes and releases the xa_lock.
686+ * May sleep if the @gfp flags permit.
687+ * Return: 0 if the reservation succeeded or -ENOMEM if it failed.
688+ */
689+static inline
690+int xa_reserve(struct xarray *xa, unsigned long index, gfp_t gfp)
691+{
692+ int ret;
693+
694+ xa_lock(xa);
695+ ret = __xa_reserve(xa, index, gfp);
696+ xa_unlock(xa);
697+
698+ return ret;
699+}
700+
701+/**
702+ * xa_reserve_bh() - Reserve this index in the XArray.
703+ * @xa: XArray.
704+ * @index: Index into array.
705+ * @gfp: Memory allocation flags.
706+ *
707+ * A softirq-disabling version of xa_reserve().
708+ *
709+ * Context: Any context. Takes and releases the xa_lock while
710+ * disabling softirqs.
711+ * Return: 0 if the reservation succeeded or -ENOMEM if it failed.
712+ */
713+static inline
714+int xa_reserve_bh(struct xarray *xa, unsigned long index, gfp_t gfp)
715+{
716+ int ret;
717+
718+ xa_lock_bh(xa);
719+ ret = __xa_reserve(xa, index, gfp);
720+ xa_unlock_bh(xa);
721+
722+ return ret;
723+}
724+
725+/**
726+ * xa_reserve_irq() - Reserve this index in the XArray.
727+ * @xa: XArray.
728+ * @index: Index into array.
729+ * @gfp: Memory allocation flags.
730+ *
731+ * An interrupt-disabling version of xa_reserve().
732+ *
733+ * Context: Process context. Takes and releases the xa_lock while
734+ * disabling interrupts.
735+ * Return: 0 if the reservation succeeded or -ENOMEM if it failed.
736+ */
737+static inline
738+int xa_reserve_irq(struct xarray *xa, unsigned long index, gfp_t gfp)
739+{
740+ int ret;
741+
742+ xa_lock_irq(xa);
743+ ret = __xa_reserve(xa, index, gfp);
744+ xa_unlock_irq(xa);
745+
746+ return ret;
747+}
748+
749+/**
750+ * xa_release() - Release a reserved entry.
751+ * @xa: XArray.
752+ * @index: Index of entry.
753+ *
754+ * After calling xa_reserve(), you can call this function to release the
755+ * reservation. If the entry at @index has been stored to, this function
756+ * will do nothing.
757+ */
758+static inline void xa_release(struct xarray *xa, unsigned long index)
759+{
760+ xa_cmpxchg(xa, index, NULL, NULL, 0);
761+}
762+
624763 /* Everything below here is the Advanced API. Proceed with caution. */
625764
626765 /*