Two easily resolvable overlapping change conflicts, one in TCP and one in the eBPF verifier.
Showing the changes to include/linux (8 of 142 files). Show all
Unified · Split
| @@ -34,6 +34,7 @@ · 33 unmodified lines | ||
| 34 | 34 | #ifndef __has_attribute |
| 35 | 35 | # define __has_attribute(x) __GCC4_has_attribute_##x |
| 36 | 36 | # define __GCC4_has_attribute___assume_aligned__ (__GNUC_MINOR__ >= 9) |
| 37 | +# define __GCC4_has_attribute___copy__ 0 | |
| 37 | 38 | # define __GCC4_has_attribute___designated_init__ 0 |
| 38 | 39 | # define __GCC4_has_attribute___externally_visible__ 1 |
| 39 | 40 | # define __GCC4_has_attribute___noclone__ 1 |
| @@ -100,6 +101,19 @@ · 60 unmodified lines | ||
| 100 | 101 | */ |
| 101 | 102 | #define __attribute_const__ __attribute__((__const__)) |
| 102 | 103 | |
| 104 | +/* | |
| 105 | + * Optional: only supported since gcc >= 9 | |
| 106 | + * Optional: not supported by clang | |
| 107 | + * Optional: not supported by icc | |
| 108 | + * | |
| 109 | + * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-copy-function-attribute | |
| 110 | + */ | |
| 111 | +#if __has_attribute(__copy__) | |
| 112 | +# define __copy(symbol) __attribute__((__copy__(symbol))) | |
| 113 | +#else | |
| 114 | +# define __copy(symbol) | |
| 115 | +#endif | |
| 116 | + | |
| 103 | 117 | /* |
| 104 | 118 | * Don't. Just don't. See commit 771c035372a0 ("deprecate the '__deprecated' |
| 105 | 119 | * attribute warnings entirely and for good") for more information. |
| @@ -1198,8 +1198,6 @@ static inline bool efi_enabled(int feature) · 1197 unmodified lines | ||
| 1198 | 1198 | extern void efi_reboot(enum reboot_mode reboot_mode, const char *__unused); |
| 1199 | 1199 | |
| 1200 | 1200 | extern bool efi_is_table_address(unsigned long phys_addr); |
| 1201 | − | |
| 1202 | −extern int efi_apply_persistent_mem_reservations(void); | |
| 1203 | 1201 | #else |
| 1204 | 1202 | static inline bool efi_enabled(int feature) |
| 1205 | 1203 | { |
| @@ -1218,11 +1216,6 @@ static inline bool efi_is_table_address(unsigned long phys_addr) · 12 unmodified lines | ||
| 1218 | 1216 | { |
| 1219 | 1217 | return false; |
| 1220 | 1218 | } |
| 1221 | − | |
| 1222 | −static inline int efi_apply_persistent_mem_reservations(void) | |
| 1223 | −{ | |
| 1224 | − return 0; | |
| 1225 | −} | |
| 1226 | 1219 | #endif |
| 1227 | 1220 | |
| 1228 | 1221 | extern int efi_status_to_err(efi_status_t status); |
| @@ -29,9 +29,6 @@ extern unsigned long max_pfn; · 28 unmodified lines | ||
| 29 | 29 | */ |
| 30 | 30 | extern unsigned long long max_possible_pfn; |
| 31 | 31 | |
| 32 | −#define INIT_MEMBLOCK_REGIONS 128 | |
| 33 | −#define INIT_PHYSMEM_REGIONS 4 | |
| 34 | − | |
| 35 | 32 | /** |
| 36 | 33 | * enum memblock_flags - definition of memory region attributes |
| 37 | 34 | * @MEMBLOCK_NONE: no special request |
| @@ -129,13 +129,13 @@ extern void cleanup_module(void); · 128 unmodified lines | ||
| 129 | 129 | #define module_init(initfn) \ |
| 130 | 130 | static inline initcall_t __maybe_unused __inittest(void) \ |
| 131 | 131 | { return initfn; } \ |
| 132 | − int init_module(void) __attribute__((alias(#initfn))); | |
| 132 | + int init_module(void) __copy(initfn) __attribute__((alias(#initfn))); | |
| 133 | 133 | |
| 134 | 134 | /* This is only required if you want to be unloadable. */ |
| 135 | 135 | #define module_exit(exitfn) \ |
| 136 | 136 | static inline exitcall_t __maybe_unused __exittest(void) \ |
| 137 | 137 | { return exitfn; } \ |
| 138 | − void cleanup_module(void) __attribute__((alias(#exitfn))); | |
| 138 | + void cleanup_module(void) __copy(exitfn) __attribute__((alias(#exitfn))); | |
| 139 | 139 | |
| 140 | 140 | #endif |
| 141 | 141 | |
| @@ -11,6 +11,8 @@ · 10 unmodified lines | ||
| 11 | 11 | #define _LINUX_NETDEV_FEATURES_H |
| 12 | 12 | |
| 13 | 13 | #include <linux/types.h> |
| 14 | +#include <linux/bitops.h> | |
| 15 | +#include <asm/byteorder.h> | |
| 14 | 16 | |
| 15 | 17 | typedef u64 netdev_features_t; |
| 16 | 18 | |
| @@ -154,8 +156,26 @@ enum { · 137 unmodified lines | ||
| 154 | 156 | #define NETIF_F_HW_TLS_TX __NETIF_F(HW_TLS_TX) |
| 155 | 157 | #define NETIF_F_HW_TLS_RX __NETIF_F(HW_TLS_RX) |
| 156 | 158 | |
| 157 | −#define for_each_netdev_feature(mask_addr, bit) \ | |
| 158 | − for_each_set_bit(bit, (unsigned long *)mask_addr, NETDEV_FEATURE_COUNT) | |
| 159 | +/* Finds the next feature with the highest number of the range of start till 0. | |
| 160 | + */ | |
| 161 | +static inline int find_next_netdev_feature(u64 feature, unsigned long start) | |
| 162 | +{ | |
| 163 | + /* like BITMAP_LAST_WORD_MASK() for u64 | |
| 164 | + * this sets the most significant 64 - start to 0. | |
| 165 | + */ | |
| 166 | + feature &= ~0ULL >> (-start & ((sizeof(feature) * 8) - 1)); | |
| 167 | + | |
| 168 | + return fls64(feature) - 1; | |
| 169 | +} | |
| 170 | + | |
| 171 | +/* This goes for the MSB to the LSB through the set feature bits, | |
| 172 | + * mask_addr should be a u64 and bit an int | |
| 173 | + */ | |
| 174 | +#define for_each_netdev_feature(mask_addr, bit) \ | |
| 175 | + for ((bit) = find_next_netdev_feature((mask_addr), \ | |
| 176 | + NETDEV_FEATURE_COUNT); \ | |
| 177 | + (bit) >= 0; \ | |
| 178 | + (bit) = find_next_netdev_feature((mask_addr), (bit) - 1)) | |
| 159 | 179 | |
| 160 | 180 | /* Features valid for ethtool to change */ |
| 161 | 181 | /* = all defined minus driver/device-class-related */ |
| @@ -447,6 +447,11 @@ struct pmu { · 446 unmodified lines | ||
| 447 | 447 | * Filter events for PMU-specific reasons. |
| 448 | 448 | */ |
| 449 | 449 | int (*filter_match) (struct perf_event *event); /* optional */ |
| 450 | + | |
| 451 | + /* | |
| 452 | + * Check period value for PERF_EVENT_IOC_PERIOD ioctl. | |
| 453 | + */ | |
| 454 | + int (*check_period) (struct perf_event *event, u64 value); /* optional */ | |
| 450 | 455 | }; |
| 451 | 456 | |
| 452 | 457 | enum perf_addr_filter_action_t { |
| @@ -2439,7 +2439,7 @@ static inline void skb_probe_transport_header(struct sk_buff *skb, · 2438 unmodified lines | ||
| 2439 | 2439 | |
| 2440 | 2440 | if (skb_flow_dissect_flow_keys_basic(skb, &keys, NULL, 0, 0, 0, 0)) |
| 2441 | 2441 | skb_set_transport_header(skb, keys.control.thoff); |
| 2442 | − else | |
| 2442 | + else if (offset_hint >= 0) | |
| 2443 | 2443 | skb_set_transport_header(skb, offset_hint); |
| 2444 | 2444 | } |
| 2445 | 2445 | |
| @@ -4235,6 +4235,12 @@ static inline bool skb_is_gso_sctp(const struct sk_buff *skb) · 1789 unmodified lines | ||
| 4235 | 4235 | return skb_shinfo(skb)->gso_type & SKB_GSO_SCTP; |
| 4236 | 4236 | } |
| 4237 | 4237 | |
| 4238 | +static inline bool skb_is_gso_tcp(const struct sk_buff *skb) | |
| 4239 | +{ | |
| 4240 | + return skb_is_gso(skb) && | |
| 4241 | + skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6); | |
| 4242 | +} | |
| 4243 | + | |
| 4238 | 4244 | static inline void skb_gso_reset(struct sk_buff *skb) |
| 4239 | 4245 | { |
| 4240 | 4246 | skb_shinfo(skb)->gso_size = 0; |
| @@ -57,6 +57,15 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, · 56 unmodified lines | ||
| 57 | 57 | |
| 58 | 58 | if (!skb_partial_csum_set(skb, start, off)) |
| 59 | 59 | return -EINVAL; |
| 60 | + } else { | |
| 61 | + /* gso packets without NEEDS_CSUM do not set transport_offset. | |
| 62 | + * probe and drop if does not match one of the above types. | |
| 63 | + */ | |
| 64 | + if (gso_type) { | |
| 65 | + skb_probe_transport_header(skb, -1); | |
| 66 | + if (!skb_transport_header_was_set(skb)) | |
| 67 | + return -EINVAL; | |
| 68 | + } | |
| 60 | 69 | } |
| 61 | 70 | |
| 62 | 71 | if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) { |