From 3089e0e022ee2cd8c61a9c95eb8541f59f6d8ec3 Mon Sep 17 00:00:00 2001 From: Beginner-Go <70857188+Beginner-Go@users.noreply.github.com> Date: Tue, 12 Mar 2024 10:26:19 +0000 Subject: [PATCH] kernel: refresh all 6.6 patches (#11979) Fixes: #11978 --- ...c-move-TX-timer-arm-after-DMA-enable.patch | 12 +- .../hack-6.6/212-tools_portability.patch | 277 +----------------- ...k-events-support-multiple-registrant.patch | 2 +- ...-linux-kernel-to-support-shortcut-fe.patch | 14 +- 4 files changed, 23 insertions(+), 282 deletions(-) diff --git a/target/linux/generic/backport-6.6/771-v6.7-02-net-stmmac-move-TX-timer-arm-after-DMA-enable.patch b/target/linux/generic/backport-6.6/771-v6.7-02-net-stmmac-move-TX-timer-arm-after-DMA-enable.patch index c02e7f888..ce39895b4 100644 --- a/target/linux/generic/backport-6.6/771-v6.7-02-net-stmmac-move-TX-timer-arm-after-DMA-enable.patch +++ b/target/linux/generic/backport-6.6/771-v6.7-02-net-stmmac-move-TX-timer-arm-after-DMA-enable.patch @@ -42,7 +42,7 @@ Signed-off-by: Paolo Abeni u64_stats_update_begin(&txq_stats->napi_syncp); u64_stats_add(&txq_stats->napi.tx_packets, tx_packets); -@@ -5603,6 +5607,7 @@ static int stmmac_napi_poll_tx(struct na +@@ -5605,6 +5609,7 @@ static int stmmac_napi_poll_tx(struct na container_of(napi, struct stmmac_channel, tx_napi); struct stmmac_priv *priv = ch->priv_data; struct stmmac_txq_stats *txq_stats; @@ -50,7 +50,7 @@ Signed-off-by: Paolo Abeni u32 chan = ch->index; int work_done; -@@ -5611,7 +5616,7 @@ static int stmmac_napi_poll_tx(struct na +@@ -5613,7 +5618,7 @@ static int stmmac_napi_poll_tx(struct na u64_stats_inc(&txq_stats->napi.poll); u64_stats_update_end(&txq_stats->napi_syncp); @@ -59,7 +59,7 @@ Signed-off-by: Paolo Abeni work_done = min(work_done, budget); if (work_done < budget && napi_complete_done(napi, work_done)) { -@@ -5622,6 +5627,10 @@ static int stmmac_napi_poll_tx(struct na +@@ -5624,6 +5629,10 @@ static int stmmac_napi_poll_tx(struct na spin_unlock_irqrestore(&ch->lock, flags); } @@ -70,7 +70,7 @@ Signed-off-by: Paolo Abeni return work_done; } -@@ -5630,6 +5639,7 @@ static int stmmac_napi_poll_rxtx(struct +@@ -5632,6 +5641,7 @@ static int stmmac_napi_poll_rxtx(struct struct stmmac_channel *ch = container_of(napi, struct stmmac_channel, rxtx_napi); struct stmmac_priv *priv = ch->priv_data; @@ -78,7 +78,7 @@ Signed-off-by: Paolo Abeni int rx_done, tx_done, rxtx_done; struct stmmac_rxq_stats *rxq_stats; struct stmmac_txq_stats *txq_stats; -@@ -5645,7 +5655,7 @@ static int stmmac_napi_poll_rxtx(struct +@@ -5647,7 +5657,7 @@ static int stmmac_napi_poll_rxtx(struct u64_stats_inc(&txq_stats->napi.poll); u64_stats_update_end(&txq_stats->napi_syncp); @@ -87,7 +87,7 @@ Signed-off-by: Paolo Abeni tx_done = min(tx_done, budget); rx_done = stmmac_rx_zc(priv, budget, chan); -@@ -5670,6 +5680,10 @@ static int stmmac_napi_poll_rxtx(struct +@@ -5672,6 +5682,10 @@ static int stmmac_napi_poll_rxtx(struct spin_unlock_irqrestore(&ch->lock, flags); } diff --git a/target/linux/generic/hack-6.6/212-tools_portability.patch b/target/linux/generic/hack-6.6/212-tools_portability.patch index ec10f4b96..3e74a76f4 100644 --- a/target/linux/generic/hack-6.6/212-tools_portability.patch +++ b/target/linux/generic/hack-6.6/212-tools_portability.patch @@ -39,7 +39,7 @@ Signed-off-by: Felix Fietkau static inline uint16_t __get_unaligned_le16(const uint8_t *p) --- /dev/null +++ b/tools/include/tools/linux_types.h -@@ -0,0 +1,18 @@ +@@ -0,0 +1,26 @@ +#ifndef __LINUX_TYPES_H +#define __LINUX_TYPES_H + @@ -47,15 +47,23 @@ Signed-off-by: Felix Fietkau + +typedef int8_t __s8; +typedef uint8_t __u8; ++typedef uint8_t __be8; ++typedef uint8_t __le8; + +typedef int16_t __s16; +typedef uint16_t __u16; ++typedef uint16_t __be16; ++typedef uint16_t __le16; + +typedef int32_t __s32; +typedef uint32_t __u32; ++typedef uint32_t __be32; ++typedef uint32_t __le32; + +typedef int64_t __s64; +typedef uint64_t __u64; ++typedef uint64_t __be64; ++typedef uint64_t __le64; + +#endif --- a/tools/include/linux/types.h @@ -73,270 +81,3 @@ Signed-off-by: Felix Fietkau struct page; struct kmem_cache; -@@ -56,7 +60,9 @@ typedef __s8 s8; - #define __user - #endif - #define __must_check -+#ifndef __cold - #define __cold -+#endif - - typedef __u16 __bitwise __le16; - typedef __u16 __bitwise __be16; ---- a/tools/perf/pmu-events/jevents.py -+++ b/tools/perf/pmu-events/jevents.py -@@ -1197,6 +1197,7 @@ such as "arm/cortex-a34".''', - #include "util/header.h" - #include "util/pmu.h" - #include -+#include - #include - - struct compact_pmu_event { ---- a/tools/arch/x86/include/asm/insn.h -+++ b/tools/arch/x86/include/asm/insn.h -@@ -7,8 +7,8 @@ - * Copyright (C) IBM Corporation, 2009 - */ - --#include - /* insn_attr_t is defined in inat.h */ -+#include - #include "inat.h" /* __ignore_sync_check__ */ - - #if defined(__BYTE_ORDER) ? __BYTE_ORDER == __LITTLE_ENDIAN : defined(__LITTLE_ENDIAN) ---- a/tools/arch/x86/include/asm/orc_types.h -+++ b/tools/arch/x86/include/asm/orc_types.h -@@ -46,7 +46,6 @@ - #define ORC_TYPE_REGS_PARTIAL 4 - - #ifndef __ASSEMBLY__ --#include - - /* - * This struct is more or less a vastly simplified version of the DWARF Call -@@ -59,12 +58,12 @@ - struct orc_entry { - s16 sp_offset; - s16 bp_offset; --#if defined(__LITTLE_ENDIAN_BITFIELD) -+#if __BYTE_ORDER == __LITTLE_ENDIAN - unsigned sp_reg:4; - unsigned bp_reg:4; - unsigned type:3; - unsigned signal:1; --#elif defined(__BIG_ENDIAN_BITFIELD) -+#elif __BYTE_ORDER == __BIG_ENDIAN - unsigned bp_reg:4; - unsigned sp_reg:4; - unsigned unused:4; ---- a/tools/arch/x86/lib/insn.c -+++ b/tools/arch/x86/lib/insn.c -@@ -15,7 +15,11 @@ - #include "../include/asm/insn.h" /* __ignore_sync_check__ */ - #include "../include/asm-generic/unaligned.h" /* __ignore_sync_check__ */ - -+#ifdef __KERNEL__ - #include -+#else -+#include -+#endif - #include - - #include "../include/asm/emulate_prefix.h" /* __ignore_sync_check__ */ ---- a/tools/include/asm-generic/bitops/fls.h -+++ b/tools/include/asm-generic/bitops/fls.h -@@ -2,6 +2,8 @@ - #ifndef _ASM_GENERIC_BITOPS_FLS_H_ - #define _ASM_GENERIC_BITOPS_FLS_H_ - -+#include -+ - /** - * fls - find last (most-significant) bit set - * @x: the word to search -@@ -10,7 +12,7 @@ - * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32. - */ - --static __always_inline int fls(unsigned int x) -+static __always_inline int __generic_fls(unsigned int x) - { - int r = 32; - -@@ -38,5 +40,6 @@ static __always_inline int fls(unsigned - } - return r; - } -+#define fls __generic_fls - - #endif /* _ASM_GENERIC_BITOPS_FLS_H_ */ ---- a/tools/include/asm-generic/bitsperlong.h -+++ b/tools/include/asm-generic/bitsperlong.h -@@ -4,11 +4,13 @@ - - #include - -+#ifndef BITS_PER_LONG - #ifdef __SIZEOF_LONG__ - #define BITS_PER_LONG (__CHAR_BIT__ * __SIZEOF_LONG__) - #else - #define BITS_PER_LONG __WORDSIZE - #endif -+#endif - - #if BITS_PER_LONG != __BITS_PER_LONG - #error Inconsistent word size. Check asm/bitsperlong.h ---- a/tools/include/linux/rbtree.h -+++ b/tools/include/linux/rbtree.h -@@ -18,7 +18,6 @@ - #define __TOOLS_LINUX_PERF_RBTREE_H - - #include --#include - - struct rb_node { - unsigned long __rb_parent_color; ---- a/tools/objtool/Makefile -+++ b/tools/objtool/Makefile -@@ -40,7 +40,7 @@ elfshdr := $(shell echo '$(pound)include - OBJTOOL_CFLAGS += $(if $(elfshdr),,-DLIBELF_USE_DEPRECATED) - - # Always want host compilation. --HOST_OVERRIDES := CC="$(HOSTCC)" LD="$(HOSTLD)" AR="$(HOSTAR)" -+HOST_OVERRIDES := CC="$(HOSTCC) $(HOST_EXTRACFLAGS)" LD="$(HOSTLD)" AR="$(HOSTAR)" - - AWK = awk - MKDIR = mkdir -@@ -55,6 +55,7 @@ BUILD_ORC := n - - ifeq ($(SRCARCH),x86) - BUILD_ORC := y -+ CFLAGS += -DBUILD_ORC - endif - - export BUILD_ORC ---- a/tools/objtool/check.c -+++ b/tools/objtool/check.c -@@ -1288,11 +1288,12 @@ static int add_ignore_alternatives(struc - return 0; - } - -+#ifndef BUILD_ORC - /* - * Symbols that replace INSN_CALL_DYNAMIC, every (tail) call to such a symbol - * will be added to the .retpoline_sites section. - */ --__weak bool arch_is_retpoline(struct symbol *sym) -+bool arch_is_retpoline(struct symbol *sym) - { - return false; - } -@@ -1301,7 +1302,7 @@ __weak bool arch_is_retpoline(struct sym - * Symbols that replace INSN_RETURN, every (tail) call to such a symbol - * will be added to the .return_sites section. - */ --__weak bool arch_is_rethunk(struct symbol *sym) -+bool arch_is_rethunk(struct symbol *sym) - { - return false; - } -@@ -1310,10 +1311,11 @@ __weak bool arch_is_rethunk(struct symbo - * Symbols that are embedded inside other instructions, because sometimes crazy - * code exists. These are mostly ignored for validation purposes. - */ --__weak bool arch_is_embedded_insn(struct symbol *sym) -+bool arch_is_embedded_insn(struct symbol *sym) - { - return false; - } -+#endif - - static struct reloc *insn_reloc(struct objtool_file *file, struct instruction *insn) - { ---- a/tools/objtool/include/objtool/objtool.h -+++ b/tools/objtool/include/objtool/objtool.h -@@ -12,7 +12,9 @@ - - #include - -+#ifndef __weak - #define __weak __attribute__((weak)) -+#endif - - struct pv_state { - bool clean; ---- a/tools/objtool/orc_dump.c -+++ b/tools/objtool/orc_dump.c -@@ -4,10 +4,10 @@ - */ - - #include --#include - #include - #include - #include -+#include - - static const char *reg_name(unsigned int reg) - { ---- a/tools/objtool/orc_gen.c -+++ b/tools/objtool/orc_gen.c -@@ -7,11 +7,11 @@ - #include - - #include --#include - - #include - #include - #include -+#include - - static int init_orc_entry(struct orc_entry *orc, struct cfi_state *cfi, - struct instruction *insn) ---- a/tools/objtool/special.c -+++ b/tools/objtool/special.c -@@ -54,9 +54,11 @@ static const struct special_entry entrie - {}, - }; - --void __weak arch_handle_alternative(unsigned short feature, struct special_alt *alt) -+#ifndef BUILD_ORC -+void arch_handle_alternative(unsigned short feature, struct special_alt *alt) - { - } -+#endif - - static void reloc_to_sec_off(struct reloc *reloc, struct section **sec, - unsigned long *off) ---- a/tools/objtool/weak.c -+++ b/tools/objtool/weak.c -@@ -15,12 +15,14 @@ - return ENOSYS; \ - }) - --int __weak orc_dump(const char *_objname) -+#ifndef BUILD_ORC -+int orc_dump(const char *_objname) - { - UNSUPPORTED("ORC"); - } - --int __weak orc_create(struct objtool_file *file) -+int orc_create(struct objtool_file *file) - { - UNSUPPORTED("ORC"); - } -+#endif ---- a/tools/scripts/Makefile.include -+++ b/tools/scripts/Makefile.include -@@ -92,7 +92,7 @@ LLVM_OBJCOPY ?= llvm-objcopy - LLVM_STRIP ?= llvm-strip - - ifeq ($(CC_NO_CLANG), 1) --EXTRA_WARNINGS += -Wstrict-aliasing=3 -+# EXTRA_WARNINGS += -Wstrict-aliasing=3 - - else ifneq ($(CROSS_COMPILE),) - # Allow userspace to override CLANG_CROSS_FLAGS to specify their own diff --git a/target/linux/generic/hack-6.6/952-add-net-conntrack-events-support-multiple-registrant.patch b/target/linux/generic/hack-6.6/952-add-net-conntrack-events-support-multiple-registrant.patch index ddfdf1eaa..fe32c1293 100644 --- a/target/linux/generic/hack-6.6/952-add-net-conntrack-events-support-multiple-registrant.patch +++ b/target/linux/generic/hack-6.6/952-add-net-conntrack-events-support-multiple-registrant.patch @@ -94,7 +94,7 @@ Signed-off-by: Zhi Chen #ifdef CONFIG_NF_CONNTRACK_EVENTS --- a/include/net/netns/conntrack.h +++ b/include/net/netns/conntrack.h -@@ -105,6 +105,9 @@ struct netns_ct { +@@ -104,6 +104,9 @@ struct netns_ct { u8 sysctl_checksum; struct ip_conntrack_stat __percpu *stat; diff --git a/target/linux/generic/hack-6.6/953-net-patch-linux-kernel-to-support-shortcut-fe.patch b/target/linux/generic/hack-6.6/953-net-patch-linux-kernel-to-support-shortcut-fe.patch index 614766aad..f6abdbf59 100644 --- a/target/linux/generic/hack-6.6/953-net-patch-linux-kernel-to-support-shortcut-fe.patch +++ b/target/linux/generic/hack-6.6/953-net-patch-linux-kernel-to-support-shortcut-fe.patch @@ -1,6 +1,6 @@ --- a/include/linux/if_bridge.h +++ b/include/linux/if_bridge.h -@@ -71,6 +71,9 @@ void brioctl_set(int (*hook)(struct net +@@ -72,6 +72,9 @@ void brioctl_set(int (*hook)(struct net int br_ioctl_call(struct net *net, struct net_bridge *br, unsigned int cmd, struct ifreq *ifr, void __user *uarg); @@ -49,7 +49,7 @@ const struct nf_ct_event_notifier *nb); --- a/net/Kconfig +++ b/net/Kconfig -@@ -495,6 +495,9 @@ config FAILOVER +@@ -504,6 +504,9 @@ config FAILOVER migration of VMs with direct attached VFs by failing over to the paravirtual datapath when the VF is unplugged. @@ -109,9 +109,9 @@ + } +#endif - len = skb->len; - trace_net_dev_start_xmit(skb, dev); -@@ -5303,6 +5311,11 @@ void netdev_rx_handler_unregister(struct + #ifdef CONFIG_ETHERNET_PACKET_MANGLE + if (dev->eth_mangle_tx && !(skb = dev->eth_mangle_tx(dev, skb))) +@@ -5308,6 +5316,11 @@ void netdev_rx_handler_unregister(struct } EXPORT_SYMBOL_GPL(netdev_rx_handler_unregister); @@ -123,7 +123,7 @@ /* * Limit the use of PFMEMALLOC reserves to those protocols that implement * the special handling of PFMEMALLOC skbs. -@@ -5351,6 +5364,10 @@ static int __netif_receive_skb_core(stru +@@ -5356,6 +5369,10 @@ static int __netif_receive_skb_core(stru int ret = NET_RX_DROP; __be16 type; @@ -134,7 +134,7 @@ net_timestamp_check(!READ_ONCE(netdev_tstamp_prequeue), skb); trace_netif_receive_skb(skb); -@@ -5388,6 +5405,15 @@ another_round: +@@ -5393,6 +5410,15 @@ another_round: goto out; }