backports.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/38] backports updates
@ 2022-10-11 21:04 Johannes Berg
  2022-10-11 21:04 ` [PATCH 01/38] backport: update pv trace fixes patch Johannes Berg
                   ` (38 more replies)
  0 siblings, 39 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd

So Felix inspired me to take a look at this ...

This is pretty much not cleaned up, but it's what we have internally
now for iwlwifi.

johannes


--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH 01/38] backport: update pv trace fixes patch
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 02/38] backport: implement NLA_POLICY_RANGE for NLA_BINARY Johannes Berg
                   ` (37 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Luca Coelho

From: Luca Coelho <luciano.coelho@intel.com>

One argument was removed from a trace, so the old patch was not
applying anymore.  Update it.

type=maint
ticket=jira:WIFI-85592

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Reviewed-on: https://git-ger-8.devtools.intel.com/gerrit/135575
---
 ...ivers_net_wireless_iwlwifi_iwl-debug.patch | 64 +++++++++++++++++++
 1 file changed, 64 insertions(+)
 create mode 100644 patches/0018-pv-trace-fixes/drivers_net_wireless_iwlwifi_iwl-debug.patch

diff --git a/patches/0018-pv-trace-fixes/drivers_net_wireless_iwlwifi_iwl-debug.patch b/patches/0018-pv-trace-fixes/drivers_net_wireless_iwlwifi_iwl-debug.patch
new file mode 100644
index 000000000000..870aa41f7745
--- /dev/null
+++ b/patches/0018-pv-trace-fixes/drivers_net_wireless_iwlwifi_iwl-debug.patch
@@ -0,0 +1,64 @@
+--- a/drivers/net/wireless/intel/iwlwifi/iwl-debug.c
++++ b/drivers/net/wireless/intel/iwlwifi/iwl-debug.c
+@@ -69,13 +69,16 @@ void __iwl_ ##fn(struct device *dev, const char *fmt, ...)	\
+ 	struct va_format vaf = {				\
+ 		.fmt = fmt,					\
+ 	};							\
+-	va_list args;						\
++	va_list args1, args2;					\
+ 								\
+-	va_start(args, fmt);					\
+-	vaf.va = &args;						\
++	va_start(args1, fmt);					\
++	va_copy(args2, args1);					\
++	vaf.va = &args2;					\
+ 	dev_ ##fn(dev, "%pV", &vaf);				\
++	va_end(args2);						\
++	vaf.va = &args1;					\
+ 	trace_iwlwifi_ ##fn(&vaf);				\
+-	va_end(args);						\
++	va_end(args1);						\
+ }
+ 
+ __iwl_fn(warn)
+@@ -94,13 +97,18 @@ void __iwl_err(struct device *dev, bool rfkill_prefix, bool trace_only,
+ 	va_list args;
+ 
+ 	va_start(args, fmt);
+-	vaf.va = &args;
+ 	if (!trace_only) {
++		va_list args2;
++
++		va_copy(args2, args);
++		vaf.va = &args2;
+ 		if (rfkill_prefix)
+ 			dev_err(dev, "(RFKILL) %pV", &vaf);
+ 		else
+ 			dev_err(dev, "%pV", &vaf);
++		va_end(args2);
+ 	}
++	vaf.va = &args;
+ 	trace_iwlwifi_err(&vaf);
+ 	va_end(args);
+ }
+@@ -117,12 +125,18 @@ void __iwl_dbg(struct device *dev,
+ 	va_list args;
+ 
+ 	va_start(args, fmt);
+-	vaf.va = &args;
+ #ifdef CONFIG_IWLWIFI_DEBUG
+ 	if (iwl_have_debug_level(level) &&
+-	    (!limit || net_ratelimit()))
++	    (!limit || net_ratelimit())) {
++		va_list args2;
++
++		va_copy(args2, args);
++		vaf.va = &args2;
+ 		dev_printk(KERN_DEBUG, dev, "%s %pV", function, &vaf);
++		va_end(args2);
++	}
+ #endif
++	vaf.va = &args;
+ 	trace_iwlwifi_dbg(level, function, &vaf);
+ 	va_end(args);
+ }
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 02/38] backport: implement NLA_POLICY_RANGE for NLA_BINARY
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
  2022-10-11 21:04 ` [PATCH 01/38] backport: update pv trace fixes patch Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 03/38] backports: bpgit: handle copied files properly in status() Johannes Berg
                   ` (36 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Luca Coelho

From: Luca Coelho <luciano.coelho@intel.com>

The range checks for NLA_BINARY are supported since v5.10.  Unwrap the
macros and introduce a new function to test type.

type=maint
ticket=jira:WIFI-85592

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Reviewed-on: https://git-ger-8.devtools.intel.com/gerrit/135576
---
 backport/backport-include/net/netlink.h    | 31 +++++++++++++++++++---
 patches/0097-nla_policy_binary_range.cocci |  5 ++++
 2 files changed, 32 insertions(+), 4 deletions(-)
 create mode 100644 patches/0097-nla_policy_binary_range.cocci

diff --git a/backport/backport-include/net/netlink.h b/backport/backport-include/net/netlink.h
index 3c7fdc7e3e0f..e94f32626782 100644
--- a/backport/backport-include/net/netlink.h
+++ b/backport/backport-include/net/netlink.h
@@ -546,10 +546,33 @@ static inline void *nla_memdup(const struct nlattr *src, gfp_t gfp)
 }
 #endif /* < 4.9 */
 
-#ifndef NLA_POLICY_MIN_LEN
-#define NLA_POLICY_MIN_LEN(_len) {		\
-	.type = NLA_BINARY			\
+#if LINUX_VERSION_IS_LESS(5,10,0)
+// pre-declare all the minimum lengths in use
+#define MIN_LEN_VALIDATION(n)						\
+static inline								\
+int nla_validate_min_len_##n(const struct nlattr *attr,			\
+			     struct netlink_ext_ack *extack)		\
+{									\
+	if (nla_len(attr) < n)						\
+		return -EINVAL;						\
+	return 0;							\
 }
-#endif
+
+MIN_LEN_VALIDATION(2)
+MIN_LEN_VALIDATION(16)
+MIN_LEN_VALIDATION(42)
+
+// double-expansion to expand _min to the actual value
+#define NLA_POLICY_BINARY_RANGE(_min, _max) _NLA_POLICY_BINARY_RANGE(_min, _max)
+#define _NLA_POLICY_BINARY_RANGE(_min, _max)		\
+{							\
+	.type = NLA_BINARY,				\
+	.len = _max,					\
+	.validation_type = NLA_VALIDATE_FUNCTION,	\
+	.validate = nla_validate_min_len_ ## _min,	\
+}
+#else
+#define NLA_POLICY_BINARY_RANGE(_min, _max) NLA_POLICY_RANGE(NLA_BINARY, _min, _max)
+#endif /* < 5.10 */
 
 #endif /* __BACKPORT_NET_NETLINK_H */
diff --git a/patches/0097-nla_policy_binary_range.cocci b/patches/0097-nla_policy_binary_range.cocci
new file mode 100644
index 000000000000..cb3b8be52b51
--- /dev/null
+++ b/patches/0097-nla_policy_binary_range.cocci
@@ -0,0 +1,5 @@
+@@
+expression MIN, MAX;
+@@
+-NLA_POLICY_RANGE(NLA_BINARY, MIN, MAX)
++NLA_POLICY_BINARY_RANGE(MIN, MAX)
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 03/38] backports: bpgit: handle copied files properly in status()
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
  2022-10-11 21:04 ` [PATCH 01/38] backport: update pv trace fixes patch Johannes Berg
  2022-10-11 21:04 ` [PATCH 02/38] backport: implement NLA_POLICY_RANGE for NLA_BINARY Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 04/38] backport: add dev_sw_netstats_tx/rx_add() functions Johannes Berg
                   ` (35 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Johannes Berg, Luciano Coelho

From: Johannes Berg <johannes.berg@intel.com>

'C' as the setatus also has two files, so need to continue
as well to get the second file added to this line.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-on: https://git-ger-8.devtools.intel.com/gerrit/135974
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Tested-by: Luciano Coelho <luciano.coelho@intel.com>
---
 lib/bpgit.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/bpgit.py b/lib/bpgit.py
index 9d35a3896ed9..77dab8bd2528 100644
--- a/lib/bpgit.py
+++ b/lib/bpgit.py
@@ -50,7 +50,7 @@ def status(tree=None):
     of the form
     ('XY', 'filename')
     or
-    ('XY', 'filename_to', 'filename_from')   [if X is 'R' for rename]
+    ('XY', 'filename_to', 'filename_from')   [if X is 'R' for rename or 'C' for copy]
     '''
     cmd = ['git', 'status', '--porcelain', '-z']
 
@@ -70,7 +70,7 @@ def status(tree=None):
             cur.append(i[:2])
             assert i[2] == ' '
             cur.append(i[3:])
-            if i[0] == 'R':
+            if i[0] in ['R', 'C']:
                 continue
         else:
             cur.append(i)
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 04/38] backport: add dev_sw_netstats_tx/rx_add() functions
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (2 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 03/38] backports: bpgit: handle copied files properly in status() Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 05/38] backport: include kcov.h in sched.h for kernels < v4.10 Johannes Berg
                   ` (34 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Luca Coelho

From: Luca Coelho <luciano.coelho@intel.com>

Two new functions were added in v5.10 and are now used in mac80211.
Add them as bakcports in netdevice.h

type=maint
ticket=jira:WIFI-95070

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Reviewed-on: https://git-ger-8.devtools.intel.com/gerrit/139718
---
 backport/backport-include/linux/netdevice.h | 25 +++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index e17731909ca5..c6ca8b5556d5 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -111,6 +111,31 @@ void dev_fetch_sw_netstats(struct rtnl_link_stats64 *s,
 
 #define netif_rx_any_context LINUX_BACKPORT(netif_rx_any_context)
 int netif_rx_any_context(struct sk_buff *skb);
+
+static inline void dev_sw_netstats_rx_add(struct net_device *dev, unsigned int len)
+{
+	struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats);
+
+	u64_stats_update_begin(&tstats->syncp);
+	tstats->rx_bytes += len;
+	tstats->rx_packets++;
+	u64_stats_update_end(&tstats->syncp);
+}
+
+#endif /* < 5.10 */
+
+#if LINUX_VERSION_IS_LESS(5,10,0)
+static inline void dev_sw_netstats_tx_add(struct net_device *dev,
+					  unsigned int packets,
+					  unsigned int len)
+{
+	struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats);
+
+	u64_stats_update_begin(&tstats->syncp);
+	tstats->tx_bytes += len;
+	tstats->tx_packets += packets;
+	u64_stats_update_end(&tstats->syncp);
+}
 #endif /* < 5.10 */
 
 #if LINUX_VERSION_IS_LESS(5,10,0)
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 05/38] backport: include kcov.h in sched.h for kernels < v4.10
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (3 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 04/38] backport: add dev_sw_netstats_tx/rx_add() functions Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 06/38] backports: increase cfg80211 wiphy padding Johannes Berg
                   ` (33 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Luca Coelho

From: Luca Coelho <luciano.coelho@intel.com>

In kernel v4.10 and later, kcov.h is included in sched.h.  Now
mac80211 uses some kcov functions, but doesn't include kcov.h
explicitly, since it's included by sched.h.  Include kvoc.h in kernels
older than v4.10 to avoid compilation issues.

type=maint
ticket=jira:WIFI-95070

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Reviewed-on: https://git-ger-8.devtools.intel.com/gerrit/139719
---
 backport/backport-include/linux/sched.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/backport/backport-include/linux/sched.h b/backport/backport-include/linux/sched.h
index 6a5cf8db6b8c..29659af437de 100644
--- a/backport/backport-include/linux/sched.h
+++ b/backport/backport-include/linux/sched.h
@@ -3,6 +3,9 @@
 
 #include_next <linux/sched.h>
 #include <linux/version.h>
+#if LINUX_VERSION_IS_LESS(4,10,0)
+#include <linux/kcov.h>
+#endif /* LINUX_VERSION_IS_LESS(4,10,0) */
 
 /* kcov was added in 4.6 and is included since then */
 #if LINUX_VERSION_IS_LESS(4,6,0)
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 06/38] backports: increase cfg80211 wiphy padding
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (4 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 05/38] backport: include kcov.h in sched.h for kernels < v4.10 Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 07/38] backport: remove aql_disable debugfs for < v4.10 Johannes Berg
                   ` (32 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Luca Coelho

From: Luca Coelho <luciano.coelho@intel.com>

The wiphy structure has grown over the 2048 bytes that we originally
used in the wiphy padding, it's 2080 bytes long as of v5.11.  Increase
the padding to an arbitrary higher round number, 2304.  We will end up
using 2 pages now, so we could go as high as a page's length, but keep
it lower so that when we grow over 2304 again we notice and can reasses
the issue.

type=maint
ticket=none

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Reviewed-on: https://git-ger-8.devtools.intel.com/gerrit/140382
---
 patches/0003-cfg80211-wext-padding/include_net_cfg80211.patch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/patches/0003-cfg80211-wext-padding/include_net_cfg80211.patch b/patches/0003-cfg80211-wext-padding/include_net_cfg80211.patch
index a804077414d9..8f9b0985b769 100644
--- a/patches/0003-cfg80211-wext-padding/include_net_cfg80211.patch
+++ b/patches/0003-cfg80211-wext-padding/include_net_cfg80211.patch
@@ -4,7 +4,7 @@
  
  	/* assign these fields before you register the wiphy */
  
-+#define WIPHY_COMPAT_PAD_SIZE	2048
++#define WIPHY_COMPAT_PAD_SIZE	2304
 +	u8 padding[WIPHY_COMPAT_PAD_SIZE];
 +
  	u8 perm_addr[ETH_ALEN];
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 07/38] backport: remove aql_disable debugfs for < v4.10
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (5 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 06/38] backports: increase cfg80211 wiphy padding Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 08/38] backport: update iwl-debug patch Johannes Berg
                   ` (31 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Luca Coelho

From: Luca Coelho <luciano.coelho@intel.com>

The static_key implementation has changed considerably in v4.10 and is
only used in a new debugfs entry in mac80211.  It's very hard to
backport the new static_key implementation, and not worth the trouble
for a functionality that will probably never be used.

type=maint
ticket=jira:WIFI-116062

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 patches/0101-remove_aql_disable.cocci | 39 +++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 patches/0101-remove_aql_disable.cocci

diff --git a/patches/0101-remove_aql_disable.cocci b/patches/0101-remove_aql_disable.cocci
new file mode 100644
index 000000000000..838d9d49e84a
--- /dev/null
+++ b/patches/0101-remove_aql_disable.cocci
@@ -0,0 +1,39 @@
+@aql_ops@
+identifier aql_disable_write, aql_disable_read;
+identifier simple_open, default_llseek;
+@@
++#if LINUX_VERSION_IS_GEQ(4,10,0)
+static const struct file_operations aql_enable_ops = {
+	.write = aql_disable_write,
+	.read = aql_disable_read,
+	.open = simple_open,
+	.llseek = default_llseek,
+};
++#endif
+
+@@
+identifier aql_ops.aql_disable_write;
+@@
++#if LINUX_VERSION_IS_GEQ(4,10,0)
+aql_disable_write(...)
+{
+...
+}
++#endif
+
+@@
+identifier aql_ops.aql_disable_read;
+@@
++#if LINUX_VERSION_IS_GEQ(4,10,0)
+aql_disable_read(...);
+{
+...
+}
++#endif
+
+@@
+expression e;
+@@
++#if LINUX_VERSION_IS_GEQ(4,10,0)
+DEBUGFS_ADD_MODE(aql_enable, e);
++#endif
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 08/38] backport: update iwl-debug patch
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (6 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 07/38] backport: remove aql_disable debugfs for < v4.10 Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 09/38] main: add module_exit() Johannes Berg
                   ` (30 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Luca Coelho

From: Luca Coelho <luciano.coelho@intel.com>

Some code had to be moved around a bit.  Update the patch.

type=maint
ticket=jira:WIFI-175745

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 ...ivers_net_wireless_iwlwifi_iwl-debug.patch | 26 +++----------------
 1 file changed, 4 insertions(+), 22 deletions(-)

diff --git a/patches/0018-pv-trace-fixes/drivers_net_wireless_iwlwifi_iwl-debug.patch b/patches/0018-pv-trace-fixes/drivers_net_wireless_iwlwifi_iwl-debug.patch
index 870aa41f7745..e8f943f46395 100644
--- a/patches/0018-pv-trace-fixes/drivers_net_wireless_iwlwifi_iwl-debug.patch
+++ b/patches/0018-pv-trace-fixes/drivers_net_wireless_iwlwifi_iwl-debug.patch
@@ -1,6 +1,8 @@
+diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-debug.c b/drivers/net/wireless/intel/iwlwifi/iwl-debug.c
+index ae4c2a3d63d5..339062da2917 100644
 --- a/drivers/net/wireless/intel/iwlwifi/iwl-debug.c
 +++ b/drivers/net/wireless/intel/iwlwifi/iwl-debug.c
-@@ -69,13 +69,16 @@ void __iwl_ ##fn(struct device *dev, const char *fmt, ...)	\
+@@ -15,13 +15,16 @@ void __iwl_ ##fn(struct device *dev, const char *fmt, ...)	\
  	struct va_format vaf = {				\
  		.fmt = fmt,					\
  	};							\
@@ -21,27 +23,7 @@
  }
  
  __iwl_fn(warn)
-@@ -94,13 +97,18 @@ void __iwl_err(struct device *dev, bool rfkill_prefix, bool trace_only,
- 	va_list args;
- 
- 	va_start(args, fmt);
--	vaf.va = &args;
- 	if (!trace_only) {
-+		va_list args2;
-+
-+		va_copy(args2, args);
-+		vaf.va = &args2;
- 		if (rfkill_prefix)
- 			dev_err(dev, "(RFKILL) %pV", &vaf);
- 		else
- 			dev_err(dev, "%pV", &vaf);
-+		va_end(args2);
- 	}
-+	vaf.va = &args;
- 	trace_iwlwifi_err(&vaf);
- 	va_end(args);
- }
-@@ -117,12 +125,18 @@ void __iwl_dbg(struct device *dev,
+@@ -73,12 +76,18 @@ void __iwl_dbg(struct device *dev,
  	va_list args;
  
  	va_start(args, fmt);
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 09/38] main: add module_exit()
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (7 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 08/38] backport: update iwl-debug patch Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 10/38] backports: add kthread.h Johannes Berg
                   ` (29 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Johannes Berg, Luciano Coelho

From: Johannes Berg <johannes.berg@intel.com>

This is needed since we have module_init() and otherwise
the kernel cannot unload the module again.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-on: https://git-ger-8.devtools.intel.com/gerrit/149476
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Tested-by: Luciano Coelho <luciano.coelho@intel.com>
---
 backport/compat/main.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/backport/compat/main.c b/backport/compat/main.c
index 17ade98b8b51..ba1422b5d778 100644
--- a/backport/compat/main.c
+++ b/backport/compat/main.c
@@ -71,3 +71,8 @@ static int __init backport_init(void)
         return 0;
 }
 subsys_initcall(backport_init);
+
+static void __exit backport_exit(void)
+{
+}
+module_exit(backport_exit);
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 10/38] backports: add kthread.h
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (8 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 09/38] main: add module_exit() Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 11/38] backports: stub structs but remove ndo_fill_forward_path Johannes Berg
                   ` (28 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Johannes Berg, Luciano Coelho

From: Johannes Berg <johannes.berg@intel.com>

In 5.17, complete_and_exit() gets replaced by
kthread_complete_and_exit(), so support that API.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-on: https://git-ger-8.devtools.intel.com/gerrit/149477
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Tested-by: Luciano Coelho <luciano.coelho@intel.com>
---
 backport/backport-include/linux/kthread.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 backport/backport-include/linux/kthread.h

diff --git a/backport/backport-include/linux/kthread.h b/backport/backport-include/linux/kthread.h
new file mode 100644
index 000000000000..23a599e92b30
--- /dev/null
+++ b/backport/backport-include/linux/kthread.h
@@ -0,0 +1,13 @@
+#ifndef __BACKPORT_LINUX_KTHREAD_H
+#define __BACKPORT_LINUX_KTHREAD_H
+#include_next <linux/kthread.h>
+
+#if LINUX_VERSION_IS_LESS(5,17,0)
+static inline void __noreturn
+kthread_complete_and_exit(struct completion *c, long ret)
+{
+	complete_and_exit(c, ret);
+}
+#endif /* < 5.17 */
+
+#endif /* __BACKPORT_LINUX_KTHREAD_H */
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 11/38] backports: stub structs but remove ndo_fill_forward_path
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (9 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 10/38] backports: add kthread.h Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-12  8:18   ` Felix Fietkau
  2022-10-11 21:04 ` [PATCH 12/38] backports: add memset_after/memset_startat Johannes Berg
                   ` (27 subsequent siblings)
  38 siblings, 1 reply; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/netdevice.h | 55 +++++++++++++++++++++
 patches/0107-net-forward-path.cocci         | 19 +++++++
 2 files changed, 74 insertions(+)
 create mode 100644 patches/0107-net-forward-path.cocci

diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index c6ca8b5556d5..d2e175243560 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -199,4 +199,59 @@ static inline void backport_dev_hold(struct net_device *dev)
 #define dev_hold LINUX_BACKPORT(dev_hold)
 #endif /* < 5.15 */
 
+#ifndef NET_DEVICE_PATH_STACK_MAX
+enum net_device_path_type {
+	DEV_PATH_ETHERNET = 0,
+	DEV_PATH_VLAN,
+	DEV_PATH_BRIDGE,
+	DEV_PATH_PPPOE,
+	DEV_PATH_DSA,
+};
+
+struct net_device_path {
+	enum net_device_path_type	type;
+	const struct net_device		*dev;
+	union {
+		struct {
+			u16		id;
+			__be16		proto;
+			u8		h_dest[ETH_ALEN];
+		} encap;
+		struct {
+			enum {
+				DEV_PATH_BR_VLAN_KEEP,
+				DEV_PATH_BR_VLAN_TAG,
+				DEV_PATH_BR_VLAN_UNTAG,
+				DEV_PATH_BR_VLAN_UNTAG_HW,
+			}		vlan_mode;
+			u16		vlan_id;
+			__be16		vlan_proto;
+		} bridge;
+		struct {
+			int port;
+			u16 proto;
+		} dsa;
+	};
+};
+
+#define NET_DEVICE_PATH_STACK_MAX	5
+#define NET_DEVICE_PATH_VLAN_MAX	2
+
+struct net_device_path_stack {
+	int			num_paths;
+	struct net_device_path	path[NET_DEVICE_PATH_STACK_MAX];
+};
+
+struct net_device_path_ctx {
+	const struct net_device *dev;
+	const u8		*daddr;
+
+	int			num_vlans;
+	struct {
+		u16		id;
+		__be16		proto;
+	} vlan[NET_DEVICE_PATH_VLAN_MAX];
+};
+#endif /* NET_DEVICE_PATH_STACK_MAX */
+
 #endif /* __BACKPORT_NETDEVICE_H */
diff --git a/patches/0107-net-forward-path.cocci b/patches/0107-net-forward-path.cocci
new file mode 100644
index 000000000000..f612239404a6
--- /dev/null
+++ b/patches/0107-net-forward-path.cocci
@@ -0,0 +1,19 @@
+@ops@
+identifier ops, fn;
+@@
+const struct net_device_ops ops = {
++#if LINUX_VERSION_IS_GEQ(5,13,0)
+  .ndo_fill_forward_path = fn,
++#endif
+  ...
+};
+
+@@
+identifier ops.fn;
+@@
++#if LINUX_VERSION_IS_GEQ(5,13,0)
+int fn(...)
+{
+...
+}
++#endif /* LINUX_VERSION_IS_GEQ(5,13,0) */
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 12/38] backports: add memset_after/memset_startat
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (10 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 11/38] backports: stub structs but remove ndo_fill_forward_path Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 13/38] backports: add ktime_get_coarse_boottime_ns Johannes Berg
                   ` (26 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/string.h | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/backport/backport-include/linux/string.h b/backport/backport-include/linux/string.h
index 39257e5f66ab..dc29dcf72b24 100644
--- a/backport/backport-include/linux/string.h
+++ b/backport/backport-include/linux/string.h
@@ -12,4 +12,24 @@ extern void *memdup_user_nul(const void __user *, size_t);
 int match_string(const char * const *array, size_t n, const char *string);
 #endif /* LINUX_VERSION_IS_LESS(4,5,0) */
 
+#ifndef memset_after
+#define memset_after(obj, v, member)					\
+({									\
+	u8 *__ptr = (u8 *)(obj);					\
+	typeof(v) __val = (v);						\
+	memset(__ptr + offsetofend(typeof(*(obj)), member), __val,	\
+	       sizeof(*(obj)) - offsetofend(typeof(*(obj)), member));	\
+})
+#endif
+
+#ifndef memset_startat
+#define memset_startat(obj, v, member)					\
+({									\
+	u8 *__ptr = (u8 *)(obj);					\
+	typeof(v) __val = (v);						\
+	memset(__ptr + offsetof(typeof(*(obj)), member), __val,		\
+	       sizeof(*(obj)) - offsetof(typeof(*(obj)), member));	\
+})
+#endif
+
 #endif /* __BACKPORT_LINUX_STRING_H */
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 13/38] backports: add ktime_get_coarse_boottime_ns
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (11 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 12/38] backports: add memset_after/memset_startat Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 14/38] patches: add spatch to adjust to changed ethtool ringparam API Johannes Berg
                   ` (25 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

... and simplify the code while at it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/timekeeping.h | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/backport/backport-include/linux/timekeeping.h b/backport/backport-include/linux/timekeeping.h
index 80c625569d6e..87744572bce6 100644
--- a/backport/backport-include/linux/timekeeping.h
+++ b/backport/backport-include/linux/timekeeping.h
@@ -6,23 +6,18 @@
 #include_next <linux/timekeeping.h>
 
 #if LINUX_VERSION_IS_LESS(5,3,0)
-#define ktime_get_boottime_ns LINUX_BACKPORT(ktime_get_boottime_ns)
-static inline u64 ktime_get_boottime_ns(void)
-{
-	return ktime_get_boot_ns();
-}
+#define ktime_get_boottime_ns ktime_get_boot_ns
+#define ktime_get_coarse_boottime_ns ktime_get_boot_ns
 #endif /* < 5.3 */
 
 #if LINUX_VERSION_IS_LESS(4,18,0)
 extern time64_t ktime_get_boottime_seconds(void);
-#endif /* < 4.18 */
 
-#if LINUX_VERSION_IS_LESS(4,18,0)
 #define ktime_get_raw_ts64 LINUX_BACKPORT(ktime_get_raw_ts64)
 static inline void ktime_get_raw_ts64(struct timespec64 *ts)
 {
 	return getrawmonotonic64(ts);
 }
-#endif
+#endif /* < 4.18 */
 
 #endif /* __BACKPORT_TIMEKEEPING_H */
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 14/38] patches: add spatch to adjust to changed ethtool ringparam API
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (12 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 13/38] backports: add ktime_get_coarse_boottime_ns Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 15/38] backport: update 0099-netlink-range patch to apply on v5.18-rc1 Johannes Berg
                   ` (24 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

This changed in 5.17-rc1, so add the necessary ifdefs via a
new spatch.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 patches/0106-ethtool-ringparam.cocci | 45 ++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 patches/0106-ethtool-ringparam.cocci

diff --git a/patches/0106-ethtool-ringparam.cocci b/patches/0106-ethtool-ringparam.cocci
new file mode 100644
index 000000000000..b131d52039ca
--- /dev/null
+++ b/patches/0106-ethtool-ringparam.cocci
@@ -0,0 +1,45 @@
+@set@
+identifier ops, fn;
+@@
+const struct ethtool_ops ops = {
+  .set_ringparam = fn,
+  ...
+};
+
+@@
+identifier set.fn;
+identifier dev, rp, krp, extack;
+@@
+int fn(struct net_device *dev,
+       struct ethtool_ringparam *rp
++#if LINUX_VERSION_IS_GEQ(5,17,0)
+       , struct kernel_ethtool_ringparam *krp,
+       struct netlink_ext_ack *extack
++#endif
+      )
+{
+...
+}
+
+@get@
+identifier ops, fn;
+@@
+const struct ethtool_ops ops = {
+  .get_ringparam = fn,
+  ...
+};
+
+@@
+identifier get.fn;
+identifier dev, rp, krp, extack;
+@@
+void fn(struct net_device *dev,
+        struct ethtool_ringparam *rp
++#if LINUX_VERSION_IS_GEQ(5,17,0)
+        , struct kernel_ethtool_ringparam *krp,
+        struct netlink_ext_ack *extack
++#endif
+       )
+{
+...
+}
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 15/38] backport: update 0099-netlink-range patch to apply on v5.18-rc1
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (13 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 14/38] patches: add spatch to adjust to changed ethtool ringparam API Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 16/38] backports: add DMI_OEM_STRING for older kernels Johannes Berg
                   ` (23 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Gregory Greenman

From: Gregory Greenman <gregory.greenman@intel.com>

For NL80211_ATTR_HE_CAPABILITY we now use NLA_POLICY_VALIDATE_FN(),
so the patch doesn't apply. Fix it.

type=maint
ticket=none

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
---
 patches/0099-netlink-range/mac80211.patch | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/patches/0099-netlink-range/mac80211.patch b/patches/0099-netlink-range/mac80211.patch
index bc55cc2f15bd..58027b0fb124 100644
--- a/patches/0099-netlink-range/mac80211.patch
+++ b/patches/0099-netlink-range/mac80211.patch
@@ -1,6 +1,6 @@
 --- a/net/wireless/nl80211.c
 +++ b/net/wireless/nl80211.c
-@@ -412,10 +412,15 @@ static const struct nla_policy
+@@ -421,10 +421,15 @@ static const struct nla_policy
  nl80211_fils_discovery_policy[NL80211_FILS_DISCOVERY_ATTR_MAX + 1] = {
  	[NL80211_FILS_DISCOVERY_ATTR_INT_MIN] = NLA_POLICY_MAX(NLA_U32, 10000),
  	[NL80211_FILS_DISCOVERY_ATTR_INT_MAX] = NLA_POLICY_MAX(NLA_U32, 10000),
@@ -55,19 +55,3 @@
  	[NL80211_ATTR_MAC_HINT] = NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN),
  	[NL80211_ATTR_WIPHY_FREQ_HINT] = { .type = NLA_U32 },
  	[NL80211_ATTR_TDLS_PEER_CAPABILITY] = { .type = NLA_U32 },
-@@ -720,10 +739,15 @@ static const struct nla_policy nl80211_p
- 	[NL80211_ATTR_TXQ_LIMIT] = { .type = NLA_U32 },
- 	[NL80211_ATTR_TXQ_MEMORY_LIMIT] = { .type = NLA_U32 },
- 	[NL80211_ATTR_TXQ_QUANTUM] = { .type = NLA_U32 },
-+#if LINUX_VERSION_IS_GEQ(5,10,0)
- 	[NL80211_ATTR_HE_CAPABILITY] =
- 		NLA_POLICY_RANGE(NLA_BINARY,
- 				 NL80211_HE_MIN_CAPABILITY_LEN,
- 				 NL80211_HE_MAX_CAPABILITY_LEN),
-+#else
-+	[NL80211_ATTR_HE_CAPABILITY] = { .type = NLA_BINARY,
-+					 .len = NL80211_HE_MAX_CAPABILITY_LEN },
-+#endif
- 	[NL80211_ATTR_FTM_RESPONDER] =
- 		NLA_POLICY_NESTED(nl80211_ftm_responder_policy),
- 	[NL80211_ATTR_TIMEOUT] = NLA_POLICY_MIN(NLA_U32, 1),
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 16/38] backports: add DMI_OEM_STRING for older kernels
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (14 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 15/38] backport: update 0099-netlink-range patch to apply on v5.18-rc1 Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 17/38] backports: define __is_constexpr() " Johannes Berg
                   ` (22 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Gregory Greenman

From: Gregory Greenman <gregory.greenman@intel.com>

type=maint
ticket=none

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
---
 backport/backport-include/linux/mod_devicetable.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/backport/backport-include/linux/mod_devicetable.h b/backport/backport-include/linux/mod_devicetable.h
index fc9beedb2d8d..07d66a6ba6ae 100644
--- a/backport/backport-include/linux/mod_devicetable.h
+++ b/backport/backport-include/linux/mod_devicetable.h
@@ -29,4 +29,8 @@ struct mhi_device_id {
 };
 #endif
 
+#if LINUX_VERSION_IS_LESS(4,17,0)
+#define DMI_OEM_STRING (DMI_STRING_MAX + 1)
+#endif /* < 4.17.0 */
+
 #endif /* __BACKPORT_MOD_DEVICETABLE_H */
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 17/38] backports: define __is_constexpr() for older kernels
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (15 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 16/38] backports: add DMI_OEM_STRING for older kernels Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 18/38] backports: update x509.asn1.[ch] Johannes Berg
                   ` (21 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Gregory Greenman

From: Gregory Greenman <gregory.greenman@intel.com>

type=maint
ticket=none

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
---
 backport/backport-include/linux/kernel.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/backport/backport-include/linux/kernel.h b/backport/backport-include/linux/kernel.h
index 36bb755e353c..2555e3c4a0a8 100644
--- a/backport/backport-include/linux/kernel.h
+++ b/backport/backport-include/linux/kernel.h
@@ -5,6 +5,17 @@
 #include <linux/bug.h>
 #include <linux/version.h>
 
+#if LINUX_VERSION_IS_LESS(4,17,0)
+
+/*
+ * This returns a constant expression while determining if an argument is
+ * a constant expression, most importantly without evaluating the argument.
+ * Glory to Martin Uecker <Martin.Uecker@med.uni-goettingen.de>
+ */
+#define __is_constexpr(x) \
+	(sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8)))
+
+#endif /* < 4.17.0 */
 
 #if LINUX_VERSION_IS_LESS(4,6,0)
 #define kstrtobool LINUX_BACKPORT(kstrtobool)
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 18/38] backports: update x509.asn1.[ch]
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (16 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 17/38] backports: define __is_constexpr() " Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 19/38] backports: update mac80211-status.patch to v6.0-rc1 Johannes Berg
                   ` (20 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Gregory Greenman

From: Gregory Greenman <gregory.greenman@intel.com>

In v5.18-rc1 a few functions were renamed:
x509_note_pkey_algo() => x509_note_sig_algo()
algo_oid => sig_algo

Adjust for this change.

type=maint
ticket=none

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
---
 backport/compat/verification/x509.asn1.c | 10 +++++-----
 backport/compat/verification/x509.asn1.h |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/backport/compat/verification/x509.asn1.c b/backport/compat/verification/x509.asn1.c
index e68864b6a1f5..590154e21da2 100644
--- a/backport/compat/verification/x509.asn1.c
+++ b/backport/compat/verification/x509.asn1.c
@@ -14,8 +14,8 @@ enum x509_actions {
 	ACT_x509_note_not_after = 4,
 	ACT_x509_note_not_before = 5,
 	ACT_x509_note_params = 6,
-	ACT_x509_note_pkey_algo = 7,
-	ACT_x509_note_serial = 8,
+	ACT_x509_note_serial = 7,
+	ACT_x509_note_sig_algo = 8,
 	ACT_x509_note_signature = 9,
 	ACT_x509_note_subject = 10,
 	ACT_x509_note_tbs_certificate = 11,
@@ -31,8 +31,8 @@ static const asn1_action_t x509_action_table[NR__x509_actions] = {
 	[   4] = x509_note_not_after,
 	[   5] = x509_note_not_before,
 	[   6] = x509_note_params,
-	[   7] = x509_note_pkey_algo,
-	[   8] = x509_note_serial,
+	[   7] = x509_note_serial,
+	[   8] = x509_note_sig_algo,
 	[   9] = x509_note_signature,
 	[  10] = x509_note_subject,
 	[  11] = x509_note_tbs_certificate,
@@ -59,7 +59,7 @@ static const unsigned char x509_machine[] = {
 	[  12] =   _tag(UNIV, CONS, SEQ),
 	[  13] =   _jump_target(74),		// --> AlgorithmIdentifier
 	[  14] =   ASN1_OP_ACT,
-	[  15] =   _action(ACT_x509_note_pkey_algo),
+	[  15] =   _action(ACT_x509_note_sig_algo),
 	// Name
 	[  16] =   ASN1_OP_MATCH_JUMP,
 	[  17] =   _tag(UNIV, CONS, SEQ),
diff --git a/backport/compat/verification/x509.asn1.h b/backport/compat/verification/x509.asn1.h
index 77ec6085ae75..10648630ade4 100644
--- a/backport/compat/verification/x509.asn1.h
+++ b/backport/compat/verification/x509.asn1.h
@@ -14,8 +14,8 @@ extern int x509_note_issuer(void *, size_t, unsigned char, const void *, size_t)
 extern int x509_note_not_after(void *, size_t, unsigned char, const void *, size_t);
 extern int x509_note_not_before(void *, size_t, unsigned char, const void *, size_t);
 extern int x509_note_params(void *, size_t, unsigned char, const void *, size_t);
-extern int x509_note_pkey_algo(void *, size_t, unsigned char, const void *, size_t);
 extern int x509_note_serial(void *, size_t, unsigned char, const void *, size_t);
+extern int x509_note_sig_algo(void *, size_t, unsigned char, const void *, size_t);
 extern int x509_note_signature(void *, size_t, unsigned char, const void *, size_t);
 extern int x509_note_subject(void *, size_t, unsigned char, const void *, size_t);
 extern int x509_note_tbs_certificate(void *, size_t, unsigned char, const void *, size_t);
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 19/38] backports: update mac80211-status.patch to v6.0-rc1
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (17 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 18/38] backports: update x509.asn1.[ch] Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 20/38] backports: add linux/efi.h Johannes Berg
                   ` (19 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Gregory Greenman

From: Gregory Greenman <gregory.greenman@intel.com>

Update for some changes in struct ieee80211_tx_status.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
---
 patches/0097-skb-list/mac80211-status.patch | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/patches/0097-skb-list/mac80211-status.patch b/patches/0097-skb-list/mac80211-status.patch
index 04d1a6af9457..7edff7f7ede4 100644
--- a/patches/0097-skb-list/mac80211-status.patch
+++ b/patches/0097-skb-list/mac80211-status.patch
@@ -5,12 +5,14 @@ support bulk free") makes use of the list attribute in the skb, but this
 is not available in kernel < 4.19, use the sk_buff_head instead on these
 kernel versions.
 
+diff --git a/include/net/mac80211.h b/include/net/mac80211.h
+index 47642b020706..1abda970a6e6 100644
 --- a/include/net/mac80211.h
 +++ b/include/net/mac80211.h
-@@ -1137,7 +1137,11 @@ struct ieee80211_tx_status {
- 	struct ieee80211_tx_info *info;
- 	struct sk_buff *skb;
- 	struct rate_info *rate;
+@@ -1178,7 +1178,11 @@ struct ieee80211_tx_status {
+ 	struct ieee80211_rate_status *rates;
+ 	u8 n_rates;
+ 
 +#if LINUX_VERSION_IS_GEQ(4,19,0)
  	struct list_head *free_list;
 +#else
@@ -19,9 +21,11 @@ kernel versions.
  };
  
  /**
+diff --git a/net/mac80211/status.c b/net/mac80211/status.c
+index e69272139437..549d50aac4b0 100644
 --- a/net/mac80211/status.c
 +++ b/net/mac80211/status.c
-@@ -1060,7 +1060,11 @@ static void __ieee80211_tx_status(struct
+@@ -1075,7 +1075,11 @@ static void __ieee80211_tx_status(struct ieee80211_hw *hw,
  	 */
  	if (!local->monitors && (!send_to_cooked || !local->cooked_mntrs)) {
  		if (status->free_list)
@@ -33,7 +37,7 @@ kernel versions.
  		else
  			dev_kfree_skb(skb);
  		return;
-@@ -1210,7 +1214,11 @@ free:
+@@ -1228,7 +1232,11 @@ void ieee80211_tx_status_ext(struct ieee80211_hw *hw,
  
  	ieee80211_report_used_skb(local, skb, false);
  	if (status->free_list)
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 20/38] backports: add linux/efi.h
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (18 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 19/38] backports: update mac80211-status.patch to v6.0-rc1 Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 21/38] backports: add eth_hw_addr_set() Johannes Berg
                   ` (18 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

We need efi_rt_services_supported() on older kernels now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/efi.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 backport/backport-include/linux/efi.h

diff --git a/backport/backport-include/linux/efi.h b/backport/backport-include/linux/efi.h
new file mode 100644
index 000000000000..c2ac9dd97947
--- /dev/null
+++ b/backport/backport-include/linux/efi.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2022 Intel Corporation
+ */
+#ifndef __BACKPORT_LINUX_EFI_H
+#define __BACKPORT_LINUX_EFI_H
+#include_next <linux/efi.h>
+
+#ifndef EFI_RT_SUPPORTED_GET_VARIABLE
+#define efi_rt_services_supported(...) efi_enabled(EFI_RUNTIME_SERVICES)
+#endif
+
+#endif /* __BACKPORT_LINUX_EFI_H */
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 21/38] backports: add eth_hw_addr_set()
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (19 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 20/38] backports: add linux/efi.h Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 22/38] backports: add module namespace support Johannes Berg
                   ` (17 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/etherdevice.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/backport/backport-include/linux/etherdevice.h b/backport/backport-include/linux/etherdevice.h
index 55672f69ddaa..f6fa51f3829c 100644
--- a/backport/backport-include/linux/etherdevice.h
+++ b/backport/backport-include/linux/etherdevice.h
@@ -38,4 +38,18 @@ static inline void u64_to_ether_addr(u64 u, u8 *addr)
 }
 #endif /* LINUX_VERSION_IS_LESS(4,11,0) */
 
+#if LINUX_VERSION_IS_LESS(5,15,0)
+/**
+ * eth_hw_addr_set - Assign Ethernet address to a net_device
+ * @dev: pointer to net_device structure
+ * @addr: address to assign
+ *
+ * Assign given address to the net_device, addr_assign_type is not changed.
+ */
+static inline void eth_hw_addr_set(struct net_device *dev, const u8 *addr)
+{
+	ether_addr_copy(dev->dev_addr, addr);
+}
+#endif /* LINUX_VERSION_IS_LESS(5,15,0) */
+
 #endif /* _BACKPORT_LINUX_ETHERDEVICE_H */
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 22/38] backports: add module namespace support
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (20 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 21/38] backports: add eth_hw_addr_set() Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 23/38] backports: add lockdep_is_held() when needed Johannes Berg
                   ` (16 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Add EXPORT_SYMBOL_NS_GPL() and MODULE_IMPORT_NS(),
for kernels that don't yet know about it. Just do
nothing about namespaces in that case, of course.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/export.h | 12 ++++++++++++
 backport/backport-include/linux/module.h |  4 ++++
 2 files changed, 16 insertions(+)
 create mode 100644 backport/backport-include/linux/export.h

diff --git a/backport/backport-include/linux/export.h b/backport/backport-include/linux/export.h
new file mode 100644
index 000000000000..c24c9f99c78b
--- /dev/null
+++ b/backport/backport-include/linux/export.h
@@ -0,0 +1,12 @@
+#ifndef _COMPAT_LINUX_EXPORT_H
+#define _COMPAT_LINUX_EXPORT_H 1
+
+#include <linux/version.h>
+
+#include_next <linux/export.h>
+
+#ifndef EXPORT_SYMBOL_NS_GPL
+#define EXPORT_SYMBOL_NS_GPL(sym, ns) EXPORT_SYMBOL_GPL(sym)
+#endif
+
+#endif /* _COMPAT_LINUX_EXPORT_H */
diff --git a/backport/backport-include/linux/module.h b/backport/backport-include/linux/module.h
index efe970f174ed..b93a56d97611 100644
--- a/backport/backport-include/linux/module.h
+++ b/backport/backport-include/linux/module.h
@@ -67,4 +67,8 @@ extern void backport_dependency_symbol(void);
 	__CFI_ADDRESSABLE(cleanup_module, __exitdata);
 #endif
 
+#if LINUX_VERSION_IS_LESS(5,4,0)
+#define MODULE_IMPORT_NS(ns)
+#endif
+
 #endif /* __BACKPORT_LINUX_MODULE_H */
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 23/38] backports: add lockdep_is_held() when needed
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (21 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 22/38] backports: add module namespace support Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 24/38] backports: add netif_rx() Johannes Berg
                   ` (15 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

If lockdep is not enabled and lockdep_is_held() not already defined
as a macro, declare it as an inline just like upstream does now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/lockdep.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/backport/backport-include/linux/lockdep.h b/backport/backport-include/linux/lockdep.h
index 842e24b7ff8f..8295b0d49184 100644
--- a/backport/backport-include/linux/lockdep.h
+++ b/backport/backport-include/linux/lockdep.h
@@ -9,6 +9,13 @@ struct lockdep_map { };
 #endif /* CONFIG_LOCKDEP */
 #endif /* LINUX_VERSION_IS_LESS(4,15,0) */
 
+#if LINUX_VERSION_IS_LESS(5,11,0)
+#if !defined(CONFIG_LOCKDEP) && !defined(lockdep_is_held)
+/* upstream since 5.11 in this exact same way - calls compile away */
+int lockdep_is_held(const void *);
+#endif
+#endif
+
 #ifndef lockdep_assert_not_held
 #ifdef CONFIG_LOCKDEP
 #ifndef LOCK_STATE_HELD
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 24/38] backports: add netif_rx()
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (22 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 23/38] backports: add lockdep_is_held() when needed Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 25/38] backports: add rfkill_soft_blocked() Johannes Berg
                   ` (14 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

This got changed upstream to detect the context to get rid
of netif_rx_ni(), so just copy the new upstream version
with the detection.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/netdevice.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index d2e175243560..9b3291bb7188 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -254,4 +254,21 @@ struct net_device_path_ctx {
 };
 #endif /* NET_DEVICE_PATH_STACK_MAX */
 
+#if LINUX_VERSION_IS_LESS(5,18,0)
+static inline int LINUX_BACKPORT(netif_rx)(struct sk_buff *skb)
+{
+	bool need_bh_off = !(hardirq_count() | softirq_count());
+	int ret;
+
+	if (need_bh_off)
+		local_bh_disable();
+	ret = netif_rx(skb);
+	if (need_bh_off)
+		local_bh_enable();
+
+	return ret;
+}
+#define netif_rx LINUX_BACKPORT(netif_rx)
+#endif /* < 5.18.0 */
+
 #endif /* __BACKPORT_NETDEVICE_H */
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 25/38] backports: add rfkill_soft_blocked()
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (23 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 24/38] backports: add netif_rx() Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 26/38] backports: add skb_postpush_rcsum() Johannes Berg
                   ` (13 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/rfkill.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/backport/backport-include/linux/rfkill.h b/backport/backport-include/linux/rfkill.h
index c0b99d58f9c0..d130c9b70c47 100644
--- a/backport/backport-include/linux/rfkill.h
+++ b/backport/backport-include/linux/rfkill.h
@@ -21,4 +21,13 @@ static inline bool rfkill_set_hw_state_reason(struct rfkill *rfkill,
 
 #endif /* 5.11 */
 
+#if LINUX_VERSION_IS_LESS(5,17,0) && !defined(CONFIG_WLAN_VENDOR_INTEL_MEI)
+
+static inline bool rfkill_soft_blocked(struct rfkill *rfkill)
+{
+	return rfkill_blocked(rfkill);
+}
+
+#endif /* 5.17 */
+
 #endif /* __BACKPORT_UAPI__RFKILL_H */
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 26/38] backports: add skb_postpush_rcsum()
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (24 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 25/38] backports: add rfkill_soft_blocked() Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 27/38] backports: add skb_list_del_init() Johannes Berg
                   ` (12 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/skbuff.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index c5015e9def24..79cff7afd73a 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -4,6 +4,23 @@
 #include <linux/version.h>
 
 
+#if LINUX_VERSION_IS_LESS(4,4,10)
+static __always_inline void
+__skb_postpush_rcsum(struct sk_buff *skb, const void *start, unsigned int len,
+		     unsigned int off)
+{
+	if (skb->ip_summed == CHECKSUM_COMPLETE)
+		skb->csum = csum_block_add(skb->csum,
+					   csum_partial(start, len, 0), off);
+}
+
+static inline void skb_postpush_rcsum(struct sk_buff *skb,
+				      const void *start, unsigned int len)
+{
+	__skb_postpush_rcsum(skb, start, len, 0);
+}
+#endif /* LINUX_VERSION_IS_LESS(4,4,10) */
+
 #if LINUX_VERSION_IS_LESS(4,13,0)
 static inline void *backport_skb_put(struct sk_buff *skb, unsigned int len)
 {
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 27/38] backports: add skb_list_del_init()
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (25 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 26/38] backports: add skb_postpush_rcsum() Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 28/38] backports: update skb kcov ifdef Johannes Berg
                   ` (11 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

This got backported to 4.19.10, but we use it for >= 4.19.0,
so provide a backported version for < 4.19.10.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/skbuff.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index 79cff7afd73a..fc99b5bb7513 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -85,8 +85,16 @@ static inline void skb_mark_not_on_list(struct sk_buff *skb)
 {
 	skb->next = NULL;
 }
+#endif /* 4.19.10 <= x < 4.20 || 4.14.217 <= x < 4.15 */
+
+#if !LINUX_VERSION_IN_RANGE(4,19,10, 4,20,0)
+static inline void skb_list_del_init(struct sk_buff *skb)
+{
+	__list_del_entry((struct list_head *)&skb->next);
+	skb_mark_not_on_list(skb);
+}
 #endif /* 4.19.10 <= x < 4.20 */
-#endif
+#endif /* < 4.20 */
 
 #if LINUX_VERSION_IS_LESS(4,11,0)
 #define skb_mac_offset LINUX_BACKPORT(skb_mac_offset)
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 28/38] backports: update skb kcov ifdef
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (26 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 27/38] backports: add skb_list_del_init() Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 29/38] backports: add DECLARE_FLEX_ARRAY() Johannes Berg
                   ` (10 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

This got backported to 5.10.54 so need to update the ifdef.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/skbuff.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index fc99b5bb7513..376dd5942a34 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -148,7 +148,7 @@ static inline __u32 skb_queue_len_lockless(const struct sk_buff_head *list_)
 }
 #endif /* < 5.6.0 */
 
-#if LINUX_VERSION_IS_LESS(5,11,0)
+#if LINUX_VERSION_IS_LESS(5,10,54)
 #define skb_get_kcov_handle LINUX_BACKPORT(skb_get_kcov_handle)
 static inline u64 skb_get_kcov_handle(struct sk_buff *skb)
 {
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 29/38] backports: add DECLARE_FLEX_ARRAY()
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (27 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 28/38] backports: update skb kcov ifdef Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 30/38] backports: add skb_get_dsfield() Johannes Berg
                   ` (9 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/stddef.h | 31 ++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/backport/backport-include/linux/stddef.h b/backport/backport-include/linux/stddef.h
index a6cdc67d2727..54afbd556467 100644
--- a/backport/backport-include/linux/stddef.h
+++ b/backport/backport-include/linux/stddef.h
@@ -23,4 +23,35 @@
 	(offsetof(TYPE, MEMBER)	+ sizeof_field(TYPE, MEMBER))
 #endif
 
+#ifndef DECLARE_FLEX_ARRAY
+/**
+ * __DECLARE_FLEX_ARRAY() - Declare a flexible array usable in a union
+ *
+ * @TYPE: The type of each flexible array element
+ * @NAME: The name of the flexible array member
+ *
+ * In order to have a flexible array member in a union or alone in a
+ * struct, it needs to be wrapped in an anonymous struct with at least 1
+ * named member, but that member can be empty.
++ */
+#define __DECLARE_FLEX_ARRAY(TYPE, NAME)       \
+	struct {			       \
+		struct { } __empty_ ## NAME;   \
+		TYPE NAME[];		       \
+	}
+
+/**
+ * DECLARE_FLEX_ARRAY() - Declare a flexible array usable in a union
+ *
+ * @TYPE: The type of each flexible array element
+ * @NAME: The name of the flexible array member
+ *
+ * In order to have a flexible array member in a union or alone in a
+ * struct, it needs to be wrapped in an anonymous struct with at least 1
+ * named member, but that member can be empty.
+ */
+#define DECLARE_FLEX_ARRAY(TYPE, NAME) \
+	__DECLARE_FLEX_ARRAY(TYPE, NAME)
+#endif
+
 #endif /* __BACKPORT_LINUX_STDDEF_H */
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 30/38] backports: add skb_get_dsfield()
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (28 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 29/38] backports: add DECLARE_FLEX_ARRAY() Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 31/38] backports: add NLA_POLICY_MIN_LEN() Johannes Berg
                   ` (8 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

That may also require skb_protocol() and skb_vlan_tag_present()

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/net/inet_ecn.h | 66 ++++++++++++++++++++++++
 1 file changed, 66 insertions(+)
 create mode 100644 backport/backport-include/net/inet_ecn.h

diff --git a/backport/backport-include/net/inet_ecn.h b/backport/backport-include/net/inet_ecn.h
new file mode 100644
index 000000000000..df83d3e179ec
--- /dev/null
+++ b/backport/backport-include/net/inet_ecn.h
@@ -0,0 +1,66 @@
+#ifndef __BACKPORT_NET_INET_ECN_H
+#define __BACKPORT_NET_INET_ECN_H
+#include_next <net/inet_ecn.h>
+#include <linux/version.h>
+#include <linux/if_vlan.h>
+
+#ifndef skb_vlan_tag_present
+#define skb_vlan_tag_present(__skb)       ((__skb)->vlan_present)
+#endif
+
+#if LINUX_VERSION_IS_LESS(5,7,10) &&			\
+	!LINUX_VERSION_IN_RANGE(4,14,212, 4,15,0) &&	\
+	!LINUX_VERSION_IN_RANGE(4,19,134, 4,20,0) &&	\
+	!LINUX_VERSION_IN_RANGE(4,4,248, 4,5,0) &&	\
+	!LINUX_VERSION_IN_RANGE(4,9,248, 4,10,0) &&	\
+	!LINUX_VERSION_IN_RANGE(5,4,53, 5,5,0)
+/* A getter for the SKB protocol field which will handle VLAN tags consistently
+ * whether VLAN acceleration is enabled or not.
+ */
+static inline __be16 skb_protocol(const struct sk_buff *skb, bool skip_vlan)
+{
+	unsigned int offset = skb_mac_offset(skb) + sizeof(struct ethhdr);
+	__be16 proto = skb->protocol;
+
+	if (!skip_vlan)
+		/* VLAN acceleration strips the VLAN header from the skb and
+		 * moves it to skb->vlan_proto
+		 */
+		return skb_vlan_tag_present(skb) ? skb->vlan_proto : proto;
+
+	while (eth_type_vlan(proto)) {
+		struct vlan_hdr vhdr, *vh;
+
+		vh = skb_header_pointer(skb, offset, sizeof(vhdr), &vhdr);
+		if (!vh)
+			break;
+
+		proto = vh->h_vlan_encapsulated_proto;
+		offset += sizeof(vhdr);
+	}
+
+	return proto;
+}
+#endif
+
+#if LINUX_VERSION_IS_LESS(5,16,0)
+#define skb_get_dsfield LINUX_BACKPORT(skb_get_dsfield)
+static inline int skb_get_dsfield(struct sk_buff *skb)
+{
+	switch (skb_protocol(skb, true)) {
+	case cpu_to_be16(ETH_P_IP):
+		if (!pskb_network_may_pull(skb, sizeof(struct iphdr)))
+			break;
+		return ipv4_get_dsfield(ip_hdr(skb));
+
+	case cpu_to_be16(ETH_P_IPV6):
+		if (!pskb_network_may_pull(skb, sizeof(struct ipv6hdr)))
+			break;
+		return ipv6_get_dsfield(ipv6_hdr(skb));
+	}
+
+	return -1;
+}
+#endif
+
+#endif /* __BACKPORT_NET_INET_ECN_H */
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 31/38] backports: add NLA_POLICY_MIN_LEN()
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (29 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 30/38] backports: add skb_get_dsfield() Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 32/38] backports: add netlink length validation for 13 Johannes Berg
                   ` (7 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/net/netlink.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/backport/backport-include/net/netlink.h b/backport/backport-include/net/netlink.h
index e94f32626782..e78a0ff7971c 100644
--- a/backport/backport-include/net/netlink.h
+++ b/backport/backport-include/net/netlink.h
@@ -264,6 +264,8 @@ nla_validate_nested_deprecated(const struct nlattr *start, int maxtype,
 	return __nla_validate_nested(start, maxtype, policy,
 				     NL_VALIDATE_LIBERAL, extack);
 }
+
+#define NLA_POLICY_MIN_LEN(_len)	{ .type = NLA_MIN_LEN, .len = _len }
 #endif /* < 5.2 */
 
 #if LINUX_VERSION_IS_LESS(5,6,0)
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 32/38] backports: add netlink length validation for 13
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (30 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 31/38] backports: add NLA_POLICY_MIN_LEN() Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 33/38] backports: add mul_u64_u64_div_u64() Johannes Berg
                   ` (6 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

This is needed for EHT.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/net/netlink.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/backport/backport-include/net/netlink.h b/backport/backport-include/net/netlink.h
index e78a0ff7971c..0de0de5ff8ad 100644
--- a/backport/backport-include/net/netlink.h
+++ b/backport/backport-include/net/netlink.h
@@ -561,6 +561,7 @@ int nla_validate_min_len_##n(const struct nlattr *attr,			\
 }
 
 MIN_LEN_VALIDATION(2)
+MIN_LEN_VALIDATION(13)
 MIN_LEN_VALIDATION(16)
 MIN_LEN_VALIDATION(42)
 
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 33/38] backports: add mul_u64_u64_div_u64()
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (31 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 32/38] backports: add netlink length validation for 13 Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 34/38] backports: add id_2 argument to find_asymmetric_key() Johannes Berg
                   ` (5 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/math64.h | 11 ++++++
 backport/compat/Makefile                 |  1 +
 backport/compat/backport-5.9.c           | 45 ++++++++++++++++++++++++
 3 files changed, 57 insertions(+)
 create mode 100644 backport/backport-include/linux/math64.h
 create mode 100644 backport/compat/backport-5.9.c

diff --git a/backport/backport-include/linux/math64.h b/backport/backport-include/linux/math64.h
new file mode 100644
index 000000000000..6aea9c9eec77
--- /dev/null
+++ b/backport/backport-include/linux/math64.h
@@ -0,0 +1,11 @@
+#ifndef __BACKPORT_LINUX_MATH64_H
+#define __BACKPORT_LINUX_MATH64_H
+#include_next <linux/math64.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_IS_LESS(5,9,0)
+#define mul_u64_u64_div_u64 LINUX_BACKPORT(mul_u64_u64_div_u64)
+extern u64 mul_u64_u64_div_u64(u64 a, u64 b, u64 c);
+#endif /* < 5.9 */
+
+#endif /* __BACKPORT_LINUX_MATH64_H */
diff --git a/backport/compat/Makefile b/backport/compat/Makefile
index b9f1dee9ae07..c488fcdc727f 100644
--- a/backport/compat/Makefile
+++ b/backport/compat/Makefile
@@ -17,6 +17,7 @@ compat-$(CPTCFG_KERNEL_4_18) += backport-4.18.o
 compat-$(CPTCFG_KERNEL_5_2) += backport-5.2.o backport-genetlink.o
 compat-$(CPTCFG_KERNEL_5_3) += backport-5.3.o
 compat-$(CPTCFG_KERNEL_5_5) += backport-5.5.o
+compat-$(CPTCFG_KERNEL_5_9) += backport-5.9.o
 compat-$(CPTCFG_KERNEL_5_10) += backport-5.10.o
 compat-$(CPTCFG_KERNEL_5_11) += backport-5.11.o
 compat-$(CPTCFG_KERNEL_5_13) += backport-5.13.o
diff --git a/backport/compat/backport-5.9.c b/backport/compat/backport-5.9.c
new file mode 100644
index 000000000000..54d1802efd31
--- /dev/null
+++ b/backport/compat/backport-5.9.c
@@ -0,0 +1,45 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/export.h>
+#include <linux/kernel.h>
+#include <linux/math64.h>
+
+u64 mul_u64_u64_div_u64(u64 a, u64 b, u64 c)
+{
+	u64 res = 0, div, rem;
+	int shift;
+
+	/* can a * b overflow ? */
+	if (ilog2(a) + ilog2(b) > 62) {
+		/*
+		 * (b * a) / c is equal to
+		 *
+		 *      (b / c) * a +
+		 *      (b % c) * a / c
+		 *
+		 * if nothing overflows. Can the 1st multiplication
+		 * overflow? Yes, but we do not care: this can only
+		 * happen if the end result can't fit in u64 anyway.
+		 *
+		 * So the code below does
+		 *
+		 *      res = (b / c) * a;
+		 *      b = b % c;
+		 */
+		div = div64_u64_rem(b, c, &rem);
+		res = div * a;
+		b = rem;
+
+		shift = ilog2(a) + ilog2(b) - 62;
+		if (shift > 0) {
+			/* drop precision */
+			b >>= shift;
+			c >>= shift;
+			if (!c)
+				return res;
+		}
+	}
+
+	return res + div64_u64(a * b, c);
+}
+EXPORT_SYMBOL_GPL(mul_u64_u64_div_u64);
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 34/38] backports: add id_2 argument to find_asymmetric_key()
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (32 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 33/38] backports: add mul_u64_u64_div_u64() Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 35/38] backports: don't backport some SKB functions for RHEL 7.6 Johannes Berg
                   ` (4 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/keys/asymmetric-type.h | 1 +
 backport/compat/verification/key.c               | 1 +
 2 files changed, 2 insertions(+)

diff --git a/backport/backport-include/keys/asymmetric-type.h b/backport/backport-include/keys/asymmetric-type.h
index 5744de9cee0f..35ddd4008c60 100644
--- a/backport/backport-include/keys/asymmetric-type.h
+++ b/backport/backport-include/keys/asymmetric-type.h
@@ -30,6 +30,7 @@ asymmetric_key_generate_id(const void *val_1, size_t len_1,
 extern struct key *find_asymmetric_key(struct key *keyring,
 				       const struct asymmetric_key_id *id_0,
 				       const struct asymmetric_key_id *id_1,
+				       const struct asymmetric_key_id *id_2,
 				       bool partial);
 #endif
 #endif /* __BP_ASYMMETRIC_TYPE_H */
diff --git a/backport/compat/verification/key.c b/backport/compat/verification/key.c
index 329f8b22e41f..f95aca4fca0e 100644
--- a/backport/compat/verification/key.c
+++ b/backport/compat/verification/key.c
@@ -129,6 +129,7 @@ EXPORT_SYMBOL_GPL(bp_key_create_or_update);
 struct key *find_asymmetric_key(struct key *keyring,
 				const struct asymmetric_key_id *id_0,
 				const struct asymmetric_key_id *id_1,
+				const struct asymmetric_key_id *id_2,
 				bool partial)
 {
 	struct key *key;
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 35/38] backports: don't backport some SKB functions for RHEL 7.6
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (33 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 34/38] backports: add id_2 argument to find_asymmetric_key() Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 36/38] backports: use kernel verification only if CONFIG_CRYPTO_HASH_INFO Johannes Berg
                   ` (3 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

For RHEL 7.6 these were backported, so don't do it again.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/skbuff.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index 376dd5942a34..419629e5d962 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -21,7 +21,8 @@ static inline void skb_postpush_rcsum(struct sk_buff *skb,
 }
 #endif /* LINUX_VERSION_IS_LESS(4,4,10) */
 
-#if LINUX_VERSION_IS_LESS(4,13,0)
+#if LINUX_VERSION_IS_LESS(4,13,0) && \
+	RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7,6)
 static inline void *backport_skb_put(struct sk_buff *skb, unsigned int len)
 {
 	return skb_put(skb, len);
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 36/38] backports: use kernel verification only if CONFIG_CRYPTO_HASH_INFO
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (34 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 35/38] backports: don't backport some SKB functions for RHEL 7.6 Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 37/38] backports: add thermal_zone_device_enable() Johannes Berg
                   ` (2 subsequent siblings)
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

If we don't have CONFIG_CRYPTO_HASH_INFO then we cannot use this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/verification.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/backport/backport-include/linux/verification.h b/backport/backport-include/linux/verification.h
index 5fd0a2d3b09f..908d1a2601ca 100644
--- a/backport/backport-include/linux/verification.h
+++ b/backport/backport-include/linux/verification.h
@@ -1,7 +1,8 @@
 #ifndef __BP_VERIFICATION_H
 #define __BP_VERIFICATION_H
 #include <linux/version.h>
-#if LINUX_VERSION_IS_GEQ(4,7,0) && !defined(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION)
+#if (LINUX_VERSION_IS_GEQ(4,7,0) && !defined(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION)) && \
+	defined(CONFIG_CRYPTO_HASH_INFO)
 #include_next <linux/verification.h>
 #else
 #include <linux/key.h>
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 37/38] backports: add thermal_zone_device_enable()
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (35 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 36/38] backports: use kernel verification only if CONFIG_CRYPTO_HASH_INFO Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-11 21:04 ` [PATCH 38/38] backports: add virtio_reset_device Johannes Berg
  2022-10-19 20:53 ` [PATCH 00/38] backports updates Hauke Mehrtens
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/thermal.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/backport/backport-include/linux/thermal.h b/backport/backport-include/linux/thermal.h
index 8210facf3697..f0be1199c5e7 100644
--- a/backport/backport-include/linux/thermal.h
+++ b/backport/backport-include/linux/thermal.h
@@ -3,6 +3,18 @@
 #include_next <linux/thermal.h>
 #include <linux/version.h>
 
+#ifdef CONFIG_THERMAL
+#if LINUX_VERSION_IS_LESS(5,9,0)
+static inline int thermal_zone_device_enable(struct thermal_zone_device *tz)
+{ return 0; }
+#endif /* < 5.9.0 */
+#else /* CONFIG_THERMAL */
+#if LINUX_VERSION_IS_LESS(5,9,0)
+static inline int thermal_zone_device_enable(struct thermal_zone_device *tz)
+{ return -ENODEV; }
+#endif /* < 5.9.0 */
+#endif /* CONFIG_THERMAL */
+
 #if LINUX_VERSION_IS_LESS(5,9,0)
 #define thermal_zone_device_enable LINUX_BACKPORT(thermal_zone_device_enable)
 static inline int thermal_zone_device_enable(struct thermal_zone_device *tz)
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 38/38] backports: add virtio_reset_device
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (36 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 37/38] backports: add thermal_zone_device_enable() Johannes Berg
@ 2022-10-11 21:04 ` Johannes Berg
  2022-10-19 20:53 ` [PATCH 00/38] backports updates Hauke Mehrtens
  38 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-11 21:04 UTC (permalink / raw)
  To: backports; +Cc: nbd, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

We need this for hwsim.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/virtio.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 backport/backport-include/linux/virtio.h

diff --git a/backport/backport-include/linux/virtio.h b/backport/backport-include/linux/virtio.h
new file mode 100644
index 000000000000..98c844918251
--- /dev/null
+++ b/backport/backport-include/linux/virtio.h
@@ -0,0 +1,13 @@
+#ifndef __BACKPORT_LINUX_VIRTIO_H
+#define __BACKPORT_LINUX_VIRTIO_H
+#include_next <linux/virtio.h>
+
+#if LINUX_VERSION_IS_LESS(5,17,0)
+#include <linux/virtio_config.h>
+static inline void virtio_reset_device(struct virtio_device *dev)
+{
+	dev->config->reset(dev);
+}
+#endif
+
+#endif /* __BACKPORT_LINUX_VIRTIO_H */
-- 
2.37.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 43+ messages in thread

* Re: [PATCH 11/38] backports: stub structs but remove ndo_fill_forward_path
  2022-10-11 21:04 ` [PATCH 11/38] backports: stub structs but remove ndo_fill_forward_path Johannes Berg
@ 2022-10-12  8:18   ` Felix Fietkau
  2022-10-12  8:50     ` Johannes Berg
  0 siblings, 1 reply; 43+ messages in thread
From: Felix Fietkau @ 2022-10-12  8:18 UTC (permalink / raw)
  To: Johannes Berg, backports; +Cc: Johannes Berg

On 11.10.22 23:04, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
>   backport/backport-include/linux/netdevice.h | 55 +++++++++++++++++++++
>   patches/0107-net-forward-path.cocci         | 19 +++++++
>   2 files changed, 74 insertions(+)
>   create mode 100644 patches/0107-net-forward-path.cocci
> 

> diff --git a/patches/0107-net-forward-path.cocci b/patches/0107-net-forward-path.cocci
> new file mode 100644
> index 000000000000..f612239404a6
> --- /dev/null
> +++ b/patches/0107-net-forward-path.cocci
> @@ -0,0 +1,19 @@
> +@ops@
> +identifier ops, fn;
> +@@
> +const struct net_device_ops ops = {
> ++#if LINUX_VERSION_IS_GEQ(5,13,0)
> +  .ndo_fill_forward_path = fn,
> ++#endif
> +  ...
> +};
> +
> +@@
> +identifier ops.fn;
> +@@
> ++#if LINUX_VERSION_IS_GEQ(5,13,0)
> +int fn(...)
> +{
> +...
> +}
> ++#endif /* LINUX_VERSION_IS_GEQ(5,13,0) */
How about using #ifdef NET_DEVICE_PATH_STACK_MAX here as well?

- Felix
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 11/38] backports: stub structs but remove ndo_fill_forward_path
  2022-10-12  8:18   ` Felix Fietkau
@ 2022-10-12  8:50     ` Johannes Berg
  0 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-12  8:50 UTC (permalink / raw)
  To: Felix Fietkau, backports

On Wed, 2022-10-12 at 10:18 +0200, Felix Fietkau wrote:
> 
> > +++ b/patches/0107-net-forward-path.cocci
> > @@ -0,0 +1,19 @@
> > +@ops@
> > +identifier ops, fn;
> > +@@
> > +const struct net_device_ops ops = {
> > ++#if LINUX_VERSION_IS_GEQ(5,13,0)
> > +  .ndo_fill_forward_path = fn,
> > ++#endif
> > +  ...
> > +};
> > +
> > +@@
> > +identifier ops.fn;
> > +@@
> > ++#if LINUX_VERSION_IS_GEQ(5,13,0)
> > +int fn(...)
> > +{
> > +...
> > +}
> > ++#endif /* LINUX_VERSION_IS_GEQ(5,13,0) */

> How about using #ifdef NET_DEVICE_PATH_STACK_MAX here as well?
> 

I guess that would work, don't remember that I thought about it and
rejected that for some reason.

johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 00/38] backports updates
  2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
                   ` (37 preceding siblings ...)
  2022-10-11 21:04 ` [PATCH 38/38] backports: add virtio_reset_device Johannes Berg
@ 2022-10-19 20:53 ` Hauke Mehrtens
  2022-10-20  7:23   ` Johannes Berg
  38 siblings, 1 reply; 43+ messages in thread
From: Hauke Mehrtens @ 2022-10-19 20:53 UTC (permalink / raw)
  To: Johannes Berg, backports; +Cc: nbd

On 10/11/22 23:04, Johannes Berg wrote:
> So Felix inspired me to take a look at this ...
> 
> This is pretty much not cleaned up, but it's what we have internally
> now for iwlwifi.
> 
> johannes
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe backports" in

Thank you for the patches.

Can I remove some of the tags from the commit messages you probably used 
internally form the patches before applying them or will you send 
cleaned up versions?

I would like to release a new version based on kernel 5.15 and 5.10 
first. This should fix the current security problems found in mac80211 
and cfg80211.

The following patches are looking like bugfixes to me, I would like to 
add them to the version based on kernel 5.15:
* backports: increase cfg80211 wiphy padding
* main: add module_exit()	
* backports: update skb kcov ifdef
* backports: don't backport some SKB functions for RHEL 7.6
* backports: use kernel verification only if CONFIG_CRYPTO_HASH_INFO

I will take these patches first.

Hauke
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 00/38] backports updates
  2022-10-19 20:53 ` [PATCH 00/38] backports updates Hauke Mehrtens
@ 2022-10-20  7:23   ` Johannes Berg
  0 siblings, 0 replies; 43+ messages in thread
From: Johannes Berg @ 2022-10-20  7:23 UTC (permalink / raw)
  To: Hauke Mehrtens, backports; +Cc: nbd

On Wed, 2022-10-19 at 22:53 +0200, Hauke Mehrtens wrote:
> 
> Can I remove some of the tags from the commit messages you probably used 
> internally form the patches before applying them
> 

Feel free to do whatever you like :)

> or will you send 
> cleaned up versions?

Well I only sent it out because Felix asked - I'll probably not have
time soon given the conference is coming up etc.

johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2022-10-20  7:23 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-11 21:04 [PATCH 00/38] backports updates Johannes Berg
2022-10-11 21:04 ` [PATCH 01/38] backport: update pv trace fixes patch Johannes Berg
2022-10-11 21:04 ` [PATCH 02/38] backport: implement NLA_POLICY_RANGE for NLA_BINARY Johannes Berg
2022-10-11 21:04 ` [PATCH 03/38] backports: bpgit: handle copied files properly in status() Johannes Berg
2022-10-11 21:04 ` [PATCH 04/38] backport: add dev_sw_netstats_tx/rx_add() functions Johannes Berg
2022-10-11 21:04 ` [PATCH 05/38] backport: include kcov.h in sched.h for kernels < v4.10 Johannes Berg
2022-10-11 21:04 ` [PATCH 06/38] backports: increase cfg80211 wiphy padding Johannes Berg
2022-10-11 21:04 ` [PATCH 07/38] backport: remove aql_disable debugfs for < v4.10 Johannes Berg
2022-10-11 21:04 ` [PATCH 08/38] backport: update iwl-debug patch Johannes Berg
2022-10-11 21:04 ` [PATCH 09/38] main: add module_exit() Johannes Berg
2022-10-11 21:04 ` [PATCH 10/38] backports: add kthread.h Johannes Berg
2022-10-11 21:04 ` [PATCH 11/38] backports: stub structs but remove ndo_fill_forward_path Johannes Berg
2022-10-12  8:18   ` Felix Fietkau
2022-10-12  8:50     ` Johannes Berg
2022-10-11 21:04 ` [PATCH 12/38] backports: add memset_after/memset_startat Johannes Berg
2022-10-11 21:04 ` [PATCH 13/38] backports: add ktime_get_coarse_boottime_ns Johannes Berg
2022-10-11 21:04 ` [PATCH 14/38] patches: add spatch to adjust to changed ethtool ringparam API Johannes Berg
2022-10-11 21:04 ` [PATCH 15/38] backport: update 0099-netlink-range patch to apply on v5.18-rc1 Johannes Berg
2022-10-11 21:04 ` [PATCH 16/38] backports: add DMI_OEM_STRING for older kernels Johannes Berg
2022-10-11 21:04 ` [PATCH 17/38] backports: define __is_constexpr() " Johannes Berg
2022-10-11 21:04 ` [PATCH 18/38] backports: update x509.asn1.[ch] Johannes Berg
2022-10-11 21:04 ` [PATCH 19/38] backports: update mac80211-status.patch to v6.0-rc1 Johannes Berg
2022-10-11 21:04 ` [PATCH 20/38] backports: add linux/efi.h Johannes Berg
2022-10-11 21:04 ` [PATCH 21/38] backports: add eth_hw_addr_set() Johannes Berg
2022-10-11 21:04 ` [PATCH 22/38] backports: add module namespace support Johannes Berg
2022-10-11 21:04 ` [PATCH 23/38] backports: add lockdep_is_held() when needed Johannes Berg
2022-10-11 21:04 ` [PATCH 24/38] backports: add netif_rx() Johannes Berg
2022-10-11 21:04 ` [PATCH 25/38] backports: add rfkill_soft_blocked() Johannes Berg
2022-10-11 21:04 ` [PATCH 26/38] backports: add skb_postpush_rcsum() Johannes Berg
2022-10-11 21:04 ` [PATCH 27/38] backports: add skb_list_del_init() Johannes Berg
2022-10-11 21:04 ` [PATCH 28/38] backports: update skb kcov ifdef Johannes Berg
2022-10-11 21:04 ` [PATCH 29/38] backports: add DECLARE_FLEX_ARRAY() Johannes Berg
2022-10-11 21:04 ` [PATCH 30/38] backports: add skb_get_dsfield() Johannes Berg
2022-10-11 21:04 ` [PATCH 31/38] backports: add NLA_POLICY_MIN_LEN() Johannes Berg
2022-10-11 21:04 ` [PATCH 32/38] backports: add netlink length validation for 13 Johannes Berg
2022-10-11 21:04 ` [PATCH 33/38] backports: add mul_u64_u64_div_u64() Johannes Berg
2022-10-11 21:04 ` [PATCH 34/38] backports: add id_2 argument to find_asymmetric_key() Johannes Berg
2022-10-11 21:04 ` [PATCH 35/38] backports: don't backport some SKB functions for RHEL 7.6 Johannes Berg
2022-10-11 21:04 ` [PATCH 36/38] backports: use kernel verification only if CONFIG_CRYPTO_HASH_INFO Johannes Berg
2022-10-11 21:04 ` [PATCH 37/38] backports: add thermal_zone_device_enable() Johannes Berg
2022-10-11 21:04 ` [PATCH 38/38] backports: add virtio_reset_device Johannes Berg
2022-10-19 20:53 ` [PATCH 00/38] backports updates Hauke Mehrtens
2022-10-20  7:23   ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).