diff options
| author | Ingo Molnar <mingo@kernel.org> | 2018-03-09 01:32:20 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2018-03-09 01:32:20 -0500 |
| commit | fc4c5a3828bdba157f8ea406e1f4ceb75c13039c (patch) | |
| tree | e3fc4601f914fa59e70c7534206cf5c2c6ba16d1 /include/linux | |
| parent | 14a7405b2e814221a951bd7a76ce4a8d24c1b3be (diff) | |
| parent | 1b88accf6a659c46d5c8e68912896f112bf882bb (diff) | |
Merge branch 'linus' into sched/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/bio.h | 4 | ||||
| -rw-r--r-- | include/linux/compat.h | 4 | ||||
| -rw-r--r-- | include/linux/compiler-clang.h | 5 | ||||
| -rw-r--r-- | include/linux/compiler-gcc.h | 19 | ||||
| -rw-r--r-- | include/linux/compiler.h | 5 | ||||
| -rw-r--r-- | include/linux/fs.h | 2 | ||||
| -rw-r--r-- | include/linux/genhd.h | 4 | ||||
| -rw-r--r-- | include/linux/init.h | 8 | ||||
| -rw-r--r-- | include/linux/jump_label.h | 3 | ||||
| -rw-r--r-- | include/linux/kconfig.h | 9 | ||||
| -rw-r--r-- | include/linux/kernel.h | 1 | ||||
| -rw-r--r-- | include/linux/kvm_host.h | 6 | ||||
| -rw-r--r-- | include/linux/memcontrol.h | 24 | ||||
| -rw-r--r-- | include/linux/mutex.h | 5 | ||||
| -rw-r--r-- | include/linux/nospec.h | 26 | ||||
| -rw-r--r-- | include/linux/perf/arm_pmu.h | 26 | ||||
| -rw-r--r-- | include/linux/phy.h | 1 | ||||
| -rw-r--r-- | include/linux/ptr_ring.h | 2 | ||||
| -rw-r--r-- | include/linux/sched/mm.h | 13 | ||||
| -rw-r--r-- | include/linux/sched/user.h | 4 | ||||
| -rw-r--r-- | include/linux/skbuff.h | 37 | ||||
| -rw-r--r-- | include/linux/swap.h | 2 | ||||
| -rw-r--r-- | include/linux/workqueue.h | 1 |
23 files changed, 106 insertions, 105 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h index d0eb659fa733..ce547a25e8ae 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
| @@ -511,6 +511,7 @@ void zero_fill_bio(struct bio *bio); | |||
| 511 | extern struct bio_vec *bvec_alloc(gfp_t, int, unsigned long *, mempool_t *); | 511 | extern struct bio_vec *bvec_alloc(gfp_t, int, unsigned long *, mempool_t *); |
| 512 | extern void bvec_free(mempool_t *, struct bio_vec *, unsigned int); | 512 | extern void bvec_free(mempool_t *, struct bio_vec *, unsigned int); |
| 513 | extern unsigned int bvec_nr_vecs(unsigned short idx); | 513 | extern unsigned int bvec_nr_vecs(unsigned short idx); |
| 514 | extern const char *bio_devname(struct bio *bio, char *buffer); | ||
| 514 | 515 | ||
| 515 | #define bio_set_dev(bio, bdev) \ | 516 | #define bio_set_dev(bio, bdev) \ |
| 516 | do { \ | 517 | do { \ |
| @@ -529,9 +530,6 @@ do { \ | |||
| 529 | #define bio_dev(bio) \ | 530 | #define bio_dev(bio) \ |
| 530 | disk_devt((bio)->bi_disk) | 531 | disk_devt((bio)->bi_disk) |
| 531 | 532 | ||
| 532 | #define bio_devname(bio, buf) \ | ||
| 533 | __bdevname(bio_dev(bio), (buf)) | ||
| 534 | |||
| 535 | #ifdef CONFIG_BLK_CGROUP | 533 | #ifdef CONFIG_BLK_CGROUP |
| 536 | int bio_associate_blkcg(struct bio *bio, struct cgroup_subsys_state *blkcg_css); | 534 | int bio_associate_blkcg(struct bio *bio, struct cgroup_subsys_state *blkcg_css); |
| 537 | void bio_disassociate_task(struct bio *bio); | 535 | void bio_disassociate_task(struct bio *bio); |
diff --git a/include/linux/compat.h b/include/linux/compat.h index 8a9643857c4a..e16d07eb08cf 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
| @@ -229,13 +229,13 @@ typedef struct compat_siginfo { | |||
| 229 | short int _addr_lsb; /* Valid LSB of the reported address. */ | 229 | short int _addr_lsb; /* Valid LSB of the reported address. */ |
| 230 | /* used when si_code=SEGV_BNDERR */ | 230 | /* used when si_code=SEGV_BNDERR */ |
| 231 | struct { | 231 | struct { |
| 232 | short _dummy_bnd; | 232 | compat_uptr_t _dummy_bnd; |
| 233 | compat_uptr_t _lower; | 233 | compat_uptr_t _lower; |
| 234 | compat_uptr_t _upper; | 234 | compat_uptr_t _upper; |
| 235 | } _addr_bnd; | 235 | } _addr_bnd; |
| 236 | /* used when si_code=SEGV_PKUERR */ | 236 | /* used when si_code=SEGV_PKUERR */ |
| 237 | struct { | 237 | struct { |
| 238 | short _dummy_pkey; | 238 | compat_uptr_t _dummy_pkey; |
| 239 | u32 _pkey; | 239 | u32 _pkey; |
| 240 | } _addr_pkey; | 240 | } _addr_pkey; |
| 241 | }; | 241 | }; |
diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h index d02a4df3f473..d3f264a5b04d 100644 --- a/include/linux/compiler-clang.h +++ b/include/linux/compiler-clang.h | |||
| @@ -27,3 +27,8 @@ | |||
| 27 | #if __has_feature(address_sanitizer) | 27 | #if __has_feature(address_sanitizer) |
| 28 | #define __SANITIZE_ADDRESS__ | 28 | #define __SANITIZE_ADDRESS__ |
| 29 | #endif | 29 | #endif |
| 30 | |||
| 31 | /* Clang doesn't have a way to turn it off per-function, yet. */ | ||
| 32 | #ifdef __noretpoline | ||
| 33 | #undef __noretpoline | ||
| 34 | #endif | ||
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 73bc63e0a1c4..e2c7f4369eff 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
| @@ -93,6 +93,10 @@ | |||
| 93 | #define __weak __attribute__((weak)) | 93 | #define __weak __attribute__((weak)) |
| 94 | #define __alias(symbol) __attribute__((alias(#symbol))) | 94 | #define __alias(symbol) __attribute__((alias(#symbol))) |
| 95 | 95 | ||
| 96 | #ifdef RETPOLINE | ||
| 97 | #define __noretpoline __attribute__((indirect_branch("keep"))) | ||
| 98 | #endif | ||
| 99 | |||
| 96 | /* | 100 | /* |
| 97 | * it doesn't make sense on ARM (currently the only user of __naked) | 101 | * it doesn't make sense on ARM (currently the only user of __naked) |
| 98 | * to trace naked functions because then mcount is called without | 102 | * to trace naked functions because then mcount is called without |
| @@ -208,6 +212,15 @@ | |||
| 208 | #endif | 212 | #endif |
| 209 | 213 | ||
| 210 | /* | 214 | /* |
| 215 | * calling noreturn functions, __builtin_unreachable() and __builtin_trap() | ||
| 216 | * confuse the stack allocation in gcc, leading to overly large stack | ||
| 217 | * frames, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82365 | ||
| 218 | * | ||
| 219 | * Adding an empty inline assembly before it works around the problem | ||
| 220 | */ | ||
| 221 | #define barrier_before_unreachable() asm volatile("") | ||
| 222 | |||
| 223 | /* | ||
| 211 | * Mark a position in code as unreachable. This can be used to | 224 | * Mark a position in code as unreachable. This can be used to |
| 212 | * suppress control flow warnings after asm blocks that transfer | 225 | * suppress control flow warnings after asm blocks that transfer |
| 213 | * control elsewhere. | 226 | * control elsewhere. |
| @@ -217,7 +230,11 @@ | |||
| 217 | * unreleased. Really, we need to have autoconf for the kernel. | 230 | * unreleased. Really, we need to have autoconf for the kernel. |
| 218 | */ | 231 | */ |
| 219 | #define unreachable() \ | 232 | #define unreachable() \ |
| 220 | do { annotate_unreachable(); __builtin_unreachable(); } while (0) | 233 | do { \ |
| 234 | annotate_unreachable(); \ | ||
| 235 | barrier_before_unreachable(); \ | ||
| 236 | __builtin_unreachable(); \ | ||
| 237 | } while (0) | ||
| 221 | 238 | ||
| 222 | /* Mark a function definition as prohibited from being cloned. */ | 239 | /* Mark a function definition as prohibited from being cloned. */ |
| 223 | #define __noclone __attribute__((__noclone__, __optimize__("no-tracer"))) | 240 | #define __noclone __attribute__((__noclone__, __optimize__("no-tracer"))) |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index e835fc0423ec..ab4711c63601 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
| @@ -86,6 +86,11 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, | |||
| 86 | # define barrier_data(ptr) barrier() | 86 | # define barrier_data(ptr) barrier() |
| 87 | #endif | 87 | #endif |
| 88 | 88 | ||
| 89 | /* workaround for GCC PR82365 if needed */ | ||
| 90 | #ifndef barrier_before_unreachable | ||
| 91 | # define barrier_before_unreachable() do { } while (0) | ||
| 92 | #endif | ||
| 93 | |||
| 89 | /* Unreachable code */ | 94 | /* Unreachable code */ |
| 90 | #ifdef CONFIG_STACK_VALIDATION | 95 | #ifdef CONFIG_STACK_VALIDATION |
| 91 | /* | 96 | /* |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 2a815560fda0..79c413985305 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -3198,7 +3198,7 @@ static inline bool vma_is_fsdax(struct vm_area_struct *vma) | |||
| 3198 | if (!vma_is_dax(vma)) | 3198 | if (!vma_is_dax(vma)) |
| 3199 | return false; | 3199 | return false; |
| 3200 | inode = file_inode(vma->vm_file); | 3200 | inode = file_inode(vma->vm_file); |
| 3201 | if (inode->i_mode == S_IFCHR) | 3201 | if (S_ISCHR(inode->i_mode)) |
| 3202 | return false; /* device-dax */ | 3202 | return false; /* device-dax */ |
| 3203 | return true; | 3203 | return true; |
| 3204 | } | 3204 | } |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 5e3531027b51..c826b0b5232a 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
| @@ -198,6 +198,7 @@ struct gendisk { | |||
| 198 | void *private_data; | 198 | void *private_data; |
| 199 | 199 | ||
| 200 | int flags; | 200 | int flags; |
| 201 | struct rw_semaphore lookup_sem; | ||
| 201 | struct kobject *slave_dir; | 202 | struct kobject *slave_dir; |
| 202 | 203 | ||
| 203 | struct timer_rand_state *random; | 204 | struct timer_rand_state *random; |
| @@ -600,8 +601,9 @@ extern void delete_partition(struct gendisk *, int); | |||
| 600 | extern void printk_all_partitions(void); | 601 | extern void printk_all_partitions(void); |
| 601 | 602 | ||
| 602 | extern struct gendisk *__alloc_disk_node(int minors, int node_id); | 603 | extern struct gendisk *__alloc_disk_node(int minors, int node_id); |
| 603 | extern struct kobject *get_disk(struct gendisk *disk); | 604 | extern struct kobject *get_disk_and_module(struct gendisk *disk); |
| 604 | extern void put_disk(struct gendisk *disk); | 605 | extern void put_disk(struct gendisk *disk); |
| 606 | extern void put_disk_and_module(struct gendisk *disk); | ||
| 605 | extern void blk_register_region(dev_t devt, unsigned long range, | 607 | extern void blk_register_region(dev_t devt, unsigned long range, |
| 606 | struct module *module, | 608 | struct module *module, |
| 607 | struct kobject *(*probe)(dev_t, int *, void *), | 609 | struct kobject *(*probe)(dev_t, int *, void *), |
diff --git a/include/linux/init.h b/include/linux/init.h index 506a98151131..bc27cf03c41e 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
| @@ -6,10 +6,10 @@ | |||
| 6 | #include <linux/types.h> | 6 | #include <linux/types.h> |
| 7 | 7 | ||
| 8 | /* Built-in __init functions needn't be compiled with retpoline */ | 8 | /* Built-in __init functions needn't be compiled with retpoline */ |
| 9 | #if defined(RETPOLINE) && !defined(MODULE) | 9 | #if defined(__noretpoline) && !defined(MODULE) |
| 10 | #define __noretpoline __attribute__((indirect_branch("keep"))) | 10 | #define __noinitretpoline __noretpoline |
| 11 | #else | 11 | #else |
| 12 | #define __noretpoline | 12 | #define __noinitretpoline |
| 13 | #endif | 13 | #endif |
| 14 | 14 | ||
| 15 | /* These macros are used to mark some functions or | 15 | /* These macros are used to mark some functions or |
| @@ -47,7 +47,7 @@ | |||
| 47 | 47 | ||
| 48 | /* These are for everybody (although not all archs will actually | 48 | /* These are for everybody (although not all archs will actually |
| 49 | discard it in modules) */ | 49 | discard it in modules) */ |
| 50 | #define __init __section(.init.text) __cold __latent_entropy __noretpoline | 50 | #define __init __section(.init.text) __cold __latent_entropy __noinitretpoline |
| 51 | #define __initdata __section(.init.data) | 51 | #define __initdata __section(.init.data) |
| 52 | #define __initconst __section(.init.rodata) | 52 | #define __initconst __section(.init.rodata) |
| 53 | #define __exitdata __section(.exit.data) | 53 | #define __exitdata __section(.exit.data) |
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h index b6a29c126cc4..2168cc6b8b30 100644 --- a/include/linux/jump_label.h +++ b/include/linux/jump_label.h | |||
| @@ -151,6 +151,7 @@ extern struct jump_entry __start___jump_table[]; | |||
| 151 | extern struct jump_entry __stop___jump_table[]; | 151 | extern struct jump_entry __stop___jump_table[]; |
| 152 | 152 | ||
| 153 | extern void jump_label_init(void); | 153 | extern void jump_label_init(void); |
| 154 | extern void jump_label_invalidate_init(void); | ||
| 154 | extern void jump_label_lock(void); | 155 | extern void jump_label_lock(void); |
| 155 | extern void jump_label_unlock(void); | 156 | extern void jump_label_unlock(void); |
| 156 | extern void arch_jump_label_transform(struct jump_entry *entry, | 157 | extern void arch_jump_label_transform(struct jump_entry *entry, |
| @@ -198,6 +199,8 @@ static __always_inline void jump_label_init(void) | |||
| 198 | static_key_initialized = true; | 199 | static_key_initialized = true; |
| 199 | } | 200 | } |
| 200 | 201 | ||
| 202 | static inline void jump_label_invalidate_init(void) {} | ||
| 203 | |||
| 201 | static __always_inline bool static_key_false(struct static_key *key) | 204 | static __always_inline bool static_key_false(struct static_key *key) |
| 202 | { | 205 | { |
| 203 | if (unlikely(static_key_count(key) > 0)) | 206 | if (unlikely(static_key_count(key) > 0)) |
diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h index fec5076eda91..dcde9471897d 100644 --- a/include/linux/kconfig.h +++ b/include/linux/kconfig.h | |||
| @@ -4,6 +4,12 @@ | |||
| 4 | 4 | ||
| 5 | #include <generated/autoconf.h> | 5 | #include <generated/autoconf.h> |
| 6 | 6 | ||
| 7 | #ifdef CONFIG_CPU_BIG_ENDIAN | ||
| 8 | #define __BIG_ENDIAN 4321 | ||
| 9 | #else | ||
| 10 | #define __LITTLE_ENDIAN 1234 | ||
| 11 | #endif | ||
| 12 | |||
| 7 | #define __ARG_PLACEHOLDER_1 0, | 13 | #define __ARG_PLACEHOLDER_1 0, |
| 8 | #define __take_second_arg(__ignored, val, ...) val | 14 | #define __take_second_arg(__ignored, val, ...) val |
| 9 | 15 | ||
| @@ -64,4 +70,7 @@ | |||
| 64 | */ | 70 | */ |
| 65 | #define IS_ENABLED(option) __or(IS_BUILTIN(option), IS_MODULE(option)) | 71 | #define IS_ENABLED(option) __or(IS_BUILTIN(option), IS_MODULE(option)) |
| 66 | 72 | ||
| 73 | /* Make sure we always have all types and struct attributes defined. */ | ||
| 74 | #include <linux/compiler_types.h> | ||
| 75 | |||
| 67 | #endif /* __LINUX_KCONFIG_H */ | 76 | #endif /* __LINUX_KCONFIG_H */ |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index ce51455e2adf..3fd291503576 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -472,6 +472,7 @@ extern bool parse_option_str(const char *str, const char *option); | |||
| 472 | extern char *next_arg(char *args, char **param, char **val); | 472 | extern char *next_arg(char *args, char **param, char **val); |
| 473 | 473 | ||
| 474 | extern int core_kernel_text(unsigned long addr); | 474 | extern int core_kernel_text(unsigned long addr); |
| 475 | extern int init_kernel_text(unsigned long addr); | ||
| 475 | extern int core_kernel_data(unsigned long addr); | 476 | extern int core_kernel_data(unsigned long addr); |
| 476 | extern int __kernel_text_address(unsigned long addr); | 477 | extern int __kernel_text_address(unsigned long addr); |
| 477 | extern int kernel_text_address(unsigned long addr); | 478 | extern int kernel_text_address(unsigned long addr); |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index ac0062b74aed..6930c63126c7 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
| @@ -1105,7 +1105,6 @@ static inline void kvm_irq_routing_update(struct kvm *kvm) | |||
| 1105 | { | 1105 | { |
| 1106 | } | 1106 | } |
| 1107 | #endif | 1107 | #endif |
| 1108 | void kvm_arch_irq_routing_update(struct kvm *kvm); | ||
| 1109 | 1108 | ||
| 1110 | static inline int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) | 1109 | static inline int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) |
| 1111 | { | 1110 | { |
| @@ -1114,6 +1113,8 @@ static inline int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) | |||
| 1114 | 1113 | ||
| 1115 | #endif /* CONFIG_HAVE_KVM_EVENTFD */ | 1114 | #endif /* CONFIG_HAVE_KVM_EVENTFD */ |
| 1116 | 1115 | ||
| 1116 | void kvm_arch_irq_routing_update(struct kvm *kvm); | ||
| 1117 | |||
| 1117 | static inline void kvm_make_request(int req, struct kvm_vcpu *vcpu) | 1118 | static inline void kvm_make_request(int req, struct kvm_vcpu *vcpu) |
| 1118 | { | 1119 | { |
| 1119 | /* | 1120 | /* |
| @@ -1272,4 +1273,7 @@ static inline long kvm_arch_vcpu_async_ioctl(struct file *filp, | |||
| 1272 | } | 1273 | } |
| 1273 | #endif /* CONFIG_HAVE_KVM_VCPU_ASYNC_IOCTL */ | 1274 | #endif /* CONFIG_HAVE_KVM_VCPU_ASYNC_IOCTL */ |
| 1274 | 1275 | ||
| 1276 | void kvm_arch_mmu_notifier_invalidate_range(struct kvm *kvm, | ||
| 1277 | unsigned long start, unsigned long end); | ||
| 1278 | |||
| 1275 | #endif | 1279 | #endif |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 882046863581..c46016bb25eb 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
| @@ -523,9 +523,11 @@ static inline void __mod_memcg_state(struct mem_cgroup *memcg, | |||
| 523 | static inline void mod_memcg_state(struct mem_cgroup *memcg, | 523 | static inline void mod_memcg_state(struct mem_cgroup *memcg, |
| 524 | int idx, int val) | 524 | int idx, int val) |
| 525 | { | 525 | { |
| 526 | preempt_disable(); | 526 | unsigned long flags; |
| 527 | |||
| 528 | local_irq_save(flags); | ||
| 527 | __mod_memcg_state(memcg, idx, val); | 529 | __mod_memcg_state(memcg, idx, val); |
| 528 | preempt_enable(); | 530 | local_irq_restore(flags); |
| 529 | } | 531 | } |
| 530 | 532 | ||
| 531 | /** | 533 | /** |
| @@ -606,9 +608,11 @@ static inline void __mod_lruvec_state(struct lruvec *lruvec, | |||
| 606 | static inline void mod_lruvec_state(struct lruvec *lruvec, | 608 | static inline void mod_lruvec_state(struct lruvec *lruvec, |
| 607 | enum node_stat_item idx, int val) | 609 | enum node_stat_item idx, int val) |
| 608 | { | 610 | { |
| 609 | preempt_disable(); | 611 | unsigned long flags; |
| 612 | |||
| 613 | local_irq_save(flags); | ||
| 610 | __mod_lruvec_state(lruvec, idx, val); | 614 | __mod_lruvec_state(lruvec, idx, val); |
| 611 | preempt_enable(); | 615 | local_irq_restore(flags); |
| 612 | } | 616 | } |
| 613 | 617 | ||
| 614 | static inline void __mod_lruvec_page_state(struct page *page, | 618 | static inline void __mod_lruvec_page_state(struct page *page, |
| @@ -630,9 +634,11 @@ static inline void __mod_lruvec_page_state(struct page *page, | |||
| 630 | static inline void mod_lruvec_page_state(struct page *page, | 634 | static inline void mod_lruvec_page_state(struct page *page, |
| 631 | enum node_stat_item idx, int val) | 635 | enum node_stat_item idx, int val) |
| 632 | { | 636 | { |
| 633 | preempt_disable(); | 637 | unsigned long flags; |
| 638 | |||
| 639 | local_irq_save(flags); | ||
| 634 | __mod_lruvec_page_state(page, idx, val); | 640 | __mod_lruvec_page_state(page, idx, val); |
| 635 | preempt_enable(); | 641 | local_irq_restore(flags); |
| 636 | } | 642 | } |
| 637 | 643 | ||
| 638 | unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order, | 644 | unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order, |
| @@ -659,9 +665,11 @@ static inline void __count_memcg_events(struct mem_cgroup *memcg, | |||
| 659 | static inline void count_memcg_events(struct mem_cgroup *memcg, | 665 | static inline void count_memcg_events(struct mem_cgroup *memcg, |
| 660 | int idx, unsigned long count) | 666 | int idx, unsigned long count) |
| 661 | { | 667 | { |
| 662 | preempt_disable(); | 668 | unsigned long flags; |
| 669 | |||
| 670 | local_irq_save(flags); | ||
| 663 | __count_memcg_events(memcg, idx, count); | 671 | __count_memcg_events(memcg, idx, count); |
| 664 | preempt_enable(); | 672 | local_irq_restore(flags); |
| 665 | } | 673 | } |
| 666 | 674 | ||
| 667 | /* idx can be of type enum memcg_event_item or vm_event_item */ | 675 | /* idx can be of type enum memcg_event_item or vm_event_item */ |
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index f25c13423bd4..cb3bbed4e633 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
| @@ -66,6 +66,11 @@ struct mutex { | |||
| 66 | #endif | 66 | #endif |
| 67 | }; | 67 | }; |
| 68 | 68 | ||
| 69 | /* | ||
| 70 | * Internal helper function; C doesn't allow us to hide it :/ | ||
| 71 | * | ||
| 72 | * DO NOT USE (outside of mutex code). | ||
| 73 | */ | ||
| 69 | static inline struct task_struct *__mutex_owner(struct mutex *lock) | 74 | static inline struct task_struct *__mutex_owner(struct mutex *lock) |
| 70 | { | 75 | { |
| 71 | return (struct task_struct *)(atomic_long_read(&lock->owner) & ~0x07); | 76 | return (struct task_struct *)(atomic_long_read(&lock->owner) & ~0x07); |
diff --git a/include/linux/nospec.h b/include/linux/nospec.h index fbc98e2c8228..e791ebc65c9c 100644 --- a/include/linux/nospec.h +++ b/include/linux/nospec.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | #ifndef _LINUX_NOSPEC_H | 6 | #ifndef _LINUX_NOSPEC_H |
| 7 | #define _LINUX_NOSPEC_H | 7 | #define _LINUX_NOSPEC_H |
| 8 | #include <asm/barrier.h> | ||
| 8 | 9 | ||
| 9 | /** | 10 | /** |
| 10 | * array_index_mask_nospec() - generate a ~0 mask when index < size, 0 otherwise | 11 | * array_index_mask_nospec() - generate a ~0 mask when index < size, 0 otherwise |
| @@ -30,26 +31,6 @@ static inline unsigned long array_index_mask_nospec(unsigned long index, | |||
| 30 | #endif | 31 | #endif |
| 31 | 32 | ||
| 32 | /* | 33 | /* |
| 33 | * Warn developers about inappropriate array_index_nospec() usage. | ||
| 34 | * | ||
| 35 | * Even if the CPU speculates past the WARN_ONCE branch, the | ||
| 36 | * sign bit of @index is taken into account when generating the | ||
| 37 | * mask. | ||
| 38 | * | ||
| 39 | * This warning is compiled out when the compiler can infer that | ||
| 40 | * @index and @size are less than LONG_MAX. | ||
| 41 | */ | ||
| 42 | #define array_index_mask_nospec_check(index, size) \ | ||
| 43 | ({ \ | ||
| 44 | if (WARN_ONCE(index > LONG_MAX || size > LONG_MAX, \ | ||
| 45 | "array_index_nospec() limited to range of [0, LONG_MAX]\n")) \ | ||
| 46 | _mask = 0; \ | ||
| 47 | else \ | ||
| 48 | _mask = array_index_mask_nospec(index, size); \ | ||
| 49 | _mask; \ | ||
| 50 | }) | ||
| 51 | |||
| 52 | /* | ||
| 53 | * array_index_nospec - sanitize an array index after a bounds check | 34 | * array_index_nospec - sanitize an array index after a bounds check |
| 54 | * | 35 | * |
| 55 | * For a code sequence like: | 36 | * For a code sequence like: |
| @@ -67,12 +48,11 @@ static inline unsigned long array_index_mask_nospec(unsigned long index, | |||
| 67 | ({ \ | 48 | ({ \ |
| 68 | typeof(index) _i = (index); \ | 49 | typeof(index) _i = (index); \ |
| 69 | typeof(size) _s = (size); \ | 50 | typeof(size) _s = (size); \ |
| 70 | unsigned long _mask = array_index_mask_nospec_check(_i, _s); \ | 51 | unsigned long _mask = array_index_mask_nospec(_i, _s); \ |
| 71 | \ | 52 | \ |
| 72 | BUILD_BUG_ON(sizeof(_i) > sizeof(long)); \ | 53 | BUILD_BUG_ON(sizeof(_i) > sizeof(long)); \ |
| 73 | BUILD_BUG_ON(sizeof(_s) > sizeof(long)); \ | 54 | BUILD_BUG_ON(sizeof(_s) > sizeof(long)); \ |
| 74 | \ | 55 | \ |
| 75 | _i &= _mask; \ | 56 | (typeof(_i)) (_i & _mask); \ |
| 76 | _i; \ | ||
| 77 | }) | 57 | }) |
| 78 | #endif /* _LINUX_NOSPEC_H */ | 58 | #endif /* _LINUX_NOSPEC_H */ |
diff --git a/include/linux/perf/arm_pmu.h b/include/linux/perf/arm_pmu.h index af0f44effd44..40036a57d072 100644 --- a/include/linux/perf/arm_pmu.h +++ b/include/linux/perf/arm_pmu.h | |||
| @@ -14,26 +14,10 @@ | |||
| 14 | 14 | ||
| 15 | #include <linux/interrupt.h> | 15 | #include <linux/interrupt.h> |
| 16 | #include <linux/perf_event.h> | 16 | #include <linux/perf_event.h> |
| 17 | #include <linux/platform_device.h> | ||
| 17 | #include <linux/sysfs.h> | 18 | #include <linux/sysfs.h> |
| 18 | #include <asm/cputype.h> | 19 | #include <asm/cputype.h> |
| 19 | 20 | ||
| 20 | /* | ||
| 21 | * struct arm_pmu_platdata - ARM PMU platform data | ||
| 22 | * | ||
| 23 | * @handle_irq: an optional handler which will be called from the | ||
| 24 | * interrupt and passed the address of the low level handler, | ||
| 25 | * and can be used to implement any platform specific handling | ||
| 26 | * before or after calling it. | ||
| 27 | * | ||
| 28 | * @irq_flags: if non-zero, these flags will be passed to request_irq | ||
| 29 | * when requesting interrupts for this PMU device. | ||
| 30 | */ | ||
| 31 | struct arm_pmu_platdata { | ||
| 32 | irqreturn_t (*handle_irq)(int irq, void *dev, | ||
| 33 | irq_handler_t pmu_handler); | ||
| 34 | unsigned long irq_flags; | ||
| 35 | }; | ||
| 36 | |||
| 37 | #ifdef CONFIG_ARM_PMU | 21 | #ifdef CONFIG_ARM_PMU |
| 38 | 22 | ||
| 39 | /* | 23 | /* |
| @@ -92,7 +76,6 @@ enum armpmu_attr_groups { | |||
| 92 | 76 | ||
| 93 | struct arm_pmu { | 77 | struct arm_pmu { |
| 94 | struct pmu pmu; | 78 | struct pmu pmu; |
| 95 | cpumask_t active_irqs; | ||
| 96 | cpumask_t supported_cpus; | 79 | cpumask_t supported_cpus; |
| 97 | char *name; | 80 | char *name; |
| 98 | irqreturn_t (*handle_irq)(int irq_num, void *dev); | 81 | irqreturn_t (*handle_irq)(int irq_num, void *dev); |
| @@ -174,12 +157,11 @@ static inline int arm_pmu_acpi_probe(armpmu_init_fn init_fn) { return 0; } | |||
| 174 | 157 | ||
| 175 | /* Internal functions only for core arm_pmu code */ | 158 | /* Internal functions only for core arm_pmu code */ |
| 176 | struct arm_pmu *armpmu_alloc(void); | 159 | struct arm_pmu *armpmu_alloc(void); |
| 160 | struct arm_pmu *armpmu_alloc_atomic(void); | ||
| 177 | void armpmu_free(struct arm_pmu *pmu); | 161 | void armpmu_free(struct arm_pmu *pmu); |
| 178 | int armpmu_register(struct arm_pmu *pmu); | 162 | int armpmu_register(struct arm_pmu *pmu); |
| 179 | int armpmu_request_irqs(struct arm_pmu *armpmu); | 163 | int armpmu_request_irq(int irq, int cpu); |
| 180 | void armpmu_free_irqs(struct arm_pmu *armpmu); | 164 | void armpmu_free_irq(int irq, int cpu); |
| 181 | int armpmu_request_irq(struct arm_pmu *armpmu, int cpu); | ||
| 182 | void armpmu_free_irq(struct arm_pmu *armpmu, int cpu); | ||
| 183 | 165 | ||
| 184 | #define ARMV8_PMU_PDEV_NAME "armv8-pmu" | 166 | #define ARMV8_PMU_PDEV_NAME "armv8-pmu" |
| 185 | 167 | ||
diff --git a/include/linux/phy.h b/include/linux/phy.h index 5a0c3e53e7c2..d7069539f351 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
| @@ -924,6 +924,7 @@ void phy_device_remove(struct phy_device *phydev); | |||
| 924 | int phy_init_hw(struct phy_device *phydev); | 924 | int phy_init_hw(struct phy_device *phydev); |
| 925 | int phy_suspend(struct phy_device *phydev); | 925 | int phy_suspend(struct phy_device *phydev); |
| 926 | int phy_resume(struct phy_device *phydev); | 926 | int phy_resume(struct phy_device *phydev); |
| 927 | int __phy_resume(struct phy_device *phydev); | ||
| 927 | int phy_loopback(struct phy_device *phydev, bool enable); | 928 | int phy_loopback(struct phy_device *phydev, bool enable); |
| 928 | struct phy_device *phy_attach(struct net_device *dev, const char *bus_id, | 929 | struct phy_device *phy_attach(struct net_device *dev, const char *bus_id, |
| 929 | phy_interface_t interface); | 930 | phy_interface_t interface); |
diff --git a/include/linux/ptr_ring.h b/include/linux/ptr_ring.h index b884b7794187..e6335227b844 100644 --- a/include/linux/ptr_ring.h +++ b/include/linux/ptr_ring.h | |||
| @@ -469,7 +469,7 @@ static inline int ptr_ring_consume_batched_bh(struct ptr_ring *r, | |||
| 469 | */ | 469 | */ |
| 470 | static inline void **__ptr_ring_init_queue_alloc(unsigned int size, gfp_t gfp) | 470 | static inline void **__ptr_ring_init_queue_alloc(unsigned int size, gfp_t gfp) |
| 471 | { | 471 | { |
| 472 | if (size * sizeof(void *) > KMALLOC_MAX_SIZE) | 472 | if (size > KMALLOC_MAX_SIZE / sizeof(void *)) |
| 473 | return NULL; | 473 | return NULL; |
| 474 | return kvmalloc_array(size, sizeof(void *), gfp | __GFP_ZERO); | 474 | return kvmalloc_array(size, sizeof(void *), gfp | __GFP_ZERO); |
| 475 | } | 475 | } |
diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h index 1149533aa2fa..9806184bb3d5 100644 --- a/include/linux/sched/mm.h +++ b/include/linux/sched/mm.h | |||
| @@ -36,7 +36,18 @@ static inline void mmgrab(struct mm_struct *mm) | |||
| 36 | atomic_inc(&mm->mm_count); | 36 | atomic_inc(&mm->mm_count); |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | extern void mmdrop(struct mm_struct *mm); | 39 | extern void __mmdrop(struct mm_struct *mm); |
| 40 | |||
| 41 | static inline void mmdrop(struct mm_struct *mm) | ||
| 42 | { | ||
| 43 | /* | ||
| 44 | * The implicit full barrier implied by atomic_dec_and_test() is | ||
| 45 | * required by the membarrier system call before returning to | ||
| 46 | * user-space, after storing to rq->curr. | ||
| 47 | */ | ||
| 48 | if (unlikely(atomic_dec_and_test(&mm->mm_count))) | ||
| 49 | __mmdrop(mm); | ||
| 50 | } | ||
| 40 | 51 | ||
| 41 | /** | 52 | /** |
| 42 | * mmget() - Pin the address space associated with a &struct mm_struct. | 53 | * mmget() - Pin the address space associated with a &struct mm_struct. |
diff --git a/include/linux/sched/user.h b/include/linux/sched/user.h index 0dcf4e480ef7..96fe289c4c6e 100644 --- a/include/linux/sched/user.h +++ b/include/linux/sched/user.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #include <linux/uidgid.h> | 5 | #include <linux/uidgid.h> |
| 6 | #include <linux/atomic.h> | 6 | #include <linux/atomic.h> |
| 7 | #include <linux/ratelimit.h> | ||
| 7 | 8 | ||
| 8 | struct key; | 9 | struct key; |
| 9 | 10 | ||
| @@ -41,6 +42,9 @@ struct user_struct { | |||
| 41 | defined(CONFIG_NET) | 42 | defined(CONFIG_NET) |
| 42 | atomic_long_t locked_vm; | 43 | atomic_long_t locked_vm; |
| 43 | #endif | 44 | #endif |
| 45 | |||
| 46 | /* Miscellaneous per-user rate limit */ | ||
| 47 | struct ratelimit_state ratelimit; | ||
| 44 | }; | 48 | }; |
| 45 | 49 | ||
| 46 | extern int uids_sysfs_init(void); | 50 | extern int uids_sysfs_init(void); |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 5ebc0f869720..ddf77cf4ff2d 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -3285,8 +3285,7 @@ int skb_zerocopy(struct sk_buff *to, struct sk_buff *from, | |||
| 3285 | void skb_split(struct sk_buff *skb, struct sk_buff *skb1, const u32 len); | 3285 | void skb_split(struct sk_buff *skb, struct sk_buff *skb1, const u32 len); |
| 3286 | int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen); | 3286 | int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen); |
| 3287 | void skb_scrub_packet(struct sk_buff *skb, bool xnet); | 3287 | void skb_scrub_packet(struct sk_buff *skb, bool xnet); |
| 3288 | unsigned int skb_gso_transport_seglen(const struct sk_buff *skb); | 3288 | bool skb_gso_validate_network_len(const struct sk_buff *skb, unsigned int mtu); |
| 3289 | bool skb_gso_validate_mtu(const struct sk_buff *skb, unsigned int mtu); | ||
| 3290 | bool skb_gso_validate_mac_len(const struct sk_buff *skb, unsigned int len); | 3289 | bool skb_gso_validate_mac_len(const struct sk_buff *skb, unsigned int len); |
| 3291 | struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features); | 3290 | struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features); |
| 3292 | struct sk_buff *skb_vlan_untag(struct sk_buff *skb); | 3291 | struct sk_buff *skb_vlan_untag(struct sk_buff *skb); |
| @@ -3646,7 +3645,7 @@ static inline bool __skb_checksum_validate_needed(struct sk_buff *skb, | |||
| 3646 | return true; | 3645 | return true; |
| 3647 | } | 3646 | } |
| 3648 | 3647 | ||
| 3649 | /* For small packets <= CHECKSUM_BREAK peform checksum complete directly | 3648 | /* For small packets <= CHECKSUM_BREAK perform checksum complete directly |
| 3650 | * in checksum_init. | 3649 | * in checksum_init. |
| 3651 | */ | 3650 | */ |
| 3652 | #define CHECKSUM_BREAK 76 | 3651 | #define CHECKSUM_BREAK 76 |
| @@ -4104,38 +4103,6 @@ static inline bool skb_head_is_locked(const struct sk_buff *skb) | |||
| 4104 | return !skb->head_frag || skb_cloned(skb); | 4103 | return !skb->head_frag || skb_cloned(skb); |
| 4105 | } | 4104 | } |
| 4106 | 4105 | ||
| 4107 | /** | ||
| 4108 | * skb_gso_network_seglen - Return length of individual segments of a gso packet | ||
| 4109 | * | ||
| 4110 | * @skb: GSO skb | ||
| 4111 | * | ||
| 4112 | * skb_gso_network_seglen is used to determine the real size of the | ||
| 4113 | * individual segments, including Layer3 (IP, IPv6) and L4 headers (TCP/UDP). | ||
| 4114 | * | ||
| 4115 | * The MAC/L2 header is not accounted for. | ||
| 4116 | */ | ||
| 4117 | static inline unsigned int skb_gso_network_seglen(const struct sk_buff *skb) | ||
| 4118 | { | ||
| 4119 | unsigned int hdr_len = skb_transport_header(skb) - | ||
| 4120 | skb_network_header(skb); | ||
| 4121 | return hdr_len + skb_gso_transport_seglen(skb); | ||
| 4122 | } | ||
| 4123 | |||
| 4124 | /** | ||
| 4125 | * skb_gso_mac_seglen - Return length of individual segments of a gso packet | ||
| 4126 | * | ||
| 4127 | * @skb: GSO skb | ||
| 4128 | * | ||
| 4129 | * skb_gso_mac_seglen is used to determine the real size of the | ||
| 4130 | * individual segments, including MAC/L2, Layer3 (IP, IPv6) and L4 | ||
| 4131 | * headers (TCP/UDP). | ||
| 4132 | */ | ||
| 4133 | static inline unsigned int skb_gso_mac_seglen(const struct sk_buff *skb) | ||
| 4134 | { | ||
| 4135 | unsigned int hdr_len = skb_transport_header(skb) - skb_mac_header(skb); | ||
| 4136 | return hdr_len + skb_gso_transport_seglen(skb); | ||
| 4137 | } | ||
| 4138 | |||
| 4139 | /* Local Checksum Offload. | 4106 | /* Local Checksum Offload. |
| 4140 | * Compute outer checksum based on the assumption that the | 4107 | * Compute outer checksum based on the assumption that the |
| 4141 | * inner checksum will be offloaded later. | 4108 | * inner checksum will be offloaded later. |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 7b6a59f722a3..a1a3f4ed94ce 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
| @@ -337,8 +337,6 @@ extern void deactivate_file_page(struct page *page); | |||
| 337 | extern void mark_page_lazyfree(struct page *page); | 337 | extern void mark_page_lazyfree(struct page *page); |
| 338 | extern void swap_setup(void); | 338 | extern void swap_setup(void); |
| 339 | 339 | ||
| 340 | extern void add_page_to_unevictable_list(struct page *page); | ||
| 341 | |||
| 342 | extern void lru_cache_add_active_or_unevictable(struct page *page, | 340 | extern void lru_cache_add_active_or_unevictable(struct page *page, |
| 343 | struct vm_area_struct *vma); | 341 | struct vm_area_struct *vma); |
| 344 | 342 | ||
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 4a54ef96aff5..bc0cda180c8b 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
| @@ -465,6 +465,7 @@ extern bool cancel_delayed_work_sync(struct delayed_work *dwork); | |||
| 465 | 465 | ||
| 466 | extern void workqueue_set_max_active(struct workqueue_struct *wq, | 466 | extern void workqueue_set_max_active(struct workqueue_struct *wq, |
| 467 | int max_active); | 467 | int max_active); |
| 468 | extern struct work_struct *current_work(void); | ||
| 468 | extern bool current_is_workqueue_rescuer(void); | 469 | extern bool current_is_workqueue_rescuer(void); |
| 469 | extern bool workqueue_congested(int cpu, struct workqueue_struct *wq); | 470 | extern bool workqueue_congested(int cpu, struct workqueue_struct *wq); |
| 470 | extern unsigned int work_busy(struct work_struct *work); | 471 | extern unsigned int work_busy(struct work_struct *work); |
