diff options
| author | Rob Herring <robh@kernel.org> | 2018-03-08 10:21:07 -0500 |
|---|---|---|
| committer | Rob Herring <robh@kernel.org> | 2018-03-08 10:21:07 -0500 |
| commit | c679fa6e3aaa5c58fc514b5b88cfa82774b8d390 (patch) | |
| tree | 0c10b339368bd1795152a66a4e245e6f654fb3ec /include | |
| parent | bdb7013df910681f84eff27b07791d4c160cb76f (diff) | |
| parent | 4fd98e374fd377ae0458a9dc44aa779cf9631ddd (diff) | |
Merge branch 'dtc-update' into dt/next
Diffstat (limited to 'include')
39 files changed, 175 insertions, 103 deletions
diff --git a/include/asm-generic/bitops/lock.h b/include/asm-generic/bitops/lock.h index bc397573c43a..67ab280ad134 100644 --- a/include/asm-generic/bitops/lock.h +++ b/include/asm-generic/bitops/lock.h | |||
| @@ -7,7 +7,8 @@ | |||
| 7 | * @nr: Bit to set | 7 | * @nr: Bit to set |
| 8 | * @addr: Address to count from | 8 | * @addr: Address to count from |
| 9 | * | 9 | * |
| 10 | * This operation is atomic and provides acquire barrier semantics. | 10 | * This operation is atomic and provides acquire barrier semantics if |
| 11 | * the returned value is 0. | ||
| 11 | * It can be used to implement bit locks. | 12 | * It can be used to implement bit locks. |
| 12 | */ | 13 | */ |
| 13 | #define test_and_set_bit_lock(nr, addr) test_and_set_bit(nr, addr) | 14 | #define test_and_set_bit_lock(nr, addr) test_and_set_bit(nr, addr) |
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index 963b755d19b0..a7613e1b0c87 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h | |||
| @@ -52,6 +52,7 @@ struct bug_entry { | |||
| 52 | #ifndef HAVE_ARCH_BUG | 52 | #ifndef HAVE_ARCH_BUG |
| 53 | #define BUG() do { \ | 53 | #define BUG() do { \ |
| 54 | printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \ | 54 | printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \ |
| 55 | barrier_before_unreachable(); \ | ||
| 55 | panic("BUG!"); \ | 56 | panic("BUG!"); \ |
| 56 | } while (0) | 57 | } while (0) |
| 57 | #endif | 58 | #endif |
diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h index 1c27526c499e..cf13842a6dbd 100644 --- a/include/drm/drm_atomic.h +++ b/include/drm/drm_atomic.h | |||
| @@ -134,6 +134,15 @@ struct drm_crtc_commit { | |||
| 134 | * &drm_pending_vblank_event pointer to clean up private events. | 134 | * &drm_pending_vblank_event pointer to clean up private events. |
| 135 | */ | 135 | */ |
| 136 | struct drm_pending_vblank_event *event; | 136 | struct drm_pending_vblank_event *event; |
| 137 | |||
| 138 | /** | ||
| 139 | * @abort_completion: | ||
| 140 | * | ||
| 141 | * A flag that's set after drm_atomic_helper_setup_commit takes a second | ||
| 142 | * reference for the completion of $drm_crtc_state.event. It's used by | ||
| 143 | * the free code to remove the second reference if commit fails. | ||
| 144 | */ | ||
| 145 | bool abort_completion; | ||
| 137 | }; | 146 | }; |
| 138 | 147 | ||
| 139 | struct __drm_planes_state { | 148 | struct __drm_planes_state { |
diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h index 76e237bd989b..6914633037a5 100644 --- a/include/drm/drm_crtc_helper.h +++ b/include/drm/drm_crtc_helper.h | |||
| @@ -77,5 +77,6 @@ void drm_kms_helper_hotplug_event(struct drm_device *dev); | |||
| 77 | 77 | ||
| 78 | void drm_kms_helper_poll_disable(struct drm_device *dev); | 78 | void drm_kms_helper_poll_disable(struct drm_device *dev); |
| 79 | void drm_kms_helper_poll_enable(struct drm_device *dev); | 79 | void drm_kms_helper_poll_enable(struct drm_device *dev); |
| 80 | bool drm_kms_helper_is_poll_worker(void); | ||
| 80 | 81 | ||
| 81 | #endif | 82 | #endif |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 64e10746f282..968173ec2726 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -587,7 +587,7 @@ extern int acpi_nvs_for_each_region(int (*func)(__u64, __u64, void *), | |||
| 587 | const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids, | 587 | const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids, |
| 588 | const struct device *dev); | 588 | const struct device *dev); |
| 589 | 589 | ||
| 590 | void *acpi_get_match_data(const struct device *dev); | 590 | const void *acpi_device_get_match_data(const struct device *dev); |
| 591 | extern bool acpi_driver_match_device(struct device *dev, | 591 | extern bool acpi_driver_match_device(struct device *dev, |
| 592 | const struct device_driver *drv); | 592 | const struct device_driver *drv); |
| 593 | int acpi_device_uevent_modalias(struct device *, struct kobj_uevent_env *); | 593 | int acpi_device_uevent_modalias(struct device *, struct kobj_uevent_env *); |
| @@ -766,7 +766,7 @@ static inline const struct acpi_device_id *acpi_match_device( | |||
| 766 | return NULL; | 766 | return NULL; |
| 767 | } | 767 | } |
| 768 | 768 | ||
| 769 | static inline void *acpi_get_match_data(const struct device *dev) | 769 | static inline const void *acpi_device_get_match_data(const struct device *dev) |
| 770 | { | 770 | { |
| 771 | return NULL; | 771 | return NULL; |
| 772 | } | 772 | } |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 4f3df807cf8f..ed63f3b69c12 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -49,7 +49,7 @@ struct blk_stat_callback; | |||
| 49 | #define BLKDEV_MIN_RQ 4 | 49 | #define BLKDEV_MIN_RQ 4 |
| 50 | #define BLKDEV_MAX_RQ 128 /* Default maximum */ | 50 | #define BLKDEV_MAX_RQ 128 /* Default maximum */ |
| 51 | 51 | ||
| 52 | /* Must be consisitent with blk_mq_poll_stats_bkt() */ | 52 | /* Must be consistent with blk_mq_poll_stats_bkt() */ |
| 53 | #define BLK_MQ_POLL_STATS_BKTS 16 | 53 | #define BLK_MQ_POLL_STATS_BKTS 16 |
| 54 | 54 | ||
| 55 | /* | 55 | /* |
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 631354acfa72..901c1ccb3374 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
| @@ -167,8 +167,6 @@ | |||
| 167 | 167 | ||
| 168 | #if GCC_VERSION >= 40100 | 168 | #if GCC_VERSION >= 40100 |
| 169 | # define __compiletime_object_size(obj) __builtin_object_size(obj, 0) | 169 | # define __compiletime_object_size(obj) __builtin_object_size(obj, 0) |
| 170 | |||
| 171 | #define __nostackprotector __attribute__((__optimize__("no-stack-protector"))) | ||
| 172 | #endif | 170 | #endif |
| 173 | 171 | ||
| 174 | #if GCC_VERSION >= 40300 | 172 | #if GCC_VERSION >= 40300 |
| @@ -196,6 +194,11 @@ | |||
| 196 | #endif /* __CHECKER__ */ | 194 | #endif /* __CHECKER__ */ |
| 197 | #endif /* GCC_VERSION >= 40300 */ | 195 | #endif /* GCC_VERSION >= 40300 */ |
| 198 | 196 | ||
| 197 | #if GCC_VERSION >= 40400 | ||
| 198 | #define __optimize(level) __attribute__((__optimize__(level))) | ||
| 199 | #define __nostackprotector __optimize("no-stack-protector") | ||
| 200 | #endif /* GCC_VERSION >= 40400 */ | ||
| 201 | |||
| 199 | #if GCC_VERSION >= 40500 | 202 | #if GCC_VERSION >= 40500 |
| 200 | 203 | ||
| 201 | #ifndef __CHECKER__ | 204 | #ifndef __CHECKER__ |
| @@ -205,6 +208,15 @@ | |||
| 205 | #endif | 208 | #endif |
| 206 | 209 | ||
| 207 | /* | 210 | /* |
| 211 | * calling noreturn functions, __builtin_unreachable() and __builtin_trap() | ||
| 212 | * confuse the stack allocation in gcc, leading to overly large stack | ||
| 213 | * frames, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82365 | ||
| 214 | * | ||
| 215 | * Adding an empty inline assembly before it works around the problem | ||
| 216 | */ | ||
| 217 | #define barrier_before_unreachable() asm volatile("") | ||
| 218 | |||
| 219 | /* | ||
| 208 | * Mark a position in code as unreachable. This can be used to | 220 | * Mark a position in code as unreachable. This can be used to |
| 209 | * suppress control flow warnings after asm blocks that transfer | 221 | * suppress control flow warnings after asm blocks that transfer |
| 210 | * control elsewhere. | 222 | * control elsewhere. |
| @@ -214,7 +226,11 @@ | |||
| 214 | * unreleased. Really, we need to have autoconf for the kernel. | 226 | * unreleased. Really, we need to have autoconf for the kernel. |
| 215 | */ | 227 | */ |
| 216 | #define unreachable() \ | 228 | #define unreachable() \ |
| 217 | do { annotate_unreachable(); __builtin_unreachable(); } while (0) | 229 | do { \ |
| 230 | annotate_unreachable(); \ | ||
| 231 | barrier_before_unreachable(); \ | ||
| 232 | __builtin_unreachable(); \ | ||
| 233 | } while (0) | ||
| 218 | 234 | ||
| 219 | /* Mark a function definition as prohibited from being cloned. */ | 235 | /* Mark a function definition as prohibited from being cloned. */ |
| 220 | #define __noclone __attribute__((__noclone__, __optimize__("no-tracer"))) | 236 | #define __noclone __attribute__((__noclone__, __optimize__("no-tracer"))) |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index c2cc57a2f508..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 | /* |
| @@ -277,6 +282,10 @@ unsigned long read_word_at_a_time(const void *addr) | |||
| 277 | 282 | ||
| 278 | #endif /* __ASSEMBLY__ */ | 283 | #endif /* __ASSEMBLY__ */ |
| 279 | 284 | ||
| 285 | #ifndef __optimize | ||
| 286 | # define __optimize(level) | ||
| 287 | #endif | ||
| 288 | |||
| 280 | /* Compile time object size, -1 for unknown */ | 289 | /* Compile time object size, -1 for unknown */ |
| 281 | #ifndef __compiletime_object_size | 290 | #ifndef __compiletime_object_size |
| 282 | # define __compiletime_object_size(obj) -1 | 291 | # define __compiletime_object_size(obj) -1 |
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 871f9e21810c..0b3fc229086c 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h | |||
| @@ -225,7 +225,7 @@ static inline void cpuidle_coupled_parallel_barrier(struct cpuidle_device *dev, | |||
| 225 | } | 225 | } |
| 226 | #endif | 226 | #endif |
| 227 | 227 | ||
| 228 | #ifdef CONFIG_ARCH_HAS_CPU_RELAX | 228 | #if defined(CONFIG_CPU_IDLE) && defined(CONFIG_ARCH_HAS_CPU_RELAX) |
| 229 | void cpuidle_poll_state_init(struct cpuidle_driver *drv); | 229 | void cpuidle_poll_state_init(struct cpuidle_driver *drv); |
| 230 | #else | 230 | #else |
| 231 | static inline void cpuidle_poll_state_init(struct cpuidle_driver *drv) {} | 231 | static inline void cpuidle_poll_state_init(struct cpuidle_driver *drv) {} |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index d4a2a7dcd72d..bf53d893ad02 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
| @@ -170,6 +170,8 @@ static inline unsigned int cpumask_local_spread(unsigned int i, int node) | |||
| 170 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) | 170 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) |
| 171 | #define for_each_cpu_not(cpu, mask) \ | 171 | #define for_each_cpu_not(cpu, mask) \ |
| 172 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) | 172 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) |
| 173 | #define for_each_cpu_wrap(cpu, mask, start) \ | ||
| 174 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)(start)) | ||
| 173 | #define for_each_cpu_and(cpu, mask, and) \ | 175 | #define for_each_cpu_and(cpu, mask, and) \ |
| 174 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)and) | 176 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)and) |
| 175 | #else | 177 | #else |
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 34fe8463d10e..eb9eab4ecd6d 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
| @@ -578,7 +578,7 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | |||
| 578 | 578 | ||
| 579 | /* | 579 | /* |
| 580 | * This is a hack for the legacy x86 forbid_dac and iommu_sac_force. Please | 580 | * This is a hack for the legacy x86 forbid_dac and iommu_sac_force. Please |
| 581 | * don't use this is new code. | 581 | * don't use this in new code. |
| 582 | */ | 582 | */ |
| 583 | #ifndef arch_dma_supported | 583 | #ifndef arch_dma_supported |
| 584 | #define arch_dma_supported(dev, mask) (1) | 584 | #define arch_dma_supported(dev, mask) (1) |
diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h index 4fa1a489efe4..4fe8f289b3f6 100644 --- a/include/linux/fwnode.h +++ b/include/linux/fwnode.h | |||
| @@ -73,8 +73,8 @@ struct fwnode_operations { | |||
| 73 | struct fwnode_handle *(*get)(struct fwnode_handle *fwnode); | 73 | struct fwnode_handle *(*get)(struct fwnode_handle *fwnode); |
| 74 | void (*put)(struct fwnode_handle *fwnode); | 74 | void (*put)(struct fwnode_handle *fwnode); |
| 75 | bool (*device_is_available)(const struct fwnode_handle *fwnode); | 75 | bool (*device_is_available)(const struct fwnode_handle *fwnode); |
| 76 | void *(*device_get_match_data)(const struct fwnode_handle *fwnode, | 76 | const void *(*device_get_match_data)(const struct fwnode_handle *fwnode, |
| 77 | const struct device *dev); | 77 | const struct device *dev); |
| 78 | bool (*property_present)(const struct fwnode_handle *fwnode, | 78 | bool (*property_present)(const struct fwnode_handle *fwnode, |
| 79 | const char *propname); | 79 | const char *propname); |
| 80 | int (*property_read_int_array)(const struct fwnode_handle *fwnode, | 80 | int (*property_read_int_array)(const struct fwnode_handle *fwnode, |
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/kcore.h b/include/linux/kcore.h index 7ff25a808fef..80db19d3a505 100644 --- a/include/linux/kcore.h +++ b/include/linux/kcore.h | |||
| @@ -10,6 +10,7 @@ enum kcore_type { | |||
| 10 | KCORE_VMALLOC, | 10 | KCORE_VMALLOC, |
| 11 | KCORE_RAM, | 11 | KCORE_RAM, |
| 12 | KCORE_VMEMMAP, | 12 | KCORE_VMEMMAP, |
| 13 | KCORE_USER, | ||
| 13 | KCORE_OTHER, | 14 | KCORE_OTHER, |
| 14 | }; | 15 | }; |
| 15 | 16 | ||
diff --git a/include/linux/libfdt_env.h b/include/linux/libfdt_env.h index 14997285e53d..c6ac1fe7ec68 100644 --- a/include/linux/libfdt_env.h +++ b/include/linux/libfdt_env.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #ifndef _LIBFDT_ENV_H | 2 | #ifndef LIBFDT_ENV_H |
| 3 | #define _LIBFDT_ENV_H | 3 | #define LIBFDT_ENV_H |
| 4 | 4 | ||
| 5 | #include <linux/string.h> | 5 | #include <linux/string.h> |
| 6 | 6 | ||
| @@ -15,4 +15,4 @@ typedef __be64 fdt64_t; | |||
| 15 | #define fdt64_to_cpu(x) be64_to_cpu(x) | 15 | #define fdt64_to_cpu(x) be64_to_cpu(x) |
| 16 | #define cpu_to_fdt64(x) cpu_to_be64(x) | 16 | #define cpu_to_fdt64(x) cpu_to_be64(x) |
| 17 | 17 | ||
| 18 | #endif /* _LIBFDT_ENV_H */ | 18 | #endif /* LIBFDT_ENV_H */ |
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/mm_inline.h b/include/linux/mm_inline.h index c30b32e3c862..10191c28fc04 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h | |||
| @@ -127,10 +127,4 @@ static __always_inline enum lru_list page_lru(struct page *page) | |||
| 127 | 127 | ||
| 128 | #define lru_to_page(head) (list_entry((head)->prev, struct page, lru)) | 128 | #define lru_to_page(head) (list_entry((head)->prev, struct page, lru)) |
| 129 | 129 | ||
| 130 | #ifdef arch_unmap_kpfn | ||
| 131 | extern void arch_unmap_kpfn(unsigned long pfn); | ||
| 132 | #else | ||
| 133 | static __always_inline void arch_unmap_kpfn(unsigned long pfn) { } | ||
| 134 | #endif | ||
| 135 | |||
| 136 | #endif | 130 | #endif |
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 b99bced39ac2..fbc98e2c8228 100644 --- a/include/linux/nospec.h +++ b/include/linux/nospec.h | |||
| @@ -20,20 +20,6 @@ static inline unsigned long array_index_mask_nospec(unsigned long index, | |||
| 20 | unsigned long size) | 20 | unsigned long size) |
| 21 | { | 21 | { |
| 22 | /* | 22 | /* |
| 23 | * Warn developers about inappropriate array_index_nospec() usage. | ||
| 24 | * | ||
| 25 | * Even if the CPU speculates past the WARN_ONCE branch, the | ||
| 26 | * sign bit of @index is taken into account when generating the | ||
| 27 | * mask. | ||
| 28 | * | ||
| 29 | * This warning is compiled out when the compiler can infer that | ||
| 30 | * @index and @size are less than LONG_MAX. | ||
| 31 | */ | ||
| 32 | if (WARN_ONCE(index > LONG_MAX || size > LONG_MAX, | ||
| 33 | "array_index_nospec() limited to range of [0, LONG_MAX]\n")) | ||
| 34 | return 0; | ||
| 35 | |||
| 36 | /* | ||
| 37 | * Always calculate and emit the mask even if the compiler | 23 | * Always calculate and emit the mask even if the compiler |
| 38 | * thinks the mask is not needed. The compiler does not take | 24 | * thinks the mask is not needed. The compiler does not take |
| 39 | * into account the value of @index under speculation. | 25 | * into account the value of @index under speculation. |
| @@ -44,6 +30,26 @@ static inline unsigned long array_index_mask_nospec(unsigned long index, | |||
| 44 | #endif | 30 | #endif |
| 45 | 31 | ||
| 46 | /* | 32 | /* |
| 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 | /* | ||
| 47 | * array_index_nospec - sanitize an array index after a bounds check | 53 | * array_index_nospec - sanitize an array index after a bounds check |
| 48 | * | 54 | * |
| 49 | * For a code sequence like: | 55 | * For a code sequence like: |
| @@ -61,7 +67,7 @@ static inline unsigned long array_index_mask_nospec(unsigned long index, | |||
| 61 | ({ \ | 67 | ({ \ |
| 62 | typeof(index) _i = (index); \ | 68 | typeof(index) _i = (index); \ |
| 63 | typeof(size) _s = (size); \ | 69 | typeof(size) _s = (size); \ |
| 64 | unsigned long _mask = array_index_mask_nospec(_i, _s); \ | 70 | unsigned long _mask = array_index_mask_nospec_check(_i, _s); \ |
| 65 | \ | 71 | \ |
| 66 | BUILD_BUG_ON(sizeof(_i) > sizeof(long)); \ | 72 | BUILD_BUG_ON(sizeof(_i) > sizeof(long)); \ |
| 67 | BUILD_BUG_ON(sizeof(_s) > sizeof(long)); \ | 73 | BUILD_BUG_ON(sizeof(_s) > sizeof(long)); \ |
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/property.h b/include/linux/property.h index 769d372c1edf..2eea4b310fc2 100644 --- a/include/linux/property.h +++ b/include/linux/property.h | |||
| @@ -283,7 +283,7 @@ bool device_dma_supported(struct device *dev); | |||
| 283 | 283 | ||
| 284 | enum dev_dma_attr device_get_dma_attr(struct device *dev); | 284 | enum dev_dma_attr device_get_dma_attr(struct device *dev); |
| 285 | 285 | ||
| 286 | void *device_get_match_data(struct device *dev); | 286 | const void *device_get_match_data(struct device *dev); |
| 287 | 287 | ||
| 288 | int device_get_phy_mode(struct device *dev); | 288 | int device_get_phy_mode(struct device *dev); |
| 289 | 289 | ||
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/semaphore.h b/include/linux/semaphore.h index dc368b8ce215..11c86fbfeb98 100644 --- a/include/linux/semaphore.h +++ b/include/linux/semaphore.h | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | * | 4 | * |
| 5 | * Distributed under the terms of the GNU GPL, version 2 | 5 | * Distributed under the terms of the GNU GPL, version 2 |
| 6 | * | 6 | * |
| 7 | * Please see kernel/semaphore.c for documentation of these functions | 7 | * Please see kernel/locking/semaphore.c for documentation of these functions |
| 8 | */ | 8 | */ |
| 9 | #ifndef __LINUX_SEMAPHORE_H | 9 | #ifndef __LINUX_SEMAPHORE_H |
| 10 | #define __LINUX_SEMAPHORE_H | 10 | #define __LINUX_SEMAPHORE_H |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 5ebc0f869720..c1e66bdcf583 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -3646,7 +3646,7 @@ static inline bool __skb_checksum_validate_needed(struct sk_buff *skb, | |||
| 3646 | return true; | 3646 | return true; |
| 3647 | } | 3647 | } |
| 3648 | 3648 | ||
| 3649 | /* For small packets <= CHECKSUM_BREAK peform checksum complete directly | 3649 | /* For small packets <= CHECKSUM_BREAK perform checksum complete directly |
| 3650 | * in checksum_init. | 3650 | * in checksum_init. |
| 3651 | */ | 3651 | */ |
| 3652 | #define CHECKSUM_BREAK 76 | 3652 | #define CHECKSUM_BREAK 76 |
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); |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 906e90223066..c96511fa9198 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
| @@ -4149,7 +4149,7 @@ void ieee80211_sta_uapsd_trigger(struct ieee80211_sta *sta, u8 tid); | |||
| 4149 | * The TX headroom reserved by mac80211 for its own tx_status functions. | 4149 | * The TX headroom reserved by mac80211 for its own tx_status functions. |
| 4150 | * This is enough for the radiotap header. | 4150 | * This is enough for the radiotap header. |
| 4151 | */ | 4151 | */ |
| 4152 | #define IEEE80211_TX_STATUS_HEADROOM 14 | 4152 | #define IEEE80211_TX_STATUS_HEADROOM ALIGN(14, 4) |
| 4153 | 4153 | ||
| 4154 | /** | 4154 | /** |
| 4155 | * ieee80211_sta_set_buffered - inform mac80211 about driver-buffered frames | 4155 | * ieee80211_sta_set_buffered - inform mac80211 about driver-buffered frames |
diff --git a/include/net/regulatory.h b/include/net/regulatory.h index ebc5a2ed8631..f83cacce3308 100644 --- a/include/net/regulatory.h +++ b/include/net/regulatory.h | |||
| @@ -78,7 +78,7 @@ struct regulatory_request { | |||
| 78 | int wiphy_idx; | 78 | int wiphy_idx; |
| 79 | enum nl80211_reg_initiator initiator; | 79 | enum nl80211_reg_initiator initiator; |
| 80 | enum nl80211_user_reg_hint_type user_reg_hint_type; | 80 | enum nl80211_user_reg_hint_type user_reg_hint_type; |
| 81 | char alpha2[2]; | 81 | char alpha2[3]; |
| 82 | enum nl80211_dfs_regions dfs_region; | 82 | enum nl80211_dfs_regions dfs_region; |
| 83 | bool intersect; | 83 | bool intersect; |
| 84 | bool processed; | 84 | bool processed; |
diff --git a/include/net/udplite.h b/include/net/udplite.h index 81bdbf97319b..9185e45b997f 100644 --- a/include/net/udplite.h +++ b/include/net/udplite.h | |||
| @@ -64,6 +64,7 @@ static inline int udplite_checksum_init(struct sk_buff *skb, struct udphdr *uh) | |||
| 64 | UDP_SKB_CB(skb)->cscov = cscov; | 64 | UDP_SKB_CB(skb)->cscov = cscov; |
| 65 | if (skb->ip_summed == CHECKSUM_COMPLETE) | 65 | if (skb->ip_summed == CHECKSUM_COMPLETE) |
| 66 | skb->ip_summed = CHECKSUM_NONE; | 66 | skb->ip_summed = CHECKSUM_NONE; |
| 67 | skb->csum_valid = 0; | ||
| 67 | } | 68 | } |
| 68 | 69 | ||
| 69 | return 0; | 70 | return 0; |
diff --git a/include/rdma/restrack.h b/include/rdma/restrack.h index c2d81167c858..2cdf8dcf4bdc 100644 --- a/include/rdma/restrack.h +++ b/include/rdma/restrack.h | |||
| @@ -29,10 +29,6 @@ enum rdma_restrack_type { | |||
| 29 | */ | 29 | */ |
| 30 | RDMA_RESTRACK_QP, | 30 | RDMA_RESTRACK_QP, |
| 31 | /** | 31 | /** |
| 32 | * @RDMA_RESTRACK_XRCD: XRC domain (XRCD) | ||
| 33 | */ | ||
| 34 | RDMA_RESTRACK_XRCD, | ||
| 35 | /** | ||
| 36 | * @RDMA_RESTRACK_MAX: Last entry, used for array dclarations | 32 | * @RDMA_RESTRACK_MAX: Last entry, used for array dclarations |
| 37 | */ | 33 | */ |
| 38 | RDMA_RESTRACK_MAX | 34 | RDMA_RESTRACK_MAX |
diff --git a/include/rdma/uverbs_ioctl.h b/include/rdma/uverbs_ioctl.h index 6da44079aa58..38287d9d23a1 100644 --- a/include/rdma/uverbs_ioctl.h +++ b/include/rdma/uverbs_ioctl.h | |||
| @@ -276,10 +276,7 @@ struct uverbs_object_tree_def { | |||
| 276 | */ | 276 | */ |
| 277 | 277 | ||
| 278 | struct uverbs_ptr_attr { | 278 | struct uverbs_ptr_attr { |
| 279 | union { | 279 | u64 data; |
| 280 | u64 data; | ||
| 281 | void __user *ptr; | ||
| 282 | }; | ||
| 283 | u16 len; | 280 | u16 len; |
| 284 | /* Combination of bits from enum UVERBS_ATTR_F_XXXX */ | 281 | /* Combination of bits from enum UVERBS_ATTR_F_XXXX */ |
| 285 | u16 flags; | 282 | u16 flags; |
| @@ -351,38 +348,60 @@ static inline const struct uverbs_attr *uverbs_attr_get(const struct uverbs_attr | |||
| 351 | } | 348 | } |
| 352 | 349 | ||
| 353 | static inline int uverbs_copy_to(const struct uverbs_attr_bundle *attrs_bundle, | 350 | static inline int uverbs_copy_to(const struct uverbs_attr_bundle *attrs_bundle, |
| 354 | size_t idx, const void *from) | 351 | size_t idx, const void *from, size_t size) |
| 355 | { | 352 | { |
| 356 | const struct uverbs_attr *attr = uverbs_attr_get(attrs_bundle, idx); | 353 | const struct uverbs_attr *attr = uverbs_attr_get(attrs_bundle, idx); |
| 357 | u16 flags; | 354 | u16 flags; |
| 355 | size_t min_size; | ||
| 358 | 356 | ||
| 359 | if (IS_ERR(attr)) | 357 | if (IS_ERR(attr)) |
| 360 | return PTR_ERR(attr); | 358 | return PTR_ERR(attr); |
| 361 | 359 | ||
| 360 | min_size = min_t(size_t, attr->ptr_attr.len, size); | ||
| 361 | if (copy_to_user(u64_to_user_ptr(attr->ptr_attr.data), from, min_size)) | ||
| 362 | return -EFAULT; | ||
| 363 | |||
| 362 | flags = attr->ptr_attr.flags | UVERBS_ATTR_F_VALID_OUTPUT; | 364 | flags = attr->ptr_attr.flags | UVERBS_ATTR_F_VALID_OUTPUT; |
| 363 | return (!copy_to_user(attr->ptr_attr.ptr, from, attr->ptr_attr.len) && | 365 | if (put_user(flags, &attr->uattr->flags)) |
| 364 | !put_user(flags, &attr->uattr->flags)) ? 0 : -EFAULT; | 366 | return -EFAULT; |
| 367 | |||
| 368 | return 0; | ||
| 365 | } | 369 | } |
| 366 | 370 | ||
| 367 | static inline int _uverbs_copy_from(void *to, size_t to_size, | 371 | static inline bool uverbs_attr_ptr_is_inline(const struct uverbs_attr *attr) |
| 372 | { | ||
| 373 | return attr->ptr_attr.len <= sizeof(attr->ptr_attr.data); | ||
| 374 | } | ||
| 375 | |||
| 376 | static inline int _uverbs_copy_from(void *to, | ||
| 368 | const struct uverbs_attr_bundle *attrs_bundle, | 377 | const struct uverbs_attr_bundle *attrs_bundle, |
| 369 | size_t idx) | 378 | size_t idx, |
| 379 | size_t size) | ||
| 370 | { | 380 | { |
| 371 | const struct uverbs_attr *attr = uverbs_attr_get(attrs_bundle, idx); | 381 | const struct uverbs_attr *attr = uverbs_attr_get(attrs_bundle, idx); |
| 372 | 382 | ||
| 373 | if (IS_ERR(attr)) | 383 | if (IS_ERR(attr)) |
| 374 | return PTR_ERR(attr); | 384 | return PTR_ERR(attr); |
| 375 | 385 | ||
| 376 | if (to_size <= sizeof(((struct ib_uverbs_attr *)0)->data)) | 386 | /* |
| 387 | * Validation ensures attr->ptr_attr.len >= size. If the caller is | ||
| 388 | * using UVERBS_ATTR_SPEC_F_MIN_SZ then it must call copy_from with | ||
| 389 | * the right size. | ||
| 390 | */ | ||
| 391 | if (unlikely(size < attr->ptr_attr.len)) | ||
| 392 | return -EINVAL; | ||
| 393 | |||
| 394 | if (uverbs_attr_ptr_is_inline(attr)) | ||
| 377 | memcpy(to, &attr->ptr_attr.data, attr->ptr_attr.len); | 395 | memcpy(to, &attr->ptr_attr.data, attr->ptr_attr.len); |
| 378 | else if (copy_from_user(to, attr->ptr_attr.ptr, attr->ptr_attr.len)) | 396 | else if (copy_from_user(to, u64_to_user_ptr(attr->ptr_attr.data), |
| 397 | attr->ptr_attr.len)) | ||
| 379 | return -EFAULT; | 398 | return -EFAULT; |
| 380 | 399 | ||
| 381 | return 0; | 400 | return 0; |
| 382 | } | 401 | } |
| 383 | 402 | ||
| 384 | #define uverbs_copy_from(to, attrs_bundle, idx) \ | 403 | #define uverbs_copy_from(to, attrs_bundle, idx) \ |
| 385 | _uverbs_copy_from(to, sizeof(*(to)), attrs_bundle, idx) | 404 | _uverbs_copy_from(to, attrs_bundle, idx, sizeof(*to)) |
| 386 | 405 | ||
| 387 | /* ================================================= | 406 | /* ================================================= |
| 388 | * Definitions -> Specs infrastructure | 407 | * Definitions -> Specs infrastructure |
diff --git a/include/sound/ac97/regs.h b/include/sound/ac97/regs.h index 4bb86d379bd5..9a4fa0c3264a 100644 --- a/include/sound/ac97/regs.h +++ b/include/sound/ac97/regs.h | |||
| @@ -31,7 +31,7 @@ | |||
| 31 | #define AC97_HEADPHONE 0x04 /* Headphone Volume (optional) */ | 31 | #define AC97_HEADPHONE 0x04 /* Headphone Volume (optional) */ |
| 32 | #define AC97_MASTER_MONO 0x06 /* Master Volume Mono (optional) */ | 32 | #define AC97_MASTER_MONO 0x06 /* Master Volume Mono (optional) */ |
| 33 | #define AC97_MASTER_TONE 0x08 /* Master Tone (Bass & Treble) (optional) */ | 33 | #define AC97_MASTER_TONE 0x08 /* Master Tone (Bass & Treble) (optional) */ |
| 34 | #define AC97_PC_BEEP 0x0a /* PC Beep Volume (optinal) */ | 34 | #define AC97_PC_BEEP 0x0a /* PC Beep Volume (optional) */ |
| 35 | #define AC97_PHONE 0x0c /* Phone Volume (optional) */ | 35 | #define AC97_PHONE 0x0c /* Phone Volume (optional) */ |
| 36 | #define AC97_MIC 0x0e /* MIC Volume */ | 36 | #define AC97_MIC 0x0e /* MIC Volume */ |
| 37 | #define AC97_LINE 0x10 /* Line In Volume */ | 37 | #define AC97_LINE 0x10 /* Line In Volume */ |
diff --git a/include/trace/events/xen.h b/include/trace/events/xen.h index b8adf05c534e..7dd8f34c37df 100644 --- a/include/trace/events/xen.h +++ b/include/trace/events/xen.h | |||
| @@ -368,7 +368,7 @@ TRACE_EVENT(xen_mmu_flush_tlb, | |||
| 368 | TP_printk("%s", "") | 368 | TP_printk("%s", "") |
| 369 | ); | 369 | ); |
| 370 | 370 | ||
| 371 | TRACE_EVENT(xen_mmu_flush_tlb_single, | 371 | TRACE_EVENT(xen_mmu_flush_tlb_one_user, |
| 372 | TP_PROTO(unsigned long addr), | 372 | TP_PROTO(unsigned long addr), |
| 373 | TP_ARGS(addr), | 373 | TP_ARGS(addr), |
| 374 | TP_STRUCT__entry( | 374 | TP_STRUCT__entry( |
diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h index f8cb5760ea4f..8bbbcb5cd94b 100644 --- a/include/uapi/linux/if_ether.h +++ b/include/uapi/linux/if_ether.h | |||
| @@ -23,7 +23,6 @@ | |||
| 23 | #define _UAPI_LINUX_IF_ETHER_H | 23 | #define _UAPI_LINUX_IF_ETHER_H |
| 24 | 24 | ||
| 25 | #include <linux/types.h> | 25 | #include <linux/types.h> |
| 26 | #include <linux/libc-compat.h> | ||
| 27 | 26 | ||
| 28 | /* | 27 | /* |
| 29 | * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble | 28 | * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble |
| @@ -151,6 +150,11 @@ | |||
| 151 | * This is an Ethernet frame header. | 150 | * This is an Ethernet frame header. |
| 152 | */ | 151 | */ |
| 153 | 152 | ||
| 153 | /* allow libcs like musl to deactivate this, glibc does not implement this. */ | ||
| 154 | #ifndef __UAPI_DEF_ETHHDR | ||
| 155 | #define __UAPI_DEF_ETHHDR 1 | ||
| 156 | #endif | ||
| 157 | |||
| 154 | #if __UAPI_DEF_ETHHDR | 158 | #if __UAPI_DEF_ETHHDR |
| 155 | struct ethhdr { | 159 | struct ethhdr { |
| 156 | unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ | 160 | unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ |
diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h index fc29efaa918c..8254c937c9f4 100644 --- a/include/uapi/linux/libc-compat.h +++ b/include/uapi/linux/libc-compat.h | |||
| @@ -264,10 +264,4 @@ | |||
| 264 | 264 | ||
| 265 | #endif /* __GLIBC__ */ | 265 | #endif /* __GLIBC__ */ |
| 266 | 266 | ||
| 267 | /* Definitions for if_ether.h */ | ||
| 268 | /* allow libcs like musl to deactivate this, glibc does not implement this. */ | ||
| 269 | #ifndef __UAPI_DEF_ETHHDR | ||
| 270 | #define __UAPI_DEF_ETHHDR 1 | ||
| 271 | #endif | ||
| 272 | |||
| 273 | #endif /* _UAPI_LIBC_COMPAT_H */ | 267 | #endif /* _UAPI_LIBC_COMPAT_H */ |
diff --git a/include/uapi/linux/ptrace.h b/include/uapi/linux/ptrace.h index e46d82b91166..d5a1b8a492b9 100644 --- a/include/uapi/linux/ptrace.h +++ b/include/uapi/linux/ptrace.h | |||
| @@ -69,8 +69,8 @@ struct ptrace_peeksiginfo_args { | |||
| 69 | #define PTRACE_SECCOMP_GET_METADATA 0x420d | 69 | #define PTRACE_SECCOMP_GET_METADATA 0x420d |
| 70 | 70 | ||
| 71 | struct seccomp_metadata { | 71 | struct seccomp_metadata { |
| 72 | unsigned long filter_off; /* Input: which filter */ | 72 | __u64 filter_off; /* Input: which filter */ |
| 73 | unsigned int flags; /* Output: filter's flags */ | 73 | __u64 flags; /* Output: filter's flags */ |
| 74 | }; | 74 | }; |
| 75 | 75 | ||
| 76 | /* Read signals from a shared (process wide) queue */ | 76 | /* Read signals from a shared (process wide) queue */ |
diff --git a/include/uapi/rdma/rdma_user_ioctl.h b/include/uapi/rdma/rdma_user_ioctl.h index 03557b5f9aa6..46de0885e800 100644 --- a/include/uapi/rdma/rdma_user_ioctl.h +++ b/include/uapi/rdma/rdma_user_ioctl.h | |||
| @@ -65,7 +65,7 @@ struct ib_uverbs_attr { | |||
| 65 | __u16 len; /* only for pointers */ | 65 | __u16 len; /* only for pointers */ |
| 66 | __u16 flags; /* combination of UVERBS_ATTR_F_XXXX */ | 66 | __u16 flags; /* combination of UVERBS_ATTR_F_XXXX */ |
| 67 | __u16 reserved; | 67 | __u16 reserved; |
| 68 | __u64 data; /* ptr to command, inline data or idr/fd */ | 68 | __aligned_u64 data; /* ptr to command, inline data or idr/fd */ |
| 69 | }; | 69 | }; |
| 70 | 70 | ||
| 71 | struct ib_uverbs_ioctl_hdr { | 71 | struct ib_uverbs_ioctl_hdr { |
| @@ -73,7 +73,7 @@ struct ib_uverbs_ioctl_hdr { | |||
| 73 | __u16 object_id; | 73 | __u16 object_id; |
| 74 | __u16 method_id; | 74 | __u16 method_id; |
| 75 | __u16 num_attrs; | 75 | __u16 num_attrs; |
| 76 | __u64 reserved; | 76 | __aligned_u64 reserved; |
| 77 | struct ib_uverbs_attr attrs[0]; | 77 | struct ib_uverbs_attr attrs[0]; |
| 78 | }; | 78 | }; |
| 79 | 79 | ||
