diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-12-03 01:55:28 -0500 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-12-03 01:55:28 -0500 |
| commit | d5d12ce229c17fde99c6f8cc42f3701264a60e8c (patch) | |
| tree | 9d3c4ec71ea8cab74d02b8311997630d651767eb /include/linux | |
| parent | 7626e002225a4c1b9455689b1f22909dfeff43ca (diff) | |
| parent | 2595646791c319cadfdbf271563aac97d0843dc7 (diff) | |
Merge 4.20-rc5 into staging-next
We need the staging fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux')
36 files changed, 369 insertions, 162 deletions
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h index a83e1f632eb7..f01623aef2f7 100644 --- a/include/linux/can/dev.h +++ b/include/linux/can/dev.h | |||
| @@ -169,6 +169,7 @@ void can_change_state(struct net_device *dev, struct can_frame *cf, | |||
| 169 | 169 | ||
| 170 | void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev, | 170 | void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev, |
| 171 | unsigned int idx); | 171 | unsigned int idx); |
| 172 | struct sk_buff *__can_get_echo_skb(struct net_device *dev, unsigned int idx, u8 *len_ptr); | ||
| 172 | unsigned int can_get_echo_skb(struct net_device *dev, unsigned int idx); | 173 | unsigned int can_get_echo_skb(struct net_device *dev, unsigned int idx); |
| 173 | void can_free_echo_skb(struct net_device *dev, unsigned int idx); | 174 | void can_free_echo_skb(struct net_device *dev, unsigned int idx); |
| 174 | 175 | ||
diff --git a/include/linux/can/rx-offload.h b/include/linux/can/rx-offload.h index cb31683bbe15..8268811a697e 100644 --- a/include/linux/can/rx-offload.h +++ b/include/linux/can/rx-offload.h | |||
| @@ -41,7 +41,12 @@ int can_rx_offload_add_timestamp(struct net_device *dev, struct can_rx_offload * | |||
| 41 | int can_rx_offload_add_fifo(struct net_device *dev, struct can_rx_offload *offload, unsigned int weight); | 41 | int can_rx_offload_add_fifo(struct net_device *dev, struct can_rx_offload *offload, unsigned int weight); |
| 42 | int can_rx_offload_irq_offload_timestamp(struct can_rx_offload *offload, u64 reg); | 42 | int can_rx_offload_irq_offload_timestamp(struct can_rx_offload *offload, u64 reg); |
| 43 | int can_rx_offload_irq_offload_fifo(struct can_rx_offload *offload); | 43 | 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); | ||
| 45 | void can_rx_offload_reset(struct can_rx_offload *offload); | 50 | void can_rx_offload_reset(struct can_rx_offload *offload); |
| 46 | void can_rx_offload_del(struct can_rx_offload *offload); | 51 | void can_rx_offload_del(struct can_rx_offload *offload); |
| 47 | void can_rx_offload_enable(struct can_rx_offload *offload); | 52 | void can_rx_offload_enable(struct can_rx_offload *offload); |
diff --git a/include/linux/ceph/ceph_features.h b/include/linux/ceph/ceph_features.h index 6b92b3395fa9..65a38c4a02a1 100644 --- a/include/linux/ceph/ceph_features.h +++ b/include/linux/ceph/ceph_features.h | |||
| @@ -213,12 +213,6 @@ DEFINE_CEPH_FEATURE_DEPRECATED(63, 1, RESERVED_BROKEN, LUMINOUS) // client-facin | |||
| 213 | CEPH_FEATURE_NEW_OSDOPREPLY_ENCODING | \ | 213 | CEPH_FEATURE_NEW_OSDOPREPLY_ENCODING | \ |
| 214 | CEPH_FEATURE_CEPHX_V2) | 214 | CEPH_FEATURE_CEPHX_V2) |
| 215 | 215 | ||
| 216 | #define CEPH_FEATURES_REQUIRED_DEFAULT \ | 216 | #define CEPH_FEATURES_REQUIRED_DEFAULT 0 |
| 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) | ||
| 223 | 217 | ||
| 224 | #endif | 218 | #endif |
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index c0f5db3a9621..2010493e1040 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
| @@ -143,18 +143,6 @@ | |||
| 143 | #define KASAN_ABI_VERSION 3 | 143 | #define KASAN_ABI_VERSION 3 |
| 144 | #endif | 144 | #endif |
| 145 | 145 | ||
| 146 | /* | ||
| 147 | * Because __no_sanitize_address conflicts with inlining: | ||
| 148 | * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368 | ||
| 149 | * we do one or the other. | ||
| 150 | */ | ||
| 151 | #ifdef CONFIG_KASAN | ||
| 152 | #define __no_sanitize_address_or_inline \ | ||
| 153 | __no_sanitize_address __maybe_unused notrace | ||
| 154 | #else | ||
| 155 | #define __no_sanitize_address_or_inline inline | ||
| 156 | #endif | ||
| 157 | |||
| 158 | #if GCC_VERSION >= 50100 | 146 | #if GCC_VERSION >= 50100 |
| 159 | #define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1 | 147 | #define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1 |
| 160 | #endif | 148 | #endif |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 18c80cfa4fc4..06396c1cf127 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
| @@ -189,7 +189,7 @@ void __read_once_size(const volatile void *p, void *res, int size) | |||
| 189 | * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368 | 189 | * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368 |
| 190 | * '__maybe_unused' allows us to avoid defined-but-not-used warnings. | 190 | * '__maybe_unused' allows us to avoid defined-but-not-used warnings. |
| 191 | */ | 191 | */ |
| 192 | # define __no_kasan_or_inline __no_sanitize_address __maybe_unused | 192 | # define __no_kasan_or_inline __no_sanitize_address notrace __maybe_unused |
| 193 | #else | 193 | #else |
| 194 | # define __no_kasan_or_inline __always_inline | 194 | # define __no_kasan_or_inline __always_inline |
| 195 | #endif | 195 | #endif |
diff --git a/include/linux/compiler_attributes.h b/include/linux/compiler_attributes.h index 6b28c1b7310c..f8c400ba1929 100644 --- a/include/linux/compiler_attributes.h +++ b/include/linux/compiler_attributes.h | |||
| @@ -4,22 +4,26 @@ | |||
| 4 | 4 | ||
| 5 | /* | 5 | /* |
| 6 | * The attributes in this file are unconditionally defined and they directly | 6 | * The attributes in this file are unconditionally defined and they directly |
| 7 | * map to compiler attribute(s) -- except those that are optional. | 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: ..."). | ||
| 8 | * | 10 | * |
| 9 | * Any other "attributes" (i.e. those that depend on a configuration option, | 11 | * Any other "attributes" (i.e. those that depend on a configuration option, |
| 10 | * on a compiler, on an architecture, on plugins, on other attributes...) | 12 | * on a compiler, on an architecture, on plugins, on other attributes...) |
| 11 | * should be defined elsewhere (e.g. compiler_types.h or compiler-*.h). | 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). | ||
| 12 | * | 16 | * |
| 13 | * This file is meant to be sorted (by actual attribute name, | 17 | * This file is meant to be sorted (by actual attribute name, |
| 14 | * not by #define identifier). Use the __attribute__((__name__)) syntax | 18 | * not by #define identifier). Use the __attribute__((__name__)) syntax |
| 15 | * (i.e. with underscores) to avoid future collisions with other macros. | 19 | * (i.e. with underscores) to avoid future collisions with other macros. |
| 16 | * If an attribute is optional, state the reason in the comment. | 20 | * Provide links to the documentation of each supported compiler, if it exists. |
| 17 | */ | 21 | */ |
| 18 | 22 | ||
| 19 | /* | 23 | /* |
| 20 | * To check for optional attributes, we use __has_attribute, which is supported | 24 | * __has_attribute is supported on gcc >= 5, clang >= 2.9 and icc >= 17. |
| 21 | * on gcc >= 5, clang >= 2.9 and icc >= 17. In the meantime, to support | 25 | * In the meantime, to support 4.6 <= gcc < 5, we implement __has_attribute |
| 22 | * 4.6 <= gcc < 5, we implement __has_attribute by hand. | 26 | * by hand. |
| 23 | * | 27 | * |
| 24 | * sparse does not support __has_attribute (yet) and defines __GNUC_MINOR__ | 28 | * sparse does not support __has_attribute (yet) and defines __GNUC_MINOR__ |
| 25 | * depending on the compiler used to build it; however, these attributes have | 29 | * depending on the compiler used to build it; however, these attributes have |
diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h index 3439d7d0249a..4a3f9c09c92d 100644 --- a/include/linux/compiler_types.h +++ b/include/linux/compiler_types.h | |||
| @@ -130,6 +130,10 @@ struct ftrace_likely_data { | |||
| 130 | # define randomized_struct_fields_end | 130 | # define randomized_struct_fields_end |
| 131 | #endif | 131 | #endif |
| 132 | 132 | ||
| 133 | #ifndef asm_volatile_goto | ||
| 134 | #define asm_volatile_goto(x...) asm goto(x) | ||
| 135 | #endif | ||
| 136 | |||
| 133 | /* Are two types/vars the same type (ignoring qualifiers)? */ | 137 | /* Are two types/vars the same type (ignoring qualifiers)? */ |
| 134 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) | 138 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) |
| 135 | 139 | ||
diff --git a/include/linux/dma-direct.h b/include/linux/dma-direct.h index bd73e7a91410..9e66bfe369aa 100644 --- a/include/linux/dma-direct.h +++ b/include/linux/dma-direct.h | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | #include <linux/dma-mapping.h> | 5 | #include <linux/dma-mapping.h> |
| 6 | #include <linux/mem_encrypt.h> | 6 | #include <linux/mem_encrypt.h> |
| 7 | 7 | ||
| 8 | #define DIRECT_MAPPING_ERROR 0 | 8 | #define DIRECT_MAPPING_ERROR (~(dma_addr_t)0) |
| 9 | 9 | ||
| 10 | #ifdef CONFIG_ARCH_HAS_PHYS_TO_DMA | 10 | #ifdef CONFIG_ARCH_HAS_PHYS_TO_DMA |
| 11 | #include <asm/dma-direct.h> | 11 | #include <asm/dma-direct.h> |
diff --git a/include/linux/efi.h b/include/linux/efi.h index 845174e113ce..100ce4a4aff6 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
| @@ -1167,6 +1167,8 @@ static inline bool efi_enabled(int feature) | |||
| 1167 | extern void efi_reboot(enum reboot_mode reboot_mode, const char *__unused); | 1167 | extern void efi_reboot(enum reboot_mode reboot_mode, const char *__unused); |
| 1168 | 1168 | ||
| 1169 | extern bool efi_is_table_address(unsigned long phys_addr); | 1169 | extern bool efi_is_table_address(unsigned long phys_addr); |
| 1170 | |||
| 1171 | extern int efi_apply_persistent_mem_reservations(void); | ||
| 1170 | #else | 1172 | #else |
| 1171 | static inline bool efi_enabled(int feature) | 1173 | static inline bool efi_enabled(int feature) |
| 1172 | { | 1174 | { |
| @@ -1185,6 +1187,11 @@ static inline bool efi_is_table_address(unsigned long phys_addr) | |||
| 1185 | { | 1187 | { |
| 1186 | return false; | 1188 | return false; |
| 1187 | } | 1189 | } |
| 1190 | |||
| 1191 | static inline int efi_apply_persistent_mem_reservations(void) | ||
| 1192 | { | ||
| 1193 | return 0; | ||
| 1194 | } | ||
| 1188 | #endif | 1195 | #endif |
| 1189 | 1196 | ||
| 1190 | extern int efi_status_to_err(efi_status_t status); | 1197 | extern int efi_status_to_err(efi_status_t status); |
diff --git a/include/linux/filter.h b/include/linux/filter.h index de629b706d1d..448dcc448f1f 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
| @@ -866,6 +866,10 @@ void bpf_jit_binary_free(struct bpf_binary_header *hdr); | |||
| 866 | 866 | ||
| 867 | void bpf_jit_free(struct bpf_prog *fp); | 867 | void bpf_jit_free(struct bpf_prog *fp); |
| 868 | 868 | ||
| 869 | int bpf_jit_get_func_addr(const struct bpf_prog *prog, | ||
| 870 | const struct bpf_insn *insn, bool extra_pass, | ||
| 871 | u64 *func_addr, bool *func_addr_fixed); | ||
| 872 | |||
| 869 | struct bpf_prog *bpf_jit_blind_constants(struct bpf_prog *fp); | 873 | struct bpf_prog *bpf_jit_blind_constants(struct bpf_prog *fp); |
| 870 | void bpf_jit_prog_release_other(struct bpf_prog *fp, struct bpf_prog *fp_other); | 874 | void bpf_jit_prog_release_other(struct bpf_prog *fp, struct bpf_prog *fp_other); |
| 871 | 875 | ||
diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h index 34cf0fdd7dc7..610815e3f1aa 100644 --- a/include/linux/fscache-cache.h +++ b/include/linux/fscache-cache.h | |||
| @@ -196,8 +196,7 @@ static inline void fscache_enqueue_retrieval(struct fscache_retrieval *op) | |||
| 196 | static inline void fscache_retrieval_complete(struct fscache_retrieval *op, | 196 | static inline void fscache_retrieval_complete(struct fscache_retrieval *op, |
| 197 | int n_pages) | 197 | int n_pages) |
| 198 | { | 198 | { |
| 199 | atomic_sub(n_pages, &op->n_pages); | 199 | if (atomic_sub_return_relaxed(n_pages, &op->n_pages) <= 0) |
| 200 | if (atomic_read(&op->n_pages) <= 0) | ||
| 201 | fscache_op_complete(&op->op, false); | 200 | fscache_op_complete(&op->op, false); |
| 202 | } | 201 | } |
| 203 | 202 | ||
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index a397907e8d72..dd16e8218db3 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
| @@ -777,8 +777,8 @@ struct ftrace_ret_stack { | |||
| 777 | extern void return_to_handler(void); | 777 | extern void return_to_handler(void); |
| 778 | 778 | ||
| 779 | extern int | 779 | extern int |
| 780 | ftrace_push_return_trace(unsigned long ret, unsigned long func, int *depth, | 780 | function_graph_enter(unsigned long ret, unsigned long func, |
| 781 | unsigned long frame_pointer, unsigned long *retp); | 781 | unsigned long frame_pointer, unsigned long *retp); |
| 782 | 782 | ||
| 783 | unsigned long ftrace_graph_ret_addr(struct task_struct *task, int *idx, | 783 | unsigned long ftrace_graph_ret_addr(struct task_struct *task, int *idx, |
| 784 | unsigned long ret, unsigned long *retp); | 784 | unsigned long ret, unsigned long *retp); |
diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h index 331dc377c275..dc12f5c4b076 100644 --- a/include/linux/hid-sensor-hub.h +++ b/include/linux/hid-sensor-hub.h | |||
| @@ -177,6 +177,7 @@ int sensor_hub_input_get_attribute_info(struct hid_sensor_hub_device *hsdev, | |||
| 177 | * @attr_usage_id: Attribute usage id as per spec | 177 | * @attr_usage_id: Attribute usage id as per spec |
| 178 | * @report_id: Report id to look for | 178 | * @report_id: Report id to look for |
| 179 | * @flag: Synchronous or asynchronous read | 179 | * @flag: Synchronous or asynchronous read |
| 180 | * @is_signed: If true then fields < 32 bits will be sign-extended | ||
| 180 | * | 181 | * |
| 181 | * Issues a synchronous or asynchronous read request for an input attribute. | 182 | * Issues a synchronous or asynchronous read request for an input attribute. |
| 182 | * Returns data upto 32 bits. | 183 | * Returns data upto 32 bits. |
| @@ -190,7 +191,8 @@ enum sensor_hub_read_flags { | |||
| 190 | int sensor_hub_input_attr_get_raw_value(struct hid_sensor_hub_device *hsdev, | 191 | int sensor_hub_input_attr_get_raw_value(struct hid_sensor_hub_device *hsdev, |
| 191 | u32 usage_id, | 192 | u32 usage_id, |
| 192 | u32 attr_usage_id, u32 report_id, | 193 | 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 | ||
| 194 | ); | 196 | ); |
| 195 | 197 | ||
| 196 | /** | 198 | /** |
diff --git a/include/linux/hid.h b/include/linux/hid.h index 2827b87590d8..a355d61940f2 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
| @@ -722,8 +722,8 @@ struct hid_usage_id { | |||
| 722 | * input will not be passed to raw_event unless hid_device_io_start is | 722 | * input will not be passed to raw_event unless hid_device_io_start is |
| 723 | * called. | 723 | * called. |
| 724 | * | 724 | * |
| 725 | * raw_event and event should return 0 on no action performed, 1 when no | 725 | * raw_event and event should return negative on error, any other value will |
| 726 | * further processing should be done and negative on error | 726 | * pass the event on to .event() typically return 0 for success. |
| 727 | * | 727 | * |
| 728 | * input_mapping shall return a negative value to completely ignore this usage | 728 | * input_mapping shall return a negative value to completely ignore this usage |
| 729 | * (e.g. doubled or invalid usage), zero to continue with parsing of this | 729 | * (e.g. doubled or invalid usage), zero to continue with parsing of this |
| @@ -1139,34 +1139,6 @@ static inline u32 hid_report_len(struct hid_report *report) | |||
| 1139 | int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, u32 size, | 1139 | int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, u32 size, |
| 1140 | int interrupt); | 1140 | int interrupt); |
| 1141 | 1141 | ||
| 1142 | |||
| 1143 | /** | ||
| 1144 | * struct hid_scroll_counter - Utility class for processing high-resolution | ||
| 1145 | * scroll events. | ||
| 1146 | * @dev: the input device for which events should be reported. | ||
| 1147 | * @microns_per_hi_res_unit: the amount moved by the user's finger for each | ||
| 1148 | * high-resolution unit reported by the mouse, in | ||
| 1149 | * microns. | ||
| 1150 | * @resolution_multiplier: the wheel's resolution in high-resolution mode as a | ||
| 1151 | * multiple of its lower resolution. For example, if | ||
| 1152 | * moving the wheel by one "notch" would result in a | ||
| 1153 | * value of 1 in low-resolution mode but 8 in | ||
| 1154 | * high-resolution, the multiplier is 8. | ||
| 1155 | * @remainder: counts the number of high-resolution units moved since the last | ||
| 1156 | * low-resolution event (REL_WHEEL or REL_HWHEEL) was sent. Should | ||
| 1157 | * only be used by class methods. | ||
| 1158 | */ | ||
| 1159 | struct hid_scroll_counter { | ||
| 1160 | struct input_dev *dev; | ||
| 1161 | int microns_per_hi_res_unit; | ||
| 1162 | int resolution_multiplier; | ||
| 1163 | |||
| 1164 | int remainder; | ||
| 1165 | }; | ||
| 1166 | |||
| 1167 | void hid_scroll_counter_handle_scroll(struct hid_scroll_counter *counter, | ||
| 1168 | int hi_res_value); | ||
| 1169 | |||
| 1170 | /* HID quirks API */ | 1142 | /* HID quirks API */ |
| 1171 | unsigned long hid_lookup_quirk(const struct hid_device *hdev); | 1143 | unsigned long hid_lookup_quirk(const struct hid_device *hdev); |
| 1172 | int hid_quirks_init(char **quirks_param, __u16 bus, int count); | 1144 | int hid_quirks_init(char **quirks_param, __u16 bus, int count); |
diff --git a/include/linux/i8253.h b/include/linux/i8253.h index e6bb36a97519..8336b2f6f834 100644 --- a/include/linux/i8253.h +++ b/include/linux/i8253.h | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #define PIT_LATCH ((PIT_TICK_RATE + HZ/2) / HZ) | 21 | #define PIT_LATCH ((PIT_TICK_RATE + HZ/2) / HZ) |
| 22 | 22 | ||
| 23 | extern raw_spinlock_t i8253_lock; | 23 | extern raw_spinlock_t i8253_lock; |
| 24 | extern bool i8253_clear_counter_on_shutdown; | ||
| 24 | extern struct clock_event_device i8253_clockevent; | 25 | extern struct clock_event_device i8253_clockevent; |
| 25 | extern void clockevent_i8253_init(bool oneshot); | 26 | extern void clockevent_i8253_init(bool oneshot); |
| 26 | 27 | ||
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index dbff9ff28f2c..34e17e6f8942 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h | |||
| @@ -2473,14 +2473,15 @@ struct mlx5_ifc_xrc_srqc_bits { | |||
| 2473 | 2473 | ||
| 2474 | u8 wq_signature[0x1]; | 2474 | u8 wq_signature[0x1]; |
| 2475 | u8 cont_srq[0x1]; | 2475 | u8 cont_srq[0x1]; |
| 2476 | u8 dbr_umem_valid[0x1]; | 2476 | u8 reserved_at_22[0x1]; |
| 2477 | u8 rlky[0x1]; | 2477 | u8 rlky[0x1]; |
| 2478 | u8 basic_cyclic_rcv_wqe[0x1]; | 2478 | u8 basic_cyclic_rcv_wqe[0x1]; |
| 2479 | u8 log_rq_stride[0x3]; | 2479 | u8 log_rq_stride[0x3]; |
| 2480 | u8 xrcd[0x18]; | 2480 | u8 xrcd[0x18]; |
| 2481 | 2481 | ||
| 2482 | u8 page_offset[0x6]; | 2482 | u8 page_offset[0x6]; |
| 2483 | u8 reserved_at_46[0x2]; | 2483 | u8 reserved_at_46[0x1]; |
| 2484 | u8 dbr_umem_valid[0x1]; | ||
| 2484 | u8 cqn[0x18]; | 2485 | u8 cqn[0x18]; |
| 2485 | 2486 | ||
| 2486 | u8 reserved_at_60[0x20]; | 2487 | u8 reserved_at_60[0x20]; |
| @@ -6689,9 +6690,12 @@ struct mlx5_ifc_create_xrc_srq_in_bits { | |||
| 6689 | 6690 | ||
| 6690 | struct mlx5_ifc_xrc_srqc_bits xrc_srq_context_entry; | 6691 | struct mlx5_ifc_xrc_srqc_bits xrc_srq_context_entry; |
| 6691 | 6692 | ||
| 6692 | u8 reserved_at_280[0x40]; | 6693 | u8 reserved_at_280[0x60]; |
| 6694 | |||
| 6693 | u8 xrc_srq_umem_valid[0x1]; | 6695 | 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]; | ||
| 6695 | 6699 | ||
| 6696 | u8 pas[0][0x40]; | 6700 | u8 pas[0][0x40]; |
| 6697 | }; | 6701 | }; |
diff --git a/include/linux/mm.h b/include/linux/mm.h index fcf9cc9d535f..5411de93a363 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -1744,11 +1744,15 @@ int __pud_alloc(struct mm_struct *mm, p4d_t *p4d, unsigned long address); | |||
| 1744 | 1744 | ||
| 1745 | static inline void mm_inc_nr_puds(struct mm_struct *mm) | 1745 | static inline void mm_inc_nr_puds(struct mm_struct *mm) |
| 1746 | { | 1746 | { |
| 1747 | if (mm_pud_folded(mm)) | ||
| 1748 | return; | ||
| 1747 | atomic_long_add(PTRS_PER_PUD * sizeof(pud_t), &mm->pgtables_bytes); | 1749 | atomic_long_add(PTRS_PER_PUD * sizeof(pud_t), &mm->pgtables_bytes); |
| 1748 | } | 1750 | } |
| 1749 | 1751 | ||
| 1750 | static inline void mm_dec_nr_puds(struct mm_struct *mm) | 1752 | static inline void mm_dec_nr_puds(struct mm_struct *mm) |
| 1751 | { | 1753 | { |
| 1754 | if (mm_pud_folded(mm)) | ||
| 1755 | return; | ||
| 1752 | atomic_long_sub(PTRS_PER_PUD * sizeof(pud_t), &mm->pgtables_bytes); | 1756 | atomic_long_sub(PTRS_PER_PUD * sizeof(pud_t), &mm->pgtables_bytes); |
| 1753 | } | 1757 | } |
| 1754 | #endif | 1758 | #endif |
| @@ -1768,11 +1772,15 @@ int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address); | |||
| 1768 | 1772 | ||
| 1769 | static inline void mm_inc_nr_pmds(struct mm_struct *mm) | 1773 | static inline void mm_inc_nr_pmds(struct mm_struct *mm) |
| 1770 | { | 1774 | { |
| 1775 | if (mm_pmd_folded(mm)) | ||
| 1776 | return; | ||
| 1771 | atomic_long_add(PTRS_PER_PMD * sizeof(pmd_t), &mm->pgtables_bytes); | 1777 | atomic_long_add(PTRS_PER_PMD * sizeof(pmd_t), &mm->pgtables_bytes); |
| 1772 | } | 1778 | } |
| 1773 | 1779 | ||
| 1774 | static inline void mm_dec_nr_pmds(struct mm_struct *mm) | 1780 | static inline void mm_dec_nr_pmds(struct mm_struct *mm) |
| 1775 | { | 1781 | { |
| 1782 | if (mm_pmd_folded(mm)) | ||
| 1783 | return; | ||
| 1776 | atomic_long_sub(PTRS_PER_PMD * sizeof(pmd_t), &mm->pgtables_bytes); | 1784 | atomic_long_sub(PTRS_PER_PMD * sizeof(pmd_t), &mm->pgtables_bytes); |
| 1777 | } | 1785 | } |
| 1778 | #endif | 1786 | #endif |
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index abe975c87b90..7f53ece2c039 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
| @@ -324,9 +324,8 @@ static inline unsigned int nanddev_ntargets(const struct nand_device *nand) | |||
| 324 | */ | 324 | */ |
| 325 | static inline unsigned int nanddev_neraseblocks(const struct nand_device *nand) | 325 | static inline unsigned int nanddev_neraseblocks(const struct nand_device *nand) |
| 326 | { | 326 | { |
| 327 | return (u64)nand->memorg.luns_per_target * | 327 | return nand->memorg.ntargets * nand->memorg.luns_per_target * |
| 328 | nand->memorg.eraseblocks_per_lun * | 328 | nand->memorg.eraseblocks_per_lun; |
| 329 | nand->memorg.pages_per_eraseblock; | ||
| 330 | } | 329 | } |
| 331 | 330 | ||
| 332 | /** | 331 | /** |
| @@ -569,7 +568,7 @@ static inline void nanddev_pos_next_eraseblock(struct nand_device *nand, | |||
| 569 | } | 568 | } |
| 570 | 569 | ||
| 571 | /** | 570 | /** |
| 572 | * nanddev_pos_next_eraseblock() - Move a position to the next page | 571 | * nanddev_pos_next_page() - Move a position to the next page |
| 573 | * @nand: NAND device | 572 | * @nand: NAND device |
| 574 | * @pos: the position to update | 573 | * @pos: the position to update |
| 575 | * | 574 | * |
diff --git a/include/linux/net_dim.h b/include/linux/net_dim.h index c79e859408e6..fd458389f7d1 100644 --- a/include/linux/net_dim.h +++ b/include/linux/net_dim.h | |||
| @@ -406,6 +406,8 @@ static inline void net_dim(struct net_dim *dim, | |||
| 406 | } | 406 | } |
| 407 | /* fall through */ | 407 | /* fall through */ |
| 408 | case NET_DIM_START_MEASURE: | 408 | 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); | ||
| 409 | dim->state = NET_DIM_MEASURE_IN_PROGRESS; | 411 | dim->state = NET_DIM_MEASURE_IN_PROGRESS; |
| 410 | break; | 412 | break; |
| 411 | case NET_DIM_APPLY_NEW_PROFILE: | 413 | case NET_DIM_APPLY_NEW_PROFILE: |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index dc1d9ed33b31..857f8abf7b91 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -3190,6 +3190,26 @@ static inline void netdev_tx_sent_queue(struct netdev_queue *dev_queue, | |||
| 3190 | #endif | 3190 | #endif |
| 3191 | } | 3191 | } |
| 3192 | 3192 | ||
| 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 | |||
| 3193 | /** | 3213 | /** |
| 3194 | * netdev_sent_queue - report the number of bytes queued to hardware | 3214 | * netdev_sent_queue - report the number of bytes queued to hardware |
| 3195 | * @dev: network device | 3215 | * @dev: network device |
diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h index 34fc80f3eb90..1d100efe74ec 100644 --- a/include/linux/netfilter/ipset/ip_set.h +++ b/include/linux/netfilter/ipset/ip_set.h | |||
| @@ -314,7 +314,7 @@ enum { | |||
| 314 | extern ip_set_id_t ip_set_get_byname(struct net *net, | 314 | extern ip_set_id_t ip_set_get_byname(struct net *net, |
| 315 | const char *name, struct ip_set **set); | 315 | const char *name, struct ip_set **set); |
| 316 | extern void ip_set_put_byindex(struct net *net, ip_set_id_t index); | 316 | 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); |
| 318 | extern ip_set_id_t ip_set_nfnl_get_byindex(struct net *net, ip_set_id_t index); | 318 | extern ip_set_id_t ip_set_nfnl_get_byindex(struct net *net, ip_set_id_t index); |
| 319 | extern void ip_set_nfnl_put(struct net *net, ip_set_id_t index); | 319 | extern void ip_set_nfnl_put(struct net *net, ip_set_id_t index); |
| 320 | 320 | ||
diff --git a/include/linux/netfilter/ipset/ip_set_comment.h b/include/linux/netfilter/ipset/ip_set_comment.h index 8e2bab1e8e90..70877f8de7e9 100644 --- a/include/linux/netfilter/ipset/ip_set_comment.h +++ b/include/linux/netfilter/ipset/ip_set_comment.h | |||
| @@ -43,11 +43,11 @@ ip_set_init_comment(struct ip_set *set, struct ip_set_comment *comment, | |||
| 43 | rcu_assign_pointer(comment->c, c); | 43 | rcu_assign_pointer(comment->c, c); |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 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() */ |
| 47 | static inline int | 47 | static inline int |
| 48 | ip_set_put_comment(struct sk_buff *skb, const struct ip_set_comment *comment) | 48 | ip_set_put_comment(struct sk_buff *skb, const struct ip_set_comment *comment) |
| 49 | { | 49 | { |
| 50 | struct ip_set_comment_rcu *c = rcu_dereference_bh(comment->c); | 50 | struct ip_set_comment_rcu *c = rcu_dereference(comment->c); |
| 51 | 51 | ||
| 52 | if (!c) | 52 | if (!c) |
| 53 | return 0; | 53 | return 0; |
diff --git a/include/linux/netfilter/nf_conntrack_proto_gre.h b/include/linux/netfilter/nf_conntrack_proto_gre.h index b8d95564bd53..14edb795ab43 100644 --- a/include/linux/netfilter/nf_conntrack_proto_gre.h +++ b/include/linux/netfilter/nf_conntrack_proto_gre.h | |||
| @@ -21,6 +21,19 @@ struct nf_ct_gre_keymap { | |||
| 21 | struct nf_conntrack_tuple tuple; | 21 | struct nf_conntrack_tuple tuple; |
| 22 | }; | 22 | }; |
| 23 | 23 | ||
| 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 | |||
| 24 | /* add new tuple->key_reply pair to keymap */ | 37 | /* add new tuple->key_reply pair to keymap */ |
| 25 | int nf_ct_gre_keymap_add(struct nf_conn *ct, enum ip_conntrack_dir dir, | 38 | int nf_ct_gre_keymap_add(struct nf_conn *ct, enum ip_conntrack_dir dir, |
| 26 | struct nf_conntrack_tuple *t); | 39 | struct nf_conntrack_tuple *t); |
diff --git a/include/linux/nmi.h b/include/linux/nmi.h index 08f9247e9827..9003e29cde46 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h | |||
| @@ -119,6 +119,8 @@ static inline int hardlockup_detector_perf_init(void) { return 0; } | |||
| 119 | void watchdog_nmi_stop(void); | 119 | void watchdog_nmi_stop(void); |
| 120 | void watchdog_nmi_start(void); | 120 | void watchdog_nmi_start(void); |
| 121 | int watchdog_nmi_probe(void); | 121 | int watchdog_nmi_probe(void); |
| 122 | int watchdog_nmi_enable(unsigned int cpu); | ||
| 123 | void watchdog_nmi_disable(unsigned int cpu); | ||
| 122 | 124 | ||
| 123 | /** | 125 | /** |
| 124 | * touch_nmi_watchdog - restart NMI watchdog timeout. | 126 | * touch_nmi_watchdog - restart NMI watchdog timeout. |
diff --git a/include/linux/platform_data/gpio-davinci.h b/include/linux/platform_data/gpio-davinci.h index f92a47e18034..a93841bfb9f7 100644 --- a/include/linux/platform_data/gpio-davinci.h +++ b/include/linux/platform_data/gpio-davinci.h | |||
| @@ -17,6 +17,8 @@ | |||
| 17 | #define __DAVINCI_GPIO_PLATFORM_H | 17 | #define __DAVINCI_GPIO_PLATFORM_H |
| 18 | 18 | ||
| 19 | struct davinci_gpio_platform_data { | 19 | struct davinci_gpio_platform_data { |
| 20 | bool no_auto_base; | ||
| 21 | u32 base; | ||
| 20 | u32 ngpio; | 22 | u32 ngpio; |
| 21 | u32 gpio_unbanked; | 23 | u32 gpio_unbanked; |
| 22 | }; | 24 | }; |
diff --git a/include/linux/psi.h b/include/linux/psi.h index 8e0725aac0aa..7006008d5b72 100644 --- a/include/linux/psi.h +++ b/include/linux/psi.h | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #ifndef _LINUX_PSI_H | 1 | #ifndef _LINUX_PSI_H |
| 2 | #define _LINUX_PSI_H | 2 | #define _LINUX_PSI_H |
| 3 | 3 | ||
| 4 | #include <linux/jump_label.h> | ||
| 4 | #include <linux/psi_types.h> | 5 | #include <linux/psi_types.h> |
| 5 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
| 6 | 7 | ||
| @@ -9,7 +10,7 @@ struct css_set; | |||
| 9 | 10 | ||
| 10 | #ifdef CONFIG_PSI | 11 | #ifdef CONFIG_PSI |
| 11 | 12 | ||
| 12 | extern bool psi_disabled; | 13 | extern struct static_key_false psi_disabled; |
| 13 | 14 | ||
| 14 | void psi_init(void); | 15 | void psi_init(void); |
| 15 | 16 | ||
diff --git a/include/linux/pstore.h b/include/linux/pstore.h index a15bc4d48752..30fcec375a3a 100644 --- a/include/linux/pstore.h +++ b/include/linux/pstore.h | |||
| @@ -90,7 +90,10 @@ struct pstore_record { | |||
| 90 | * | 90 | * |
| 91 | * @buf_lock: spinlock to serialize access to @buf | 91 | * @buf_lock: spinlock to serialize access to @buf |
| 92 | * @buf: preallocated crash dump buffer | 92 | * @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) | ||
| 94 | * | 97 | * |
| 95 | * @read_mutex: serializes @open, @read, @close, and @erase callbacks | 98 | * @read_mutex: serializes @open, @read, @close, and @erase callbacks |
| 96 | * @flags: bitfield of frontends the backend can accept writes for | 99 | * @flags: bitfield of frontends the backend can accept writes for |
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 6c2ffed907f5..de20ede2c5c8 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
| @@ -64,15 +64,12 @@ extern void exit_ptrace(struct task_struct *tracer, struct list_head *dead); | |||
| 64 | #define PTRACE_MODE_NOAUDIT 0x04 | 64 | #define PTRACE_MODE_NOAUDIT 0x04 |
| 65 | #define PTRACE_MODE_FSCREDS 0x08 | 65 | #define PTRACE_MODE_FSCREDS 0x08 |
| 66 | #define PTRACE_MODE_REALCREDS 0x10 | 66 | #define PTRACE_MODE_REALCREDS 0x10 |
| 67 | #define PTRACE_MODE_SCHED 0x20 | ||
| 68 | #define PTRACE_MODE_IBPB 0x40 | ||
| 69 | 67 | ||
| 70 | /* shorthands for READ/ATTACH and FSCREDS/REALCREDS combinations */ | 68 | /* shorthands for READ/ATTACH and FSCREDS/REALCREDS combinations */ |
| 71 | #define PTRACE_MODE_READ_FSCREDS (PTRACE_MODE_READ | PTRACE_MODE_FSCREDS) | 69 | #define PTRACE_MODE_READ_FSCREDS (PTRACE_MODE_READ | PTRACE_MODE_FSCREDS) |
| 72 | #define PTRACE_MODE_READ_REALCREDS (PTRACE_MODE_READ | PTRACE_MODE_REALCREDS) | 70 | #define PTRACE_MODE_READ_REALCREDS (PTRACE_MODE_READ | PTRACE_MODE_REALCREDS) |
| 73 | #define PTRACE_MODE_ATTACH_FSCREDS (PTRACE_MODE_ATTACH | PTRACE_MODE_FSCREDS) | 71 | #define PTRACE_MODE_ATTACH_FSCREDS (PTRACE_MODE_ATTACH | PTRACE_MODE_FSCREDS) |
| 74 | #define PTRACE_MODE_ATTACH_REALCREDS (PTRACE_MODE_ATTACH | PTRACE_MODE_REALCREDS) | 72 | #define PTRACE_MODE_ATTACH_REALCREDS (PTRACE_MODE_ATTACH | PTRACE_MODE_REALCREDS) |
| 75 | #define PTRACE_MODE_SPEC_IBPB (PTRACE_MODE_ATTACH_REALCREDS | PTRACE_MODE_IBPB) | ||
| 76 | 73 | ||
| 77 | /** | 74 | /** |
| 78 | * ptrace_may_access - check whether the caller is permitted to access | 75 | * 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); | |||
| 90 | */ | 87 | */ |
| 91 | extern bool ptrace_may_access(struct task_struct *task, unsigned int mode); | 88 | extern bool ptrace_may_access(struct task_struct *task, unsigned int mode); |
| 92 | 89 | ||
| 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 | |||
| 107 | static inline int ptrace_reparented(struct task_struct *child) | 90 | static inline int ptrace_reparented(struct task_struct *child) |
| 108 | { | 91 | { |
| 109 | return !same_thread_group(child->real_parent, child->parent); | 92 | return !same_thread_group(child->real_parent, child->parent); |
diff --git a/include/linux/sched.h b/include/linux/sched.h index a51c13c2b1a0..291a9bd5b97f 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -1116,6 +1116,7 @@ struct task_struct { | |||
| 1116 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | 1116 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
| 1117 | /* Index of current stored address in ret_stack: */ | 1117 | /* Index of current stored address in ret_stack: */ |
| 1118 | int curr_ret_stack; | 1118 | int curr_ret_stack; |
| 1119 | int curr_ret_depth; | ||
| 1119 | 1120 | ||
| 1120 | /* Stack of return addresses for return function tracing: */ | 1121 | /* Stack of return addresses for return function tracing: */ |
| 1121 | struct ftrace_ret_stack *ret_stack; | 1122 | struct ftrace_ret_stack *ret_stack; |
| @@ -1453,6 +1454,8 @@ static inline bool is_percpu_thread(void) | |||
| 1453 | #define PFA_SPREAD_SLAB 2 /* Spread some slab caches over cpuset */ | 1454 | #define PFA_SPREAD_SLAB 2 /* Spread some slab caches over cpuset */ |
| 1454 | #define PFA_SPEC_SSB_DISABLE 3 /* Speculative Store Bypass disabled */ | 1455 | #define PFA_SPEC_SSB_DISABLE 3 /* Speculative Store Bypass disabled */ |
| 1455 | #define PFA_SPEC_SSB_FORCE_DISABLE 4 /* Speculative Store Bypass force disabled*/ | 1456 | #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 */ | ||
| 1456 | 1459 | ||
| 1457 | #define TASK_PFA_TEST(name, func) \ | 1460 | #define TASK_PFA_TEST(name, func) \ |
| 1458 | static inline bool task_##func(struct task_struct *p) \ | 1461 | static inline bool task_##func(struct task_struct *p) \ |
| @@ -1484,6 +1487,13 @@ TASK_PFA_CLEAR(SPEC_SSB_DISABLE, spec_ssb_disable) | |||
| 1484 | TASK_PFA_TEST(SPEC_SSB_FORCE_DISABLE, spec_ssb_force_disable) | 1487 | TASK_PFA_TEST(SPEC_SSB_FORCE_DISABLE, spec_ssb_force_disable) |
| 1485 | TASK_PFA_SET(SPEC_SSB_FORCE_DISABLE, spec_ssb_force_disable) | 1488 | TASK_PFA_SET(SPEC_SSB_FORCE_DISABLE, spec_ssb_force_disable) |
| 1486 | 1489 | ||
| 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 | |||
| 1487 | static inline void | 1497 | static inline void |
| 1488 | current_restore_flags(unsigned long orig_flags, unsigned long flags) | 1498 | current_restore_flags(unsigned long orig_flags, unsigned long flags) |
| 1489 | { | 1499 | { |
diff --git a/include/linux/sched/smt.h b/include/linux/sched/smt.h new file mode 100644 index 000000000000..59d3736c454c --- /dev/null +++ b/include/linux/sched/smt.h | |||
| @@ -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 | ||
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 0ba687454267..0d1b2c3f127b 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -1326,6 +1326,22 @@ static inline void skb_zcopy_set(struct sk_buff *skb, struct ubuf_info *uarg) | |||
| 1326 | } | 1326 | } |
| 1327 | } | 1327 | } |
| 1328 | 1328 | ||
| 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 | |||
| 1329 | /* Release a reference on a zerocopy structure */ | 1345 | /* Release a reference on a zerocopy structure */ |
| 1330 | static inline void skb_zcopy_clear(struct sk_buff *skb, bool zerocopy) | 1346 | static inline void skb_zcopy_clear(struct sk_buff *skb, bool zerocopy) |
| 1331 | { | 1347 | { |
| @@ -1335,7 +1351,7 @@ static inline void skb_zcopy_clear(struct sk_buff *skb, bool zerocopy) | |||
| 1335 | if (uarg->callback == sock_zerocopy_callback) { | 1351 | if (uarg->callback == sock_zerocopy_callback) { |
| 1336 | uarg->zerocopy = uarg->zerocopy && zerocopy; | 1352 | uarg->zerocopy = uarg->zerocopy && zerocopy; |
| 1337 | sock_zerocopy_put(uarg); | 1353 | sock_zerocopy_put(uarg); |
| 1338 | } else { | 1354 | } else if (!skb_zcopy_is_nouarg(skb)) { |
| 1339 | uarg->callback(uarg, zerocopy); | 1355 | uarg->callback(uarg, zerocopy); |
| 1340 | } | 1356 | } |
| 1341 | 1357 | ||
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 8ed77bb4ed86..a9b0280687d5 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
| @@ -196,6 +196,7 @@ struct tcp_sock { | |||
| 196 | u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */ | 196 | u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */ |
| 197 | u32 lsndtime; /* timestamp of last sent data packet (for restart window) */ | 197 | u32 lsndtime; /* timestamp of last sent data packet (for restart window) */ |
| 198 | u32 last_oow_ack_time; /* timestamp of last out-of-window ACK */ | 198 | u32 last_oow_ack_time; /* timestamp of last out-of-window ACK */ |
| 199 | u32 compressed_ack_rcv_nxt; | ||
| 199 | 200 | ||
| 200 | u32 tsoffset; /* timestamp offset */ | 201 | u32 tsoffset; /* timestamp offset */ |
| 201 | 202 | ||
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h index 40b0b4c1bf7b..df20f8bdbfa3 100644 --- a/include/linux/tracehook.h +++ b/include/linux/tracehook.h | |||
| @@ -83,8 +83,8 @@ static inline int ptrace_report_syscall(struct pt_regs *regs) | |||
| 83 | * tracehook_report_syscall_entry - task is about to attempt a system call | 83 | * tracehook_report_syscall_entry - task is about to attempt a system call |
| 84 | * @regs: user register state of current task | 84 | * @regs: user register state of current task |
| 85 | * | 85 | * |
| 86 | * This will be called if %TIF_SYSCALL_TRACE has been set, when the | 86 | * This will be called if %TIF_SYSCALL_TRACE or %TIF_SYSCALL_EMU have been set, |
| 87 | * current task has just entered the kernel for a system call. | 87 | * when the current task has just entered the kernel for a system call. |
| 88 | * Full user register state is available here. Changing the values | 88 | * Full user register state is available here. Changing the values |
| 89 | * in @regs can affect the system call number and arguments to be tried. | 89 | * in @regs can affect the system call number and arguments to be tried. |
| 90 | * It is safe to block here, preventing the system call from beginning. | 90 | * It is safe to block here, preventing the system call from beginning. |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 538ba1a58f5b..e9de8ad0bad7 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
| @@ -166,7 +166,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p) | |||
| 166 | struct tracepoint_func *it_func_ptr; \ | 166 | struct tracepoint_func *it_func_ptr; \ |
| 167 | void *it_func; \ | 167 | void *it_func; \ |
| 168 | void *__data; \ | 168 | void *__data; \ |
| 169 | int __maybe_unused idx = 0; \ | 169 | int __maybe_unused __idx = 0; \ |
| 170 | \ | 170 | \ |
| 171 | if (!(cond)) \ | 171 | if (!(cond)) \ |
| 172 | return; \ | 172 | return; \ |
| @@ -182,7 +182,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p) | |||
| 182 | * doesn't work from the idle path. \ | 182 | * doesn't work from the idle path. \ |
| 183 | */ \ | 183 | */ \ |
| 184 | if (rcuidle) { \ | 184 | if (rcuidle) { \ |
| 185 | idx = srcu_read_lock_notrace(&tracepoint_srcu); \ | 185 | __idx = srcu_read_lock_notrace(&tracepoint_srcu);\ |
| 186 | rcu_irq_enter_irqson(); \ | 186 | rcu_irq_enter_irqson(); \ |
| 187 | } \ | 187 | } \ |
| 188 | \ | 188 | \ |
| @@ -198,7 +198,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p) | |||
| 198 | \ | 198 | \ |
| 199 | if (rcuidle) { \ | 199 | if (rcuidle) { \ |
| 200 | rcu_irq_exit_irqson(); \ | 200 | rcu_irq_exit_irqson(); \ |
| 201 | srcu_read_unlock_notrace(&tracepoint_srcu, idx);\ | 201 | srcu_read_unlock_notrace(&tracepoint_srcu, __idx);\ |
| 202 | } \ | 202 | } \ |
| 203 | \ | 203 | \ |
| 204 | preempt_enable_notrace(); \ | 204 | preempt_enable_notrace(); \ |
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h index b7a99ce56bc9..a1be64c9940f 100644 --- a/include/linux/usb/quirks.h +++ b/include/linux/usb/quirks.h | |||
| @@ -66,4 +66,7 @@ | |||
| 66 | /* Device needs a pause after every control message. */ | 66 | /* Device needs a pause after every control message. */ |
| 67 | #define USB_QUIRK_DELAY_CTRL_MSG BIT(13) | 67 | #define USB_QUIRK_DELAY_CTRL_MSG BIT(13) |
| 68 | 68 | ||
| 69 | /* Hub needs extra delay after resetting its port. */ | ||
| 70 | #define USB_QUIRK_HUB_SLOW_RESET BIT(14) | ||
| 71 | |||
| 69 | #endif /* __LINUX_USB_QUIRKS_H */ | 72 | #endif /* __LINUX_USB_QUIRKS_H */ |
diff --git a/include/linux/xarray.h b/include/linux/xarray.h index d9514928ddac..564892e19f8c 100644 --- a/include/linux/xarray.h +++ b/include/linux/xarray.h | |||
| @@ -289,9 +289,7 @@ struct xarray { | |||
| 289 | void xa_init_flags(struct xarray *, gfp_t flags); | 289 | void xa_init_flags(struct xarray *, gfp_t flags); |
| 290 | void *xa_load(struct xarray *, unsigned long index); | 290 | void *xa_load(struct xarray *, unsigned long index); |
| 291 | void *xa_store(struct xarray *, unsigned long index, void *entry, gfp_t); | 291 | void *xa_store(struct xarray *, unsigned long index, void *entry, gfp_t); |
| 292 | void *xa_cmpxchg(struct xarray *, unsigned long index, | 292 | void *xa_erase(struct xarray *, unsigned long index); |
| 293 | void *old, void *entry, gfp_t); | ||
| 294 | int xa_reserve(struct xarray *, unsigned long index, gfp_t); | ||
| 295 | void *xa_store_range(struct xarray *, unsigned long first, unsigned long last, | 293 | void *xa_store_range(struct xarray *, unsigned long first, unsigned long last, |
| 296 | void *entry, gfp_t); | 294 | void *entry, gfp_t); |
| 297 | bool xa_get_mark(struct xarray *, unsigned long index, xa_mark_t); | 295 | bool xa_get_mark(struct xarray *, unsigned long index, xa_mark_t); |
| @@ -344,65 +342,6 @@ static inline bool xa_marked(const struct xarray *xa, xa_mark_t mark) | |||
| 344 | } | 342 | } |
| 345 | 343 | ||
| 346 | /** | 344 | /** |
| 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 | |||
| 405 | /** | ||
| 406 | * xa_for_each() - Iterate over a portion of an XArray. | 345 | * xa_for_each() - Iterate over a portion of an XArray. |
| 407 | * @xa: XArray. | 346 | * @xa: XArray. |
| 408 | * @entry: Entry retrieved from array. | 347 | * @entry: Entry retrieved from array. |
| @@ -455,6 +394,7 @@ void *__xa_store(struct xarray *, unsigned long index, void *entry, gfp_t); | |||
| 455 | void *__xa_cmpxchg(struct xarray *, unsigned long index, void *old, | 394 | void *__xa_cmpxchg(struct xarray *, unsigned long index, void *old, |
| 456 | void *entry, gfp_t); | 395 | void *entry, gfp_t); |
| 457 | int __xa_alloc(struct xarray *, u32 *id, u32 max, void *entry, gfp_t); | 396 | int __xa_alloc(struct xarray *, u32 *id, u32 max, void *entry, gfp_t); |
| 397 | int __xa_reserve(struct xarray *, unsigned long index, gfp_t); | ||
| 458 | void __xa_set_mark(struct xarray *, unsigned long index, xa_mark_t); | 398 | void __xa_set_mark(struct xarray *, unsigned long index, xa_mark_t); |
| 459 | void __xa_clear_mark(struct xarray *, unsigned long index, xa_mark_t); | 399 | void __xa_clear_mark(struct xarray *, unsigned long index, xa_mark_t); |
| 460 | 400 | ||
| @@ -487,6 +427,58 @@ static inline int __xa_insert(struct xarray *xa, unsigned long index, | |||
| 487 | } | 427 | } |
| 488 | 428 | ||
| 489 | /** | 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 | |||
| 481 | /** | ||
| 490 | * xa_erase_bh() - Erase this entry from the XArray. | 482 | * xa_erase_bh() - Erase this entry from the XArray. |
| 491 | * @xa: XArray. | 483 | * @xa: XArray. |
| 492 | * @index: Index of entry. | 484 | * @index: Index of entry. |
| @@ -495,7 +487,7 @@ static inline int __xa_insert(struct xarray *xa, unsigned long index, | |||
| 495 | * the third argument. The XArray does not need to allocate memory, so | 487 | * the third argument. The XArray does not need to allocate memory, so |
| 496 | * the user does not need to provide GFP flags. | 488 | * the user does not need to provide GFP flags. |
| 497 | * | 489 | * |
| 498 | * Context: Process context. Takes and releases the xa_lock while | 490 | * Context: Any context. Takes and releases the xa_lock while |
| 499 | * disabling softirqs. | 491 | * disabling softirqs. |
| 500 | * Return: The entry which used to be at this index. | 492 | * Return: The entry which used to be at this index. |
| 501 | */ | 493 | */ |
| @@ -535,6 +527,61 @@ static inline void *xa_erase_irq(struct xarray *xa, unsigned long index) | |||
| 535 | } | 527 | } |
| 536 | 528 | ||
| 537 | /** | 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 | |||
| 584 | /** | ||
| 538 | * xa_alloc() - Find somewhere to store this entry in the XArray. | 585 | * xa_alloc() - Find somewhere to store this entry in the XArray. |
| 539 | * @xa: XArray. | 586 | * @xa: XArray. |
| 540 | * @id: Pointer to ID. | 587 | * @id: Pointer to ID. |
| @@ -575,7 +622,7 @@ static inline int xa_alloc(struct xarray *xa, u32 *id, u32 max, void *entry, | |||
| 575 | * Updates the @id pointer with the index, then stores the entry at that | 622 | * Updates the @id pointer with the index, then stores the entry at that |
| 576 | * index. A concurrent lookup will not see an uninitialised @id. | 623 | * index. A concurrent lookup will not see an uninitialised @id. |
| 577 | * | 624 | * |
| 578 | * Context: Process context. Takes and releases the xa_lock while | 625 | * Context: Any context. Takes and releases the xa_lock while |
| 579 | * disabling softirqs. May sleep if the @gfp flags permit. | 626 | * disabling softirqs. May sleep if the @gfp flags permit. |
| 580 | * Return: 0 on success, -ENOMEM if memory allocation fails or -ENOSPC if | 627 | * Return: 0 on success, -ENOMEM if memory allocation fails or -ENOSPC if |
| 581 | * there is no more space in the XArray. | 628 | * 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, | |||
| 621 | return err; | 668 | return err; |
| 622 | } | 669 | } |
| 623 | 670 | ||
| 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 | |||
| 624 | /* Everything below here is the Advanced API. Proceed with caution. */ | 763 | /* Everything below here is the Advanced API. Proceed with caution. */ |
| 625 | 764 | ||
| 626 | /* | 765 | /* |
