reverted: --- linux-6.5.0/Documentation/ABI/testing/sysfs-class-net-statistics +++ linux-6.5.0.orig/Documentation/ABI/testing/sysfs-class-net-statistics @@ -1,4 +1,4 @@ +What: /sys/class//statistics/collisions -What: /sys/class/net//statistics/collisions Date: April 2005 KernelVersion: 2.6.12 Contact: netdev@vger.kernel.org @@ -6,7 +6,7 @@ Indicates the number of collisions seen by this network device. This value might not be relevant with all MAC layers. +What: /sys/class//statistics/multicast -What: /sys/class/net//statistics/multicast Date: April 2005 KernelVersion: 2.6.12 Contact: netdev@vger.kernel.org @@ -14,7 +14,7 @@ Indicates the number of multicast packets received by this network device. +What: /sys/class//statistics/rx_bytes -What: /sys/class/net//statistics/rx_bytes Date: April 2005 KernelVersion: 2.6.12 Contact: netdev@vger.kernel.org @@ -23,7 +23,7 @@ See the network driver for the exact meaning of when this value is incremented. +What: /sys/class//statistics/rx_compressed -What: /sys/class/net//statistics/rx_compressed Date: April 2005 KernelVersion: 2.6.12 Contact: netdev@vger.kernel.org @@ -32,7 +32,7 @@ network device. This value might only be relevant for interfaces that support packet compression (e.g: PPP). +What: /sys/class//statistics/rx_crc_errors -What: /sys/class/net//statistics/rx_crc_errors Date: April 2005 KernelVersion: 2.6.12 Contact: netdev@vger.kernel.org @@ -41,7 +41,7 @@ by this network device. Note that the specific meaning might depend on the MAC layer used by the interface. +What: /sys/class//statistics/rx_dropped -What: /sys/class/net//statistics/rx_dropped Date: April 2005 KernelVersion: 2.6.12 Contact: netdev@vger.kernel.org @@ -51,7 +51,7 @@ packet processing. See the network driver for the exact meaning of this value. +What: /sys/class//statistics/rx_errors -What: /sys/class/net//statistics/rx_errors Date: April 2005 KernelVersion: 2.6.12 Contact: netdev@vger.kernel.org @@ -59,7 +59,7 @@ Indicates the number of receive errors on this network device. See the network driver for the exact meaning of this value. +What: /sys/class//statistics/rx_fifo_errors -What: /sys/class/net//statistics/rx_fifo_errors Date: April 2005 KernelVersion: 2.6.12 Contact: netdev@vger.kernel.org @@ -68,7 +68,7 @@ network device. See the network driver for the exact meaning of this value. +What: /sys/class//statistics/rx_frame_errors -What: /sys/class/net//statistics/rx_frame_errors Date: April 2005 KernelVersion: 2.6.12 Contact: netdev@vger.kernel.org @@ -78,7 +78,7 @@ on the MAC layer protocol used. See the network driver for the exact meaning of this value. +What: /sys/class//statistics/rx_length_errors -What: /sys/class/net//statistics/rx_length_errors Date: April 2005 KernelVersion: 2.6.12 Contact: netdev@vger.kernel.org @@ -87,7 +87,7 @@ error, oversized or undersized. See the network driver for the exact meaning of this value. +What: /sys/class//statistics/rx_missed_errors -What: /sys/class/net//statistics/rx_missed_errors Date: April 2005 KernelVersion: 2.6.12 Contact: netdev@vger.kernel.org @@ -96,7 +96,7 @@ due to lack of capacity in the receive side. See the network driver for the exact meaning of this value. +What: /sys/class//statistics/rx_nohandler -What: /sys/class/net//statistics/rx_nohandler Date: February 2016 KernelVersion: 4.6 Contact: netdev@vger.kernel.org @@ -104,7 +104,7 @@ Indicates the number of received packets that were dropped on an inactive device by the network core. +What: /sys/class//statistics/rx_over_errors -What: /sys/class/net//statistics/rx_over_errors Date: April 2005 KernelVersion: 2.6.12 Contact: netdev@vger.kernel.org @@ -114,7 +114,7 @@ (e.g: larger than MTU). See the network driver for the exact meaning of this value. +What: /sys/class//statistics/rx_packets -What: /sys/class/net//statistics/rx_packets Date: April 2005 KernelVersion: 2.6.12 Contact: netdev@vger.kernel.org @@ -122,7 +122,7 @@ Indicates the total number of good packets received by this network device. +What: /sys/class//statistics/tx_aborted_errors -What: /sys/class/net//statistics/tx_aborted_errors Date: April 2005 KernelVersion: 2.6.12 Contact: netdev@vger.kernel.org @@ -132,7 +132,7 @@ a medium collision). See the network driver for the exact meaning of this value. +What: /sys/class//statistics/tx_bytes -What: /sys/class/net//statistics/tx_bytes Date: April 2005 KernelVersion: 2.6.12 Contact: netdev@vger.kernel.org @@ -143,7 +143,7 @@ transmitted packets or all packets that have been queued for transmission. +What: /sys/class//statistics/tx_carrier_errors -What: /sys/class/net//statistics/tx_carrier_errors Date: April 2005 KernelVersion: 2.6.12 Contact: netdev@vger.kernel.org @@ -152,7 +152,7 @@ because of carrier errors (e.g: physical link down). See the network driver for the exact meaning of this value. +What: /sys/class//statistics/tx_compressed -What: /sys/class/net//statistics/tx_compressed Date: April 2005 KernelVersion: 2.6.12 Contact: netdev@vger.kernel.org @@ -161,7 +161,7 @@ this might only be relevant for devices that support compression (e.g: PPP). +What: /sys/class//statistics/tx_dropped -What: /sys/class/net//statistics/tx_dropped Date: April 2005 KernelVersion: 2.6.12 Contact: netdev@vger.kernel.org @@ -170,7 +170,7 @@ See the driver for the exact reasons as to why the packets were dropped. +What: /sys/class//statistics/tx_errors -What: /sys/class/net//statistics/tx_errors Date: April 2005 KernelVersion: 2.6.12 Contact: netdev@vger.kernel.org @@ -179,7 +179,7 @@ a network device. See the driver for the exact reasons as to why the packets were dropped. +What: /sys/class//statistics/tx_fifo_errors -What: /sys/class/net//statistics/tx_fifo_errors Date: April 2005 KernelVersion: 2.6.12 Contact: netdev@vger.kernel.org @@ -188,7 +188,7 @@ FIFO error. See the driver for the exact reasons as to why the packets were dropped. +What: /sys/class//statistics/tx_heartbeat_errors -What: /sys/class/net//statistics/tx_heartbeat_errors Date: April 2005 KernelVersion: 2.6.12 Contact: netdev@vger.kernel.org @@ -197,7 +197,7 @@ reported as heartbeat errors. See the driver for the exact reasons as to why the packets were dropped. +What: /sys/class//statistics/tx_packets -What: /sys/class/net//statistics/tx_packets Date: April 2005 KernelVersion: 2.6.12 Contact: netdev@vger.kernel.org @@ -206,7 +206,7 @@ device. See the driver for whether this reports the number of all attempted or successful transmissions. +What: /sys/class//statistics/tx_window_errors -What: /sys/class/net//statistics/tx_window_errors Date: April 2005 KernelVersion: 2.6.12 Contact: netdev@vger.kernel.org diff -u linux-6.5.0/Documentation/arch/arm64/silicon-errata.rst linux-6.5.0/Documentation/arch/arm64/silicon-errata.rst --- linux-6.5.0/Documentation/arch/arm64/silicon-errata.rst +++ linux-6.5.0/Documentation/arch/arm64/silicon-errata.rst @@ -238,7 +237,0 @@ -+----------------+-----------------+-----------------+-----------------------------+ -| Microsoft | Azure Cobalt 100| #2139208 | ARM64_ERRATUM_2139208 | -+----------------+-----------------+-----------------+-----------------------------+ -| Microsoft | Azure Cobalt 100| #2067961 | ARM64_ERRATUM_2067961 | -+----------------+-----------------+-----------------+-----------------------------+ -| Microsoft | Azure Cobalt 100| #2253138 | ARM64_ERRATUM_2253138 | -+----------------+-----------------+-----------------+-----------------------------+ reverted: --- linux-6.5.0/Documentation/arch/ia64/features.rst +++ linux-6.5.0.orig/Documentation/arch/ia64/features.rst @@ -1,3 +1,3 @@ .. SPDX-License-Identifier: GPL-2.0 +.. kernel-feat:: $srctree/Documentation/features ia64 -.. kernel-feat:: features ia64 reverted: --- linux-6.5.0/Documentation/networking/devlink/devlink-port.rst +++ linux-6.5.0.orig/Documentation/networking/devlink/devlink-port.rst @@ -126,7 +126,7 @@ `devlink port function set roce` command. Users may also set the function as migratable using +'devlink port function set migratable' command. -`devlink port function set migratable` command. Function attributes =================== diff -u linux-6.5.0/Documentation/sphinx/kernel_feat.py linux-6.5.0/Documentation/sphinx/kernel_feat.py --- linux-6.5.0/Documentation/sphinx/kernel_feat.py +++ linux-6.5.0/Documentation/sphinx/kernel_feat.py @@ -118,7 +118,7 @@ else: out_lines += line + "\n" - nodeList = self.nestedParse(out_lines, self.arguments[0]) + nodeList = self.nestedParse(out_lines, fname) return nodeList def runCmd(self, cmd, **kwargs): diff -u linux-6.5.0/MAINTAINERS linux-6.5.0/MAINTAINERS --- linux-6.5.0/MAINTAINERS +++ linux-6.5.0/MAINTAINERS @@ -23381,7 +23381,6 @@ F: include/xen/swiotlb-xen.h XFS FILESYSTEM -M: Catherine Hoang M: Darrick J. Wong L: linux-xfs@vger.kernel.org S: Supported diff -u linux-6.5.0/arch/Kconfig linux-6.5.0/arch/Kconfig --- linux-6.5.0/arch/Kconfig +++ linux-6.5.0/arch/Kconfig @@ -694,7 +694,6 @@ bool "Shadow Call Stack" depends on ARCH_SUPPORTS_SHADOW_CALL_STACK depends on DYNAMIC_FTRACE_WITH_ARGS || DYNAMIC_FTRACE_WITH_REGS || !FUNCTION_GRAPH_TRACER - depends on MMU help This option enables the compiler's Shadow Call Stack, which uses a shadow stack to protect function return addresses from reverted: --- linux-6.5.0/arch/arc/include/asm/cacheflush.h +++ linux-6.5.0.orig/arch/arc/include/asm/cacheflush.h @@ -46,7 +46,6 @@ /* TBD: optimize this */ #define flush_cache_vmap(start, end) flush_cache_all() -#define flush_cache_vmap_early(start, end) do { } while (0) #define flush_cache_vunmap(start, end) flush_cache_all() #define flush_cache_dup_mm(mm) /* called on fork (VIVT only) */ reverted: --- linux-6.5.0/arch/arc/include/asm/jump_label.h +++ linux-6.5.0.orig/arch/arc/include/asm/jump_label.h @@ -31,7 +31,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool branch) { + asm_volatile_goto(".balign "__stringify(JUMP_LABEL_NOP_SIZE)" \n" - asm goto(".balign "__stringify(JUMP_LABEL_NOP_SIZE)" \n" "1: \n" "nop \n" ".pushsection __jump_table, \"aw\" \n" @@ -47,7 +47,7 @@ static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch) { + asm_volatile_goto(".balign "__stringify(JUMP_LABEL_NOP_SIZE)" \n" - asm goto(".balign "__stringify(JUMP_LABEL_NOP_SIZE)" \n" "1: \n" "b %l[l_yes] \n" ".pushsection __jump_table, \"aw\" \n" reverted: --- linux-6.5.0/arch/arm/include/asm/cacheflush.h +++ linux-6.5.0.orig/arch/arm/include/asm/cacheflush.h @@ -341,8 +341,6 @@ dsb(ishst); } -#define flush_cache_vmap_early(start, end) do { } while (0) - static inline void flush_cache_vunmap(unsigned long start, unsigned long end) { if (!cache_is_vipt_nonaliasing()) reverted: --- linux-6.5.0/arch/arm/include/asm/jump_label.h +++ linux-6.5.0.orig/arch/arm/include/asm/jump_label.h @@ -11,7 +11,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool branch) { + asm_volatile_goto("1:\n\t" - asm goto("1:\n\t" WASM(nop) "\n\t" ".pushsection __jump_table, \"aw\"\n\t" ".word 1b, %l[l_yes], %c0\n\t" @@ -25,7 +25,7 @@ static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch) { + asm_volatile_goto("1:\n\t" - asm goto("1:\n\t" WASM(b) " %l[l_yes]\n\t" ".pushsection __jump_table, \"aw\"\n\t" ".word 1b, %l[l_yes], %c0\n\t" reverted: --- linux-6.5.0/arch/arm64/crypto/aes-neonbs-glue.c +++ linux-6.5.0.orig/arch/arm64/crypto/aes-neonbs-glue.c @@ -227,19 +227,8 @@ src += blocks * AES_BLOCK_SIZE; } if (nbytes && walk.nbytes == walk.total) { - u8 buf[AES_BLOCK_SIZE]; - u8 *d = dst; - - if (unlikely(nbytes < AES_BLOCK_SIZE)) - src = dst = memcpy(buf + sizeof(buf) - nbytes, - src, nbytes); - neon_aes_ctr_encrypt(dst, src, ctx->enc, ctx->key.rounds, nbytes, walk.iv); - - if (unlikely(nbytes < AES_BLOCK_SIZE)) - memcpy(d, dst, nbytes); - nbytes = 0; } kernel_neon_end(); reverted: --- linux-6.5.0/arch/arm64/include/asm/alternative-macros.h +++ linux-6.5.0.orig/arch/arm64/include/asm/alternative-macros.h @@ -229,7 +229,7 @@ compiletime_assert(cpucap < ARM64_NCAPS, "cpucap must be < ARM64_NCAPS"); + asm_volatile_goto( - asm goto( ALTERNATIVE_CB("b %l[l_no]", %[cpucap], alt_cb_patch_nops) : : [cpucap] "i" (cpucap) @@ -247,7 +247,7 @@ compiletime_assert(cpucap < ARM64_NCAPS, "cpucap must be < ARM64_NCAPS"); + asm_volatile_goto( - asm goto( ALTERNATIVE("nop", "b %l[l_yes]", %[cpucap]) : : [cpucap] "i" (cpucap) diff -u linux-6.5.0/arch/arm64/include/asm/cputype.h linux-6.5.0/arch/arm64/include/asm/cputype.h --- linux-6.5.0/arch/arm64/include/asm/cputype.h +++ linux-6.5.0/arch/arm64/include/asm/cputype.h @@ -61,7 +61,6 @@ #define ARM_CPU_IMP_HISI 0x48 #define ARM_CPU_IMP_APPLE 0x61 #define ARM_CPU_IMP_AMPERE 0xC0 -#define ARM_CPU_IMP_MICROSOFT 0x6D #define ARM_CPU_PART_AEM_V8 0xD0F #define ARM_CPU_PART_FOUNDATION 0xD00 @@ -136,8 +135,6 @@ #define AMPERE_CPU_PART_AMPERE1 0xAC3 -#define MICROSOFT_CPU_PART_AZURE_COBALT_100 0xD49 /* Based on r0p0 of ARM Neoverse N2 */ - #define MIDR_CORTEX_A53 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A53) #define MIDR_CORTEX_A57 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A57) #define MIDR_CORTEX_A72 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A72) @@ -196,7 +193,6 @@ #define MIDR_APPLE_M2_BLIZZARD_MAX MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M2_BLIZZARD_MAX) #define MIDR_APPLE_M2_AVALANCHE_MAX MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M2_AVALANCHE_MAX) #define MIDR_AMPERE1 MIDR_CPU_MODEL(ARM_CPU_IMP_AMPERE, AMPERE_CPU_PART_AMPERE1) -#define MIDR_MICROSOFT_AZURE_COBALT_100 MIDR_CPU_MODEL(ARM_CPU_IMP_MICROSOFT, MICROSOFT_CPU_PART_AZURE_COBALT_100) /* Fujitsu Erratum 010001 affects A64FX 1.0 and 1.1, (v0r0 and v1r0) */ #define MIDR_FUJITSU_ERRATUM_010001 MIDR_FUJITSU_A64FX reverted: --- linux-6.5.0/arch/arm64/include/asm/jump_label.h +++ linux-6.5.0.orig/arch/arm64/include/asm/jump_label.h @@ -18,7 +18,7 @@ static __always_inline bool arch_static_branch(struct static_key * const key, const bool branch) { + asm_volatile_goto( - asm goto( "1: nop \n\t" " .pushsection __jump_table, \"aw\" \n\t" " .align 3 \n\t" @@ -35,7 +35,7 @@ static __always_inline bool arch_static_branch_jump(struct static_key * const key, const bool branch) { + asm_volatile_goto( - asm goto( "1: b %l[l_yes] \n\t" " .pushsection __jump_table, \"aw\" \n\t" " .align 3 \n\t" diff -u linux-6.5.0/arch/arm64/kernel/cpu_errata.c linux-6.5.0/arch/arm64/kernel/cpu_errata.c --- linux-6.5.0/arch/arm64/kernel/cpu_errata.c +++ linux-6.5.0/arch/arm64/kernel/cpu_errata.c @@ -390,7 +390,6 @@ static const struct midr_range trbe_overwrite_fill_mode_cpus[] = { #ifdef CONFIG_ARM64_ERRATUM_2139208 MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N2), - MIDR_ALL_VERSIONS(MIDR_MICROSOFT_AZURE_COBALT_100), #endif #ifdef CONFIG_ARM64_ERRATUM_2119858 MIDR_ALL_VERSIONS(MIDR_CORTEX_A710), @@ -404,7 +403,6 @@ static const struct midr_range tsb_flush_fail_cpus[] = { #ifdef CONFIG_ARM64_ERRATUM_2067961 MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N2), - MIDR_ALL_VERSIONS(MIDR_MICROSOFT_AZURE_COBALT_100), #endif #ifdef CONFIG_ARM64_ERRATUM_2054223 MIDR_ALL_VERSIONS(MIDR_CORTEX_A710), @@ -417,7 +415,6 @@ static struct midr_range trbe_write_out_of_range_cpus[] = { #ifdef CONFIG_ARM64_ERRATUM_2253138 MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N2), - MIDR_ALL_VERSIONS(MIDR_MICROSOFT_AZURE_COBALT_100), #endif #ifdef CONFIG_ARM64_ERRATUM_2224489 MIDR_ALL_VERSIONS(MIDR_CORTEX_A710), diff -u linux-6.5.0/arch/arm64/kernel/fpsimd.c linux-6.5.0/arch/arm64/kernel/fpsimd.c --- linux-6.5.0/arch/arm64/kernel/fpsimd.c +++ linux-6.5.0/arch/arm64/kernel/fpsimd.c @@ -1686,7 +1686,7 @@ void fpsimd_signal_preserve_current_state(void) { fpsimd_preserve_current_state(); - if (current->thread.fp_type == FP_STATE_SVE) + if (test_thread_flag(TIF_SVE)) sve_to_fpsimd(current); } reverted: --- linux-6.5.0/arch/arm64/kernel/signal.c +++ linux-6.5.0.orig/arch/arm64/kernel/signal.c @@ -242,7 +242,7 @@ vl = task_get_sme_vl(current); vq = sve_vq_from_vl(vl); flags |= SVE_SIG_FLAG_SM; + } else if (test_thread_flag(TIF_SVE)) { - } else if (current->thread.fp_type == FP_STATE_SVE) { vq = sve_vq_from_vl(vl); } @@ -878,7 +878,7 @@ if (system_supports_sve() || system_supports_sme()) { unsigned int vq = 0; + if (add_all || test_thread_flag(TIF_SVE) || - if (add_all || current->thread.fp_type == FP_STATE_SVE || thread_sm_enabled(¤t->thread)) { int vl = max(sve_max_vl(), sme_max_vl()); reverted: --- linux-6.5.0/arch/arm64/kvm/pkvm.c +++ linux-6.5.0.orig/arch/arm64/kvm/pkvm.c @@ -101,17 +101,6 @@ hyp_mem_base); } -static void __pkvm_destroy_hyp_vm(struct kvm *host_kvm) -{ - if (host_kvm->arch.pkvm.handle) { - WARN_ON(kvm_call_hyp_nvhe(__pkvm_teardown_vm, - host_kvm->arch.pkvm.handle)); - } - - host_kvm->arch.pkvm.handle = 0; - free_hyp_memcache(&host_kvm->arch.pkvm.teardown_mc); -} - /* * Allocates and donates memory for hypervisor VM structs at EL2. * @@ -192,7 +181,7 @@ return 0; destroy_vm: + pkvm_destroy_hyp_vm(host_kvm); - __pkvm_destroy_hyp_vm(host_kvm); return ret; free_vm: free_pages_exact(hyp_vm, hyp_vm_sz); @@ -205,19 +194,23 @@ { int ret = 0; + mutex_lock(&host_kvm->lock); - mutex_lock(&host_kvm->arch.config_lock); if (!host_kvm->arch.pkvm.handle) ret = __pkvm_create_hyp_vm(host_kvm); + mutex_unlock(&host_kvm->lock); - mutex_unlock(&host_kvm->arch.config_lock); return ret; } void pkvm_destroy_hyp_vm(struct kvm *host_kvm) { + if (host_kvm->arch.pkvm.handle) { + WARN_ON(kvm_call_hyp_nvhe(__pkvm_teardown_vm, + host_kvm->arch.pkvm.handle)); + } + + host_kvm->arch.pkvm.handle = 0; + free_hyp_memcache(&host_kvm->arch.pkvm.teardown_mc); - mutex_lock(&host_kvm->arch.config_lock); - __pkvm_destroy_hyp_vm(host_kvm); - mutex_unlock(&host_kvm->arch.config_lock); } int pkvm_init_host_vm(struct kvm *host_kvm) reverted: --- linux-6.5.0/arch/csky/abiv1/inc/abi/cacheflush.h +++ linux-6.5.0.orig/arch/csky/abiv1/inc/abi/cacheflush.h @@ -41,7 +41,6 @@ */ extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end); #define flush_cache_vmap(start, end) cache_wbinv_all() -#define flush_cache_vmap_early(start, end) do { } while (0) #define flush_cache_vunmap(start, end) cache_wbinv_all() #define flush_icache_page(vma, page) do {} while (0); reverted: --- linux-6.5.0/arch/csky/abiv2/inc/abi/cacheflush.h +++ linux-6.5.0.orig/arch/csky/abiv2/inc/abi/cacheflush.h @@ -36,7 +36,6 @@ void flush_icache_deferred(struct mm_struct *mm); #define flush_cache_vmap(start, end) do { } while (0) -#define flush_cache_vmap_early(start, end) do { } while (0) #define flush_cache_vunmap(start, end) do { } while (0) #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ diff -u linux-6.5.0/arch/csky/include/asm/jump_label.h linux-6.5.0/arch/csky/include/asm/jump_label.h --- linux-6.5.0/arch/csky/include/asm/jump_label.h +++ linux-6.5.0/arch/csky/include/asm/jump_label.h @@ -12,7 +12,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool branch) { - asm goto( + asm_volatile_goto( "1: nop32 \n" " .pushsection __jump_table, \"aw\" \n" " .align 2 \n" @@ -29,7 +29,7 @@ static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch) { - asm goto( + asm_volatile_goto( "1: bsr32 %l[label] \n" " .pushsection __jump_table, \"aw\" \n" " .align 2 \n" reverted: --- linux-6.5.0/arch/loongarch/include/asm/jump_label.h +++ linux-6.5.0.orig/arch/loongarch/include/asm/jump_label.h @@ -22,7 +22,7 @@ static __always_inline bool arch_static_branch(struct static_key * const key, const bool branch) { + asm_volatile_goto( - asm goto( "1: nop \n\t" JUMP_TABLE_ENTRY : : "i"(&((char *)key)[branch]) : : l_yes); @@ -35,7 +35,7 @@ static __always_inline bool arch_static_branch_jump(struct static_key * const key, const bool branch) { + asm_volatile_goto( - asm goto( "1: b %l[l_yes] \n\t" JUMP_TABLE_ENTRY : : "i"(&((char *)key)[branch]) : : l_yes); reverted: --- linux-6.5.0/arch/m68k/include/asm/cacheflush_mm.h +++ linux-6.5.0.orig/arch/m68k/include/asm/cacheflush_mm.h @@ -191,7 +191,6 @@ #define flush_cache_all() __flush_cache_all() #define flush_cache_vmap(start, end) flush_cache_all() -#define flush_cache_vmap_early(start, end) do { } while (0) #define flush_cache_vunmap(start, end) flush_cache_all() static inline void flush_cache_mm(struct mm_struct *mm) reverted: --- linux-6.5.0/arch/mips/include/asm/cacheflush.h +++ linux-6.5.0.orig/arch/mips/include/asm/cacheflush.h @@ -93,8 +93,6 @@ __flush_cache_vmap(); } -#define flush_cache_vmap_early(start, end) do { } while (0) - extern void (*__flush_cache_vunmap)(void); static inline void flush_cache_vunmap(unsigned long start, unsigned long end) reverted: --- linux-6.5.0/arch/mips/include/asm/checksum.h +++ linux-6.5.0.orig/arch/mips/include/asm/checksum.h @@ -241,8 +241,7 @@ " .set pop" : "=&r" (sum), "=&r" (tmp) : "r" (saddr), "r" (daddr), + "0" (htonl(len)), "r" (htonl(proto)), "r" (sum)); - "0" (htonl(len)), "r" (htonl(proto)), "r" (sum) - : "memory"); return csum_fold(sum); } reverted: --- linux-6.5.0/arch/mips/include/asm/jump_label.h +++ linux-6.5.0.orig/arch/mips/include/asm/jump_label.h @@ -36,7 +36,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool branch) { + asm_volatile_goto("1:\t" B_INSN " 2f\n\t" - asm goto("1:\t" B_INSN " 2f\n\t" "2:\t.insn\n\t" ".pushsection __jump_table, \"aw\"\n\t" WORD_INSN " 1b, %l[l_yes], %0\n\t" @@ -50,7 +50,7 @@ static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch) { + asm_volatile_goto("1:\t" J_INSN " %l[l_yes]\n\t" - asm goto("1:\t" J_INSN " %l[l_yes]\n\t" ".pushsection __jump_table, \"aw\"\n\t" WORD_INSN " 1b, %l[l_yes], %0\n\t" ".popsection\n\t" reverted: --- linux-6.5.0/arch/mips/include/asm/ptrace.h +++ linux-6.5.0.orig/arch/mips/include/asm/ptrace.h @@ -154,8 +154,6 @@ } #define instruction_pointer(regs) ((regs)->cp0_epc) -extern unsigned long exception_ip(struct pt_regs *regs); -#define exception_ip(regs) exception_ip(regs) #define profile_pc(regs) instruction_pointer(regs) extern asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall); reverted: --- linux-6.5.0/arch/mips/kernel/ptrace.c +++ linux-6.5.0.orig/arch/mips/kernel/ptrace.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include @@ -49,12 +48,6 @@ #define CREATE_TRACE_POINTS #include -unsigned long exception_ip(struct pt_regs *regs) -{ - return exception_epc(regs); -} -EXPORT_SYMBOL(exception_ip); - /* * Called by kernel/ptrace.c when detaching.. * reverted: --- linux-6.5.0/arch/nios2/include/asm/cacheflush.h +++ linux-6.5.0.orig/arch/nios2/include/asm/cacheflush.h @@ -34,7 +34,6 @@ extern void flush_icache_page(struct vm_area_struct *vma, struct page *page); #define flush_cache_vmap(start, end) flush_dcache_range(start, end) -#define flush_cache_vmap_early(start, end) do { } while (0) #define flush_cache_vunmap(start, end) flush_dcache_range(start, end) extern void copy_to_user_page(struct vm_area_struct *vma, struct page *page, diff -u linux-6.5.0/arch/parisc/Kconfig linux-6.5.0/arch/parisc/Kconfig --- linux-6.5.0/arch/parisc/Kconfig +++ linux-6.5.0/arch/parisc/Kconfig @@ -24,6 +24,7 @@ select RTC_DRV_GENERIC select INIT_ALL_POSSIBLE select BUG + select BUILDTIME_TABLE_SORT select HAVE_PCI select HAVE_PERF_EVENTS select HAVE_KERNEL_BZIP2 diff -u linux-6.5.0/arch/parisc/include/asm/assembly.h linux-6.5.0/arch/parisc/include/asm/assembly.h --- linux-6.5.0/arch/parisc/include/asm/assembly.h +++ linux-6.5.0/arch/parisc/include/asm/assembly.h @@ -576,7 +576,6 @@ .section __ex_table,"aw" ! \ .align 4 ! \ .word (fault_addr - .), (except_addr - .) ! \ - or %r0,%r0,%r0 ! \ .previous reverted: --- linux-6.5.0/arch/parisc/include/asm/cacheflush.h +++ linux-6.5.0.orig/arch/parisc/include/asm/cacheflush.h @@ -41,7 +41,6 @@ void invalidate_kernel_vmap_range(void *vaddr, int size); #define flush_cache_vmap(start, end) flush_cache_all() -#define flush_cache_vmap_early(start, end) do { } while (0) #define flush_cache_vunmap(start, end) flush_cache_all() #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1 reverted: --- linux-6.5.0/arch/parisc/include/asm/extable.h +++ linux-6.5.0.orig/arch/parisc/include/asm/extable.h @@ -1,64 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __PARISC_EXTABLE_H -#define __PARISC_EXTABLE_H - -#include -#include - -/* - * The exception table consists of three addresses: - * - * - A relative address to the instruction that is allowed to fault. - * - A relative address at which the program should continue (fixup routine) - * - An asm statement which specifies which CPU register will - * receive -EFAULT when an exception happens if the lowest bit in - * the fixup address is set. - * - * Note: The register specified in the err_opcode instruction will be - * modified at runtime if a fault happens. Register %r0 will be ignored. - * - * Since relative addresses are used, 32bit values are sufficient even on - * 64bit kernel. - */ - -struct pt_regs; -int fixup_exception(struct pt_regs *regs); - -#define ARCH_HAS_RELATIVE_EXTABLE -struct exception_table_entry { - int insn; /* relative address of insn that is allowed to fault. */ - int fixup; /* relative address of fixup routine */ - int err_opcode; /* sample opcode with register which holds error code */ -}; - -#define ASM_EXCEPTIONTABLE_ENTRY( fault_addr, except_addr, opcode )\ - ".section __ex_table,\"aw\"\n" \ - ".align 4\n" \ - ".word (" #fault_addr " - .), (" #except_addr " - .)\n" \ - opcode "\n" \ - ".previous\n" - -/* - * ASM_EXCEPTIONTABLE_ENTRY_EFAULT() creates a special exception table entry - * (with lowest bit set) for which the fault handler in fixup_exception() will - * load -EFAULT on fault into the register specified by the err_opcode instruction, - * and zeroes the target register in case of a read fault in get_user(). - */ -#define ASM_EXCEPTIONTABLE_VAR(__err_var) \ - int __err_var = 0 -#define ASM_EXCEPTIONTABLE_ENTRY_EFAULT( fault_addr, except_addr, register )\ - ASM_EXCEPTIONTABLE_ENTRY( fault_addr, except_addr + 1, "or %%r0,%%r0," register) - -static inline void swap_ex_entry_fixup(struct exception_table_entry *a, - struct exception_table_entry *b, - struct exception_table_entry tmp, - int delta) -{ - a->fixup = b->fixup + delta; - b->fixup = tmp.fixup - delta; - a->err_opcode = b->err_opcode; - b->err_opcode = tmp.err_opcode; -} -#define swap_ex_entry_fixup swap_ex_entry_fixup - -#endif diff -u linux-6.5.0/arch/parisc/include/asm/jump_label.h linux-6.5.0/arch/parisc/include/asm/jump_label.h --- linux-6.5.0/arch/parisc/include/asm/jump_label.h +++ linux-6.5.0/arch/parisc/include/asm/jump_label.h @@ -12,7 +12,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool branch) { - asm goto("1:\n\t" + asm_volatile_goto("1:\n\t" "nop\n\t" ".pushsection __jump_table, \"aw\"\n\t" ".align %1\n\t" @@ -29,7 +29,7 @@ static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch) { - asm goto("1:\n\t" + asm_volatile_goto("1:\n\t" "b,n %l[l_yes]\n\t" ".pushsection __jump_table, \"aw\"\n\t" ".align %1\n\t" reverted: --- linux-6.5.0/arch/parisc/include/asm/special_insns.h +++ linux-6.5.0.orig/arch/parisc/include/asm/special_insns.h @@ -8,8 +8,7 @@ "copy %%r0,%0\n" \ "8:\tlpa %%r0(%1),%0\n" \ "9:\n" \ + ASM_EXCEPTIONTABLE_ENTRY(8b, 9b) \ - ASM_EXCEPTIONTABLE_ENTRY(8b, 9b, \ - "or %%r0,%%r0,%%r0") \ : "=&r" (pa) \ : "r" (va) \ : "memory" \ @@ -23,8 +22,7 @@ "copy %%r0,%0\n" \ "8:\tlpa %%r0(%%sr3,%1),%0\n" \ "9:\n" \ + ASM_EXCEPTIONTABLE_ENTRY(8b, 9b) \ - ASM_EXCEPTIONTABLE_ENTRY(8b, 9b, \ - "or %%r0,%%r0,%%r0") \ : "=&r" (pa) \ : "r" (va) \ : "memory" \ diff -u linux-6.5.0/arch/parisc/include/asm/uaccess.h linux-6.5.0/arch/parisc/include/asm/uaccess.h --- linux-6.5.0/arch/parisc/include/asm/uaccess.h +++ linux-6.5.0/arch/parisc/include/asm/uaccess.h @@ -7,7 +7,6 @@ */ #include #include -#include #include #include @@ -27,6 +26,37 @@ #define STD_USER(sr, x, ptr) __put_user_asm(sr, "std", x, ptr) #endif +/* + * The exception table contains two values: the first is the relative offset to + * the address of the instruction that is allowed to fault, and the second is + * the relative offset to the address of the fixup routine. Since relative + * addresses are used, 32bit values are sufficient even on 64bit kernel. + */ + +#define ARCH_HAS_RELATIVE_EXTABLE +struct exception_table_entry { + int insn; /* relative address of insn that is allowed to fault. */ + int fixup; /* relative address of fixup routine */ +}; + +#define ASM_EXCEPTIONTABLE_ENTRY( fault_addr, except_addr )\ + ".section __ex_table,\"aw\"\n" \ + ".align 4\n" \ + ".word (" #fault_addr " - .), (" #except_addr " - .)\n\t" \ + ".previous\n" + +/* + * ASM_EXCEPTIONTABLE_ENTRY_EFAULT() creates a special exception table entry + * (with lowest bit set) for which the fault handler in fixup_exception() will + * load -EFAULT into %r29 for a read or write fault, and zeroes the target + * register in case of a read fault in get_user(). + */ +#define ASM_EXCEPTIONTABLE_REG 29 +#define ASM_EXCEPTIONTABLE_VAR(__variable) \ + register long __variable __asm__ ("r29") = 0 +#define ASM_EXCEPTIONTABLE_ENTRY_EFAULT( fault_addr, except_addr )\ + ASM_EXCEPTIONTABLE_ENTRY( fault_addr, except_addr + 1) + #define __get_user_internal(sr, val, ptr) \ ({ \ ASM_EXCEPTIONTABLE_VAR(__gu_err); \ @@ -53,7 +83,7 @@ \ __asm__("1: " ldx " 0(%%sr%2,%3),%0\n" \ "9:\n" \ - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b, "%1") \ + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b) \ : "=r"(__gu_val), "+r"(__gu_err) \ : "i"(sr), "r"(ptr)); \ \ @@ -85,8 +115,8 @@ "1: ldw 0(%%sr%2,%3),%0\n" \ "2: ldw 4(%%sr%2,%3),%R0\n" \ "9:\n" \ - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b, "%1") \ - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 9b, "%1") \ + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b) \ + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 9b) \ : "=&r"(__gu_tmp.l), "+r"(__gu_err) \ : "i"(sr), "r"(ptr)); \ \ @@ -144,7 +174,7 @@ __asm__ __volatile__ ( \ "1: " stx " %1,0(%%sr%2,%3)\n" \ "9:\n" \ - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b, "%0") \ + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b) \ : "+r"(__pu_err) \ : "r"(x), "i"(sr), "r"(ptr)) @@ -156,14 +186,15 @@ "1: stw %1,0(%%sr%2,%3)\n" \ "2: stw %R1,4(%%sr%2,%3)\n" \ "9:\n" \ - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b, "%0") \ - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 9b, "%0") \ + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b) \ + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 9b) \ : "+r"(__pu_err) \ : "r"(__val), "i"(sr), "r"(ptr)); \ } while (0) #endif /* !defined(CONFIG_64BIT) */ + /* * Complex access routines -- external declarations */ @@ -187,2 +218,5 @@ +struct pt_regs; +int fixup_exception(struct pt_regs *regs); + #endif /* __PARISC_UACCESS_H */ reverted: --- linux-6.5.0/arch/parisc/kernel/cache.c +++ linux-6.5.0.orig/arch/parisc/kernel/cache.c @@ -817,7 +817,7 @@ #endif " fic,m %3(%4,%0)\n" "2: sync\n" + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 2b) - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 2b, "%1") : "+r" (start), "+r" (error) : "r" (end), "r" (dcache_stride), "i" (SR_USER)); } @@ -832,7 +832,7 @@ #endif " fdc,m %3(%4,%0)\n" "2: sync\n" + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 2b) - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 2b, "%1") : "+r" (start), "+r" (error) : "r" (end), "r" (icache_stride), "i" (SR_USER)); } diff -u linux-6.5.0/arch/parisc/kernel/drivers.c linux-6.5.0/arch/parisc/kernel/drivers.c --- linux-6.5.0/arch/parisc/kernel/drivers.c +++ linux-6.5.0/arch/parisc/kernel/drivers.c @@ -1004,9 +1004,6 @@ pr_info("\n"); - /* Prevent hung task messages when printing on serial console */ - cond_resched(); - pr_info("#define HPA_%08lx_DESCRIPTION \"%s\"\n", hpa, parisc_hardware_description(&dev->id)); reverted: --- linux-6.5.0/arch/parisc/kernel/unaligned.c +++ linux-6.5.0.orig/arch/parisc/kernel/unaligned.c @@ -120,8 +120,8 @@ "2: ldbs 1(%%sr1,%3), %0\n" " depw %2, 23, 24, %0\n" "3: \n" + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 3b) + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 3b) - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 3b, "%1") - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 3b, "%1") : "+r" (val), "+r" (ret), "=&r" (temp1) : "r" (saddr), "r" (regs->isr) ); @@ -152,8 +152,8 @@ " mtctl %2,11\n" " vshd %0,%3,%0\n" "3: \n" + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 3b) + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 3b) - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 3b, "%1") - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 3b, "%1") : "+r" (val), "+r" (ret), "=&r" (temp1), "=&r" (temp2) : "r" (saddr), "r" (regs->isr) ); @@ -189,8 +189,8 @@ " mtsar %%r19\n" " shrpd %0,%%r20,%%sar,%0\n" "3: \n" + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 3b) + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 3b) - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 3b, "%1") - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 3b, "%1") : "=r" (val), "+r" (ret) : "0" (val), "r" (saddr), "r" (regs->isr) : "r19", "r20" ); @@ -209,9 +209,9 @@ " vshd %0,%R0,%0\n" " vshd %R0,%4,%R0\n" "4: \n" + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 4b) + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 4b) + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(3b, 4b) - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 4b, "%1") - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 4b, "%1") - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(3b, 4b, "%1") : "+r" (val), "+r" (ret), "+r" (saddr), "=&r" (shift), "=&r" (temp1) : "r" (regs->isr) ); } @@ -244,8 +244,8 @@ "1: stb %1, 0(%%sr1, %3)\n" "2: stb %2, 1(%%sr1, %3)\n" "3: \n" + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 3b) + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 3b) - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 3b, "%0") - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 3b, "%0") : "+r" (ret), "=&r" (temp1) : "r" (val), "r" (regs->ior), "r" (regs->isr) ); @@ -285,8 +285,8 @@ " stw %%r20,0(%%sr1,%2)\n" " stw %%r21,4(%%sr1,%2)\n" "3: \n" + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 3b) + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 3b) - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 3b, "%0") - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 3b, "%0") : "+r" (ret) : "r" (val), "r" (regs->ior), "r" (regs->isr) : "r19", "r20", "r21", "r22", "r1" ); @@ -329,10 +329,10 @@ "3: std %%r20,0(%%sr1,%2)\n" "4: std %%r21,8(%%sr1,%2)\n" "5: \n" + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 5b) + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 5b) + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(3b, 5b) + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(4b, 5b) - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 5b, "%0") - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 5b, "%0") - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(3b, 5b, "%0") - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(4b, 5b, "%0") : "+r" (ret) : "r" (val), "r" (regs->ior), "r" (regs->isr) : "r19", "r20", "r21", "r22", "r1" ); @@ -358,11 +358,11 @@ "4: stw %%r1,4(%%sr1,%3)\n" "5: stw %2,8(%%sr1,%3)\n" "6: \n" + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 6b) + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 6b) + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(3b, 6b) + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(4b, 6b) + ASM_EXCEPTIONTABLE_ENTRY_EFAULT(5b, 6b) - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 6b, "%0") - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 6b, "%0") - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(3b, 6b, "%0") - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(4b, 6b, "%0") - ASM_EXCEPTIONTABLE_ENTRY_EFAULT(5b, 6b, "%0") : "+r" (ret) : "r" (valh), "r" (vall), "r" (regs->ior), "r" (regs->isr) : "r19", "r20", "r21", "r1" ); reverted: --- linux-6.5.0/arch/parisc/mm/fault.c +++ linux-6.5.0.orig/arch/parisc/mm/fault.c @@ -150,16 +150,11 @@ * Fix up get_user() and put_user(). * ASM_EXCEPTIONTABLE_ENTRY_EFAULT() sets the least-significant * bit in the relative address of the fixup routine to indicate + * that gr[ASM_EXCEPTIONTABLE_REG] should be loaded with + * -EFAULT to report a userspace access error. - * that the register encoded in the "or %r0,%r0,register" - * opcode should be loaded with -EFAULT to report a userspace - * access error. */ if (fix->fixup & 1) { + regs->gr[ASM_EXCEPTIONTABLE_REG] = -EFAULT; - int fault_error_reg = fix->err_opcode & 0x1f; - if (!WARN_ON(!fault_error_reg)) - regs->gr[fault_error_reg] = -EFAULT; - pr_debug("Unalignment fixup of register %d at %pS\n", - fault_error_reg, (void*)regs->iaoq[0]); /* zero target register for get_user() */ if (parisc_acctyp(0, regs->iir) == VM_READ) { reverted: --- linux-6.5.0/arch/powerpc/include/asm/jump_label.h +++ linux-6.5.0.orig/arch/powerpc/include/asm/jump_label.h @@ -17,7 +17,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool branch) { + asm_volatile_goto("1:\n\t" - asm goto("1:\n\t" "nop # arch_static_branch\n\t" ".pushsection __jump_table, \"aw\"\n\t" ".long 1b - ., %l[l_yes] - .\n\t" @@ -32,7 +32,7 @@ static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch) { + asm_volatile_goto("1:\n\t" - asm goto("1:\n\t" "b %l[l_yes] # arch_static_branch_jump\n\t" ".pushsection __jump_table, \"aw\"\n\t" ".long 1b - ., %l[l_yes] - .\n\t" reverted: --- linux-6.5.0/arch/powerpc/include/asm/reg.h +++ linux-6.5.0.orig/arch/powerpc/include/asm/reg.h @@ -617,8 +617,6 @@ #endif #define SPRN_HID2 0x3F8 /* Hardware Implementation Register 2 */ #define SPRN_HID2_GEKKO 0x398 /* Gekko HID2 Register */ -#define SPRN_HID2_G2_LE 0x3F3 /* G2_LE HID2 Register */ -#define HID2_G2_LE_HBE (1<<18) /* High BAT Enable (G2_LE) */ #define SPRN_IABR 0x3F2 /* Instruction Address Breakpoint Register */ #define SPRN_IABR2 0x3FA /* 83xx */ #define SPRN_IBCR 0x135 /* 83xx Insn Breakpoint Control Reg */ reverted: --- linux-6.5.0/arch/powerpc/include/asm/thread_info.h +++ linux-6.5.0.orig/arch/powerpc/include/asm/thread_info.h @@ -14,7 +14,7 @@ #ifdef __KERNEL__ +#ifdef CONFIG_KASAN -#if defined(CONFIG_KASAN) && CONFIG_THREAD_SHIFT < 15 #define MIN_THREAD_SHIFT (CONFIG_THREAD_SHIFT + 1) #else #define MIN_THREAD_SHIFT CONFIG_THREAD_SHIFT reverted: --- linux-6.5.0/arch/powerpc/include/asm/uaccess.h +++ linux-6.5.0.orig/arch/powerpc/include/asm/uaccess.h @@ -74,7 +74,7 @@ /* -mprefixed can generate offsets beyond range, fall back hack */ #ifdef CONFIG_PPC_KERNEL_PREFIXED #define __put_user_asm_goto(x, addr, label, op) \ + asm_volatile_goto( \ - asm goto( \ "1: " op " %0,0(%1) # put_user\n" \ EX_TABLE(1b, %l2) \ : \ @@ -83,7 +83,7 @@ : label) #else #define __put_user_asm_goto(x, addr, label, op) \ + asm_volatile_goto( \ - asm goto( \ "1: " op "%U1%X1 %0,%1 # put_user\n" \ EX_TABLE(1b, %l2) \ : \ @@ -97,7 +97,7 @@ __put_user_asm_goto(x, ptr, label, "std") #else /* __powerpc64__ */ #define __put_user_asm2_goto(x, addr, label) \ + asm_volatile_goto( \ - asm goto( \ "1: stw%X1 %0, %1\n" \ "2: stw%X1 %L0, %L1\n" \ EX_TABLE(1b, %l2) \ @@ -146,7 +146,7 @@ /* -mprefixed can generate offsets beyond range, fall back hack */ #ifdef CONFIG_PPC_KERNEL_PREFIXED #define __get_user_asm_goto(x, addr, label, op) \ + asm_volatile_goto( \ - asm_goto_output( \ "1: "op" %0,0(%1) # get_user\n" \ EX_TABLE(1b, %l2) \ : "=r" (x) \ @@ -155,7 +155,7 @@ : label) #else #define __get_user_asm_goto(x, addr, label, op) \ + asm_volatile_goto( \ - asm_goto_output( \ "1: "op"%U1%X1 %0, %1 # get_user\n" \ EX_TABLE(1b, %l2) \ : "=r" (x) \ @@ -169,7 +169,7 @@ __get_user_asm_goto(x, addr, label, "ld") #else /* __powerpc64__ */ #define __get_user_asm2_goto(x, addr, label) \ + asm_volatile_goto( \ - asm_goto_output( \ "1: lwz%X1 %0, %1\n" \ "2: lwz%X1 %L0, %L1\n" \ EX_TABLE(1b, %l2) \ reverted: --- linux-6.5.0/arch/powerpc/kernel/cpu_setup_6xx.S +++ linux-6.5.0.orig/arch/powerpc/kernel/cpu_setup_6xx.S @@ -26,15 +26,6 @@ bl __init_fpu_registers END_FTR_SECTION_IFCLR(CPU_FTR_FPU_UNAVAILABLE) bl setup_common_caches - - /* - * This assumes that all cores using __setup_cpu_603 with - * MMU_FTR_USE_HIGH_BATS are G2_LE compatible - */ -BEGIN_MMU_FTR_SECTION - bl setup_g2_le_hid2 -END_MMU_FTR_SECTION_IFSET(MMU_FTR_USE_HIGH_BATS) - mtlr r5 blr _GLOBAL(__setup_cpu_604) @@ -124,16 +115,6 @@ blr SYM_FUNC_END(setup_604_hid0) -/* Enable high BATs for G2_LE and derivatives like e300cX */ -SYM_FUNC_START_LOCAL(setup_g2_le_hid2) - mfspr r11,SPRN_HID2_G2_LE - oris r11,r11,HID2_G2_LE_HBE@h - mtspr SPRN_HID2_G2_LE,r11 - sync - isync - blr -SYM_FUNC_END(setup_g2_le_hid2) - /* 7400 <= rev 2.7 and 7410 rev = 1.0 suffer from some * erratas we work around here. * Moto MPC710CE.pdf describes them, those are errata @@ -514,3 +495,4 @@ mtcr r7 blr _ASM_NOKPROBE_SYMBOL(__restore_cpu_setup) + reverted: --- linux-6.5.0/arch/powerpc/kernel/cpu_specs_e500mc.h +++ linux-6.5.0.orig/arch/powerpc/kernel/cpu_specs_e500mc.h @@ -8,8 +8,7 @@ #ifdef CONFIG_PPC64 #define COMMON_USER_BOOKE (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \ + PPC_FEATURE_HAS_FPU | PPC_FEATURE_64) - PPC_FEATURE_HAS_FPU | PPC_FEATURE_64 | \ - PPC_FEATURE_BOOKE) #else #define COMMON_USER_BOOKE (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \ PPC_FEATURE_BOOKE) reverted: --- linux-6.5.0/arch/powerpc/kernel/interrupt_64.S +++ linux-6.5.0.orig/arch/powerpc/kernel/interrupt_64.S @@ -52,8 +52,7 @@ mr r10,r1 ld r1,PACAKSAVE(r13) std r10,0(r1) + std r11,_NIP(r1) - std r11,_LINK(r1) - std r11,_NIP(r1) /* Saved LR is also the next instruction */ std r12,_MSR(r1) std r0,GPR0(r1) std r10,GPR1(r1) @@ -71,6 +70,7 @@ std r9,GPR13(r1) SAVE_NVGPRS(r1) std r11,_XER(r1) + std r11,_LINK(r1) std r11,_CTR(r1) li r11,\trapnr reverted: --- linux-6.5.0/arch/powerpc/kernel/irq_64.c +++ linux-6.5.0.orig/arch/powerpc/kernel/irq_64.c @@ -230,7 +230,7 @@ * This allows interrupts to be unmasked without hard disabling, and * also without new hard interrupts coming in ahead of pending ones. */ + asm_volatile_goto( - asm goto( "1: \n" " lbz 9,%0(13) \n" " cmpwi 9,0 \n" reverted: --- linux-6.5.0/arch/powerpc/mm/kasan/init_32.c +++ linux-6.5.0.orig/arch/powerpc/mm/kasan/init_32.c @@ -64,7 +64,6 @@ if (ret) return ret; - k_start = k_start & PAGE_MASK; block = memblock_alloc(k_end - k_start, PAGE_SIZE); if (!block) return -ENOMEM; diff -u linux-6.5.0/arch/powerpc/platforms/pseries/lpar.c linux-6.5.0/arch/powerpc/platforms/pseries/lpar.c --- linux-6.5.0/arch/powerpc/platforms/pseries/lpar.c +++ linux-6.5.0/arch/powerpc/platforms/pseries/lpar.c @@ -661,12 +661,8 @@ { struct lppaca *lppaca = &lppaca_of(cpu); - /* - * VPA steal time counters are reported at TB frequency. Hence do a - * conversion to ns before returning - */ - return tb_to_ns(be64_to_cpu(READ_ONCE(lppaca->enqueue_dispatch_tb)) + - be64_to_cpu(READ_ONCE(lppaca->ready_enqueue_tb))); + return be64_to_cpu(READ_ONCE(lppaca->enqueue_dispatch_tb)) + + be64_to_cpu(READ_ONCE(lppaca->ready_enqueue_tb)); } #endif reverted: --- linux-6.5.0/arch/riscv/include/asm/cacheflush.h +++ linux-6.5.0.orig/arch/riscv/include/asm/cacheflush.h @@ -38,8 +38,7 @@ flush_icache_mm(vma->vm_mm, 0) #ifdef CONFIG_64BIT +#define flush_cache_vmap(start, end) flush_tlb_kernel_range(start, end) -#define flush_cache_vmap(start, end) flush_tlb_kernel_range(start, end) -#define flush_cache_vmap_early(start, end) local_flush_tlb_kernel_range(start, end) #endif #ifndef CONFIG_SMP reverted: --- linux-6.5.0/arch/riscv/include/asm/hugetlb.h +++ linux-6.5.0.orig/arch/riscv/include/asm/hugetlb.h @@ -10,9 +10,6 @@ } #define arch_clear_hugepage_flags arch_clear_hugepage_flags -bool arch_hugetlb_migration_supported(struct hstate *h); -#define arch_hugetlb_migration_supported arch_hugetlb_migration_supported - #ifdef CONFIG_RISCV_ISA_SVNAPOT #define __HAVE_ARCH_HUGE_PTE_CLEAR void huge_pte_clear(struct mm_struct *mm, unsigned long addr, reverted: --- linux-6.5.0/arch/riscv/include/asm/hwcap.h +++ linux-6.5.0.orig/arch/riscv/include/asm/hwcap.h @@ -91,7 +91,7 @@ "ext must be < RISCV_ISA_EXT_MAX"); if (IS_ENABLED(CONFIG_RISCV_ALTERNATIVE)) { + asm_volatile_goto( - asm goto( ALTERNATIVE("j %l[l_no]", "nop", 0, %[ext], 1) : : [ext] "i" (ext) @@ -114,7 +114,7 @@ "ext must be < RISCV_ISA_EXT_MAX"); if (IS_ENABLED(CONFIG_RISCV_ALTERNATIVE)) { + asm_volatile_goto( - asm goto( ALTERNATIVE("nop", "j %l[l_yes]", 0, %[ext], 1) : : [ext] "i" (ext) reverted: --- linux-6.5.0/arch/riscv/include/asm/jump_label.h +++ linux-6.5.0.orig/arch/riscv/include/asm/jump_label.h @@ -17,7 +17,7 @@ static __always_inline bool arch_static_branch(struct static_key * const key, const bool branch) { + asm_volatile_goto( - asm goto( " .align 2 \n\t" " .option push \n\t" " .option norelax \n\t" @@ -39,7 +39,7 @@ static __always_inline bool arch_static_branch_jump(struct static_key * const key, const bool branch) { + asm_volatile_goto( - asm goto( " .align 2 \n\t" " .option push \n\t" " .option norelax \n\t" reverted: --- linux-6.5.0/arch/riscv/include/asm/sbi.h +++ linux-6.5.0.orig/arch/riscv/include/asm/sbi.h @@ -273,6 +273,9 @@ void sbi_shutdown(void); void sbi_send_ipi(unsigned int cpu); int sbi_remote_fence_i(const struct cpumask *cpu_mask); +int sbi_remote_sfence_vma(const struct cpumask *cpu_mask, + unsigned long start, + unsigned long size); int sbi_remote_sfence_vma_asid(const struct cpumask *cpu_mask, unsigned long start, reverted: --- linux-6.5.0/arch/riscv/include/asm/stacktrace.h +++ linux-6.5.0.orig/arch/riscv/include/asm/stacktrace.h @@ -21,9 +21,4 @@ return !(((unsigned long)(current->stack) ^ current_stack_pointer) & ~(THREAD_SIZE - 1)); } - -#ifdef CONFIG_VMAP_STACK -DECLARE_PER_CPU(unsigned long [OVERFLOW_STACK_SIZE/sizeof(long)], overflow_stack); -#endif /* CONFIG_VMAP_STACK */ - #endif /* _ASM_RISCV_STACKTRACE_H */ reverted: --- linux-6.5.0/arch/riscv/include/asm/tlb.h +++ linux-6.5.0.orig/arch/riscv/include/asm/tlb.h @@ -15,13 +15,7 @@ static inline void tlb_flush(struct mmu_gather *tlb) { + flush_tlb_mm(tlb->mm); -#ifdef CONFIG_MMU - if (tlb->fullmm || tlb->need_flush_all || tlb->freed_tables) - flush_tlb_mm(tlb->mm); - else - flush_tlb_mm_range(tlb->mm, tlb->start, tlb->end, - tlb_get_unmap_size(tlb)); -#endif } #endif /* _ASM_RISCV_TLB_H */ reverted: --- linux-6.5.0/arch/riscv/include/asm/tlbflush.h +++ linux-6.5.0.orig/arch/riscv/include/asm/tlbflush.h @@ -11,9 +11,6 @@ #include #include -#define FLUSH_TLB_MAX_SIZE ((unsigned long)-1) -#define FLUSH_TLB_NO_ASID ((unsigned long)-1) - #ifdef CONFIG_MMU extern unsigned long asid_mask; @@ -35,13 +32,9 @@ #if defined(CONFIG_SMP) && defined(CONFIG_MMU) void flush_tlb_all(void); void flush_tlb_mm(struct mm_struct *mm); -void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start, - unsigned long end, unsigned int page_size); void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr); void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned long end); -void flush_tlb_kernel_range(unsigned long start, unsigned long end); -void local_flush_tlb_kernel_range(unsigned long start, unsigned long end); #ifdef CONFIG_TRANSPARENT_HUGEPAGE #define __HAVE_ARCH_FLUSH_PMD_TLB_RANGE void flush_pmd_tlb_range(struct vm_area_struct *vma, unsigned long start, @@ -58,16 +51,14 @@ local_flush_tlb_all(); } +#define flush_tlb_mm(mm) flush_tlb_all() +#endif /* !CONFIG_SMP || !CONFIG_MMU */ + /* Flush a range of kernel pages */ static inline void flush_tlb_kernel_range(unsigned long start, unsigned long end) { + flush_tlb_all(); - local_flush_tlb_all(); } -#define flush_tlb_mm(mm) flush_tlb_all() -#define flush_tlb_mm_range(mm, start, end, page_size) flush_tlb_all() -#define local_flush_tlb_kernel_range(start, end) flush_tlb_all() -#endif /* !CONFIG_SMP || !CONFIG_MMU */ - #endif /* _ASM_RISCV_TLBFLUSH_H */ reverted: --- linux-6.5.0/arch/riscv/kernel/sbi.c +++ linux-6.5.0.orig/arch/riscv/kernel/sbi.c @@ -11,7 +11,6 @@ #include #include #include -#include /* default SBI version is 0.1 */ unsigned long sbi_spec_version __ro_after_init = SBI_SPEC_VERSION_DEFAULT; @@ -378,14 +377,31 @@ EXPORT_SYMBOL(sbi_remote_fence_i); /** + * sbi_remote_sfence_vma() - Execute SFENCE.VMA instructions on given remote + * harts for the specified virtual address range. + * @cpu_mask: A cpu mask containing all the target harts. + * @start: Start of the virtual address + * @size: Total size of the virtual address range. + * + * Return: 0 on success, appropriate linux error code otherwise. + */ +int sbi_remote_sfence_vma(const struct cpumask *cpu_mask, + unsigned long start, + unsigned long size) +{ + return __sbi_rfence(SBI_EXT_RFENCE_REMOTE_SFENCE_VMA, + cpu_mask, start, size, 0, 0); +} +EXPORT_SYMBOL(sbi_remote_sfence_vma); + +/** * sbi_remote_sfence_vma_asid() - Execute SFENCE.VMA instructions on given + * remote harts for a virtual address range belonging to a specific ASID. - * remote harts for a virtual address range belonging to a specific ASID or not. * * @cpu_mask: A cpu mask containing all the target harts. * @start: Start of the virtual address * @size: Total size of the virtual address range. + * @asid: The value of address space identifier (ASID). - * @asid: The value of address space identifier (ASID), or FLUSH_TLB_NO_ASID - * for flushing all address spaces. * * Return: 0 on success, appropriate linux error code otherwise. */ @@ -394,12 +410,8 @@ unsigned long size, unsigned long asid) { + return __sbi_rfence(SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID, + cpu_mask, start, size, asid, 0); - if (asid == FLUSH_TLB_NO_ASID) - return __sbi_rfence(SBI_EXT_RFENCE_REMOTE_SFENCE_VMA, - cpu_mask, start, size, 0, 0); - else - return __sbi_rfence(SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID, - cpu_mask, start, size, asid, 0); } EXPORT_SYMBOL(sbi_remote_sfence_vma_asid); reverted: --- linux-6.5.0/arch/riscv/mm/hugetlbpage.c +++ linux-6.5.0.orig/arch/riscv/mm/hugetlbpage.c @@ -125,26 +125,6 @@ return pte; } -unsigned long hugetlb_mask_last_page(struct hstate *h) -{ - unsigned long hp_size = huge_page_size(h); - - switch (hp_size) { -#ifndef __PAGETABLE_PMD_FOLDED - case PUD_SIZE: - return P4D_SIZE - PUD_SIZE; -#endif - case PMD_SIZE: - return PUD_SIZE - PMD_SIZE; - case napot_cont_size(NAPOT_CONT64KB_ORDER): - return PMD_SIZE - napot_cont_size(NAPOT_CONT64KB_ORDER); - default: - break; - } - - return 0UL; -} - static pte_t get_clear_contig(struct mm_struct *mm, unsigned long addr, pte_t *ptep, @@ -197,35 +177,11 @@ return entry; } -static void clear_flush(struct mm_struct *mm, - unsigned long addr, - pte_t *ptep, - unsigned long pgsize, - unsigned long ncontig) -{ - struct vm_area_struct vma = TLB_FLUSH_VMA(mm, 0); - unsigned long i, saddr = addr; - - for (i = 0; i < ncontig; i++, addr += pgsize, ptep++) - ptep_get_and_clear(mm, addr, ptep); - - flush_tlb_range(&vma, saddr, addr); -} - -/* - * When dealing with NAPOT mappings, the privileged specification indicates that - * "if an update needs to be made, the OS generally should first mark all of the - * PTEs invalid, then issue SFENCE.VMA instruction(s) covering all 4 KiB regions - * within the range, [...] then update the PTE(s), as described in Section - * 4.2.1.". That's the equivalent of the Break-Before-Make approach used by - * arm64. - */ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte) { - unsigned long pgsize; int i, pte_num; if (!pte_napot(pte)) { @@ -234,22 +190,7 @@ } pte_num = napot_pte_num(napot_cont_order(pte)); + for (i = 0; i < pte_num; i++, ptep++, addr += PAGE_SIZE) - pgsize = 1 << hugepage_shift; - - if (!pte_present(pte)) { - for (i = 0; i < pte_num; i++, ptep++, addr += pgsize) - set_ptes(mm, addr, ptep, pte, 1); - return; - } - - if (!pte_napot(pte)) { - set_ptes(mm, addr, ptep, pte, 1); - return; - } - - clear_flush(mm, addr, ptep, pgsize, pte_num); - - for (i = 0; i < pte_num; i++, ptep++, addr += pgsize) set_pte_at(mm, addr, ptep, pte); } @@ -357,7 +298,7 @@ pte_clear(mm, addr, ptep); } +static __init bool is_napot_size(unsigned long size) -static bool is_napot_size(unsigned long size) { unsigned long order; @@ -385,7 +326,7 @@ #else +static __init bool is_napot_size(unsigned long size) -static bool is_napot_size(unsigned long size) { return false; } @@ -402,7 +343,7 @@ return pmd_leaf(pmd); } +bool __init arch_hugetlb_valid_size(unsigned long size) -static bool __hugetlb_valid_size(unsigned long size) { if (size == HPAGE_SIZE) return true; @@ -414,16 +355,6 @@ return false; } -bool __init arch_hugetlb_valid_size(unsigned long size) -{ - return __hugetlb_valid_size(size); -} - -bool arch_hugetlb_migration_supported(struct hstate *h) -{ - return __hugetlb_valid_size(huge_page_size(h)); -} - #ifdef CONFIG_CONTIG_ALLOC static __init int gigantic_pages_init(void) { diff -u linux-6.5.0/arch/riscv/mm/init.c linux-6.5.0/arch/riscv/mm/init.c --- linux-6.5.0/arch/riscv/mm/init.c +++ linux-6.5.0/arch/riscv/mm/init.c @@ -1397,10 +1397,6 @@ early_memtest(min_low_pfn << PAGE_SHIFT, max_low_pfn << PAGE_SHIFT); arch_numa_init(); sparse_init(); -#ifdef CONFIG_SPARSEMEM_VMEMMAP - /* The entire VMEMMAP region has been populated. Flush TLB for this region */ - local_flush_tlb_kernel_range(VMEMMAP_START, VMEMMAP_END); -#endif zone_sizes_init(); reserve_crashkernel(); memblock_dump_all(); reverted: --- linux-6.5.0/arch/riscv/mm/tlbflush.c +++ linux-6.5.0.orig/arch/riscv/mm/tlbflush.c @@ -8,50 +8,28 @@ static inline void local_flush_tlb_all_asid(unsigned long asid) { + __asm__ __volatile__ ("sfence.vma x0, %0" + : + : "r" (asid) + : "memory"); - if (asid != FLUSH_TLB_NO_ASID) - __asm__ __volatile__ ("sfence.vma x0, %0" - : - : "r" (asid) - : "memory"); - else - local_flush_tlb_all(); } static inline void local_flush_tlb_page_asid(unsigned long addr, unsigned long asid) { + __asm__ __volatile__ ("sfence.vma %0, %1" + : + : "r" (addr), "r" (asid) + : "memory"); - if (asid != FLUSH_TLB_NO_ASID) - __asm__ __volatile__ ("sfence.vma %0, %1" - : - : "r" (addr), "r" (asid) - : "memory"); - else - local_flush_tlb_page(addr); } +static inline void local_flush_tlb_range(unsigned long start, + unsigned long size, unsigned long stride) -/* - * Flush entire TLB if number of entries to be flushed is greater - * than the threshold below. - */ -static unsigned long tlb_flush_all_threshold __read_mostly = 64; - -static void local_flush_tlb_range_threshold_asid(unsigned long start, - unsigned long size, - unsigned long stride, - unsigned long asid) { + if (size <= stride) + local_flush_tlb_page(start); + else + local_flush_tlb_all(); - unsigned long nr_ptes_in_range = DIV_ROUND_UP(size, stride); - int i; - - if (nr_ptes_in_range > tlb_flush_all_threshold) { - local_flush_tlb_all_asid(asid); - return; - } - - for (i = 0; i < nr_ptes_in_range; ++i) { - local_flush_tlb_page_asid(start, asid); - start += stride; - } } static inline void local_flush_tlb_range_asid(unsigned long start, @@ -59,16 +37,8 @@ { if (size <= stride) local_flush_tlb_page_asid(start, asid); + else - else if (size == FLUSH_TLB_MAX_SIZE) local_flush_tlb_all_asid(asid); - else - local_flush_tlb_range_threshold_asid(start, size, stride, asid); -} - -/* Flush a range of kernel pages without broadcasting */ -void local_flush_tlb_kernel_range(unsigned long start, unsigned long end) -{ - local_flush_tlb_range_asid(start, end - start, PAGE_SIZE, FLUSH_TLB_NO_ASID); } static void __ipi_flush_tlb_all(void *info) @@ -81,7 +51,7 @@ if (riscv_use_ipi_for_rfence()) on_each_cpu(__ipi_flush_tlb_all, NULL, 1); else + sbi_remote_sfence_vma(NULL, 0, -1); - sbi_remote_sfence_vma_asid(NULL, 0, FLUSH_TLB_MAX_SIZE, FLUSH_TLB_NO_ASID); } struct flush_tlb_range_data { @@ -98,62 +68,68 @@ local_flush_tlb_range_asid(d->start, d->size, d->stride, d->asid); } +static void __ipi_flush_tlb_range(void *info) +{ + struct flush_tlb_range_data *d = info; + + local_flush_tlb_range(d->start, d->size, d->stride); +} + static void __flush_tlb_range(struct mm_struct *mm, unsigned long start, unsigned long size, unsigned long stride) { struct flush_tlb_range_data ftd; + struct cpumask *cmask = mm_cpumask(mm); + unsigned int cpuid; - const struct cpumask *cmask; - unsigned long asid = FLUSH_TLB_NO_ASID; bool broadcast; + if (cpumask_empty(cmask)) + return; - if (mm) { - unsigned int cpuid; - - cmask = mm_cpumask(mm); - if (cpumask_empty(cmask)) - return; - - cpuid = get_cpu(); - /* check if the tlbflush needs to be sent to other CPUs */ - broadcast = cpumask_any_but(cmask, cpuid) < nr_cpu_ids; - - if (static_branch_unlikely(&use_asid_allocator)) - asid = atomic_long_read(&mm->context.id) & asid_mask; - } else { - cmask = cpu_online_mask; - broadcast = true; - } + cpuid = get_cpu(); + /* check if the tlbflush needs to be sent to other CPUs */ + broadcast = cpumask_any_but(cmask, cpuid) < nr_cpu_ids; + if (static_branch_unlikely(&use_asid_allocator)) { + unsigned long asid = atomic_long_read(&mm->context.id) & asid_mask; + + if (broadcast) { + if (riscv_use_ipi_for_rfence()) { + ftd.asid = asid; + ftd.start = start; + ftd.size = size; + ftd.stride = stride; + on_each_cpu_mask(cmask, + __ipi_flush_tlb_range_asid, + &ftd, 1); + } else + sbi_remote_sfence_vma_asid(cmask, + start, size, asid); + } else { + local_flush_tlb_range_asid(start, size, stride, asid); + } - if (broadcast) { - if (riscv_use_ipi_for_rfence()) { - ftd.asid = asid; - ftd.start = start; - ftd.size = size; - ftd.stride = stride; - on_each_cpu_mask(cmask, - __ipi_flush_tlb_range_asid, - &ftd, 1); - } else - sbi_remote_sfence_vma_asid(cmask, - start, size, asid); } else { + if (broadcast) { + if (riscv_use_ipi_for_rfence()) { + ftd.asid = 0; + ftd.start = start; + ftd.size = size; + ftd.stride = stride; + on_each_cpu_mask(cmask, + __ipi_flush_tlb_range, + &ftd, 1); + } else + sbi_remote_sfence_vma(cmask, start, size); + } else { + local_flush_tlb_range(start, size, stride); + } - local_flush_tlb_range_asid(start, size, stride, asid); } + put_cpu(); - if (mm) - put_cpu(); } void flush_tlb_mm(struct mm_struct *mm) { + __flush_tlb_range(mm, 0, -1, PAGE_SIZE); - __flush_tlb_range(mm, 0, FLUSH_TLB_MAX_SIZE, PAGE_SIZE); -} - -void flush_tlb_mm_range(struct mm_struct *mm, - unsigned long start, unsigned long end, - unsigned int page_size) -{ - __flush_tlb_range(mm, start, end - start, page_size); } void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr) @@ -166,12 +142,6 @@ { __flush_tlb_range(vma->vm_mm, start, end - start, PAGE_SIZE); } - -void flush_tlb_kernel_range(unsigned long start, unsigned long end) -{ - __flush_tlb_range(NULL, start, end - start, PAGE_SIZE); -} - #ifdef CONFIG_TRANSPARENT_HUGEPAGE void flush_pmd_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned long end) reverted: --- linux-6.5.0/arch/s390/include/asm/jump_label.h +++ linux-6.5.0.orig/arch/s390/include/asm/jump_label.h @@ -25,7 +25,7 @@ */ static __always_inline bool arch_static_branch(struct static_key *key, bool branch) { + asm_volatile_goto("0: brcl 0,%l[label]\n" - asm goto("0: brcl 0,%l[label]\n" ".pushsection __jump_table,\"aw\"\n" ".balign 8\n" ".long 0b-.,%l[label]-.\n" @@ -39,7 +39,7 @@ static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch) { + asm_volatile_goto("0: brcl 15,%l[label]\n" - asm goto("0: brcl 15,%l[label]\n" ".pushsection __jump_table,\"aw\"\n" ".balign 8\n" ".long 0b-.,%l[label]-.\n" reverted: --- linux-6.5.0/arch/sh/include/asm/cacheflush.h +++ linux-6.5.0.orig/arch/sh/include/asm/cacheflush.h @@ -83,7 +83,6 @@ unsigned long len); #define flush_cache_vmap(start, end) local_flush_cache_all(NULL) -#define flush_cache_vmap_early(start, end) do { } while (0) #define flush_cache_vunmap(start, end) local_flush_cache_all(NULL) #define flush_dcache_mmap_lock(mapping) do { } while (0) reverted: --- linux-6.5.0/arch/sparc/include/asm/cacheflush_32.h +++ linux-6.5.0.orig/arch/sparc/include/asm/cacheflush_32.h @@ -44,7 +44,6 @@ #define flush_dcache_mmap_unlock(mapping) do { } while (0) #define flush_cache_vmap(start, end) flush_cache_all() -#define flush_cache_vmap_early(start, end) do { } while (0) #define flush_cache_vunmap(start, end) flush_cache_all() /* When a context switch happens we must flush all user windows so that reverted: --- linux-6.5.0/arch/sparc/include/asm/cacheflush_64.h +++ linux-6.5.0.orig/arch/sparc/include/asm/cacheflush_64.h @@ -72,7 +72,6 @@ #define flush_dcache_mmap_unlock(mapping) do { } while (0) #define flush_cache_vmap(start, end) do { } while (0) -#define flush_cache_vmap_early(start, end) do { } while (0) #define flush_cache_vunmap(start, end) do { } while (0) #endif /* !__ASSEMBLY__ */ reverted: --- linux-6.5.0/arch/sparc/include/asm/jump_label.h +++ linux-6.5.0.orig/arch/sparc/include/asm/jump_label.h @@ -10,7 +10,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool branch) { + asm_volatile_goto("1:\n\t" - asm goto("1:\n\t" "nop\n\t" "nop\n\t" ".pushsection __jump_table, \"aw\"\n\t" @@ -26,7 +26,7 @@ static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch) { + asm_volatile_goto("1:\n\t" - asm goto("1:\n\t" "b %l[l_yes]\n\t" "nop\n\t" ".pushsection __jump_table, \"aw\"\n\t" reverted: --- linux-6.5.0/arch/um/Makefile +++ linux-6.5.0.orig/arch/um/Makefile @@ -120,9 +120,7 @@ $(Q)$(MAKE) $(build)=$(HOST_DIR)/um include/generated/user_constants.h LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static +LINK-$(CONFIG_LD_SCRIPT_DYN) += $(call cc-option, -no-pie) -ifdef CONFIG_LD_SCRIPT_DYN -LINK-$(call gcc-min-version, 60100)$(CONFIG_CC_IS_CLANG) += -no-pie -endif LINK-$(CONFIG_LD_SCRIPT_DYN_RPATH) += -Wl,-rpath,/lib CFLAGS_NO_HARDENING := $(call cc-option, -fno-PIC,) $(call cc-option, -fno-pic,) \ reverted: --- linux-6.5.0/arch/um/include/asm/cpufeature.h +++ linux-6.5.0.orig/arch/um/include/asm/cpufeature.h @@ -75,7 +75,7 @@ */ static __always_inline bool _static_cpu_has(u16 bit) { + asm_volatile_goto("1: jmp 6f\n" - asm goto("1: jmp 6f\n" "2:\n" ".skip -(((5f-4f) - (2b-1b)) > 0) * " "((5f-4f) - (2b-1b)),0x90\n" reverted: --- linux-6.5.0/arch/x86/Kconfig.cpu +++ linux-6.5.0.orig/arch/x86/Kconfig.cpu @@ -375,7 +375,7 @@ config X86_MINIMUM_CPU_FAMILY int default "64" if X86_64 + default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MCRUSOE || MCORE2 || MK7 || MK8) - default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MCORE2 || MK7 || MK8) default "5" if X86_32 && X86_CMPXCHG64 default "4" reverted: --- linux-6.5.0/arch/x86/boot/Makefile +++ linux-6.5.0.orig/arch/x86/boot/Makefile @@ -89,7 +89,7 @@ SETUP_OBJS = $(addprefix $(obj)/,$(setup-y)) +sed-zoffset := -e 's/^\([0-9a-fA-F]*\) [a-zA-Z] \(startup_32\|startup_64\|efi32_stub_entry\|efi64_stub_entry\|efi_pe_entry\|efi32_pe_entry\|input_data\|kernel_info\|_end\|_ehead\|_text\|z_.*\)$$/\#define ZO_\2 0x\1/p' -sed-zoffset := -e 's/^\([0-9a-fA-F]*\) [a-zA-Z] \(startup_32\|efi.._stub_entry\|efi\(32\)\?_pe_entry\|input_data\|kernel_info\|_end\|_ehead\|_text\|_e\?data\|z_.*\)$$/\#define ZO_\2 0x\1/p' quiet_cmd_zoffset = ZOFFSET $@ cmd_zoffset = $(NM) $< | sed -n $(sed-zoffset) > $@ reverted: --- linux-6.5.0/arch/x86/boot/compressed/vmlinux.lds.S +++ linux-6.5.0.orig/arch/x86/boot/compressed/vmlinux.lds.S @@ -43,13 +43,11 @@ *(.rodata.*) _erodata = . ; } + .data : { - .data : ALIGN(0x1000) { _data = . ; *(.data) *(.data.*) + *(.bss.efistub) - - /* Add 4 bytes of extra space for a CRC-32 checksum */ - . = ALIGN(. + 4, 0x200); _edata = . ; } . = ALIGN(L1_CACHE_BYTES); reverted: --- linux-6.5.0/arch/x86/boot/header.S +++ linux-6.5.0.orig/arch/x86/boot/header.S @@ -36,20 +36,66 @@ #define ROOT_RDONLY 1 #endif - .set salign, 0x1000 - .set falign, 0x200 - .code16 .section ".bstext", "ax" + + .global bootsect_start +bootsect_start: #ifdef CONFIG_EFI_STUB # "MZ", MS-DOS header .word MZ_MAGIC +#endif + + # Normalize the start address + ljmp $BOOTSEG, $start2 + +start2: + movw %cs, %ax + movw %ax, %ds + movw %ax, %es + movw %ax, %ss + xorw %sp, %sp + sti + cld + + movw $bugger_off_msg, %si + +msg_loop: + lodsb + andb %al, %al + jz bs_die + movb $0xe, %ah + movw $7, %bx + int $0x10 + jmp msg_loop + +bs_die: + # Allow the user to press a key, then reboot + xorw %ax, %ax + int $0x16 + int $0x19 + + # int 0x19 should never return. In case it does anyway, + # invoke the BIOS reset code... + ljmp $0xf000,$0xfff0 + +#ifdef CONFIG_EFI_STUB .org 0x38 # # Offset to the PE header. # .long LINUX_PE_MAGIC .long pe_header +#endif /* CONFIG_EFI_STUB */ + + .section ".bsdata", "a" +bugger_off_msg: + .ascii "Use a boot loader.\r\n" + .ascii "\n" + .ascii "Remove disk and press any key to reboot...\r\n" + .byte 0 + +#ifdef CONFIG_EFI_STUB pe_header: .long PE_MAGIC @@ -78,26 +124,30 @@ .byte 0x02 # MajorLinkerVersion .byte 0x14 # MinorLinkerVersion + # Filled in by build.c + .long 0 # SizeOfCode - .long ZO__data # SizeOfCode + .long 0 # SizeOfInitializedData - .long ZO__end - ZO__data # SizeOfInitializedData .long 0 # SizeOfUninitializedData + # Filled in by build.c + .long 0x0000 # AddressOfEntryPoint - .long setup_size + ZO_efi_pe_entry # AddressOfEntryPoint + .long 0x0200 # BaseOfCode - .long setup_size # BaseOfCode #ifdef CONFIG_X86_32 .long 0 # data #endif extra_header_fields: + # PE specification requires ImageBase to be 64k aligned + .set image_base, (LOAD_PHYSICAL_ADDR + 0xffff) & ~0xffff #ifdef CONFIG_X86_32 + .long image_base # ImageBase - .long 0 # ImageBase #else + .quad image_base # ImageBase - .quad 0 # ImageBase #endif + .long 0x20 # SectionAlignment + .long 0x20 # FileAlignment - .long salign # SectionAlignment - .long falign # FileAlignment .word 0 # MajorOperatingSystemVersion .word 0 # MinorOperatingSystemVersion .word LINUX_EFISTUB_MAJOR_VERSION # MajorImageVersion @@ -106,9 +156,12 @@ .word 0 # MinorSubsystemVersion .long 0 # Win32VersionValue + # + # The size of the bzImage is written in tools/build.c + # + .long 0 # SizeOfImage - .long setup_size + ZO__end # SizeOfImage + .long 0x200 # SizeOfHeaders - .long salign # SizeOfHeaders .long 0 # CheckSum .word IMAGE_SUBSYSTEM_EFI_APPLICATION # Subsystem (EFI application) #ifdef CONFIG_EFI_DXE_MEM_ATTRIBUTES @@ -139,77 +192,87 @@ # Section table section_table: + # + # The offset & size fields are filled in by build.c. + # .ascii ".setup" .byte 0 .byte 0 + .long 0 + .long 0x0 # startup_{32,64} + .long 0 # Size of initialized data + # on disk + .long 0x0 # startup_{32,64} + .long 0 # PointerToRelocations + .long 0 # PointerToLineNumbers + .word 0 # NumberOfRelocations + .word 0 # NumberOfLineNumbers + .long IMAGE_SCN_CNT_CODE | \ + IMAGE_SCN_MEM_READ | \ + IMAGE_SCN_MEM_EXECUTE | \ + IMAGE_SCN_ALIGN_16BYTES # Characteristics - .long pecompat_fstart - salign # VirtualSize - .long salign # VirtualAddress - .long pecompat_fstart - salign # SizeOfRawData - .long salign # PointerToRawData + # + # The EFI application loader requires a relocation section + # because EFI applications must be relocatable. The .reloc + # offset & size fields are filled in by build.c. + # + .ascii ".reloc" + .byte 0 + .byte 0 + .long 0 + .long 0 + .long 0 # SizeOfRawData + .long 0 # PointerToRawData + .long 0 # PointerToRelocations + .long 0 # PointerToLineNumbers + .word 0 # NumberOfRelocations + .word 0 # NumberOfLineNumbers - .long 0, 0, 0 .long IMAGE_SCN_CNT_INITIALIZED_DATA | \ IMAGE_SCN_MEM_READ | \ + IMAGE_SCN_MEM_DISCARDABLE | \ + IMAGE_SCN_ALIGN_1BYTES # Characteristics - IMAGE_SCN_MEM_DISCARDABLE # Characteristics #ifdef CONFIG_EFI_MIXED + # + # The offset & size fields are filled in by build.c. + # .asciz ".compat" + .long 0 + .long 0x0 + .long 0 # Size of initialized data + # on disk + .long 0x0 + .long 0 # PointerToRelocations + .long 0 # PointerToLineNumbers + .word 0 # NumberOfRelocations + .word 0 # NumberOfLineNumbers - - .long pecompat_fsize # VirtualSize - .long pecompat_fstart # VirtualAddress - .long pecompat_fsize # SizeOfRawData - .long pecompat_fstart # PointerToRawData - - .long 0, 0, 0 .long IMAGE_SCN_CNT_INITIALIZED_DATA | \ IMAGE_SCN_MEM_READ | \ + IMAGE_SCN_MEM_DISCARDABLE | \ + IMAGE_SCN_ALIGN_1BYTES # Characteristics +#endif - IMAGE_SCN_MEM_DISCARDABLE # Characteristics + # + # The offset & size fields are filled in by build.c. + # - /* - * Put the IA-32 machine type and the associated entry point address in - * the .compat section, so loaders can figure out which other execution - * modes this image supports. - */ - .pushsection ".pecompat", "a", @progbits - .balign salign - .globl pecompat_fstart -pecompat_fstart: - .byte 0x1 # Version - .byte 8 # Size - .word IMAGE_FILE_MACHINE_I386 # PE machine type - .long setup_size + ZO_efi32_pe_entry # Entrypoint - .byte 0x0 # Sentinel - .popsection -#else - .set pecompat_fstart, setup_size -#endif .ascii ".text" .byte 0 .byte 0 .byte 0 + .long 0 + .long 0x0 # startup_{32,64} + .long 0 # Size of initialized data - .long ZO__data - .long setup_size - .long ZO__data # Size of initialized data # on disk + .long 0x0 # startup_{32,64} - .long setup_size .long 0 # PointerToRelocations .long 0 # PointerToLineNumbers .word 0 # NumberOfRelocations .word 0 # NumberOfLineNumbers .long IMAGE_SCN_CNT_CODE | \ IMAGE_SCN_MEM_READ | \ + IMAGE_SCN_MEM_EXECUTE | \ + IMAGE_SCN_ALIGN_16BYTES # Characteristics - IMAGE_SCN_MEM_EXECUTE # Characteristics - - .ascii ".data\0\0\0" - .long ZO__end - ZO__data # VirtualSize - .long setup_size + ZO__data # VirtualAddress - .long ZO__edata - ZO__data # SizeOfRawData - .long setup_size + ZO__data # PointerToRawData - - .long 0, 0, 0 - .long IMAGE_SCN_CNT_INITIALIZED_DATA | \ - IMAGE_SCN_MEM_READ | \ - IMAGE_SCN_MEM_WRITE # Characteristics .set section_count, (. - section_table) / 40 #endif /* CONFIG_EFI_STUB */ @@ -223,12 +286,12 @@ .globl hdr hdr: +setup_sects: .byte 0 /* Filled in by build.c */ - .byte setup_sects - 1 root_flags: .word ROOT_RDONLY +syssize: .long 0 /* Filled in by build.c */ -syssize: .long ZO__edata / 16 ram_size: .word 0 /* Obsolete */ vid_mode: .word SVGA_MODE +root_dev: .word 0 /* Filled in by build.c */ -root_dev: .word 0 /* Default to major/minor 0/0 */ boot_flag: .word 0xAA55 # offset 512, entry point @@ -516,25 +579,9 @@ # define INIT_SIZE VO_INIT_SIZE #endif - .macro __handover_offset -#ifndef CONFIG_EFI_HANDOVER_PROTOCOL - .long 0 -#elif !defined(CONFIG_X86_64) - .long ZO_efi32_stub_entry -#else - /* Yes, this is really how we defined it :( */ - .long ZO_efi64_stub_entry - 0x200 -#ifdef CONFIG_EFI_MIXED - .if ZO_efi32_stub_entry != ZO_efi64_stub_entry - 0x200 - .error "32-bit and 64-bit EFI entry points do not match" - .endif -#endif -#endif - .endm - init_size: .long INIT_SIZE # kernel initialization size +handover_offset: .long 0 # Filled in by build.c +kernel_info_offset: .long 0 # Filled in by build.c -handover_offset: __handover_offset -kernel_info_offset: .long ZO_kernel_info # End of setup header ##################################################### reverted: --- linux-6.5.0/arch/x86/boot/setup.ld +++ linux-6.5.0.orig/arch/x86/boot/setup.ld @@ -10,11 +10,10 @@ SECTIONS { . = 0; + .bstext : { *(.bstext) } + .bsdata : { *(.bsdata) } - .bstext : { - *(.bstext) - . = 495; - } =0xffffffff + . = 495; .header : { *(.header) } .entrytext : { *(.entrytext) } .inittext : { *(.inittext) } @@ -24,9 +23,6 @@ .text : { *(.text .text.*) } .text32 : { *(.text32) } - .pecompat : { *(.pecompat) } - PROVIDE(pecompat_fsize = setup_size - pecompat_fstart); - . = ALIGN(16); .rodata : { *(.rodata*) } @@ -42,10 +38,8 @@ .signature : { setup_sig = .; LONG(0x5a5aaa55) + } - setup_size = ALIGN(ABSOLUTE(.), 4096); - setup_sects = ABSOLUTE(setup_size / 512); - } . = ALIGN(16); .bss : reverted: --- linux-6.5.0/arch/x86/boot/tools/build.c +++ linux-6.5.0.orig/arch/x86/boot/tools/build.c @@ -40,6 +40,10 @@ typedef unsigned short u16; typedef unsigned int u32; +#define DEFAULT_MAJOR_ROOT 0 +#define DEFAULT_MINOR_ROOT 0 +#define DEFAULT_ROOT_DEV (DEFAULT_MAJOR_ROOT << 8 | DEFAULT_MINOR_ROOT) + /* Minimal number of setup sectors */ #define SETUP_SECT_MIN 5 #define SETUP_SECT_MAX 64 @@ -47,7 +51,22 @@ /* This must be large enough to hold the entire setup */ u8 buf[SETUP_SECT_MAX*512]; +#define PECOFF_RELOC_RESERVE 0x20 + +#ifdef CONFIG_EFI_MIXED +#define PECOFF_COMPAT_RESERVE 0x20 +#else +#define PECOFF_COMPAT_RESERVE 0x0 +#endif + +static unsigned long efi32_stub_entry; +static unsigned long efi64_stub_entry; +static unsigned long efi_pe_entry; +static unsigned long efi32_pe_entry; +static unsigned long kernel_info; +static unsigned long startup_64; +static unsigned long _ehead; +static unsigned long _end; -static unsigned long _edata; /*----------------------------------------------------------------------*/ @@ -133,6 +152,180 @@ die("Usage: build setup system zoffset.h image"); } +#ifdef CONFIG_EFI_STUB + +static void update_pecoff_section_header_fields(char *section_name, u32 vma, u32 size, u32 datasz, u32 offset) +{ + unsigned int pe_header; + unsigned short num_sections; + u8 *section; + + pe_header = get_unaligned_le32(&buf[0x3c]); + num_sections = get_unaligned_le16(&buf[pe_header + 6]); + +#ifdef CONFIG_X86_32 + section = &buf[pe_header + 0xa8]; +#else + section = &buf[pe_header + 0xb8]; +#endif + + while (num_sections > 0) { + if (strncmp((char*)section, section_name, 8) == 0) { + /* section header size field */ + put_unaligned_le32(size, section + 0x8); + + /* section header vma field */ + put_unaligned_le32(vma, section + 0xc); + + /* section header 'size of initialised data' field */ + put_unaligned_le32(datasz, section + 0x10); + + /* section header 'file offset' field */ + put_unaligned_le32(offset, section + 0x14); + + break; + } + section += 0x28; + num_sections--; + } +} + +static void update_pecoff_section_header(char *section_name, u32 offset, u32 size) +{ + update_pecoff_section_header_fields(section_name, offset, size, size, offset); +} + +static void update_pecoff_setup_and_reloc(unsigned int size) +{ + u32 setup_offset = 0x200; + u32 reloc_offset = size - PECOFF_RELOC_RESERVE - PECOFF_COMPAT_RESERVE; +#ifdef CONFIG_EFI_MIXED + u32 compat_offset = reloc_offset + PECOFF_RELOC_RESERVE; +#endif + u32 setup_size = reloc_offset - setup_offset; + + update_pecoff_section_header(".setup", setup_offset, setup_size); + update_pecoff_section_header(".reloc", reloc_offset, PECOFF_RELOC_RESERVE); + + /* + * Modify .reloc section contents with a single entry. The + * relocation is applied to offset 10 of the relocation section. + */ + put_unaligned_le32(reloc_offset + 10, &buf[reloc_offset]); + put_unaligned_le32(10, &buf[reloc_offset + 4]); + +#ifdef CONFIG_EFI_MIXED + update_pecoff_section_header(".compat", compat_offset, PECOFF_COMPAT_RESERVE); + + /* + * Put the IA-32 machine type (0x14c) and the associated entry point + * address in the .compat section, so loaders can figure out which other + * execution modes this image supports. + */ + buf[compat_offset] = 0x1; + buf[compat_offset + 1] = 0x8; + put_unaligned_le16(0x14c, &buf[compat_offset + 2]); + put_unaligned_le32(efi32_pe_entry + size, &buf[compat_offset + 4]); +#endif +} + +static void update_pecoff_text(unsigned int text_start, unsigned int file_sz, + unsigned int init_sz) +{ + unsigned int pe_header; + unsigned int text_sz = file_sz - text_start; + unsigned int bss_sz = init_sz - file_sz; + + pe_header = get_unaligned_le32(&buf[0x3c]); + + /* + * The PE/COFF loader may load the image at an address which is + * misaligned with respect to the kernel_alignment field in the setup + * header. + * + * In order to avoid relocating the kernel to correct the misalignment, + * add slack to allow the buffer to be aligned within the declared size + * of the image. + */ + bss_sz += CONFIG_PHYSICAL_ALIGN; + init_sz += CONFIG_PHYSICAL_ALIGN; + + /* + * Size of code: Subtract the size of the first sector (512 bytes) + * which includes the header. + */ + put_unaligned_le32(file_sz - 512 + bss_sz, &buf[pe_header + 0x1c]); + + /* Size of image */ + put_unaligned_le32(init_sz, &buf[pe_header + 0x50]); + + /* + * Address of entry point for PE/COFF executable + */ + put_unaligned_le32(text_start + efi_pe_entry, &buf[pe_header + 0x28]); + + update_pecoff_section_header_fields(".text", text_start, text_sz + bss_sz, + text_sz, text_start); +} + +static int reserve_pecoff_reloc_section(int c) +{ + /* Reserve 0x20 bytes for .reloc section */ + memset(buf+c, 0, PECOFF_RELOC_RESERVE); + return PECOFF_RELOC_RESERVE; +} + +static void efi_stub_defaults(void) +{ + /* Defaults for old kernel */ +#ifdef CONFIG_X86_32 + efi_pe_entry = 0x10; +#else + efi_pe_entry = 0x210; + startup_64 = 0x200; +#endif +} + +static void efi_stub_entry_update(void) +{ + unsigned long addr = efi32_stub_entry; + +#ifdef CONFIG_EFI_HANDOVER_PROTOCOL +#ifdef CONFIG_X86_64 + /* Yes, this is really how we defined it :( */ + addr = efi64_stub_entry - 0x200; +#endif + +#ifdef CONFIG_EFI_MIXED + if (efi32_stub_entry != addr) + die("32-bit and 64-bit EFI entry points do not match\n"); +#endif +#endif + put_unaligned_le32(addr, &buf[0x264]); +} + +#else + +static inline void update_pecoff_setup_and_reloc(unsigned int size) {} +static inline void update_pecoff_text(unsigned int text_start, + unsigned int file_sz, + unsigned int init_sz) {} +static inline void efi_stub_defaults(void) {} +static inline void efi_stub_entry_update(void) {} + +static inline int reserve_pecoff_reloc_section(int c) +{ + return 0; +} +#endif /* CONFIG_EFI_STUB */ + +static int reserve_pecoff_compat_section(int c) +{ + /* Reserve 0x20 bytes for .compat section */ + memset(buf+c, 0, PECOFF_COMPAT_RESERVE); + return PECOFF_COMPAT_RESERVE; +} + /* * Parse zoffset.h and find the entry points. We could just #include zoffset.h * but that would mean tools/build would have to be rebuilt every time. It's @@ -161,7 +354,14 @@ p = (char *)buf; while (p && *p) { + PARSE_ZOFS(p, efi32_stub_entry); + PARSE_ZOFS(p, efi64_stub_entry); + PARSE_ZOFS(p, efi_pe_entry); + PARSE_ZOFS(p, efi32_pe_entry); + PARSE_ZOFS(p, kernel_info); + PARSE_ZOFS(p, startup_64); + PARSE_ZOFS(p, _ehead); + PARSE_ZOFS(p, _end); - PARSE_ZOFS(p, _edata); p = strchr(p, '\n'); while (p && (*p == '\r' || *p == '\n')) @@ -171,14 +371,17 @@ int main(int argc, char ** argv) { + unsigned int i, sz, setup_sectors, init_sz; - unsigned int i, sz, setup_sectors; int c; + u32 sys_size; struct stat sb; FILE *file, *dest; int fd; void *kernel; u32 crc = 0xffffffffUL; + efi_stub_defaults(); + if (argc != 5) usage(); parse_zoffset(argv[3]); @@ -200,27 +403,72 @@ die("Boot block hasn't got boot flag (0xAA55)"); fclose(file); + c += reserve_pecoff_compat_section(c); + c += reserve_pecoff_reloc_section(c); + /* Pad unused space with zeros */ + setup_sectors = (c + 511) / 512; - setup_sectors = (c + 4095) / 4096; - setup_sectors *= 8; if (setup_sectors < SETUP_SECT_MIN) setup_sectors = SETUP_SECT_MIN; i = setup_sectors*512; memset(buf+c, 0, i-c); + update_pecoff_setup_and_reloc(i); + + /* Set the default root device */ + put_unaligned_le16(DEFAULT_ROOT_DEV, &buf[508]); + /* Open and stat the kernel file */ fd = open(argv[2], O_RDONLY); if (fd < 0) die("Unable to open `%s': %m", argv[2]); if (fstat(fd, &sb)) die("Unable to stat `%s': %m", argv[2]); + sz = sb.st_size; - if (_edata != sb.st_size) - die("Unexpected file size `%s': %u != %u", argv[2], _edata, - sb.st_size); - sz = _edata - 4; kernel = mmap(NULL, sz, PROT_READ, MAP_SHARED, fd, 0); if (kernel == MAP_FAILED) die("Unable to mmap '%s': %m", argv[2]); + /* Number of 16-byte paragraphs, including space for a 4-byte CRC */ + sys_size = (sz + 15 + 4) / 16; +#ifdef CONFIG_EFI_STUB + /* + * COFF requires minimum 32-byte alignment of sections, and + * adding a signature is problematic without that alignment. + */ + sys_size = (sys_size + 1) & ~1; +#endif + + /* Patch the setup code with the appropriate size parameters */ + buf[0x1f1] = setup_sectors-1; + put_unaligned_le32(sys_size, &buf[0x1f4]); + + init_sz = get_unaligned_le32(&buf[0x260]); +#ifdef CONFIG_EFI_STUB + /* + * The decompression buffer will start at ImageBase. When relocating + * the compressed kernel to its end, we must ensure that the head + * section does not get overwritten. The head section occupies + * [i, i + _ehead), and the destination is [init_sz - _end, init_sz). + * + * At present these should never overlap, because 'i' is at most 32k + * because of SETUP_SECT_MAX, '_ehead' is less than 1k, and the + * calculation of INIT_SIZE in boot/header.S ensures that + * 'init_sz - _end' is at least 64k. + * + * For future-proofing, increase init_sz if necessary. + */ + + if (init_sz - _end < i + _ehead) { + init_sz = (i + _ehead + _end + 4095) & ~4095; + put_unaligned_le32(init_sz, &buf[0x260]); + } +#endif + update_pecoff_text(setup_sectors * 512, i + (sys_size * 16), init_sz); + + efi_stub_entry_update(); + + /* Update kernel_info offset. */ + put_unaligned_le32(kernel_info, &buf[0x268]); crc = partial_crc32(buf, i, crc); if (fwrite(buf, 1, i, dest) != i) @@ -231,6 +479,13 @@ if (fwrite(kernel, 1, sz, dest) != sz) die("Writing kernel failed"); + /* Add padding leaving 4 bytes for the checksum */ + while (sz++ < (sys_size*16) - 4) { + crc = partial_crc32_one('\0', crc); + if (fwrite("\0", 1, 1, dest) != 1) + die("Writing padding failed"); + } + /* Write the CRC */ put_unaligned_le32(crc, buf); if (fwrite(buf, 1, 4, dest) != 4) reverted: --- linux-6.5.0/arch/x86/include/asm/barrier.h +++ linux-6.5.0.orig/arch/x86/include/asm/barrier.h @@ -81,4 +81,22 @@ #include +/* + * Make previous memory operations globally visible before + * a WRMSR. + * + * MFENCE makes writes visible, but only affects load/store + * instructions. WRMSR is unfortunately not a load/store + * instruction and is unaffected by MFENCE. The LFENCE ensures + * that the WRMSR is not reordered. + * + * Most WRMSRs are full serializing instructions themselves and + * do not require this barrier. This is only required for the + * IA32_TSC_DEADLINE and X2APIC MSRs. + */ +static inline void weak_wrmsr_fence(void) +{ + asm volatile("mfence; lfence" : : : "memory"); +} + #endif /* _ASM_X86_BARRIER_H */ reverted: --- linux-6.5.0/arch/x86/include/asm/cpufeature.h +++ linux-6.5.0.orig/arch/x86/include/asm/cpufeature.h @@ -168,7 +168,7 @@ */ static __always_inline bool _static_cpu_has(u16 bit) { + asm_volatile_goto( - asm goto( ALTERNATIVE_TERNARY("jmp 6f", %P[feature], "", "jmp %l[t_no]") ".pushsection .altinstr_aux,\"ax\"\n" "6:\n" diff -u linux-6.5.0/arch/x86/include/asm/cpufeatures.h linux-6.5.0/arch/x86/include/asm/cpufeatures.h --- linux-6.5.0/arch/x86/include/asm/cpufeatures.h +++ linux-6.5.0/arch/x86/include/asm/cpufeatures.h @@ -308,10 +308,10 @@ #define X86_FEATURE_MSR_TSX_CTRL (11*32+20) /* "" MSR IA32_TSX_CTRL (Intel) implemented */ #define X86_FEATURE_SMBA (11*32+21) /* "" Slow Memory Bandwidth Allocation */ #define X86_FEATURE_BMEC (11*32+22) /* "" Bandwidth Monitoring Event Configuration */ + #define X86_FEATURE_SRSO (11*32+24) /* "" AMD BTB untrain RETs */ #define X86_FEATURE_SRSO_ALIAS (11*32+25) /* "" AMD BTB untrain RETs through aliasing */ #define X86_FEATURE_IBPB_ON_VMEXIT (11*32+26) /* "" Issue an IBPB only on VMEXIT */ -#define X86_FEATURE_APIC_MSRS_FENCE (11*32+27) /* "" IA32_TSC_DEADLINE and X2APIC MSRs need fencing */ /* Intel-defined CPU features, CPUID level 0x00000007:1 (EAX), word 12 */ #define X86_FEATURE_AVX_VNNI (12*32+ 4) /* AVX VNNI instructions */ reverted: --- linux-6.5.0/arch/x86/include/asm/jump_label.h +++ linux-6.5.0.orig/arch/x86/include/asm/jump_label.h @@ -24,7 +24,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool branch) { + asm_volatile_goto("1:" - asm goto("1:" "jmp %l[l_yes] # objtool NOPs this \n\t" JUMP_TABLE_ENTRY : : "i" (key), "i" (2 | branch) : : l_yes); @@ -38,7 +38,7 @@ static __always_inline bool arch_static_branch(struct static_key * const key, const bool branch) { + asm_volatile_goto("1:" - asm goto("1:" ".byte " __stringify(BYTES_NOP5) "\n\t" JUMP_TABLE_ENTRY : : "i" (key), "i" (branch) : : l_yes); @@ -52,7 +52,7 @@ static __always_inline bool arch_static_branch_jump(struct static_key * const key, const bool branch) { + asm_volatile_goto("1:" - asm goto("1:" "jmp %l[l_yes]\n\t" JUMP_TABLE_ENTRY : : "i" (key), "i" (branch) : : l_yes); diff -u linux-6.5.0/arch/x86/include/asm/processor.h linux-6.5.0/arch/x86/include/asm/processor.h --- linux-6.5.0/arch/x86/include/asm/processor.h +++ linux-6.5.0/arch/x86/include/asm/processor.h @@ -727,20 +727,2 @@ -/* - * Make previous memory operations globally visible before - * a WRMSR. - * - * MFENCE makes writes visible, but only affects load/store - * instructions. WRMSR is unfortunately not a load/store - * instruction and is unaffected by MFENCE. The LFENCE ensures - * that the WRMSR is not reordered. - * - * Most WRMSRs are full serializing instructions themselves and - * do not require this barrier. This is only required for the - * IA32_TSC_DEADLINE and X2APIC MSRs. - */ -static inline void weak_wrmsr_fence(void) -{ - alternative("mfence; lfence", "", ALT_NOT(X86_FEATURE_APIC_MSRS_FENCE)); -} - #endif /* _ASM_X86_PROCESSOR_H */ reverted: --- linux-6.5.0/arch/x86/include/asm/rmwcc.h +++ linux-6.5.0.orig/arch/x86/include/asm/rmwcc.h @@ -18,7 +18,7 @@ #define __GEN_RMWcc(fullop, _var, cc, clobbers, ...) \ ({ \ bool c = false; \ + asm_volatile_goto (fullop "; j" #cc " %l[cc_label]" \ - asm goto (fullop "; j" #cc " %l[cc_label]" \ : : [var] "m" (_var), ## __VA_ARGS__ \ : clobbers : cc_label); \ if (0) { \ diff -u linux-6.5.0/arch/x86/include/asm/uaccess.h linux-6.5.0/arch/x86/include/asm/uaccess.h --- linux-6.5.0/arch/x86/include/asm/uaccess.h +++ linux-6.5.0/arch/x86/include/asm/uaccess.h @@ -133,7 +133,7 @@ #ifdef CONFIG_X86_32 #define __put_user_goto_u64(x, addr, label) \ - asm goto("\n" \ + asm_volatile_goto("\n" \ "1: movl %%eax,0(%1)\n" \ "2: movl %%edx,4(%1)\n" \ _ASM_EXTABLE_UA(1b, %l2) \ @@ -295,7 +295,7 @@ } while (0) #define __get_user_asm(x, addr, itype, ltype, label) \ - asm_goto_output("\n" \ + asm_volatile_goto("\n" \ "1: mov"itype" %[umem],%[output]\n" \ _ASM_EXTABLE_UA(1b, %l2) \ : [output] ltype(x) \ @@ -375,7 +375,7 @@ __typeof__(_ptr) _old = (__typeof__(_ptr))(_pold); \ __typeof__(*(_ptr)) __old = *_old; \ __typeof__(*(_ptr)) __new = (_new); \ - asm_goto_output("\n" \ + asm_volatile_goto("\n" \ "1: " LOCK_PREFIX "cmpxchg"itype" %[new], %[ptr]\n"\ _ASM_EXTABLE_UA(1b, %l[label]) \ : CC_OUT(z) (success), \ @@ -394,7 +394,7 @@ __typeof__(_ptr) _old = (__typeof__(_ptr))(_pold); \ __typeof__(*(_ptr)) __old = *_old; \ __typeof__(*(_ptr)) __new = (_new); \ - asm_goto_output("\n" \ + asm_volatile_goto("\n" \ "1: " LOCK_PREFIX "cmpxchg8b %[ptr]\n" \ _ASM_EXTABLE_UA(1b, %l[label]) \ : CC_OUT(z) (success), \ @@ -477,7 +477,7 @@ * aliasing issues. */ #define __put_user_goto(x, addr, itype, ltype, label) \ - asm goto("\n" \ + asm_volatile_goto("\n" \ "1: mov"itype" %0,%1\n" \ _ASM_EXTABLE_UA(1b, %l2) \ : : ltype(x), "m" (__m(addr)) \ diff -u linux-6.5.0/arch/x86/include/asm/virtext.h linux-6.5.0/arch/x86/include/asm/virtext.h --- linux-6.5.0/arch/x86/include/asm/virtext.h +++ linux-6.5.0/arch/x86/include/asm/virtext.h @@ -43,9 +43,9 @@ */ static inline int cpu_vmxoff(void) { - asm goto("1: vmxoff\n\t" - _ASM_EXTABLE(1b, %l[fault]) - ::: "cc", "memory" : fault); + asm_volatile_goto("1: vmxoff\n\t" + _ASM_EXTABLE(1b, %l[fault]) + ::: "cc", "memory" : fault); cr4_clear_bits(X86_CR4_VMXE); return 0; @@ -129,9 +129,9 @@ * case, GIF must already be set, otherwise the NMI would have * been blocked, so just eat the fault. */ - asm goto("1: stgi\n\t" - _ASM_EXTABLE(1b, %l[fault]) - ::: "memory" : fault); + asm_volatile_goto("1: stgi\n\t" + _ASM_EXTABLE(1b, %l[fault]) + ::: "memory" : fault); fault: wrmsrl(MSR_EFER, efer & ~EFER_SVME); } diff -u linux-6.5.0/arch/x86/kernel/cpu/amd.c linux-6.5.0/arch/x86/kernel/cpu/amd.c --- linux-6.5.0/arch/x86/kernel/cpu/amd.c +++ linux-6.5.0/arch/x86/kernel/cpu/amd.c @@ -1157,9 +1157,6 @@ if (!cpu_has(c, X86_FEATURE_HYPERVISOR) && cpu_has_amd_erratum(c, amd_erratum_1485)) msr_set_bit(MSR_ZEN4_BP_CFG, MSR_ZEN4_BP_CFG_SHARED_BTB_FIX_BIT); - - /* AMD CPUs don't need fencing after x2APIC/TSC_DEADLINE MSR writes. */ - clear_cpu_cap(c, X86_FEATURE_APIC_MSRS_FENCE); } #ifdef CONFIG_X86_32 diff -u linux-6.5.0/arch/x86/kernel/cpu/common.c linux-6.5.0/arch/x86/kernel/cpu/common.c --- linux-6.5.0/arch/x86/kernel/cpu/common.c +++ linux-6.5.0/arch/x86/kernel/cpu/common.c @@ -1848,13 +1848,6 @@ c->apicid = apic->phys_pkg_id(c->initial_apicid, 0); #endif - - /* - * Set default APIC and TSC_DEADLINE MSR fencing flag. AMD and - * Hygon will clear it in ->c_init() below. - */ - set_cpu_cap(c, X86_FEATURE_APIC_MSRS_FENCE); - /* * Vendor-specific initialization. In this section we * canonicalize the feature flags, meaning if there are diff -u linux-6.5.0/arch/x86/kernel/cpu/hygon.c linux-6.5.0/arch/x86/kernel/cpu/hygon.c --- linux-6.5.0/arch/x86/kernel/cpu/hygon.c +++ linux-6.5.0/arch/x86/kernel/cpu/hygon.c @@ -347,9 +347,6 @@ set_cpu_bug(c, X86_BUG_SYSRET_SS_ATTRS); check_null_seg_clears_base(c); - - /* Hygon CPUs don't need fencing after x2APIC/TSC_DEADLINE MSR writes. */ - clear_cpu_cap(c, X86_FEATURE_APIC_MSRS_FENCE); } static void cpu_detect_tlb_hygon(struct cpuinfo_x86 *c) reverted: --- linux-6.5.0/arch/x86/kernel/fpu/signal.c +++ linux-6.5.0.orig/arch/x86/kernel/fpu/signal.c @@ -274,13 +274,12 @@ * Attempt to restore the FPU registers directly from user memory. * Pagefaults are handled and any errors returned are fatal. */ +static bool restore_fpregs_from_user(void __user *buf, u64 xrestore, + bool fx_only, unsigned int size) -static bool restore_fpregs_from_user(void __user *buf, u64 xrestore, bool fx_only) { struct fpu *fpu = ¤t->thread.fpu; int ret; - /* Restore enabled features only. */ - xrestore &= fpu->fpstate->user_xfeatures; retry: fpregs_lock(); /* Ensure that XFD is up to date */ @@ -310,7 +309,7 @@ if (ret != X86_TRAP_PF) return false; + if (!fault_in_readable(buf, size)) - if (!fault_in_readable(buf, fpu->fpstate->user_size)) goto retry; return false; } @@ -340,6 +339,7 @@ struct user_i387_ia32_struct env; bool success, fx_only = false; union fpregs_state *fpregs; + unsigned int state_size; u64 user_xfeatures = 0; if (use_xsave()) { @@ -349,14 +349,17 @@ return false; fx_only = !fx_sw_user.magic1; + state_size = fx_sw_user.xstate_size; user_xfeatures = fx_sw_user.xfeatures; } else { user_xfeatures = XFEATURE_MASK_FPSSE; + state_size = fpu->fpstate->user_size; } if (likely(!ia32_fxstate)) { /* Restore the FPU registers directly from user memory. */ + return restore_fpregs_from_user(buf_fx, user_xfeatures, fx_only, + state_size); - return restore_fpregs_from_user(buf_fx, user_xfeatures, fx_only); } /* reverted: --- linux-6.5.0/arch/x86/kvm/svm/svm_ops.h +++ linux-6.5.0.orig/arch/x86/kvm/svm/svm_ops.h @@ -8,7 +8,7 @@ #define svm_asm(insn, clobber...) \ do { \ + asm_volatile_goto("1: " __stringify(insn) "\n\t" \ - asm goto("1: " __stringify(insn) "\n\t" \ _ASM_EXTABLE(1b, %l[fault]) \ ::: clobber : fault); \ return; \ @@ -18,7 +18,7 @@ #define svm_asm1(insn, op1, clobber...) \ do { \ + asm_volatile_goto("1: " __stringify(insn) " %0\n\t" \ - asm goto("1: " __stringify(insn) " %0\n\t" \ _ASM_EXTABLE(1b, %l[fault]) \ :: op1 : clobber : fault); \ return; \ @@ -28,7 +28,7 @@ #define svm_asm2(insn, op1, op2, clobber...) \ do { \ + asm_volatile_goto("1: " __stringify(insn) " %1, %0\n\t" \ - asm goto("1: " __stringify(insn) " %1, %0\n\t" \ _ASM_EXTABLE(1b, %l[fault]) \ :: op1, op2 : clobber : fault); \ return; \ diff -u linux-6.5.0/arch/x86/kvm/vmx/pmu_intel.c linux-6.5.0/arch/x86/kvm/vmx/pmu_intel.c --- linux-6.5.0/arch/x86/kvm/vmx/pmu_intel.c +++ linux-6.5.0/arch/x86/kvm/vmx/pmu_intel.c @@ -43,7 +43,7 @@ static void reprogram_fixed_counters(struct kvm_pmu *pmu, u64 data) { struct kvm_pmc *pmc; - u64 old_fixed_ctr_ctrl = pmu->fixed_ctr_ctrl; + u8 old_fixed_ctr_ctrl = pmu->fixed_ctr_ctrl; int i; pmu->fixed_ctr_ctrl = data; diff -u linux-6.5.0/arch/x86/kvm/vmx/vmx.c linux-6.5.0/arch/x86/kvm/vmx/vmx.c --- linux-6.5.0/arch/x86/kvm/vmx/vmx.c +++ linux-6.5.0/arch/x86/kvm/vmx/vmx.c @@ -2773,7 +2773,7 @@ cr4_set_bits(X86_CR4_VMXE); - asm goto("1: vmxon %[vmxon_pointer]\n\t" + asm_volatile_goto("1: vmxon %[vmxon_pointer]\n\t" _ASM_EXTABLE(1b, %l[fault]) : : [vmxon_pointer] "m"(vmxon_pointer) : : fault); reverted: --- linux-6.5.0/arch/x86/kvm/vmx/vmx_ops.h +++ linux-6.5.0.orig/arch/x86/kvm/vmx/vmx_ops.h @@ -94,7 +94,7 @@ #ifdef CONFIG_CC_HAS_ASM_GOTO_OUTPUT + asm_volatile_goto("1: vmread %[field], %[output]\n\t" - asm_goto_output("1: vmread %[field], %[output]\n\t" "jna %l[do_fail]\n\t" _ASM_EXTABLE(1b, %l[do_exception]) @@ -188,7 +188,7 @@ #define vmx_asm1(insn, op1, error_args...) \ do { \ + asm_volatile_goto("1: " __stringify(insn) " %0\n\t" \ - asm goto("1: " __stringify(insn) " %0\n\t" \ ".byte 0x2e\n\t" /* branch not taken hint */ \ "jna %l[error]\n\t" \ _ASM_EXTABLE(1b, %l[fault]) \ @@ -205,7 +205,7 @@ #define vmx_asm2(insn, op1, op2, error_args...) \ do { \ + asm_volatile_goto("1: " __stringify(insn) " %1, %0\n\t" \ - asm goto("1: " __stringify(insn) " %1, %0\n\t" \ ".byte 0x2e\n\t" /* branch not taken hint */ \ "jna %l[error]\n\t" \ _ASM_EXTABLE(1b, %l[fault]) \ diff -u linux-6.5.0/arch/x86/kvm/x86.c linux-6.5.0/arch/x86/kvm/x86.c --- linux-6.5.0/arch/x86/kvm/x86.c +++ linux-6.5.0/arch/x86/kvm/x86.c @@ -5304,8 +5304,7 @@ if (events->flags & KVM_VCPUEVENT_VALID_NMI_PENDING) { vcpu->arch.nmi_pending = 0; atomic_set(&vcpu->arch.nmi_queued, events->nmi.pending); - if (events->nmi.pending) - kvm_make_request(KVM_REQ_NMI, vcpu); + kvm_make_request(KVM_REQ_NMI, vcpu); } static_call(kvm_x86_set_nmi_mask)(vcpu, events->nmi.masked); reverted: --- linux-6.5.0/arch/x86/lib/getuser.S +++ linux-6.5.0.orig/arch/x86/lib/getuser.S @@ -163,23 +163,23 @@ #endif /* get_user */ + _ASM_EXTABLE(1b, __get_user_handle_exception) + _ASM_EXTABLE(2b, __get_user_handle_exception) + _ASM_EXTABLE(3b, __get_user_handle_exception) - _ASM_EXTABLE_UA(1b, __get_user_handle_exception) - _ASM_EXTABLE_UA(2b, __get_user_handle_exception) - _ASM_EXTABLE_UA(3b, __get_user_handle_exception) #ifdef CONFIG_X86_64 + _ASM_EXTABLE(4b, __get_user_handle_exception) - _ASM_EXTABLE_UA(4b, __get_user_handle_exception) #else + _ASM_EXTABLE(4b, __get_user_8_handle_exception) + _ASM_EXTABLE(5b, __get_user_8_handle_exception) - _ASM_EXTABLE_UA(4b, __get_user_8_handle_exception) - _ASM_EXTABLE_UA(5b, __get_user_8_handle_exception) #endif /* __get_user */ + _ASM_EXTABLE(6b, __get_user_handle_exception) + _ASM_EXTABLE(7b, __get_user_handle_exception) + _ASM_EXTABLE(8b, __get_user_handle_exception) - _ASM_EXTABLE_UA(6b, __get_user_handle_exception) - _ASM_EXTABLE_UA(7b, __get_user_handle_exception) - _ASM_EXTABLE_UA(8b, __get_user_handle_exception) #ifdef CONFIG_X86_64 + _ASM_EXTABLE(9b, __get_user_handle_exception) - _ASM_EXTABLE_UA(9b, __get_user_handle_exception) #else + _ASM_EXTABLE(9b, __get_user_8_handle_exception) + _ASM_EXTABLE(10b, __get_user_8_handle_exception) - _ASM_EXTABLE_UA(9b, __get_user_8_handle_exception) - _ASM_EXTABLE_UA(10b, __get_user_8_handle_exception) #endif diff -u linux-6.5.0/arch/x86/lib/putuser.S linux-6.5.0/arch/x86/lib/putuser.S --- linux-6.5.0/arch/x86/lib/putuser.S +++ linux-6.5.0/arch/x86/lib/putuser.S @@ -136,13 +136,13 @@ - _ASM_EXTABLE_UA(1b, __put_user_handle_exception) - _ASM_EXTABLE_UA(2b, __put_user_handle_exception) - _ASM_EXTABLE_UA(3b, __put_user_handle_exception) - _ASM_EXTABLE_UA(4b, __put_user_handle_exception) - _ASM_EXTABLE_UA(5b, __put_user_handle_exception) - _ASM_EXTABLE_UA(6b, __put_user_handle_exception) - _ASM_EXTABLE_UA(7b, __put_user_handle_exception) - _ASM_EXTABLE_UA(9b, __put_user_handle_exception) + _ASM_EXTABLE(1b, __put_user_handle_exception) + _ASM_EXTABLE(2b, __put_user_handle_exception) + _ASM_EXTABLE(3b, __put_user_handle_exception) + _ASM_EXTABLE(4b, __put_user_handle_exception) + _ASM_EXTABLE(5b, __put_user_handle_exception) + _ASM_EXTABLE(6b, __put_user_handle_exception) + _ASM_EXTABLE(7b, __put_user_handle_exception) + _ASM_EXTABLE(9b, __put_user_handle_exception) #ifdef CONFIG_X86_32 - _ASM_EXTABLE_UA(8b, __put_user_handle_exception) - _ASM_EXTABLE_UA(10b, __put_user_handle_exception) + _ASM_EXTABLE(8b, __put_user_handle_exception) + _ASM_EXTABLE(10b, __put_user_handle_exception) #endif reverted: --- linux-6.5.0/arch/x86/mm/ident_map.c +++ linux-6.5.0.orig/arch/x86/mm/ident_map.c @@ -26,31 +26,18 @@ for (; addr < end; addr = next) { pud_t *pud = pud_page + pud_index(addr); pmd_t *pmd; - bool use_gbpage; next = (addr & PUD_MASK) + PUD_SIZE; if (next > end) next = end; + if (info->direct_gbpages) { + pud_t pudval; - /* if this is already a gbpage, this portion is already mapped */ - if (pud_large(*pud)) - continue; - - /* Is using a gbpage allowed? */ - use_gbpage = info->direct_gbpages; + if (pud_present(*pud)) + continue; - /* Don't use gbpage if it maps more than the requested region. */ - /* at the begining: */ - use_gbpage &= ((addr & ~PUD_MASK) == 0); - /* ... or at the end: */ - use_gbpage &= ((next & ~PUD_MASK) == 0); - - /* Never overwrite existing mappings */ - use_gbpage &= !pud_present(*pud); - - if (use_gbpage) { - pud_t pudval; + addr &= PUD_MASK; pudval = __pud((addr - info->offset) | info->page_flag); set_pud(pud, pudval); continue; reverted: --- linux-6.5.0/arch/xtensa/include/asm/cacheflush.h +++ linux-6.5.0.orig/arch/xtensa/include/asm/cacheflush.h @@ -116,9 +116,8 @@ #define flush_cache_mm(mm) flush_cache_all() #define flush_cache_dup_mm(mm) flush_cache_mm(mm) +#define flush_cache_vmap(start,end) flush_cache_all() +#define flush_cache_vunmap(start,end) flush_cache_all() -#define flush_cache_vmap(start,end) flush_cache_all() -#define flush_cache_vmap_early(start,end) do { } while (0) -#define flush_cache_vunmap(start,end) flush_cache_all() #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1 void flush_dcache_page(struct page *); @@ -135,7 +134,6 @@ #define flush_cache_dup_mm(mm) do { } while (0) #define flush_cache_vmap(start,end) do { } while (0) -#define flush_cache_vmap_early(start,end) do { } while (0) #define flush_cache_vunmap(start,end) do { } while (0) #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0 reverted: --- linux-6.5.0/arch/xtensa/include/asm/jump_label.h +++ linux-6.5.0.orig/arch/xtensa/include/asm/jump_label.h @@ -13,7 +13,7 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool branch) { + asm_volatile_goto("1:\n\t" - asm goto("1:\n\t" "_nop\n\t" ".pushsection __jump_table, \"aw\"\n\t" ".word 1b, %l[l_yes], %c0\n\t" @@ -38,7 +38,7 @@ * make it reachable and wrap both into a no-transform block * to avoid any assembler interference with this. */ + asm_volatile_goto("1:\n\t" - asm goto("1:\n\t" ".begin no-transform\n\t" "_j %l[l_yes]\n\t" "2:\n\t" reverted: --- linux-6.5.0/block/blk-iocost.c +++ linux-6.5.0.orig/block/blk-iocost.c @@ -1353,13 +1353,6 @@ lockdep_assert_held(&iocg->waitq.lock); - /* - * If the delay is set by another CPU, we may be in the past. No need to - * change anything if so. This avoids decay calculation underflow. - */ - if (time_before64(now->now, iocg->delay_at)) - return false; - /* calculate the current delay in effect - 1/2 every second */ tdelta = now->now - iocg->delay_at; if (iocg->delay) diff -u linux-6.5.0/block/blk-mq.c linux-6.5.0/block/blk-mq.c --- linux-6.5.0/block/blk-mq.c +++ linux-6.5.0/block/blk-mq.c @@ -766,16 +766,11 @@ /* * Partial zone append completions cannot be supported as the * BIO fragments may end up not being written sequentially. - * For such case, force the completed nbytes to be equal to - * the BIO size so that bio_advance() sets the BIO remaining - * size to 0 and we end up calling bio_endio() before returning. */ - if (bio->bi_iter.bi_size != nbytes) { + if (bio->bi_iter.bi_size != nbytes) bio->bi_status = BLK_STS_IOERR; - nbytes = bio->bi_iter.bi_size; - } else { + else bio->bi_iter.bi_sector = rq->__sector; - } } bio_advance(bio, nbytes); reverted: --- linux-6.5.0/block/blk-wbt.c +++ linux-6.5.0.orig/block/blk-wbt.c @@ -165,9 +165,9 @@ */ static bool wb_recent_wait(struct rq_wb *rwb) { + struct bdi_writeback *wb = &rwb->rqos.disk->bdi->wb; - struct backing_dev_info *bdi = rwb->rqos.disk->bdi; + return time_before(jiffies, wb->dirty_sleep + HZ); - return time_before(jiffies, bdi->last_bdp_sleep + HZ); } static inline struct rq_wait *get_rq_wait(struct rq_wb *rwb, reverted: --- linux-6.5.0/crypto/algif_hash.c +++ linux-6.5.0.orig/crypto/algif_hash.c @@ -91,13 +91,13 @@ if (!(msg->msg_flags & MSG_MORE)) { err = hash_alloc_result(sk, ctx); if (err) + goto unlock_free; - goto unlock_free_result; ahash_request_set_crypt(&ctx->req, NULL, ctx->result, 0); err = crypto_wait_req(crypto_ahash_final(&ctx->req), &ctx->wait); if (err) + goto unlock_free; - goto unlock_free_result; } goto done_more; } @@ -170,7 +170,6 @@ unlock_free: af_alg_free_sg(&ctx->sgl); -unlock_free_result: hash_free_result(sk, ctx); ctx->more = false; goto unlock; diff -u linux-6.5.0/debian.master/changelog linux-6.5.0/debian.master/changelog --- linux-6.5.0/debian.master/changelog +++ linux-6.5.0/debian.master/changelog @@ -1,504 +1,6 @@ -linux (6.5.0-39.39) mantic; urgency=medium +linux (6.5.0-40.40) mantic; urgency=medium - * mantic/linux: 6.5.0-39.39 -proposed tracker (LP: #2063709) - - * RTL8852BE fw security fail then lost WIFI function during suspend/resume - cycle (LP: #2063096) - - wifi: rtw89: download firmware with five times retry - - * Fix bluetooth connections with 3.0 device (LP: #2063067) - - Bluetooth: hci_event: Fix handling of HCI_EV_IO_CAPA_REQUEST - - * cifs: Copying file to same directory results in page fault (LP: #2060919) - - SAUCE: Revert "cifs: fix flushing folio regression for 6.1 backport" - - * USB stick can't be detected (LP: #2040948) - - usb: Disable USB3 LPM at shutdown - - * CVE-2024-26733 - - arp: Prevent overflow in arp_req_get(). - - * CVE-2024-26736 - - afs: Increase buffer size in afs_update_volume_status() - - * CVE-2024-26801 - - Bluetooth: Avoid potential use-after-free in hci_error_reset - - * CVE-2024-26805 - - netlink: Fix kernel-infoleak-after-free in __skb_datagram_iter - - * CVE-2024-26809 - - netfilter: nft_set_pipapo: release elements in clone only from destroy path - - * CVE-2024-26792 - - btrfs: fix double free of anonymous device after snapshot creation failure - - * CVE-2024-26782 - - mptcp: fix double-free on socket dismantle - - * CVE-2024-26748 - - usb: cdns3: fix memory double free when handle zero packet - - * CVE-2024-26735 - - ipv6: sr: fix possible use-after-free and null-ptr-deref - - * CVE-2024-26789 - - crypto: arm64/neonbs - fix out-of-bounds access on short input - - * CVE-2024-26734 - - devlink: fix possible use-after-free and memory leaks in devlink_init() - - * The keyboard does not work after latest kernel update (LP: #2060727) - - Input: atkbd - do not skip atkbd_deactivate() when skipping ATKBD_CMD_GETID - - * proc_sched_rt01 from ubuntu_ltp failed (LP: #2057734) - - sched/rt: sysctl_sched_rr_timeslice show default timeslice after reset - - sched/rt: Disallow writing invalid values to sched_rt_period_us - - * Avoid creating non-working backlight sysfs knob from ASUS board - (LP: #2060422) - - platform/x86: asus-wmi: Consider device is absent when the read is ~0 - - * [Ubuntu 22.04.4/linux-image-6.5.0-26-generic] Kernel output "UBSAN: array- - index-out-of-bounds in /build/linux-hwe-6.5-34pCLi/linux- - hwe-6.5-6.5.0/drivers/net/hyperv/netvsc.c:1445:41" multiple times, - especially during boot. (LP: #2058477) - - hv: hyperv.h: Replace one-element array with flexible-array member - - * Fix acpi_power_meter accessing IPMI region before it's ready (LP: #2059263) - - ACPI: IPMI: Add helper to wait for when SMI is selected - - hwmon: (acpi_power_meter) Ensure IPMI space handler is ready on Dell systems - - * Include cifs.ko in linux-modules package (LP: #2042546) - - [Packaging] Replace fs/cifs with fs/smb/client in inclusion list - - * Mantic update: upstream stable patchset 2024-04-16 (LP: #2061814) - - btrfs: add and use helper to check if block group is used - - btrfs: do not delete unused block group if it may be used soon - - btrfs: forbid creating subvol qgroups - - btrfs: forbid deleting live subvol qgroup - - btrfs: send: return EOPNOTSUPP on unknown flags - - btrfs: don't reserve space for checksums when writing to nocow files - - btrfs: reject encoded write if inode has nodatasum flag set - - btrfs: don't drop extent_map for free space inode on write error - - driver core: Fix device_link_flag_is_sync_state_only() - - of: unittest: Fix compile in the non-dynamic case - - KVM: selftests: Fix a semaphore imbalance in the dirty ring logging test - - wifi: iwlwifi: Fix some error codes - - wifi: iwlwifi: uninitialized variable in iwl_acpi_get_ppag_table() - - of: property: Improve finding the supplier of a remote-endpoint property - - net: openvswitch: limit the number of recursions from action sets - - lan966x: Fix crash when adding interface under a lag - - spi: ppc4xx: Drop write-only variable - - ASoC: rt5645: Fix deadlock in rt5645_jack_detect_work() - - net: sysfs: Fix /sys/class/net/ path for statistics - - nouveau/svm: fix kvcalloc() argument order - - MIPS: Add 'memory' clobber to csum_ipv6_magic() inline assembler - - i40e: Do not allow untrusted VF to remove administratively set MAC - - i40e: Fix waiting for queues of all VSIs to be disabled - - scs: add CONFIG_MMU dependency for vfree_atomic() - - tracing/trigger: Fix to return error if failed to alloc snapshot - - mm/writeback: fix possible divide-by-zero in wb_dirty_limits(), again - - scsi: storvsc: Fix ring buffer size calculation - - dm-crypt, dm-verity: disable tasklets - - ASoC: amd: yc: Add DMI quirk for MSI Bravo 15 C7VF - - parisc: Prevent hung tasks when printing inventory on serial console - - ALSA: hda/realtek: Fix the external mic not being recognised for Acer Swift - 1 SF114-32 - - ALSA: hda/realtek: Enable Mute LED on HP Laptop 14-fq0xxx - - HID: i2c-hid-of: fix NULL-deref on failed power up - - HID: wacom: generic: Avoid reporting a serial of '0' to userspace - - HID: wacom: Do not register input devices until after hid_hw_start - - iio: hid-sensor-als: Return 0 for HID_USAGE_SENSOR_TIME_TIMESTAMP - - usb: ucsi: Add missing ppm_lock - - usb: ulpi: Fix debugfs directory leak - - usb: ucsi_acpi: Fix command completion handling - - USB: hub: check for alternate port before enabling A_ALT_HNP_SUPPORT - - usb: f_mass_storage: forbid async queue when shutdown happen - - usb: dwc3: gadget: Fix NULL pointer dereference in dwc3_gadget_suspend - - interconnect: qcom: sc8180x: Mark CO0 BCM keepalive - - media: ir_toy: fix a memleak in irtoy_tx - - driver core: fw_devlink: Improve detection of overlapping cycles - - cifs: fix underflow in parse_server_interfaces() - - i2c: qcom-geni: Correct I2C TRE sequence - - irqchip/loongson-eiointc: Use correct struct type in eiointc_domain_alloc() - - i2c: pasemi: split driver into two separate modules - - modpost: trim leading spaces when processing source files list - - mptcp: get rid of msk->subflow - - mptcp: fix data re-injection from stale subflow - - selftests: mptcp: add missing kconfig for NF Filter - - selftests: mptcp: add missing kconfig for NF Filter in v6 - - selftests: mptcp: add missing kconfig for NF Mangle - - selftests: mptcp: increase timeout to 30 min - - mptcp: drop the push_pending field - - mptcp: check addrs list in userspace_pm_get_local_id - - scsi: Revert "scsi: fcoe: Fix potential deadlock on &fip->ctlr_lock" - - Revert "drm/amd: flush any delayed gfxoff on suspend entry" - - drm/virtio: Set segment size for virtio_gpu device - - lsm: fix the logic in security_inode_getsecctx() - - firewire: core: correct documentation of fw_csr_string() kernel API - - ALSA: hda/realtek: Apply headset jack quirk for non-bass alc287 thinkpads - - kbuild: Fix changing ELF file type for output of gen_btf for big endian - - nfc: nci: free rx_data_reassembly skb on NCI device cleanup - - net: hsr: remove WARN_ONCE() in send_hsr_supervision_frame() - - net: stmmac: do not clear TBS enable bit on link up/down - - xen-netback: properly sync TX responses - - modpost: Don't let "driver"s reference .exit.* - - linux/init: remove __memexit* annotations - - um: Fix adding '-no-pie' for clang - - modpost: Add '.ltext' and '.ltext.*' to TEXT_SECTIONS - - ALSA: hda/realtek: Enable headset mic on Vaio VJFE-ADL - - ASoC: codecs: wcd938x: handle deferred probe - - ALSA: hda/realtek: fix mute/micmute LEDs for HP ZBook Power - - binder: signal epoll threads of self-work - - misc: fastrpc: Mark all sessions as invalid in cb_remove - - ext4: avoid bb_free and bb_fragments inconsistency in mb_free_blocks() - - tracing: Fix wasted memory in saved_cmdlines logic - - staging: iio: ad5933: fix type mismatch regression - - iio: magnetometer: rm3100: add boundary check for the value read from - RM3100_REG_TMRC - - iio: core: fix memleak in iio_device_register_sysfs - - iio: commom: st_sensors: ensure proper DMA alignment - - iio: accel: bma400: Fix a compilation problem - - iio: adc: ad_sigma_delta: ensure proper DMA alignment - - iio: imu: adis: ensure proper DMA alignment - - iio: imu: bno055: serdev requires REGMAP - - media: rc: bpf attach/detach requires write permission - - ksmbd: free aux buffer if ksmbd_iov_pin_rsp_read fails - - drm/msm: Wire up tlb ops - - drm/prime: Support page array >= 4GB - - drm/amd/display: Increase frame-larger-than for all display_mode_vba files - - drm/amd/display: Preserve original aspect ratio in create stream - - hv_netvsc: Fix race condition between netvsc_probe and netvsc_remove - - ring-buffer: Clean ring_buffer_poll_wait() error return - - nfp: flower: fix hardware offload for the transfer layer port - - serial: max310x: set default value when reading clock ready bit - - serial: max310x: improve crystal stable clock detection - - serial: max310x: fail probe if clock crystal is unstable - - serial: max310x: prevent infinite while() loop in port startup - - powerpc/64: Set task pt_regs->link to the LR value on scv entry - - powerpc/cputable: Add missing PPC_FEATURE_BOOKE on PPC64 Book-E - - powerpc/pseries: fix accuracy of stolen time - - x86/Kconfig: Transmeta Crusoe is CPU family 5, not 6 - - x86/fpu: Stop relying on userspace for info to fault in xsave buffer - - KVM: x86/pmu: Fix type length error when reading pmu->fixed_ctr_ctrl - - x86/mm/ident_map: Use gbpages only where full GB page should be mapped. - - io_uring/net: fix multishot accept overflow handling - - mmc: slot-gpio: Allow non-sleeping GPIO ro - - ALSA: hda/realtek: fix mute/micmute LED For HP mt645 - - ALSA: hda/conexant: Add quirk for SWS JS201D - - nilfs2: fix data corruption in dsync block recovery for small block sizes - - nilfs2: fix hang in nilfs_lookup_dirty_data_buffers() - - crypto: ccp - Fix null pointer dereference in __sev_platform_shutdown_locked - - nfp: use correct macro for LengthSelect in BAR config - - nfp: flower: prevent re-adding mac index for bonded port - - wifi: cfg80211: fix wiphy delayed work queueing - - wifi: mac80211: reload info pointer in ieee80211_tx_dequeue() - - irqchip/irq-brcmstb-l2: Add write memory barrier before exit - - irqchip/gic-v3-its: Fix GICv4.1 VPE affinity update - - zonefs: Improve error handling - - mmc: sdhci-pci-o2micro: Fix a warm reboot issue that disk can't be detected - by BIOS - - ASoC: amd: yc: Add DMI quirk for Lenovo Ideapad Pro 5 16ARP8 - - tools/rtla: Remove unused sched_getattr() function - - tools/rtla: Replace setting prio with nice for SCHED_OTHER - - tools/rtla: Exit with EXIT_SUCCESS when help is invoked - - tools/rtla: Fix uninitialized bucket/data->bucket_size warning - - tools/rtla: Fix Makefile compiler options for clang - - fs: relax mount_setattr() permission checks - - net: ethernet: ti: cpsw: enable mac_managed_pm to fix mdio - - s390/qeth: Fix potential loss of L3-IP@ in case of network issues - - net: ethernet: ti: cpsw_new: enable mac_managed_pm to fix mdio - - hv_netvsc: Register VF in netvsc_probe if NET_DEVICE_REGISTER missed - - ceph: prevent use-after-free in encode_cap_msg() - - fs,hugetlb: fix NULL pointer dereference in hugetlbs_fill_super - - mm: hugetlb pages should not be reserved by shmat() if SHM_NORESERVE - - of: property: fix typo in io-channels - - can: netlink: Fix TDCO calculation using the old data bittiming - - can: j1939: prevent deadlock by changing j1939_socks_lock to rwlock - - can: j1939: Fix UAF in j1939_sk_match_filter during - setsockopt(SO_J1939_FILTER) - - pmdomain: core: Move the unused cleanup to a _sync initcall - - fs/proc: do_task_stat: move thread_group_cputime_adjusted() outside of - lock_task_sighand() - - tracing: Inform kmemleak of saved_cmdlines allocation - - selftests/mm: ksm_tests should only MADV_HUGEPAGE valid memory - - selftests/mm: Update va_high_addr_switch.sh to check CPU for la57 flag - - md: bypass block throttle for superblock update - - block: fix partial zone append completion handling in req_bio_endio() - - netfilter: ipset: Missing gc cancellations fixed - - parisc: Fix random data corruption from exception handler - - nfsd: don't take fi_lock in nfsd_break_deleg_cb() - - sched/membarrier: reduce the ability to hammer on sys_membarrier - - of: property: Add in-ports/out-ports support to of_graph_get_port_parent() - - nilfs2: fix potential bug in end_buffer_async_write - - arm64: Subscribe Microsoft Azure Cobalt 100 to ARM Neoverse N2 errata - - work around gcc bugs with 'asm goto' with outputs - - [Config] updateconfigs for GCC_ASM_GOTO_OUTPUT_WORKAROUND - - update workarounds for gcc "asm goto" issue - - selftests/landlock: Fix fs_test build with old libc - - KVM: selftests: Delete superfluous, unused "stage" variable in AMX test - - KVM: selftests: Avoid infinite loop in hyperv_features when invtsc is - missing - - drm/msm/gem: Fix double resv lock aquire - - ASoC: SOF: ipc3-topology: Fix pipeline tear down logic - - net/handshake: Fix handshake_req_destroy_test1 - - bonding: do not report NETDEV_XDP_ACT_XSK_ZEROCOPY - - devlink: Fix command annotation documentation - - of: property: Improve finding the consumer of a remote-endpoint property - - perf: CXL: fix mismatched cpmu event opcode - - selftests: forwarding: Fix layer 2 miss test flakiness - - selftests: forwarding: Fix bridge MDB test flakiness - - selftests: bridge_mdb: Use MDB get instead of dump - - selftests: forwarding: Suppress grep warnings - - ptrace: Introduce exception_ip arch hook - - mm/memory: Use exception ip to search exception tables - - userfaultfd: fix mmap_changing checking in mfill_atomic_hugetlb - - selftests/mm: switch to bash from sh - - selftests: mm: fix map_hugetlb failure on 64K page size systems - - nouveau: offload fence uevents work to workqueue - - HID: bpf: remove double fdget() - - HID: bpf: actually free hdev memory after attaching a HID-BPF program - - usb: chipidea: core: handle power lost in workqueue - - usb: core: Prevent null pointer dereference in update_port_device_state - - interconnect: qcom: sm8550: Enable sync_state - - powerpc/pseries/iommu: Fix iommu initialisation during DLPAR add - - powerpc/6xx: set High BAT Enable flag on G2_LE cores - - iio: adc: ad4130: zero-initialize clock init data - - iio: adc: ad4130: only set GPIO_CTRL if pin is unused - - irqchip/gic-v3-its: Handle non-coherent GICv4 redistributors - - kallsyms: ignore ARMv4 thunks along with others - - selftests: mptcp: add mptcp_lib_kill_wait - - mptcp: fix rcv space initialization - - mptcp: really cope with fastopen race - - Revert "powerpc/pseries/iommu: Fix iommu initialisation during DLPAR add" - - drm/amd: Don't init MEC2 firmware when it fails to load - - usb: typec: tpcm: Fix issues with power being removed during reset - - tracing/timerlat: Move hrtimer_init to timerlat_fd open() - - tracing/synthetic: Fix trace_string() return value - - tracing/probes: Fix to show a parse error for bad type for $comm - - tracing/probes: Fix to set arg size and fmt after setting type from BTF - - Revert "workqueue: Override implicit ordered attribute in - workqueue_apply_unbound_cpumask()" - - iio: pressure: bmp280: Add missing bmp085 to SPI id table - - pmdomain: mediatek: fix race conditions with genpd - - drm/amd/display: Add align done check - - drm/amdgpu/soc21: update VCN 4 max HEVC encoding resolution - - drm/amd/display: Fix MST Null Ptr for RV - - net: dsa: mv88e6xxx: Fix failed probe due to unsupported C45 reads - - nfp: flower: add hardware offload check for post ct entry - - ftrace: Fix DIRECT_CALLS to use SAVE_REGS by default - - serial: core: introduce uart_port_tx_flags() - - serial: mxs-auart: fix tx - - KVM: x86: make KVM_REQ_NMI request iff NMI pending for vcpu - - crypto: algif_hash - Remove bogus SGL free on zero-length error path - - nfp: enable NETDEV_XDP_ACT_REDIRECT feature flag - - wifi: iwlwifi: mvm: fix a crash when we run out of stations - - thunderbolt: Fix setting the CNS bit in ROUTER_CS_5 - - smb: client: set correct id, uid and cruid for multiuser automounts - - KVM: arm64: Fix circular locking dependency - - arm64/signal: Don't assume that TIF_SVE means we saved SVE state - - ASoC: SOF: IPC3: fix message bounds on ipc ops - - tools/rv: Fix curr_reactor uninitialized variable - - tools/rv: Fix Makefile compiler options for clang - - tools/rtla: Fix clang warning about mount_point var size - - pmdomain: renesas: r8a77980-sysc: CR7 must be always on - - blk-wbt: Fix detection of dirty-throttled tasks - - docs: kernel_feat.py: fix build error for missing files - - tracing: Fix HAVE_DYNAMIC_FTRACE_WITH_REGS ifdef - - netfilter: ipset: fix performance regression in swap operation - - tracefs: Check for dentry->d_inode exists in set_gid() - - x86/efi: Drop EFI stub .bss from .data section - - x86/efi: Drop alignment flags from PE section headers - - x86/boot: Remove the 'bugger off' message - - x86/boot: Omit compression buffer from PE/COFF image memory footprint - - x86/boot: Drop redundant code setting the root device - - x86/boot: Drop references to startup_64 - - x86/boot: Grab kernel_info offset from zoffset header directly - - x86/boot: Set EFI handover offset directly in header asm - - x86/boot: Define setup size in linker script - - x86/boot: Derive file size from _edata symbol - - x86/boot: Construct PE/COFF .text section from assembler - - x86/boot: Drop PE/COFF .reloc section - - x86/boot: Split off PE/COFF .data section - - x86/boot: Increase section and file alignment to 4k/512 - - x86/efistub: Use 1:1 file:memory mapping for PE/COFF .compat section - - x86/barrier: Do not serialize MSR accesses on AMD - - Documentation/arch/ia64/features.rst: fix kernel-feat directive - - Upstream stable to v6.1.79, v6.6.18 - - * Mantic update: upstream stable patchset 2024-04-16 (LP: #2061814) // - CVE-2024-26694 - - wifi: iwlwifi: fix double-free bug - - * There is sound from the speakers and headphones at the same time on Oasis 14 - and 16 platforms (LP: #2054487) // Mantic update: upstream stable patchset - 2024-04-16 (LP: #2061814) - - ALSA: hda/realtek - Add speaker pin verbtable for Dell dual speaker platform - - ALSA: hda/realtek: add IDs for Dell dual spk platform - - * Mantic update: upstream stable patchset 2024-04-16 (LP: #2061814) // - CVE-2024-26704 - - ext4: fix double-free of blocks due to wrong extents moved_len - - * Mantic update: upstream stable patchset 2024-04-16 (LP: #2061814) // - CVE-2024-26710 - - powerpc/kasan: Limit KASAN thread size increase to 32KB - - * Mantic update: upstream stable patchset 2024-04-16 (LP: #2061814) // - CVE-2024-26712 - - powerpc/kasan: Fix addr error caused by page alignment - - * Mantic update: upstream stable patchset 2024-04-02 (LP: #2059991) - - ext4: regenerate buddy after block freeing failed if under fc replay - - dmaengine: fsl-dpaa2-qdma: Fix the size of dma pools - - dmaengine: ti: k3-udma: Report short packet errors - - dmaengine: fsl-qdma: Fix a memory leak related to the status queue DMA - - dmaengine: fsl-qdma: Fix a memory leak related to the queue command DMA - - phy: renesas: rcar-gen3-usb2: Fix returning wrong error code - - dmaengine: fix is_slave_direction() return false when DMA_DEV_TO_DEV - - phy: ti: phy-omap-usb2: Fix NULL pointer dereference for SRP - - cifs: failure to add channel on iface should bump up weight - - drm/msms/dp: fixed link clock divider bits be over written in BPC unknown - case - - drm/msm/dp: return correct Colorimetry for DP_TEST_DYNAMIC_RANGE_CEA case - - drm/msm/dpu: check for valid hw_pp in dpu_encoder_helper_phys_cleanup - - net: stmmac: xgmac: fix handling of DPP safety error for DMA channels - - wifi: mac80211: fix waiting for beacons logic - - netdevsim: avoid potential loop in nsim_dev_trap_report_work() - - net: atlantic: Fix DMA mapping for PTP hwts ring - - selftests: net: cut more slack for gro fwd tests. - - selftests: net: avoid just another constant wait - - tunnels: fix out of bounds access when building IPv6 PMTU error - - atm: idt77252: fix a memleak in open_card_ubr0 - - octeontx2-pf: Fix a memleak otx2_sq_init - - hwmon: (aspeed-pwm-tacho) mutex for tach reading - - hwmon: (coretemp) Fix out-of-bounds memory access - - hwmon: (coretemp) Fix bogus core_id to attr name mapping - - inet: read sk->sk_family once in inet_recv_error() - - drm/i915/gvt: Fix uninitialized variable in handle_mmio() - - rxrpc: Fix response to PING RESPONSE ACKs to a dead call - - tipc: Check the bearer type before calling tipc_udp_nl_bearer_add() - - af_unix: Call kfree_skb() for dead unix_(sk)->oob_skb in GC. - - ppp_async: limit MRU to 64K - - selftests: cmsg_ipv6: repeat the exact packet - - netfilter: nft_compat: narrow down revision to unsigned 8-bits - - netfilter: nft_compat: reject unused compat flag - - netfilter: nft_compat: restrict match/target protocol to u16 - - drm/amd/display: Implement bounds check for stream encoder creation in - DCN301 - - netfilter: nft_ct: reject direction for ct id - - fs/ntfs3: Fix an NULL dereference bug - - scsi: core: Move scsi_host_busy() out of host lock if it is for per-command - - blk-iocost: Fix an UBSAN shift-out-of-bounds warning - - ALSA: usb-audio: Add delay quirk for MOTU M Series 2nd revision - - ALSA: usb-audio: Add a quirk for Yamaha YIT-W12TX transmitter - - ALSA: usb-audio: add quirk for RODE NT-USB+ - - USB: serial: qcserial: add new usb-id for Dell Wireless DW5826e - - USB: serial: option: add Fibocom FM101-GL variant - - USB: serial: cp210x: add ID for IMST iM871A-USB - - usb: dwc3: host: Set XHCI_SG_TRB_CACHE_SIZE_QUIRK - - usb: host: xhci-plat: Add support for XHCI_SG_TRB_CACHE_SIZE_QUIRK - - hrtimer: Report offline hrtimer enqueue - - Input: i8042 - fix strange behavior of touchpad on Clevo NS70PU - - io_uring/net: fix sr->len for IORING_OP_RECV with MSG_WAITALL and buffers - - net: stmmac: xgmac: use #define for string constants - - ALSA: usb-audio: Sort quirk table entries - - net: stmmac: xgmac: fix a typo of register name in DPP safety handling - - perf evlist: Fix evlist__new_default() for > 1 core PMU - - cifs: avoid redundant calls to disable multichannel - - rust: arc: add explicit `drop()` around `Box::from_raw()` - - rust: task: remove redundant explicit link - - rust: print: use explicit link in documentation - - MAINTAINERS: add Catherine as xfs maintainer for 6.6.y - - xfs: bump max fsgeom struct version - - xfs: hoist freeing of rt data fork extent mappings - - xfs: prevent rt growfs when quota is enabled - - xfs: rt stubs should return negative errnos when rt disabled - - xfs: fix units conversion error in xfs_bmap_del_extent_delay - - xfs: make sure maxlen is still congruent with prod when rounding down - - xfs: introduce protection for drop nlink - - xfs: handle nimaps=0 from xfs_bmapi_write in xfs_alloc_file_space - - xfs: allow read IO and FICLONE to run concurrently - - xfs: factor out xfs_defer_pending_abort - - xfs: abort intent items when recovery intents fail - - xfs: only remap the written blocks in xfs_reflink_end_cow_extent - - xfs: up(ic_sema) if flushing data device fails - - xfs: fix internal error from AGFL exhaustion - - xfs: inode recovery does not validate the recovered inode - - xfs: clean up dqblk extraction - - xfs: dquot recovery does not validate the recovered dquot - - xfs: clean up FS_XFLAG_REALTIME handling in xfs_ioctl_setattr_xflags - - xfs: respect the stable writes flag on the RT device - - wifi: mac80211: fix RCU use in TDLS fast-xmit - - wifi: iwlwifi: exit eSR only after the FW does - - wifi: brcmfmac: Adjust n_channels usage for __counted_by - - selftests/net: convert unicast_extensions.sh to run it in unique namespace - - selftests/net: convert pmtu.sh to run it in unique namespace - - selftests/net: change shebang to bash to support "source" - - selftests: net: fix tcp listener handling in pmtu.sh - - tsnep: Fix mapping for zero copy XDP_TX action - - rxrpc: Fix generation of serial numbers to skip zero - - rxrpc: Fix delayed ACKs to not set the reference serial number - - rxrpc: Fix counting of new acks and nacks - - selftests: net: let big_tcp test cope with slow env - - drm/amd/display: Fix 'panel_cntl' could be null in - 'dcn21_set_backlight_level()' - - drm/amd/display: Add NULL test for 'timing generator' in 'dcn21_set_pipe()' - - riscv: Improve tlb_flush() - - riscv: Make __flush_tlb_range() loop over pte instead of flushing the whole - tlb - - riscv: Improve flush_tlb_kernel_range() - - mm: Introduce flush_cache_vmap_early() - - riscv: mm: execute local TLB flush after populating vmemmap - - riscv: Fix set_huge_pte_at() for NAPOT mapping - - riscv: Fix hugetlb_mask_last_page() when NAPOT is enabled - - riscv: Flush the tlb when a page directory is freed - - libceph: rename read_sparse_msg_*() to read_partial_sparse_msg_*() - - libceph: just wait for more data to be available on the socket - - riscv: Fix arch_hugetlb_migration_supported() for NAPOT - - riscv: declare overflow_stack as exported from traps.c - - Revert "usb: typec: tcpm: fix cc role at port reset" - - x86/lib: Revert to _ASM_EXTABLE_UA() for {get,put}_user() fixups - - xhci: process isoc TD properly when there was a transaction error mid TD. - - xhci: handle isoc Babble and Buffer Overrun events properly - - usb: dwc3: pci: add support for the Intel Arrow Lake-H - - media: solo6x10: replace max(a, min(b, c)) by clamp(b, a, c) - - io_uring/poll: move poll execution helpers higher up - - io_uring/net: un-indent mshot retry path in io_recv_finish() - - io_uring/poll: add requeue return code from poll multishot handling - - io_uring/net: limit inline multishot retries - - Upstream stable to v6.1.78, v6.6.17 - - * Mantic update: upstream stable patchset 2024-04-02 (LP: #2059991) // The - keyboard does not work after latest kernel update (LP: #2060727) - - Input: atkbd - skip ATKBD_CMD_SETLEDS when skipping ATKBD_CMD_GETID - - * Mantic update: upstream stable patchset 2024-04-02 (LP: #2059991) // - CVE-2024-26809 - - netfilter: nft_set_pipapo: store index in scratch maps - - netfilter: nft_set_pipapo: add helper to release pcpu scratch area - - netfilter: nft_set_pipapo: remove scratch_aligned pointer - - * CVE-2024-26593 - - i2c: i801: Fix block process call transactions - - * CVE-2023-47233 - - wifi: brcmfmac: Fix use-after-free bug in brcmf_cfg80211_detach - - * CVE-2024-26622 - - tomoyo: fix UAF write bug in tomoyo_write_control() - - * CVE-2024-2201 - - x86/bugs: Change commas to semicolons in 'spectre_v2' sysfs file - - x86/syscall: Don't force use of indirect calls for system calls - - x86/bhi: Add support for clearing branch history at syscall entry - - x86/bhi: Define SPEC_CTRL_BHI_DIS_S - - x86/bhi: Enumerate Branch History Injection (BHI) bug - - x86/bhi: Add BHI mitigation knob - - x86/bhi: Mitigate KVM by default - - KVM: x86: Add BHI_NO - - [Config] Set CONFIG_BHI to enabled (auto) + * mantic/linux: 6.5.0-40.40 -proposed tracker (LP: #2063709) * [Mantic] Compile broken on armhf (cc1 out of memory) (LP: #2060446) - Revert "minmax: relax check to allow comparison between unsigned arguments @@ -508,9 +10,6 @@ signedness." - Revert "minmax: add umin(a, b) and umax(a, b)" - * Packaging resync (LP: #1786013) - - [Packaging] drop getabis data - * Drop fips-checks script from trees (LP: #2055083) - [Packaging] Remove fips-checks script @@ -518,9 +17,6 @@ (LP: #2058573) - ALSA: hda/realtek: fix the hp playback volume issue for LG machines - * Remove getabis scripts (LP: #2059143) - - [Packaging] Remove getabis - * Mantic update: upstream stable patchset 2024-03-27 (LP: #2059284) - asm-generic: make sparse happy with odd-sized put_unaligned_*() - powerpc/mm: Fix null-pointer dereference in pgtable_cache_add @@ -547,7 +43,6 @@ - ACPI: APEI: set memory failure flags as MF_ACTION_REQUIRED on synchronous events - FS:JFS:UBSAN:array-index-out-of-bounds in dbAdjTree - - jfs: fix slab-out-of-bounds Read in dtSearch - jfs: fix array-index-out-of-bounds in dbAdjTree - pstore/ram: Fix crash when setting number of cpus to an odd number - crypto: octeontx2 - Fix cptvf driver cleanup @@ -852,13 +347,6 @@ - pds_core: Prevent health thread from running during reset/remove - Upstream stable to v6.1.77, v6.6.16 - * Mantic update: upstream stable patchset 2024-03-27 (LP: #2059284) // - CVE-2023-52603 - - UBSAN: array-index-out-of-bounds in dtSplitRoot - - * iwlwifi disconnect and crash - intel wifi7 (LP: #2058808) - - wifi: iwlwifi: pcie: fix RB status reading - * Mantic update: upstream stable patchset 2024-03-26 (LP: #2059068) - iio: adc: ad7091r: Set alert bit in config register - iio: adc: ad7091r: Allow users to configure device events @@ -868,7 +356,6 @@ - btrfs: sysfs: validate scrub_speed_max value - crypto: api - Disallow identical driver names - PM: hibernate: Enforce ordering during image compression/decompression - - hwrng: core - Fix page fault dead lock on mmap-ed hwrng - crypto: s390/aes - Fix buffer overread in CTR mode - s390/vfio-ap: unpin pages on gisc registration failure - PM / devfreq: Fix buffer overflow in trans_stat_show @@ -936,11 +423,9 @@ - Revert "drm/amd: Enable PCIe PME from D3" - wifi: mac80211: fix potential sta-link leak - net/smc: fix illegal rmb_desc access in SMC-D connection dump - - tcp: make sure init the accept_queue's spinlocks once - bnxt_en: Wait for FLR to complete during probe - vlan: skip nested type that is not IFLA_VLAN_QOS_MAPPING - llc: make llc_ui_sendmsg() more robust against bonding changes - - llc: Drop support for ETH_P_TR_802_2. - udp: fix busy polling - net: fix removing a namespace with conflicting altnames - tun: fix missing dropped counter in tun_xdp_act @@ -952,7 +437,6 @@ - afs: Hide silly-rename files from userspace - tcp: Add memory barrier to tcp_push() - netlink: fix potential sleeping issue in mqueue_flush_file - - ipv6: init the accept_queue's spinlocks in inet6_create - net/mlx5: DR, Use the right GVMI number for drop action - net/mlx5: DR, Can't go to uplink vport on RX rule - net/mlx5: Use mlx5 device constant for selecting CQ period mode for ASO @@ -1194,16 +678,10 @@ - net: tls: factor out tls_*crypt_async_wait() - tls: fix race between async notify and socket close - * CVE-2023-52600 - - jfs: fix uaf in jfs_evict_inode - * Fix headphone mic detection issue on ALC897 (LP: #2056418) - ALSA: hda/realtek - Fix headset Mic no show at resume back for Lenovo ALC897 platform - * CVE-2024-26581 - - netfilter: nft_set_rbtree: skip end interval element from gc - * The screen brightness is unable to adjust on BOE panel DPN#R6FD8 (LP: #2057430) - drm/amd/display: Re-add aux intercept disable delay generically for 2+ @@ -1777,6 +1255,79 @@ CVE-2024-26583 - net: tls, fix WARNIING in __sk_msg_free + -- Roxana Nicolescu Tue, 30 Apr 2024 14:51:16 +0200 + +linux (6.5.0-35.35) mantic; urgency=medium + + * mantic/linux: 6.5.0-35.35 -proposed tracker (LP: #2063581) + + * cifs: Copying file to same directory results in page fault (LP: #2060919) + - SAUCE: Revert "cifs: fix flushing folio regression for 6.1 backport" + + * CVE-2024-26805 + - netlink: Fix kernel-infoleak-after-free in __skb_datagram_iter + + * CVE-2024-26801 + - Bluetooth: Avoid potential use-after-free in hci_error_reset + + * CVE-2024-26704 + - ext4: fix double-free of blocks due to wrong extents moved_len + + * CVE-2023-52601 + - jfs: fix array-index-out-of-bounds in dbAdjTree + + * CVE-2024-26635 + - llc: Drop support for ETH_P_TR_802_2. + + * CVE-2024-26622 + - tomoyo: fix UAF write bug in tomoyo_write_control() + + * CVE-2024-26614 + - tcp: make sure init the accept_queue's spinlocks once + - ipv6: init the accept_queue's spinlocks in inet6_create + + * CVE-2024-52615 + - hwrng: core - Fix page fault dead lock on mmap-ed hwrng + + * CVE-2024-52602 + - jfs: fix slab-out-of-bounds Read in dtSearch + + * CVE-2023-47233 + - wifi: brcmfmac: Fix use-after-free bug in brcmf_cfg80211_detach + + * CVE-2024-2201 + - x86/bugs: Change commas to semicolons in 'spectre_v2' sysfs file + - x86/syscall: Don't force use of indirect calls for system calls + - x86/bhi: Add support for clearing branch history at syscall entry + - x86/bhi: Define SPEC_CTRL_BHI_DIS_S + - x86/bhi: Enumerate Branch History Injection (BHI) bug + - x86/bhi: Add BHI mitigation knob + - x86/bhi: Mitigate KVM by default + - KVM: x86: Add BHI_NO + - [Config] Set CONFIG_BHI to enabled (auto) + + -- Stefan Bader Fri, 26 Apr 2024 11:32:29 +0200 + +linux (6.5.0-28.29) mantic; urgency=medium + + * mantic/linux: 6.5.0-28.29 -proposed tracker (LP: #2059706) + + * Packaging resync (LP: #1786013) + - [Packaging] drop getabis data + + * Remove getabis scripts (LP: #2059143) + - [Packaging] Remove getabis + + * CVE-2023-52600 + - jfs: fix uaf in jfs_evict_inode + + * Mantic update: upstream stable patchset 2024-03-27 (LP: #2059284) // + CVE-2023-52603 + - UBSAN: array-index-out-of-bounds in dtSplitRoot + + * CVE-2024-26581 + - netfilter: nft_set_rbtree: skip end interval element from gc + * Mantic update: upstream stable patchset 2024-03-07 (LP: #2056403) // CVE-2024-26589 - bpf: Reject variable offset alu on PTR_TO_FLOW_KEYS @@ -1785,7 +1336,10 @@ CVE-2024-26591 - bpf: Fix re-attachment branch in bpf_tracing_prog_attach - -- Roxana Nicolescu Fri, 26 Apr 2024 13:15:35 +0200 + * iwlwifi disconnect and crash - intel wifi7 (LP: #2058808) + - wifi: iwlwifi: pcie: fix RB status reading + + -- Manuel Diewald Thu, 28 Mar 2024 19:28:42 +0100 linux (6.5.0-27.28) mantic; urgency=medium diff -u linux-6.5.0/debian.master/config/annotations linux-6.5.0/debian.master/config/annotations --- linux-6.5.0/debian.master/config/annotations +++ linux-6.5.0/debian.master/config/annotations @@ -5135,7 +5135,6 @@ CONFIG_GARP policy<{'amd64': 'm', 'arm64': 'm', 'armhf': 'm', 'ppc64el': 'm', 'riscv64': 'm', 's390x': 'm'}> CONFIG_GART_IOMMU policy<{'amd64': 'y'}> CONFIG_GCC11_NO_ARRAY_BOUNDS policy<{'amd64': 'y', 'arm64': 'y', 'armhf': 'y', 'ppc64el': 'y', 'riscv64': 'y', 's390x': 'y'}> -CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND policy<{'amd64': 'y', 'arm64': 'y', 'armhf': 'y', 'ppc64el': 'y', 'riscv64': 'y', 's390x': 'y'}> CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE policy<{'riscv64': 'y'}> CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS policy<{'arm64': 'y'}> CONFIG_GCC_VERSION policy<{'amd64': '130200', 'arm64': '130200', 'armhf': '130200', 'ppc64el': '130200', 'riscv64': '130200', 's390x': '130200'}> diff -u linux-6.5.0/debian.master/control.d/generic.inclusion-list linux-6.5.0/debian.master/control.d/generic.inclusion-list --- linux-6.5.0/debian.master/control.d/generic.inclusion-list +++ linux-6.5.0/debian.master/control.d/generic.inclusion-list @@ -228,7 +228,7 @@ fs/btrfs/* fs/cachefiles/cachefiles.ko fs/ceph/* -fs/smb/* +fs/cifs/* fs/configfs/* fs/dlm/dlm.ko fs/ecryptfs/* diff -u linux-6.5.0/debian.master/upstream-stable linux-6.5.0/debian.master/upstream-stable --- linux-6.5.0/debian.master/upstream-stable +++ linux-6.5.0/debian.master/upstream-stable @@ -3,3 +3,3 @@ - linux-6.1.y = v6.1.79 + linux-6.1.y = v6.1.77 linux-6.5.y = v6.5.13 - linux-6.6.y = v6.6.18 + linux-6.6.y = v6.6.16 diff -u linux-6.5.0/debian/changelog linux-6.5.0/debian/changelog --- linux-6.5.0/debian/changelog +++ linux-6.5.0/debian/changelog @@ -1,504 +1,6 @@ -linux (6.5.0-39.39) mantic; urgency=medium +linux (6.5.0-40.40) mantic; urgency=medium - * mantic/linux: 6.5.0-39.39 -proposed tracker (LP: #2063709) - - * RTL8852BE fw security fail then lost WIFI function during suspend/resume - cycle (LP: #2063096) - - wifi: rtw89: download firmware with five times retry - - * Fix bluetooth connections with 3.0 device (LP: #2063067) - - Bluetooth: hci_event: Fix handling of HCI_EV_IO_CAPA_REQUEST - - * cifs: Copying file to same directory results in page fault (LP: #2060919) - - SAUCE: Revert "cifs: fix flushing folio regression for 6.1 backport" - - * USB stick can't be detected (LP: #2040948) - - usb: Disable USB3 LPM at shutdown - - * CVE-2024-26733 - - arp: Prevent overflow in arp_req_get(). - - * CVE-2024-26736 - - afs: Increase buffer size in afs_update_volume_status() - - * CVE-2024-26801 - - Bluetooth: Avoid potential use-after-free in hci_error_reset - - * CVE-2024-26805 - - netlink: Fix kernel-infoleak-after-free in __skb_datagram_iter - - * CVE-2024-26809 - - netfilter: nft_set_pipapo: release elements in clone only from destroy path - - * CVE-2024-26792 - - btrfs: fix double free of anonymous device after snapshot creation failure - - * CVE-2024-26782 - - mptcp: fix double-free on socket dismantle - - * CVE-2024-26748 - - usb: cdns3: fix memory double free when handle zero packet - - * CVE-2024-26735 - - ipv6: sr: fix possible use-after-free and null-ptr-deref - - * CVE-2024-26789 - - crypto: arm64/neonbs - fix out-of-bounds access on short input - - * CVE-2024-26734 - - devlink: fix possible use-after-free and memory leaks in devlink_init() - - * The keyboard does not work after latest kernel update (LP: #2060727) - - Input: atkbd - do not skip atkbd_deactivate() when skipping ATKBD_CMD_GETID - - * proc_sched_rt01 from ubuntu_ltp failed (LP: #2057734) - - sched/rt: sysctl_sched_rr_timeslice show default timeslice after reset - - sched/rt: Disallow writing invalid values to sched_rt_period_us - - * Avoid creating non-working backlight sysfs knob from ASUS board - (LP: #2060422) - - platform/x86: asus-wmi: Consider device is absent when the read is ~0 - - * [Ubuntu 22.04.4/linux-image-6.5.0-26-generic] Kernel output "UBSAN: array- - index-out-of-bounds in /build/linux-hwe-6.5-34pCLi/linux- - hwe-6.5-6.5.0/drivers/net/hyperv/netvsc.c:1445:41" multiple times, - especially during boot. (LP: #2058477) - - hv: hyperv.h: Replace one-element array with flexible-array member - - * Fix acpi_power_meter accessing IPMI region before it's ready (LP: #2059263) - - ACPI: IPMI: Add helper to wait for when SMI is selected - - hwmon: (acpi_power_meter) Ensure IPMI space handler is ready on Dell systems - - * Include cifs.ko in linux-modules package (LP: #2042546) - - [Packaging] Replace fs/cifs with fs/smb/client in inclusion list - - * Mantic update: upstream stable patchset 2024-04-16 (LP: #2061814) - - btrfs: add and use helper to check if block group is used - - btrfs: do not delete unused block group if it may be used soon - - btrfs: forbid creating subvol qgroups - - btrfs: forbid deleting live subvol qgroup - - btrfs: send: return EOPNOTSUPP on unknown flags - - btrfs: don't reserve space for checksums when writing to nocow files - - btrfs: reject encoded write if inode has nodatasum flag set - - btrfs: don't drop extent_map for free space inode on write error - - driver core: Fix device_link_flag_is_sync_state_only() - - of: unittest: Fix compile in the non-dynamic case - - KVM: selftests: Fix a semaphore imbalance in the dirty ring logging test - - wifi: iwlwifi: Fix some error codes - - wifi: iwlwifi: uninitialized variable in iwl_acpi_get_ppag_table() - - of: property: Improve finding the supplier of a remote-endpoint property - - net: openvswitch: limit the number of recursions from action sets - - lan966x: Fix crash when adding interface under a lag - - spi: ppc4xx: Drop write-only variable - - ASoC: rt5645: Fix deadlock in rt5645_jack_detect_work() - - net: sysfs: Fix /sys/class/net/ path for statistics - - nouveau/svm: fix kvcalloc() argument order - - MIPS: Add 'memory' clobber to csum_ipv6_magic() inline assembler - - i40e: Do not allow untrusted VF to remove administratively set MAC - - i40e: Fix waiting for queues of all VSIs to be disabled - - scs: add CONFIG_MMU dependency for vfree_atomic() - - tracing/trigger: Fix to return error if failed to alloc snapshot - - mm/writeback: fix possible divide-by-zero in wb_dirty_limits(), again - - scsi: storvsc: Fix ring buffer size calculation - - dm-crypt, dm-verity: disable tasklets - - ASoC: amd: yc: Add DMI quirk for MSI Bravo 15 C7VF - - parisc: Prevent hung tasks when printing inventory on serial console - - ALSA: hda/realtek: Fix the external mic not being recognised for Acer Swift - 1 SF114-32 - - ALSA: hda/realtek: Enable Mute LED on HP Laptop 14-fq0xxx - - HID: i2c-hid-of: fix NULL-deref on failed power up - - HID: wacom: generic: Avoid reporting a serial of '0' to userspace - - HID: wacom: Do not register input devices until after hid_hw_start - - iio: hid-sensor-als: Return 0 for HID_USAGE_SENSOR_TIME_TIMESTAMP - - usb: ucsi: Add missing ppm_lock - - usb: ulpi: Fix debugfs directory leak - - usb: ucsi_acpi: Fix command completion handling - - USB: hub: check for alternate port before enabling A_ALT_HNP_SUPPORT - - usb: f_mass_storage: forbid async queue when shutdown happen - - usb: dwc3: gadget: Fix NULL pointer dereference in dwc3_gadget_suspend - - interconnect: qcom: sc8180x: Mark CO0 BCM keepalive - - media: ir_toy: fix a memleak in irtoy_tx - - driver core: fw_devlink: Improve detection of overlapping cycles - - cifs: fix underflow in parse_server_interfaces() - - i2c: qcom-geni: Correct I2C TRE sequence - - irqchip/loongson-eiointc: Use correct struct type in eiointc_domain_alloc() - - i2c: pasemi: split driver into two separate modules - - modpost: trim leading spaces when processing source files list - - mptcp: get rid of msk->subflow - - mptcp: fix data re-injection from stale subflow - - selftests: mptcp: add missing kconfig for NF Filter - - selftests: mptcp: add missing kconfig for NF Filter in v6 - - selftests: mptcp: add missing kconfig for NF Mangle - - selftests: mptcp: increase timeout to 30 min - - mptcp: drop the push_pending field - - mptcp: check addrs list in userspace_pm_get_local_id - - scsi: Revert "scsi: fcoe: Fix potential deadlock on &fip->ctlr_lock" - - Revert "drm/amd: flush any delayed gfxoff on suspend entry" - - drm/virtio: Set segment size for virtio_gpu device - - lsm: fix the logic in security_inode_getsecctx() - - firewire: core: correct documentation of fw_csr_string() kernel API - - ALSA: hda/realtek: Apply headset jack quirk for non-bass alc287 thinkpads - - kbuild: Fix changing ELF file type for output of gen_btf for big endian - - nfc: nci: free rx_data_reassembly skb on NCI device cleanup - - net: hsr: remove WARN_ONCE() in send_hsr_supervision_frame() - - net: stmmac: do not clear TBS enable bit on link up/down - - xen-netback: properly sync TX responses - - modpost: Don't let "driver"s reference .exit.* - - linux/init: remove __memexit* annotations - - um: Fix adding '-no-pie' for clang - - modpost: Add '.ltext' and '.ltext.*' to TEXT_SECTIONS - - ALSA: hda/realtek: Enable headset mic on Vaio VJFE-ADL - - ASoC: codecs: wcd938x: handle deferred probe - - ALSA: hda/realtek: fix mute/micmute LEDs for HP ZBook Power - - binder: signal epoll threads of self-work - - misc: fastrpc: Mark all sessions as invalid in cb_remove - - ext4: avoid bb_free and bb_fragments inconsistency in mb_free_blocks() - - tracing: Fix wasted memory in saved_cmdlines logic - - staging: iio: ad5933: fix type mismatch regression - - iio: magnetometer: rm3100: add boundary check for the value read from - RM3100_REG_TMRC - - iio: core: fix memleak in iio_device_register_sysfs - - iio: commom: st_sensors: ensure proper DMA alignment - - iio: accel: bma400: Fix a compilation problem - - iio: adc: ad_sigma_delta: ensure proper DMA alignment - - iio: imu: adis: ensure proper DMA alignment - - iio: imu: bno055: serdev requires REGMAP - - media: rc: bpf attach/detach requires write permission - - ksmbd: free aux buffer if ksmbd_iov_pin_rsp_read fails - - drm/msm: Wire up tlb ops - - drm/prime: Support page array >= 4GB - - drm/amd/display: Increase frame-larger-than for all display_mode_vba files - - drm/amd/display: Preserve original aspect ratio in create stream - - hv_netvsc: Fix race condition between netvsc_probe and netvsc_remove - - ring-buffer: Clean ring_buffer_poll_wait() error return - - nfp: flower: fix hardware offload for the transfer layer port - - serial: max310x: set default value when reading clock ready bit - - serial: max310x: improve crystal stable clock detection - - serial: max310x: fail probe if clock crystal is unstable - - serial: max310x: prevent infinite while() loop in port startup - - powerpc/64: Set task pt_regs->link to the LR value on scv entry - - powerpc/cputable: Add missing PPC_FEATURE_BOOKE on PPC64 Book-E - - powerpc/pseries: fix accuracy of stolen time - - x86/Kconfig: Transmeta Crusoe is CPU family 5, not 6 - - x86/fpu: Stop relying on userspace for info to fault in xsave buffer - - KVM: x86/pmu: Fix type length error when reading pmu->fixed_ctr_ctrl - - x86/mm/ident_map: Use gbpages only where full GB page should be mapped. - - io_uring/net: fix multishot accept overflow handling - - mmc: slot-gpio: Allow non-sleeping GPIO ro - - ALSA: hda/realtek: fix mute/micmute LED For HP mt645 - - ALSA: hda/conexant: Add quirk for SWS JS201D - - nilfs2: fix data corruption in dsync block recovery for small block sizes - - nilfs2: fix hang in nilfs_lookup_dirty_data_buffers() - - crypto: ccp - Fix null pointer dereference in __sev_platform_shutdown_locked - - nfp: use correct macro for LengthSelect in BAR config - - nfp: flower: prevent re-adding mac index for bonded port - - wifi: cfg80211: fix wiphy delayed work queueing - - wifi: mac80211: reload info pointer in ieee80211_tx_dequeue() - - irqchip/irq-brcmstb-l2: Add write memory barrier before exit - - irqchip/gic-v3-its: Fix GICv4.1 VPE affinity update - - zonefs: Improve error handling - - mmc: sdhci-pci-o2micro: Fix a warm reboot issue that disk can't be detected - by BIOS - - ASoC: amd: yc: Add DMI quirk for Lenovo Ideapad Pro 5 16ARP8 - - tools/rtla: Remove unused sched_getattr() function - - tools/rtla: Replace setting prio with nice for SCHED_OTHER - - tools/rtla: Exit with EXIT_SUCCESS when help is invoked - - tools/rtla: Fix uninitialized bucket/data->bucket_size warning - - tools/rtla: Fix Makefile compiler options for clang - - fs: relax mount_setattr() permission checks - - net: ethernet: ti: cpsw: enable mac_managed_pm to fix mdio - - s390/qeth: Fix potential loss of L3-IP@ in case of network issues - - net: ethernet: ti: cpsw_new: enable mac_managed_pm to fix mdio - - hv_netvsc: Register VF in netvsc_probe if NET_DEVICE_REGISTER missed - - ceph: prevent use-after-free in encode_cap_msg() - - fs,hugetlb: fix NULL pointer dereference in hugetlbs_fill_super - - mm: hugetlb pages should not be reserved by shmat() if SHM_NORESERVE - - of: property: fix typo in io-channels - - can: netlink: Fix TDCO calculation using the old data bittiming - - can: j1939: prevent deadlock by changing j1939_socks_lock to rwlock - - can: j1939: Fix UAF in j1939_sk_match_filter during - setsockopt(SO_J1939_FILTER) - - pmdomain: core: Move the unused cleanup to a _sync initcall - - fs/proc: do_task_stat: move thread_group_cputime_adjusted() outside of - lock_task_sighand() - - tracing: Inform kmemleak of saved_cmdlines allocation - - selftests/mm: ksm_tests should only MADV_HUGEPAGE valid memory - - selftests/mm: Update va_high_addr_switch.sh to check CPU for la57 flag - - md: bypass block throttle for superblock update - - block: fix partial zone append completion handling in req_bio_endio() - - netfilter: ipset: Missing gc cancellations fixed - - parisc: Fix random data corruption from exception handler - - nfsd: don't take fi_lock in nfsd_break_deleg_cb() - - sched/membarrier: reduce the ability to hammer on sys_membarrier - - of: property: Add in-ports/out-ports support to of_graph_get_port_parent() - - nilfs2: fix potential bug in end_buffer_async_write - - arm64: Subscribe Microsoft Azure Cobalt 100 to ARM Neoverse N2 errata - - work around gcc bugs with 'asm goto' with outputs - - [Config] updateconfigs for GCC_ASM_GOTO_OUTPUT_WORKAROUND - - update workarounds for gcc "asm goto" issue - - selftests/landlock: Fix fs_test build with old libc - - KVM: selftests: Delete superfluous, unused "stage" variable in AMX test - - KVM: selftests: Avoid infinite loop in hyperv_features when invtsc is - missing - - drm/msm/gem: Fix double resv lock aquire - - ASoC: SOF: ipc3-topology: Fix pipeline tear down logic - - net/handshake: Fix handshake_req_destroy_test1 - - bonding: do not report NETDEV_XDP_ACT_XSK_ZEROCOPY - - devlink: Fix command annotation documentation - - of: property: Improve finding the consumer of a remote-endpoint property - - perf: CXL: fix mismatched cpmu event opcode - - selftests: forwarding: Fix layer 2 miss test flakiness - - selftests: forwarding: Fix bridge MDB test flakiness - - selftests: bridge_mdb: Use MDB get instead of dump - - selftests: forwarding: Suppress grep warnings - - ptrace: Introduce exception_ip arch hook - - mm/memory: Use exception ip to search exception tables - - userfaultfd: fix mmap_changing checking in mfill_atomic_hugetlb - - selftests/mm: switch to bash from sh - - selftests: mm: fix map_hugetlb failure on 64K page size systems - - nouveau: offload fence uevents work to workqueue - - HID: bpf: remove double fdget() - - HID: bpf: actually free hdev memory after attaching a HID-BPF program - - usb: chipidea: core: handle power lost in workqueue - - usb: core: Prevent null pointer dereference in update_port_device_state - - interconnect: qcom: sm8550: Enable sync_state - - powerpc/pseries/iommu: Fix iommu initialisation during DLPAR add - - powerpc/6xx: set High BAT Enable flag on G2_LE cores - - iio: adc: ad4130: zero-initialize clock init data - - iio: adc: ad4130: only set GPIO_CTRL if pin is unused - - irqchip/gic-v3-its: Handle non-coherent GICv4 redistributors - - kallsyms: ignore ARMv4 thunks along with others - - selftests: mptcp: add mptcp_lib_kill_wait - - mptcp: fix rcv space initialization - - mptcp: really cope with fastopen race - - Revert "powerpc/pseries/iommu: Fix iommu initialisation during DLPAR add" - - drm/amd: Don't init MEC2 firmware when it fails to load - - usb: typec: tpcm: Fix issues with power being removed during reset - - tracing/timerlat: Move hrtimer_init to timerlat_fd open() - - tracing/synthetic: Fix trace_string() return value - - tracing/probes: Fix to show a parse error for bad type for $comm - - tracing/probes: Fix to set arg size and fmt after setting type from BTF - - Revert "workqueue: Override implicit ordered attribute in - workqueue_apply_unbound_cpumask()" - - iio: pressure: bmp280: Add missing bmp085 to SPI id table - - pmdomain: mediatek: fix race conditions with genpd - - drm/amd/display: Add align done check - - drm/amdgpu/soc21: update VCN 4 max HEVC encoding resolution - - drm/amd/display: Fix MST Null Ptr for RV - - net: dsa: mv88e6xxx: Fix failed probe due to unsupported C45 reads - - nfp: flower: add hardware offload check for post ct entry - - ftrace: Fix DIRECT_CALLS to use SAVE_REGS by default - - serial: core: introduce uart_port_tx_flags() - - serial: mxs-auart: fix tx - - KVM: x86: make KVM_REQ_NMI request iff NMI pending for vcpu - - crypto: algif_hash - Remove bogus SGL free on zero-length error path - - nfp: enable NETDEV_XDP_ACT_REDIRECT feature flag - - wifi: iwlwifi: mvm: fix a crash when we run out of stations - - thunderbolt: Fix setting the CNS bit in ROUTER_CS_5 - - smb: client: set correct id, uid and cruid for multiuser automounts - - KVM: arm64: Fix circular locking dependency - - arm64/signal: Don't assume that TIF_SVE means we saved SVE state - - ASoC: SOF: IPC3: fix message bounds on ipc ops - - tools/rv: Fix curr_reactor uninitialized variable - - tools/rv: Fix Makefile compiler options for clang - - tools/rtla: Fix clang warning about mount_point var size - - pmdomain: renesas: r8a77980-sysc: CR7 must be always on - - blk-wbt: Fix detection of dirty-throttled tasks - - docs: kernel_feat.py: fix build error for missing files - - tracing: Fix HAVE_DYNAMIC_FTRACE_WITH_REGS ifdef - - netfilter: ipset: fix performance regression in swap operation - - tracefs: Check for dentry->d_inode exists in set_gid() - - x86/efi: Drop EFI stub .bss from .data section - - x86/efi: Drop alignment flags from PE section headers - - x86/boot: Remove the 'bugger off' message - - x86/boot: Omit compression buffer from PE/COFF image memory footprint - - x86/boot: Drop redundant code setting the root device - - x86/boot: Drop references to startup_64 - - x86/boot: Grab kernel_info offset from zoffset header directly - - x86/boot: Set EFI handover offset directly in header asm - - x86/boot: Define setup size in linker script - - x86/boot: Derive file size from _edata symbol - - x86/boot: Construct PE/COFF .text section from assembler - - x86/boot: Drop PE/COFF .reloc section - - x86/boot: Split off PE/COFF .data section - - x86/boot: Increase section and file alignment to 4k/512 - - x86/efistub: Use 1:1 file:memory mapping for PE/COFF .compat section - - x86/barrier: Do not serialize MSR accesses on AMD - - Documentation/arch/ia64/features.rst: fix kernel-feat directive - - Upstream stable to v6.1.79, v6.6.18 - - * Mantic update: upstream stable patchset 2024-04-16 (LP: #2061814) // - CVE-2024-26694 - - wifi: iwlwifi: fix double-free bug - - * There is sound from the speakers and headphones at the same time on Oasis 14 - and 16 platforms (LP: #2054487) // Mantic update: upstream stable patchset - 2024-04-16 (LP: #2061814) - - ALSA: hda/realtek - Add speaker pin verbtable for Dell dual speaker platform - - ALSA: hda/realtek: add IDs for Dell dual spk platform - - * Mantic update: upstream stable patchset 2024-04-16 (LP: #2061814) // - CVE-2024-26704 - - ext4: fix double-free of blocks due to wrong extents moved_len - - * Mantic update: upstream stable patchset 2024-04-16 (LP: #2061814) // - CVE-2024-26710 - - powerpc/kasan: Limit KASAN thread size increase to 32KB - - * Mantic update: upstream stable patchset 2024-04-16 (LP: #2061814) // - CVE-2024-26712 - - powerpc/kasan: Fix addr error caused by page alignment - - * Mantic update: upstream stable patchset 2024-04-02 (LP: #2059991) - - ext4: regenerate buddy after block freeing failed if under fc replay - - dmaengine: fsl-dpaa2-qdma: Fix the size of dma pools - - dmaengine: ti: k3-udma: Report short packet errors - - dmaengine: fsl-qdma: Fix a memory leak related to the status queue DMA - - dmaengine: fsl-qdma: Fix a memory leak related to the queue command DMA - - phy: renesas: rcar-gen3-usb2: Fix returning wrong error code - - dmaengine: fix is_slave_direction() return false when DMA_DEV_TO_DEV - - phy: ti: phy-omap-usb2: Fix NULL pointer dereference for SRP - - cifs: failure to add channel on iface should bump up weight - - drm/msms/dp: fixed link clock divider bits be over written in BPC unknown - case - - drm/msm/dp: return correct Colorimetry for DP_TEST_DYNAMIC_RANGE_CEA case - - drm/msm/dpu: check for valid hw_pp in dpu_encoder_helper_phys_cleanup - - net: stmmac: xgmac: fix handling of DPP safety error for DMA channels - - wifi: mac80211: fix waiting for beacons logic - - netdevsim: avoid potential loop in nsim_dev_trap_report_work() - - net: atlantic: Fix DMA mapping for PTP hwts ring - - selftests: net: cut more slack for gro fwd tests. - - selftests: net: avoid just another constant wait - - tunnels: fix out of bounds access when building IPv6 PMTU error - - atm: idt77252: fix a memleak in open_card_ubr0 - - octeontx2-pf: Fix a memleak otx2_sq_init - - hwmon: (aspeed-pwm-tacho) mutex for tach reading - - hwmon: (coretemp) Fix out-of-bounds memory access - - hwmon: (coretemp) Fix bogus core_id to attr name mapping - - inet: read sk->sk_family once in inet_recv_error() - - drm/i915/gvt: Fix uninitialized variable in handle_mmio() - - rxrpc: Fix response to PING RESPONSE ACKs to a dead call - - tipc: Check the bearer type before calling tipc_udp_nl_bearer_add() - - af_unix: Call kfree_skb() for dead unix_(sk)->oob_skb in GC. - - ppp_async: limit MRU to 64K - - selftests: cmsg_ipv6: repeat the exact packet - - netfilter: nft_compat: narrow down revision to unsigned 8-bits - - netfilter: nft_compat: reject unused compat flag - - netfilter: nft_compat: restrict match/target protocol to u16 - - drm/amd/display: Implement bounds check for stream encoder creation in - DCN301 - - netfilter: nft_ct: reject direction for ct id - - fs/ntfs3: Fix an NULL dereference bug - - scsi: core: Move scsi_host_busy() out of host lock if it is for per-command - - blk-iocost: Fix an UBSAN shift-out-of-bounds warning - - ALSA: usb-audio: Add delay quirk for MOTU M Series 2nd revision - - ALSA: usb-audio: Add a quirk for Yamaha YIT-W12TX transmitter - - ALSA: usb-audio: add quirk for RODE NT-USB+ - - USB: serial: qcserial: add new usb-id for Dell Wireless DW5826e - - USB: serial: option: add Fibocom FM101-GL variant - - USB: serial: cp210x: add ID for IMST iM871A-USB - - usb: dwc3: host: Set XHCI_SG_TRB_CACHE_SIZE_QUIRK - - usb: host: xhci-plat: Add support for XHCI_SG_TRB_CACHE_SIZE_QUIRK - - hrtimer: Report offline hrtimer enqueue - - Input: i8042 - fix strange behavior of touchpad on Clevo NS70PU - - io_uring/net: fix sr->len for IORING_OP_RECV with MSG_WAITALL and buffers - - net: stmmac: xgmac: use #define for string constants - - ALSA: usb-audio: Sort quirk table entries - - net: stmmac: xgmac: fix a typo of register name in DPP safety handling - - perf evlist: Fix evlist__new_default() for > 1 core PMU - - cifs: avoid redundant calls to disable multichannel - - rust: arc: add explicit `drop()` around `Box::from_raw()` - - rust: task: remove redundant explicit link - - rust: print: use explicit link in documentation - - MAINTAINERS: add Catherine as xfs maintainer for 6.6.y - - xfs: bump max fsgeom struct version - - xfs: hoist freeing of rt data fork extent mappings - - xfs: prevent rt growfs when quota is enabled - - xfs: rt stubs should return negative errnos when rt disabled - - xfs: fix units conversion error in xfs_bmap_del_extent_delay - - xfs: make sure maxlen is still congruent with prod when rounding down - - xfs: introduce protection for drop nlink - - xfs: handle nimaps=0 from xfs_bmapi_write in xfs_alloc_file_space - - xfs: allow read IO and FICLONE to run concurrently - - xfs: factor out xfs_defer_pending_abort - - xfs: abort intent items when recovery intents fail - - xfs: only remap the written blocks in xfs_reflink_end_cow_extent - - xfs: up(ic_sema) if flushing data device fails - - xfs: fix internal error from AGFL exhaustion - - xfs: inode recovery does not validate the recovered inode - - xfs: clean up dqblk extraction - - xfs: dquot recovery does not validate the recovered dquot - - xfs: clean up FS_XFLAG_REALTIME handling in xfs_ioctl_setattr_xflags - - xfs: respect the stable writes flag on the RT device - - wifi: mac80211: fix RCU use in TDLS fast-xmit - - wifi: iwlwifi: exit eSR only after the FW does - - wifi: brcmfmac: Adjust n_channels usage for __counted_by - - selftests/net: convert unicast_extensions.sh to run it in unique namespace - - selftests/net: convert pmtu.sh to run it in unique namespace - - selftests/net: change shebang to bash to support "source" - - selftests: net: fix tcp listener handling in pmtu.sh - - tsnep: Fix mapping for zero copy XDP_TX action - - rxrpc: Fix generation of serial numbers to skip zero - - rxrpc: Fix delayed ACKs to not set the reference serial number - - rxrpc: Fix counting of new acks and nacks - - selftests: net: let big_tcp test cope with slow env - - drm/amd/display: Fix 'panel_cntl' could be null in - 'dcn21_set_backlight_level()' - - drm/amd/display: Add NULL test for 'timing generator' in 'dcn21_set_pipe()' - - riscv: Improve tlb_flush() - - riscv: Make __flush_tlb_range() loop over pte instead of flushing the whole - tlb - - riscv: Improve flush_tlb_kernel_range() - - mm: Introduce flush_cache_vmap_early() - - riscv: mm: execute local TLB flush after populating vmemmap - - riscv: Fix set_huge_pte_at() for NAPOT mapping - - riscv: Fix hugetlb_mask_last_page() when NAPOT is enabled - - riscv: Flush the tlb when a page directory is freed - - libceph: rename read_sparse_msg_*() to read_partial_sparse_msg_*() - - libceph: just wait for more data to be available on the socket - - riscv: Fix arch_hugetlb_migration_supported() for NAPOT - - riscv: declare overflow_stack as exported from traps.c - - Revert "usb: typec: tcpm: fix cc role at port reset" - - x86/lib: Revert to _ASM_EXTABLE_UA() for {get,put}_user() fixups - - xhci: process isoc TD properly when there was a transaction error mid TD. - - xhci: handle isoc Babble and Buffer Overrun events properly - - usb: dwc3: pci: add support for the Intel Arrow Lake-H - - media: solo6x10: replace max(a, min(b, c)) by clamp(b, a, c) - - io_uring/poll: move poll execution helpers higher up - - io_uring/net: un-indent mshot retry path in io_recv_finish() - - io_uring/poll: add requeue return code from poll multishot handling - - io_uring/net: limit inline multishot retries - - Upstream stable to v6.1.78, v6.6.17 - - * Mantic update: upstream stable patchset 2024-04-02 (LP: #2059991) // The - keyboard does not work after latest kernel update (LP: #2060727) - - Input: atkbd - skip ATKBD_CMD_SETLEDS when skipping ATKBD_CMD_GETID - - * Mantic update: upstream stable patchset 2024-04-02 (LP: #2059991) // - CVE-2024-26809 - - netfilter: nft_set_pipapo: store index in scratch maps - - netfilter: nft_set_pipapo: add helper to release pcpu scratch area - - netfilter: nft_set_pipapo: remove scratch_aligned pointer - - * CVE-2024-26593 - - i2c: i801: Fix block process call transactions - - * CVE-2023-47233 - - wifi: brcmfmac: Fix use-after-free bug in brcmf_cfg80211_detach - - * CVE-2024-26622 - - tomoyo: fix UAF write bug in tomoyo_write_control() - - * CVE-2024-2201 - - x86/bugs: Change commas to semicolons in 'spectre_v2' sysfs file - - x86/syscall: Don't force use of indirect calls for system calls - - x86/bhi: Add support for clearing branch history at syscall entry - - x86/bhi: Define SPEC_CTRL_BHI_DIS_S - - x86/bhi: Enumerate Branch History Injection (BHI) bug - - x86/bhi: Add BHI mitigation knob - - x86/bhi: Mitigate KVM by default - - KVM: x86: Add BHI_NO - - [Config] Set CONFIG_BHI to enabled (auto) + * mantic/linux: 6.5.0-40.40 -proposed tracker (LP: #2063709) * [Mantic] Compile broken on armhf (cc1 out of memory) (LP: #2060446) - Revert "minmax: relax check to allow comparison between unsigned arguments @@ -508,9 +10,6 @@ signedness." - Revert "minmax: add umin(a, b) and umax(a, b)" - * Packaging resync (LP: #1786013) - - [Packaging] drop getabis data - * Drop fips-checks script from trees (LP: #2055083) - [Packaging] Remove fips-checks script @@ -518,9 +17,6 @@ (LP: #2058573) - ALSA: hda/realtek: fix the hp playback volume issue for LG machines - * Remove getabis scripts (LP: #2059143) - - [Packaging] Remove getabis - * Mantic update: upstream stable patchset 2024-03-27 (LP: #2059284) - asm-generic: make sparse happy with odd-sized put_unaligned_*() - powerpc/mm: Fix null-pointer dereference in pgtable_cache_add @@ -547,7 +43,6 @@ - ACPI: APEI: set memory failure flags as MF_ACTION_REQUIRED on synchronous events - FS:JFS:UBSAN:array-index-out-of-bounds in dbAdjTree - - jfs: fix slab-out-of-bounds Read in dtSearch - jfs: fix array-index-out-of-bounds in dbAdjTree - pstore/ram: Fix crash when setting number of cpus to an odd number - crypto: octeontx2 - Fix cptvf driver cleanup @@ -852,13 +347,6 @@ - pds_core: Prevent health thread from running during reset/remove - Upstream stable to v6.1.77, v6.6.16 - * Mantic update: upstream stable patchset 2024-03-27 (LP: #2059284) // - CVE-2023-52603 - - UBSAN: array-index-out-of-bounds in dtSplitRoot - - * iwlwifi disconnect and crash - intel wifi7 (LP: #2058808) - - wifi: iwlwifi: pcie: fix RB status reading - * Mantic update: upstream stable patchset 2024-03-26 (LP: #2059068) - iio: adc: ad7091r: Set alert bit in config register - iio: adc: ad7091r: Allow users to configure device events @@ -868,7 +356,6 @@ - btrfs: sysfs: validate scrub_speed_max value - crypto: api - Disallow identical driver names - PM: hibernate: Enforce ordering during image compression/decompression - - hwrng: core - Fix page fault dead lock on mmap-ed hwrng - crypto: s390/aes - Fix buffer overread in CTR mode - s390/vfio-ap: unpin pages on gisc registration failure - PM / devfreq: Fix buffer overflow in trans_stat_show @@ -936,11 +423,9 @@ - Revert "drm/amd: Enable PCIe PME from D3" - wifi: mac80211: fix potential sta-link leak - net/smc: fix illegal rmb_desc access in SMC-D connection dump - - tcp: make sure init the accept_queue's spinlocks once - bnxt_en: Wait for FLR to complete during probe - vlan: skip nested type that is not IFLA_VLAN_QOS_MAPPING - llc: make llc_ui_sendmsg() more robust against bonding changes - - llc: Drop support for ETH_P_TR_802_2. - udp: fix busy polling - net: fix removing a namespace with conflicting altnames - tun: fix missing dropped counter in tun_xdp_act @@ -952,7 +437,6 @@ - afs: Hide silly-rename files from userspace - tcp: Add memory barrier to tcp_push() - netlink: fix potential sleeping issue in mqueue_flush_file - - ipv6: init the accept_queue's spinlocks in inet6_create - net/mlx5: DR, Use the right GVMI number for drop action - net/mlx5: DR, Can't go to uplink vport on RX rule - net/mlx5: Use mlx5 device constant for selecting CQ period mode for ASO @@ -1194,16 +678,10 @@ - net: tls: factor out tls_*crypt_async_wait() - tls: fix race between async notify and socket close - * CVE-2023-52600 - - jfs: fix uaf in jfs_evict_inode - * Fix headphone mic detection issue on ALC897 (LP: #2056418) - ALSA: hda/realtek - Fix headset Mic no show at resume back for Lenovo ALC897 platform - * CVE-2024-26581 - - netfilter: nft_set_rbtree: skip end interval element from gc - * The screen brightness is unable to adjust on BOE panel DPN#R6FD8 (LP: #2057430) - drm/amd/display: Re-add aux intercept disable delay generically for 2+ @@ -1777,6 +1255,79 @@ CVE-2024-26583 - net: tls, fix WARNIING in __sk_msg_free + -- Roxana Nicolescu Tue, 30 Apr 2024 14:51:16 +0200 + +linux (6.5.0-35.35) mantic; urgency=medium + + * mantic/linux: 6.5.0-35.35 -proposed tracker (LP: #2063581) + + * cifs: Copying file to same directory results in page fault (LP: #2060919) + - SAUCE: Revert "cifs: fix flushing folio regression for 6.1 backport" + + * CVE-2024-26805 + - netlink: Fix kernel-infoleak-after-free in __skb_datagram_iter + + * CVE-2024-26801 + - Bluetooth: Avoid potential use-after-free in hci_error_reset + + * CVE-2024-26704 + - ext4: fix double-free of blocks due to wrong extents moved_len + + * CVE-2023-52601 + - jfs: fix array-index-out-of-bounds in dbAdjTree + + * CVE-2024-26635 + - llc: Drop support for ETH_P_TR_802_2. + + * CVE-2024-26622 + - tomoyo: fix UAF write bug in tomoyo_write_control() + + * CVE-2024-26614 + - tcp: make sure init the accept_queue's spinlocks once + - ipv6: init the accept_queue's spinlocks in inet6_create + + * CVE-2024-52615 + - hwrng: core - Fix page fault dead lock on mmap-ed hwrng + + * CVE-2024-52602 + - jfs: fix slab-out-of-bounds Read in dtSearch + + * CVE-2023-47233 + - wifi: brcmfmac: Fix use-after-free bug in brcmf_cfg80211_detach + + * CVE-2024-2201 + - x86/bugs: Change commas to semicolons in 'spectre_v2' sysfs file + - x86/syscall: Don't force use of indirect calls for system calls + - x86/bhi: Add support for clearing branch history at syscall entry + - x86/bhi: Define SPEC_CTRL_BHI_DIS_S + - x86/bhi: Enumerate Branch History Injection (BHI) bug + - x86/bhi: Add BHI mitigation knob + - x86/bhi: Mitigate KVM by default + - KVM: x86: Add BHI_NO + - [Config] Set CONFIG_BHI to enabled (auto) + + -- Stefan Bader Fri, 26 Apr 2024 11:32:29 +0200 + +linux (6.5.0-28.29) mantic; urgency=medium + + * mantic/linux: 6.5.0-28.29 -proposed tracker (LP: #2059706) + + * Packaging resync (LP: #1786013) + - [Packaging] drop getabis data + + * Remove getabis scripts (LP: #2059143) + - [Packaging] Remove getabis + + * CVE-2023-52600 + - jfs: fix uaf in jfs_evict_inode + + * Mantic update: upstream stable patchset 2024-03-27 (LP: #2059284) // + CVE-2023-52603 + - UBSAN: array-index-out-of-bounds in dtSplitRoot + + * CVE-2024-26581 + - netfilter: nft_set_rbtree: skip end interval element from gc + * Mantic update: upstream stable patchset 2024-03-07 (LP: #2056403) // CVE-2024-26589 - bpf: Reject variable offset alu on PTR_TO_FLOW_KEYS @@ -1785,7 +1336,10 @@ CVE-2024-26591 - bpf: Fix re-attachment branch in bpf_tracing_prog_attach - -- Roxana Nicolescu Fri, 26 Apr 2024 13:15:35 +0200 + * iwlwifi disconnect and crash - intel wifi7 (LP: #2058808) + - wifi: iwlwifi: pcie: fix RB status reading + + -- Manuel Diewald Thu, 28 Mar 2024 19:28:42 +0100 linux (6.5.0-27.28) mantic; urgency=medium diff -u linux-6.5.0/debian/control linux-6.5.0/debian/control --- linux-6.5.0/debian/control +++ linux-6.5.0/debian/control @@ -94,7 +94,7 @@ you do not want this package. Install the appropriate linux-headers package instead. -Package: linux-headers-6.5.0-39 +Package: linux-headers-6.5.0-40 Build-Profiles: Architecture: all Multi-Arch: foreign @@ -104,7 +104,7 @@ Description: Header files related to Linux kernel version 6.5.0 This package provides kernel header files for version 6.5.0, for sites that want the latest kernel headers. Please read - /usr/share/doc/linux-headers-6.5.0-39/debian.README.gz for details + /usr/share/doc/linux-headers-6.5.0-40/debian.README.gz for details Package: linux-tools-common Build-Profiles: @@ -119,18 +119,18 @@ version locked tools (such as perf and x86_energy_perf_policy) for version 6.5.0. -Package: linux-tools-6.5.0-39 +Package: linux-tools-6.5.0-40 Build-Profiles: Architecture: amd64 armhf arm64 ppc64el s390x Section: devel Priority: optional Depends: ${misc:Depends}, ${shlibs:Depends}, linux-tools-common -Description: Linux kernel version specific tools for version 6.5.0-39 +Description: Linux kernel version specific tools for version 6.5.0-40 This package provides the architecture dependant parts for kernel version locked tools (such as perf and x86_energy_perf_policy) for - version 6.5.0-39 on + version 6.5.0-40 on 64 bit x86. - You probably want to install linux-tools-6.5.0-39-. + You probably want to install linux-tools-6.5.0-40-. Package: linux-cloud-tools-common Build-Profiles: @@ -143,17 +143,17 @@ This package provides the architecture independent parts for kernel version locked tools for cloud tools for version 6.5.0. -Package: linux-cloud-tools-6.5.0-39 +Package: linux-cloud-tools-6.5.0-40 Build-Profiles: Architecture: amd64 armhf Section: devel Priority: optional Depends: ${misc:Depends}, ${shlibs:Depends}, linux-cloud-tools-common -Description: Linux kernel version specific cloud tools for version 6.5.0-39 +Description: Linux kernel version specific cloud tools for version 6.5.0-40 This package provides the architecture dependant parts for kernel - version locked tools for cloud tools for version 6.5.0-39 on + version locked tools for cloud tools for version 6.5.0-40 on 64 bit x86. - You probably want to install linux-cloud-tools-6.5.0-39-. + You probably want to install linux-cloud-tools-6.5.0-40-. Package: linux-tools-host Build-Profiles: @@ -193,17 +193,17 @@ contained in each file. -Package: linux-image-unsigned-6.5.0-39-generic +Package: linux-image-unsigned-6.5.0-40-generic Build-Profiles: Architecture: amd64 armhf arm64 ppc64el s390x Section: kernel Priority: optional Provides: linux-image, fuse-module, kvm-api-4, redhat-cluster-modules, ivtv-modules, virtualbox-guest-modules [amd64], ${linux:rprovides} -Depends: ${misc:Depends}, ${shlibs:Depends}, kmod, linux-base (>= 4.5ubuntu1~16.04.1), linux-modules-6.5.0-39-generic +Depends: ${misc:Depends}, ${shlibs:Depends}, kmod, linux-base (>= 4.5ubuntu1~16.04.1), linux-modules-6.5.0-40-generic Recommends: grub-pc [amd64] | grub-efi-amd64 [amd64] | grub-efi-ia32 [amd64] | grub [amd64] | lilo [amd64] | flash-kernel [armhf arm64] | grub-efi-arm64 [arm64] | grub-efi-arm [armhf] | grub-ieee1275 [ppc64el], initramfs-tools | linux-initramfs-tool Breaks: flash-kernel (<< 3.90ubuntu2) [arm64 armhf], s390-tools (<< 2.3.0-0ubuntu3) [s390x] -Conflicts: linux-image-6.5.0-39-generic -Suggests: fdutils, linux-doc | linux-source-6.5.0, linux-tools, linux-headers-6.5.0-39-generic, linux-modules-extra-6.5.0-39-generic +Conflicts: linux-image-6.5.0-40-generic +Suggests: fdutils, linux-doc | linux-source-6.5.0, linux-tools, linux-headers-6.5.0-40-generic, linux-modules-extra-6.5.0-40-generic Description: Linux kernel image for version 6.5.0 on 64 bit x86 SMP This package contains the unsigned Linux kernel image for version 6.5.0 on 64 bit x86 SMP. @@ -216,7 +216,7 @@ the linux-generic meta-package, which will ensure that upgrades work correctly, and that supporting packages are also installed. -Package: linux-modules-6.5.0-39-generic +Package: linux-modules-6.5.0-40-generic Build-Profiles: Architecture: amd64 armhf arm64 ppc64el s390x Section: kernel @@ -236,12 +236,12 @@ the linux-generic meta-package, which will ensure that upgrades work correctly, and that supporting packages are also installed. -Package: linux-modules-extra-6.5.0-39-generic +Package: linux-modules-extra-6.5.0-40-generic Build-Profiles: Architecture: amd64 armhf arm64 ppc64el s390x Section: kernel Priority: optional -Depends: ${misc:Depends}, ${shlibs:Depends}, linux-modules-6.5.0-39-generic, wireless-regdb +Depends: ${misc:Depends}, ${shlibs:Depends}, linux-modules-6.5.0-40-generic, wireless-regdb Description: Linux kernel extra modules for version 6.5.0 on 64 bit x86 SMP This package contains the Linux kernel extra modules for version 6.5.0 on 64 bit x86 SMP. @@ -258,21 +258,21 @@ the linux-generic meta-package, which will ensure that upgrades work correctly, and that supporting packages are also installed. -Package: linux-headers-6.5.0-39-generic +Package: linux-headers-6.5.0-40-generic Build-Profiles: Architecture: amd64 armhf arm64 ppc64el s390x Section: devel Priority: optional -Depends: ${misc:Depends}, linux-headers-6.5.0-39, ${shlibs:Depends} +Depends: ${misc:Depends}, linux-headers-6.5.0-40, ${shlibs:Depends} Provides: linux-headers, linux-headers-3.0 Description: Linux kernel headers for version 6.5.0 on 64 bit x86 SMP This package provides kernel header files for version 6.5.0 on 64 bit x86 SMP. . This is for sites that want the latest kernel headers. Please read - /usr/share/doc/linux-headers-6.5.0-39/debian.README.gz for details. + /usr/share/doc/linux-headers-6.5.0-40/debian.README.gz for details. -Package: linux-lib-rust-6.5.0-39-generic +Package: linux-lib-rust-6.5.0-40-generic Build-Profiles: Architecture: amd64 Multi-Arch: foreign @@ -283,7 +283,7 @@ This package provides kernel library files for version 6.5.0, that allow to compile out-of-tree kernel modules written in Rust. -Package: linux-image-unsigned-6.5.0-39-generic-dbgsym +Package: linux-image-unsigned-6.5.0-40-generic-dbgsym Build-Profiles: Architecture: amd64 armhf arm64 ppc64el s390x Section: devel @@ -300,31 +300,31 @@ is uncompressed, and unstripped. This package also includes the unstripped modules. -Package: linux-tools-6.5.0-39-generic +Package: linux-tools-6.5.0-40-generic Build-Profiles: Architecture: amd64 armhf arm64 ppc64el s390x Section: devel Priority: optional -Depends: ${misc:Depends}, linux-tools-6.5.0-39 -Description: Linux kernel version specific tools for version 6.5.0-39 +Depends: ${misc:Depends}, linux-tools-6.5.0-40 +Description: Linux kernel version specific tools for version 6.5.0-40 This package provides the architecture dependant parts for kernel version locked tools (such as perf and x86_energy_perf_policy) for - version 6.5.0-39 on + version 6.5.0-40 on 64 bit x86. -Package: linux-cloud-tools-6.5.0-39-generic +Package: linux-cloud-tools-6.5.0-40-generic Build-Profiles: Architecture: amd64 armhf arm64 ppc64el s390x Section: devel Priority: optional -Depends: ${misc:Depends}, linux-cloud-tools-6.5.0-39 -Description: Linux kernel version specific cloud tools for version 6.5.0-39 +Depends: ${misc:Depends}, linux-cloud-tools-6.5.0-40 +Description: Linux kernel version specific cloud tools for version 6.5.0-40 This package provides the architecture dependant parts for kernel - version locked tools for cloud for version 6.5.0-39 on + version locked tools for cloud for version 6.5.0-40 on 64 bit x86. -Package: linux-buildinfo-6.5.0-39-generic +Package: linux-buildinfo-6.5.0-40-generic Build-Profiles: Architecture: amd64 armhf arm64 ppc64el s390x Section: kernel @@ -338,18 +338,18 @@ You likely do not want to install this package. -Package: linux-modules-ipu6-6.5.0-39-generic +Package: linux-modules-ipu6-6.5.0-40-generic Build-Profiles: Architecture: amd64 armhf arm64 ppc64el s390x Section: kernel Priority: optional Depends: ${misc:Depends}, - linux-image-6.5.0-39-generic | linux-image-unsigned-6.5.0-39-generic, + linux-image-6.5.0-40-generic | linux-image-unsigned-6.5.0-40-generic, Built-Using: ${linux:BuiltUsing} -Description: Linux kernel ipu6 modules for version 6.5.0-39 +Description: Linux kernel ipu6 modules for version 6.5.0-40 This package provides the Linux kernel ipu6 modules for version - 6.5.0-39. + 6.5.0-40. . You likely do not want to install this package directly. Instead, install the one of the linux-modules-ipu6-generic* meta-packages, @@ -357,18 +357,18 @@ also installed. -Package: linux-modules-ivsc-6.5.0-39-generic +Package: linux-modules-ivsc-6.5.0-40-generic Build-Profiles: Architecture: amd64 armhf arm64 ppc64el s390x Section: kernel Priority: optional Depends: ${misc:Depends}, - linux-image-6.5.0-39-generic | linux-image-unsigned-6.5.0-39-generic, + linux-image-6.5.0-40-generic | linux-image-unsigned-6.5.0-40-generic, Built-Using: ${linux:BuiltUsing} -Description: Linux kernel ivsc modules for version 6.5.0-39 +Description: Linux kernel ivsc modules for version 6.5.0-40 This package provides the Linux kernel ivsc modules for version - 6.5.0-39. + 6.5.0-40. . You likely do not want to install this package directly. Instead, install the one of the linux-modules-ivsc-generic* meta-packages, @@ -376,18 +376,18 @@ also installed. -Package: linux-modules-iwlwifi-6.5.0-39-generic +Package: linux-modules-iwlwifi-6.5.0-40-generic Build-Profiles: Architecture: amd64 armhf arm64 ppc64el s390x Section: kernel Priority: optional Depends: ${misc:Depends}, - linux-image-6.5.0-39-generic | linux-image-unsigned-6.5.0-39-generic, + linux-image-6.5.0-40-generic | linux-image-unsigned-6.5.0-40-generic, Built-Using: ${linux:BuiltUsing} -Description: Linux kernel iwlwifi modules for version 6.5.0-39 +Description: Linux kernel iwlwifi modules for version 6.5.0-40 This package provides the Linux kernel iwlwifi modules for version - 6.5.0-39. + 6.5.0-40. . You likely do not want to install this package directly. Instead, install the one of the linux-modules-iwlwifi-generic* meta-packages, @@ -395,17 +395,17 @@ also installed. -Package: linux-image-unsigned-6.5.0-39-generic-64k +Package: linux-image-unsigned-6.5.0-40-generic-64k Build-Profiles: Architecture: arm64 Section: kernel Priority: optional Provides: linux-image, fuse-module, kvm-api-4, redhat-cluster-modules, ivtv-modules, ${linux:rprovides} -Depends: ${misc:Depends}, ${shlibs:Depends}, kmod, linux-base (>= 4.5ubuntu1~16.04.1), linux-modules-6.5.0-39-generic-64k +Depends: ${misc:Depends}, ${shlibs:Depends}, kmod, linux-base (>= 4.5ubuntu1~16.04.1), linux-modules-6.5.0-40-generic-64k Recommends: grub-efi-arm64 [arm64] | flash-kernel [arm64], initramfs-tools | linux-initramfs-tool Breaks: flash-kernel (<< 3.90ubuntu2) [arm64 armhf], s390-tools (<< 2.3.0-0ubuntu3) [s390x] -Conflicts: linux-image-6.5.0-39-generic-64k -Suggests: fdutils, linux-doc | linux-source-6.5.0, linux-tools, linux-headers-6.5.0-39-generic-64k, linux-modules-extra-6.5.0-39-generic-64k +Conflicts: linux-image-6.5.0-40-generic-64k +Suggests: fdutils, linux-doc | linux-source-6.5.0, linux-tools, linux-headers-6.5.0-40-generic-64k, linux-modules-extra-6.5.0-40-generic-64k Description: Linux kernel image for version 6.5.0 on 64 bit x86 SMP This package contains the unsigned Linux kernel image for version 6.5.0 on 64 bit x86 SMP. @@ -418,7 +418,7 @@ the linux-generic-64k meta-package, which will ensure that upgrades work correctly, and that supporting packages are also installed. -Package: linux-modules-6.5.0-39-generic-64k +Package: linux-modules-6.5.0-40-generic-64k Build-Profiles: Architecture: arm64 Section: kernel @@ -438,12 +438,12 @@ the linux-generic-64k meta-package, which will ensure that upgrades work correctly, and that supporting packages are also installed. -Package: linux-modules-extra-6.5.0-39-generic-64k +Package: linux-modules-extra-6.5.0-40-generic-64k Build-Profiles: Architecture: arm64 Section: kernel Priority: optional -Depends: ${misc:Depends}, ${shlibs:Depends}, linux-modules-6.5.0-39-generic-64k, wireless-regdb +Depends: ${misc:Depends}, ${shlibs:Depends}, linux-modules-6.5.0-40-generic-64k, wireless-regdb Description: Linux kernel extra modules for version 6.5.0 on 64 bit x86 SMP This package contains the Linux kernel extra modules for version 6.5.0 on 64 bit x86 SMP. @@ -460,21 +460,21 @@ the linux-generic-64k meta-package, which will ensure that upgrades work correctly, and that supporting packages are also installed. -Package: linux-headers-6.5.0-39-generic-64k +Package: linux-headers-6.5.0-40-generic-64k Build-Profiles: Architecture: arm64 Section: devel Priority: optional -Depends: ${misc:Depends}, linux-headers-6.5.0-39, ${shlibs:Depends} +Depends: ${misc:Depends}, linux-headers-6.5.0-40, ${shlibs:Depends} Provides: linux-headers, linux-headers-3.0 Description: Linux kernel headers for version 6.5.0 on 64 bit x86 SMP This package provides kernel header files for version 6.5.0 on 64 bit x86 SMP. . This is for sites that want the latest kernel headers. Please read - /usr/share/doc/linux-headers-6.5.0-39/debian.README.gz for details. + /usr/share/doc/linux-headers-6.5.0-40/debian.README.gz for details. -Package: linux-lib-rust-6.5.0-39-generic-64k +Package: linux-lib-rust-6.5.0-40-generic-64k Build-Profiles: Architecture: amd64 Multi-Arch: foreign @@ -485,7 +485,7 @@ This package provides kernel library files for version 6.5.0, that allow to compile out-of-tree kernel modules written in Rust. -Package: linux-image-unsigned-6.5.0-39-generic-64k-dbgsym +Package: linux-image-unsigned-6.5.0-40-generic-64k-dbgsym Build-Profiles: Architecture: arm64 Section: devel @@ -502,31 +502,31 @@ is uncompressed, and unstripped. This package also includes the unstripped modules. -Package: linux-tools-6.5.0-39-generic-64k +Package: linux-tools-6.5.0-40-generic-64k Build-Profiles: Architecture: arm64 Section: devel Priority: optional -Depends: ${misc:Depends}, linux-tools-6.5.0-39 -Description: Linux kernel version specific tools for version 6.5.0-39 +Depends: ${misc:Depends}, linux-tools-6.5.0-40 +Description: Linux kernel version specific tools for version 6.5.0-40 This package provides the architecture dependant parts for kernel version locked tools (such as perf and x86_energy_perf_policy) for - version 6.5.0-39 on + version 6.5.0-40 on 64 bit x86. -Package: linux-cloud-tools-6.5.0-39-generic-64k +Package: linux-cloud-tools-6.5.0-40-generic-64k Build-Profiles: Architecture: arm64 Section: devel Priority: optional -Depends: ${misc:Depends}, linux-cloud-tools-6.5.0-39 -Description: Linux kernel version specific cloud tools for version 6.5.0-39 +Depends: ${misc:Depends}, linux-cloud-tools-6.5.0-40 +Description: Linux kernel version specific cloud tools for version 6.5.0-40 This package provides the architecture dependant parts for kernel - version locked tools for cloud for version 6.5.0-39 on + version locked tools for cloud for version 6.5.0-40 on 64 bit x86. -Package: linux-buildinfo-6.5.0-39-generic-64k +Package: linux-buildinfo-6.5.0-40-generic-64k Build-Profiles: Architecture: arm64 Section: kernel @@ -540,18 +540,18 @@ You likely do not want to install this package. -Package: linux-modules-ipu6-6.5.0-39-generic-64k +Package: linux-modules-ipu6-6.5.0-40-generic-64k Build-Profiles: Architecture: arm64 Section: kernel Priority: optional Depends: ${misc:Depends}, - linux-image-6.5.0-39-generic-64k | linux-image-unsigned-6.5.0-39-generic-64k, + linux-image-6.5.0-40-generic-64k | linux-image-unsigned-6.5.0-40-generic-64k, Built-Using: ${linux:BuiltUsing} -Description: Linux kernel ipu6 modules for version 6.5.0-39 +Description: Linux kernel ipu6 modules for version 6.5.0-40 This package provides the Linux kernel ipu6 modules for version - 6.5.0-39. + 6.5.0-40. . You likely do not want to install this package directly. Instead, install the one of the linux-modules-ipu6-generic-64k* meta-packages, @@ -559,18 +559,18 @@ also installed. -Package: linux-modules-ivsc-6.5.0-39-generic-64k +Package: linux-modules-ivsc-6.5.0-40-generic-64k Build-Profiles: Architecture: arm64 Section: kernel Priority: optional Depends: ${misc:Depends}, - linux-image-6.5.0-39-generic-64k | linux-image-unsigned-6.5.0-39-generic-64k, + linux-image-6.5.0-40-generic-64k | linux-image-unsigned-6.5.0-40-generic-64k, Built-Using: ${linux:BuiltUsing} -Description: Linux kernel ivsc modules for version 6.5.0-39 +Description: Linux kernel ivsc modules for version 6.5.0-40 This package provides the Linux kernel ivsc modules for version - 6.5.0-39. + 6.5.0-40. . You likely do not want to install this package directly. Instead, install the one of the linux-modules-ivsc-generic-64k* meta-packages, @@ -578,18 +578,18 @@ also installed. -Package: linux-modules-iwlwifi-6.5.0-39-generic-64k +Package: linux-modules-iwlwifi-6.5.0-40-generic-64k Build-Profiles: Architecture: arm64 Section: kernel Priority: optional Depends: ${misc:Depends}, - linux-image-6.5.0-39-generic-64k | linux-image-unsigned-6.5.0-39-generic-64k, + linux-image-6.5.0-40-generic-64k | linux-image-unsigned-6.5.0-40-generic-64k, Built-Using: ${linux:BuiltUsing} -Description: Linux kernel iwlwifi modules for version 6.5.0-39 +Description: Linux kernel iwlwifi modules for version 6.5.0-40 This package provides the Linux kernel iwlwifi modules for version - 6.5.0-39. + 6.5.0-40. . You likely do not want to install this package directly. Instead, install the one of the linux-modules-iwlwifi-generic-64k* meta-packages, @@ -597,17 +597,17 @@ also installed. -Package: linux-image-unsigned-6.5.0-39-generic-lpae +Package: linux-image-unsigned-6.5.0-40-generic-lpae Build-Profiles: Architecture: armhf Section: kernel Priority: optional Provides: linux-image, fuse-module, kvm-api-4, redhat-cluster-modules, ivtv-modules, ${linux:rprovides} -Depends: ${misc:Depends}, ${shlibs:Depends}, kmod, linux-base (>= 4.5ubuntu1~16.04.1), linux-modules-6.5.0-39-generic-lpae +Depends: ${misc:Depends}, ${shlibs:Depends}, kmod, linux-base (>= 4.5ubuntu1~16.04.1), linux-modules-6.5.0-40-generic-lpae Recommends: flash-kernel [armhf] | grub-efi-arm [armhf], initramfs-tools | linux-initramfs-tool Breaks: flash-kernel (<< 3.90ubuntu2) [arm64 armhf], s390-tools (<< 2.3.0-0ubuntu3) [s390x] -Conflicts: linux-image-6.5.0-39-generic-lpae -Suggests: fdutils, linux-doc | linux-source-6.5.0, linux-tools, linux-headers-6.5.0-39-generic-lpae, linux-modules-extra-6.5.0-39-generic-lpae +Conflicts: linux-image-6.5.0-40-generic-lpae +Suggests: fdutils, linux-doc | linux-source-6.5.0, linux-tools, linux-headers-6.5.0-40-generic-lpae, linux-modules-extra-6.5.0-40-generic-lpae Description: Linux kernel image for version 6.5.0 on 64 bit x86 SMP This package contains the unsigned Linux kernel image for version 6.5.0 on 64 bit x86 SMP. @@ -620,7 +620,7 @@ the linux-generic-lpae meta-package, which will ensure that upgrades work correctly, and that supporting packages are also installed. -Package: linux-modules-6.5.0-39-generic-lpae +Package: linux-modules-6.5.0-40-generic-lpae Build-Profiles: Architecture: armhf Section: kernel @@ -640,12 +640,12 @@ the linux-generic-lpae meta-package, which will ensure that upgrades work correctly, and that supporting packages are also installed. -Package: linux-modules-extra-6.5.0-39-generic-lpae +Package: linux-modules-extra-6.5.0-40-generic-lpae Build-Profiles: Architecture: armhf Section: kernel Priority: optional -Depends: ${misc:Depends}, ${shlibs:Depends}, linux-modules-6.5.0-39-generic-lpae, wireless-regdb +Depends: ${misc:Depends}, ${shlibs:Depends}, linux-modules-6.5.0-40-generic-lpae, wireless-regdb Description: Linux kernel extra modules for version 6.5.0 on 64 bit x86 SMP This package contains the Linux kernel extra modules for version 6.5.0 on 64 bit x86 SMP. @@ -662,21 +662,21 @@ the linux-generic-lpae meta-package, which will ensure that upgrades work correctly, and that supporting packages are also installed. -Package: linux-headers-6.5.0-39-generic-lpae +Package: linux-headers-6.5.0-40-generic-lpae Build-Profiles: Architecture: armhf Section: devel Priority: optional -Depends: ${misc:Depends}, linux-headers-6.5.0-39, ${shlibs:Depends} +Depends: ${misc:Depends}, linux-headers-6.5.0-40, ${shlibs:Depends} Provides: linux-headers, linux-headers-3.0 Description: Linux kernel headers for version 6.5.0 on 64 bit x86 SMP This package provides kernel header files for version 6.5.0 on 64 bit x86 SMP. . This is for sites that want the latest kernel headers. Please read - /usr/share/doc/linux-headers-6.5.0-39/debian.README.gz for details. + /usr/share/doc/linux-headers-6.5.0-40/debian.README.gz for details. -Package: linux-lib-rust-6.5.0-39-generic-lpae +Package: linux-lib-rust-6.5.0-40-generic-lpae Build-Profiles: Architecture: amd64 Multi-Arch: foreign @@ -687,7 +687,7 @@ This package provides kernel library files for version 6.5.0, that allow to compile out-of-tree kernel modules written in Rust. -Package: linux-image-unsigned-6.5.0-39-generic-lpae-dbgsym +Package: linux-image-unsigned-6.5.0-40-generic-lpae-dbgsym Build-Profiles: Architecture: armhf Section: devel @@ -704,31 +704,31 @@ is uncompressed, and unstripped. This package also includes the unstripped modules. -Package: linux-tools-6.5.0-39-generic-lpae +Package: linux-tools-6.5.0-40-generic-lpae Build-Profiles: Architecture: armhf Section: devel Priority: optional -Depends: ${misc:Depends}, linux-tools-6.5.0-39 -Description: Linux kernel version specific tools for version 6.5.0-39 +Depends: ${misc:Depends}, linux-tools-6.5.0-40 +Description: Linux kernel version specific tools for version 6.5.0-40 This package provides the architecture dependant parts for kernel version locked tools (such as perf and x86_energy_perf_policy) for - version 6.5.0-39 on + version 6.5.0-40 on 64 bit x86. -Package: linux-cloud-tools-6.5.0-39-generic-lpae +Package: linux-cloud-tools-6.5.0-40-generic-lpae Build-Profiles: Architecture: armhf Section: devel Priority: optional -Depends: ${misc:Depends}, linux-cloud-tools-6.5.0-39 -Description: Linux kernel version specific cloud tools for version 6.5.0-39 +Depends: ${misc:Depends}, linux-cloud-tools-6.5.0-40 +Description: Linux kernel version specific cloud tools for version 6.5.0-40 This package provides the architecture dependant parts for kernel - version locked tools for cloud for version 6.5.0-39 on + version locked tools for cloud for version 6.5.0-40 on 64 bit x86. -Package: linux-buildinfo-6.5.0-39-generic-lpae +Package: linux-buildinfo-6.5.0-40-generic-lpae Build-Profiles: Architecture: armhf Section: kernel @@ -742,18 +742,18 @@ You likely do not want to install this package. -Package: linux-modules-ipu6-6.5.0-39-generic-lpae +Package: linux-modules-ipu6-6.5.0-40-generic-lpae Build-Profiles: Architecture: armhf Section: kernel Priority: optional Depends: ${misc:Depends}, - linux-image-6.5.0-39-generic-lpae | linux-image-unsigned-6.5.0-39-generic-lpae, + linux-image-6.5.0-40-generic-lpae | linux-image-unsigned-6.5.0-40-generic-lpae, Built-Using: ${linux:BuiltUsing} -Description: Linux kernel ipu6 modules for version 6.5.0-39 +Description: Linux kernel ipu6 modules for version 6.5.0-40 This package provides the Linux kernel ipu6 modules for version - 6.5.0-39. + 6.5.0-40. . You likely do not want to install this package directly. Instead, install the one of the linux-modules-ipu6-generic-lpae* meta-packages, @@ -761,18 +761,18 @@ also installed. -Package: linux-modules-ivsc-6.5.0-39-generic-lpae +Package: linux-modules-ivsc-6.5.0-40-generic-lpae Build-Profiles: Architecture: armhf Section: kernel Priority: optional Depends: ${misc:Depends}, - linux-image-6.5.0-39-generic-lpae | linux-image-unsigned-6.5.0-39-generic-lpae, + linux-image-6.5.0-40-generic-lpae | linux-image-unsigned-6.5.0-40-generic-lpae, Built-Using: ${linux:BuiltUsing} -Description: Linux kernel ivsc modules for version 6.5.0-39 +Description: Linux kernel ivsc modules for version 6.5.0-40 This package provides the Linux kernel ivsc modules for version - 6.5.0-39. + 6.5.0-40. . You likely do not want to install this package directly. Instead, install the one of the linux-modules-ivsc-generic-lpae* meta-packages, @@ -780,18 +780,18 @@ also installed. -Package: linux-modules-iwlwifi-6.5.0-39-generic-lpae +Package: linux-modules-iwlwifi-6.5.0-40-generic-lpae Build-Profiles: Architecture: armhf Section: kernel Priority: optional Depends: ${misc:Depends}, - linux-image-6.5.0-39-generic-lpae | linux-image-unsigned-6.5.0-39-generic-lpae, + linux-image-6.5.0-40-generic-lpae | linux-image-unsigned-6.5.0-40-generic-lpae, Built-Using: ${linux:BuiltUsing} -Description: Linux kernel iwlwifi modules for version 6.5.0-39 +Description: Linux kernel iwlwifi modules for version 6.5.0-40 This package provides the Linux kernel iwlwifi modules for version - 6.5.0-39. + 6.5.0-40. . You likely do not want to install this package directly. Instead, install the one of the linux-modules-iwlwifi-generic-lpae* meta-packages, reverted: --- linux-6.5.0/drivers/acpi/acpi_ipmi.c +++ linux-6.5.0.orig/drivers/acpi/acpi_ipmi.c @@ -22,8 +22,6 @@ /* the IPMI timeout is 5s */ #define IPMI_TIMEOUT (5000) #define ACPI_IPMI_MAX_MSG_LENGTH 64 -/* 2s should be suffient for SMI being selected */ -#define ACPI_IPMI_SMI_SELECTION_TIMEOUT (2 * HZ) struct acpi_ipmi_device { /* the device list attached to driver_data.ipmi_devices */ @@ -56,7 +54,6 @@ * to this selected global IPMI system interface. */ struct acpi_ipmi_device *selected_smi; - struct completion smi_selection_done; }; struct acpi_ipmi_msg { @@ -466,10 +463,8 @@ if (temp->handle == handle) goto err_lock; } + if (!driver_data.selected_smi) - if (!driver_data.selected_smi) { driver_data.selected_smi = ipmi_device; - complete(&driver_data.smi_selection_done); - } list_add_tail(&ipmi_device->head, &driver_data.ipmi_devices); mutex_unlock(&driver_data.ipmi_lock); @@ -583,20 +578,6 @@ return status; } -int acpi_wait_for_acpi_ipmi(void) -{ - long ret; - - ret = wait_for_completion_interruptible_timeout(&driver_data.smi_selection_done, - ACPI_IPMI_SMI_SELECTION_TIMEOUT); - - if (ret <= 0) - return -ETIMEDOUT; - - return 0; -} -EXPORT_SYMBOL_GPL(acpi_wait_for_acpi_ipmi); - static int __init acpi_ipmi_init(void) { int result; @@ -605,8 +586,6 @@ if (acpi_disabled) return 0; - init_completion(&driver_data.smi_selection_done); - status = acpi_install_address_space_handler(ACPI_ROOT_OBJECT, ACPI_ADR_SPACE_IPMI, &acpi_ipmi_space_handler, diff -u linux-6.5.0/drivers/android/binder.c linux-6.5.0/drivers/android/binder.c --- linux-6.5.0/drivers/android/binder.c +++ linux-6.5.0/drivers/android/binder.c @@ -478,16 +478,6 @@ { WARN_ON(!list_empty(&thread->waiting_thread_node)); binder_enqueue_work_ilocked(work, &thread->todo); - - /* (e)poll-based threads require an explicit wakeup signal when - * queuing their own work; they rely on these events to consume - * messages without I/O block. Without it, threads risk waiting - * indefinitely without handling the work. - */ - if (thread->looper & BINDER_LOOPER_STATE_POLL && - thread->pid == current->pid && !thread->process_todo) - wake_up_interruptible_sync(&thread->wait); - thread->process_todo = true; } reverted: --- linux-6.5.0/drivers/atm/idt77252.c +++ linux-6.5.0.orig/drivers/atm/idt77252.c @@ -2930,8 +2930,6 @@ vc->scq = alloc_scq(card, vc->class); if (!vc->scq) { printk("%s: can't get SCQ.\n", card->name); - kfree(card->vcs[0]); - card->vcs[0] = NULL; return -ENOMEM; } diff -u linux-6.5.0/drivers/base/core.c linux-6.5.0/drivers/base/core.c --- linux-6.5.0/drivers/base/core.c +++ linux-6.5.0/drivers/base/core.c @@ -283,12 +283,10 @@ return false; } -#define DL_MARKER_FLAGS (DL_FLAG_INFERRED | \ - DL_FLAG_CYCLE | \ - DL_FLAG_MANAGED) static inline bool device_link_flag_is_sync_state_only(u32 flags) { - return (flags & ~DL_MARKER_FLAGS) == DL_FLAG_SYNC_STATE_ONLY; + return (flags & ~(DL_FLAG_INFERRED | DL_FLAG_CYCLE)) == + (DL_FLAG_SYNC_STATE_ONLY | DL_FLAG_MANAGED); } /** @@ -2059,14 +2057,9 @@ /* * SYNC_STATE_ONLY device links don't block probing and supports cycles. - * So, one might expect that cycle detection isn't necessary for them. - * However, if the device link was marked as SYNC_STATE_ONLY because - * it's part of a cycle, then we still need to do cycle detection. This - * is because the consumer and supplier might be part of multiple cycles - * and we need to detect all those cycles. + * So cycle detection isn't necessary and shouldn't be done. */ - if (!device_link_flag_is_sync_state_only(flags) || - flags & DL_FLAG_CYCLE) { + if (!(flags & DL_FLAG_SYNC_STATE_ONLY)) { device_links_write_lock(); if (__fw_devlink_relax_cycles(con, sup_handle)) { __fwnode_link_cycle(link); reverted: --- linux-6.5.0/drivers/base/power/domain.c +++ linux-6.5.0.orig/drivers/base/power/domain.c @@ -1102,7 +1102,7 @@ return 0; } +late_initcall(genpd_power_off_unused); -late_initcall_sync(genpd_power_off_unused); #ifdef CONFIG_PM_SLEEP reverted: --- linux-6.5.0/drivers/crypto/ccp/sev-dev.c +++ linux-6.5.0.orig/drivers/crypto/ccp/sev-dev.c @@ -520,16 +520,10 @@ static int __sev_platform_shutdown_locked(int *error) { + struct sev_device *sev = psp_master->sev_data; - struct psp_device *psp = psp_master; - struct sev_device *sev; int ret; + if (!sev || sev->state == SEV_STATE_UNINIT) - if (!psp || !psp->sev_data) - return 0; - - sev = psp->sev_data; - - if (sev->state == SEV_STATE_UNINIT) return 0; ret = __sev_do_cmd_locked(SEV_CMD_SHUTDOWN, NULL, error); reverted: --- linux-6.5.0/drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c +++ linux-6.5.0.orig/drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c @@ -38,17 +38,15 @@ if (!dpaa2_chan->fd_pool) goto err; + dpaa2_chan->fl_pool = dma_pool_create("fl_pool", dev, + sizeof(struct dpaa2_fl_entry), + sizeof(struct dpaa2_fl_entry), 0); - dpaa2_chan->fl_pool = - dma_pool_create("fl_pool", dev, - sizeof(struct dpaa2_fl_entry) * 3, - sizeof(struct dpaa2_fl_entry), 0); - if (!dpaa2_chan->fl_pool) goto err_fd; dpaa2_chan->sdd_pool = dma_pool_create("sdd_pool", dev, + sizeof(struct dpaa2_qdma_sd_d), - sizeof(struct dpaa2_qdma_sd_d) * 2, sizeof(struct dpaa2_qdma_sd_d), 0); if (!dpaa2_chan->sdd_pool) goto err_fl; reverted: --- linux-6.5.0/drivers/dma/fsl-qdma.c +++ linux-6.5.0.orig/drivers/dma/fsl-qdma.c @@ -514,11 +514,11 @@ queue_temp = queue_head + i + (j * queue_num); queue_temp->cq = + dma_alloc_coherent(&pdev->dev, + sizeof(struct fsl_qdma_format) * + queue_size[i], + &queue_temp->bus_addr, + GFP_KERNEL); - dmam_alloc_coherent(&pdev->dev, - sizeof(struct fsl_qdma_format) * - queue_size[i], - &queue_temp->bus_addr, - GFP_KERNEL); if (!queue_temp->cq) return NULL; queue_temp->block_base = fsl_qdma->block_base + @@ -563,11 +563,11 @@ /* * Buffer for queue command */ + status_head->cq = dma_alloc_coherent(&pdev->dev, + sizeof(struct fsl_qdma_format) * + status_size, + &status_head->bus_addr, + GFP_KERNEL); - status_head->cq = dmam_alloc_coherent(&pdev->dev, - sizeof(struct fsl_qdma_format) * - status_size, - &status_head->bus_addr, - GFP_KERNEL); if (!status_head->cq) { devm_kfree(&pdev->dev, status_head); return NULL; @@ -1268,6 +1268,8 @@ static int fsl_qdma_remove(struct platform_device *pdev) { + int i; + struct fsl_qdma_queue *status; struct device_node *np = pdev->dev.of_node; struct fsl_qdma_engine *fsl_qdma = platform_get_drvdata(pdev); @@ -1276,6 +1278,11 @@ of_dma_controller_free(np); dma_async_device_unregister(&fsl_qdma->dma_dev); + for (i = 0; i < fsl_qdma->block_number; i++) { + status = fsl_qdma->status[i]; + dma_free_coherent(&pdev->dev, sizeof(struct fsl_qdma_format) * + status->n_cq, status->cq, status->bus_addr); + } return 0; } reverted: --- linux-6.5.0/drivers/dma/ti/k3-udma.c +++ linux-6.5.0.orig/drivers/dma/ti/k3-udma.c @@ -3969,7 +3969,6 @@ { struct udma_chan *uc = to_udma_chan(&vc->chan); struct udma_desc *d; - u8 status; if (!vd) return; @@ -3979,12 +3978,12 @@ if (d->metadata_size) udma_fetch_epib(uc, d); + /* Provide residue information for the client */ if (result) { void *desc_vaddr = udma_curr_cppi5_desc_vaddr(d, d->desc_idx); if (cppi5_desc_get_type(desc_vaddr) == CPPI5_INFO0_DESC_TYPE_VAL_HOST) { - /* Provide residue information for the client */ result->residue = d->residue - cppi5_hdesc_get_pktlen(desc_vaddr); if (result->residue) @@ -3993,12 +3992,7 @@ result->result = DMA_TRANS_NOERROR; } else { result->residue = 0; + result->result = DMA_TRANS_NOERROR; - /* Propagate TR Response errors to the client */ - status = d->hwdesc[0].tr_resp_base->status; - if (status) - result->result = DMA_TRANS_ABORTED; - else - result->result = DMA_TRANS_NOERROR; } } } diff -u linux-6.5.0/drivers/firewire/core-device.c linux-6.5.0/drivers/firewire/core-device.c --- linux-6.5.0/drivers/firewire/core-device.c +++ linux-6.5.0/drivers/firewire/core-device.c @@ -100,9 +100,10 @@ * @buf: where to put the string * @size: size of @buf, in bytes * - * The string is taken from a minimal ASCII text descriptor leaf just after the entry with the - * @key. The string is zero-terminated. An overlong string is silently truncated such that it - * and the zero byte fit into @size. + * The string is taken from a minimal ASCII text descriptor leaf after + * the immediate entry with @key. The string is zero-terminated. + * An overlong string is silently truncated such that it and the + * zero byte fit into @size. * * Returns strlen(buf) or a negative error code. */ reverted: --- linux-6.5.0/drivers/firmware/efi/libstub/Makefile +++ linux-6.5.0.orig/drivers/firmware/efi/libstub/Makefile @@ -107,6 +107,13 @@ # https://bugs.llvm.org/show_bug.cgi?id=46480 STUBCOPY_FLAGS-y += --remove-section=.note.gnu.property +# +# For x86, bootloaders like systemd-boot or grub-efi do not zero-initialize the +# .bss section, so the .bss section of the EFI stub needs to be included in the +# .data section of the compressed kernel to ensure initialization. Rename the +# .bss section here so it's easy to pick out in the linker script. +# +STUBCOPY_FLAGS-$(CONFIG_X86) += --rename-section .bss=.bss.efistub,load,alloc STUBCOPY_RELOC-$(CONFIG_X86_32) := R_386_32 STUBCOPY_RELOC-$(CONFIG_X86_64) := R_X86_64_64 diff -u linux-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c linux-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c --- linux-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ linux-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -4370,6 +4370,7 @@ drm_fb_helper_set_suspend_unlocked(adev_to_drm(adev)->fb_helper, true); cancel_delayed_work_sync(&adev->delayed_init_work); + flush_delayed_work(&adev->gfx.gfx_off_delay_work); amdgpu_ras_suspend(adev); diff -u linux-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c linux-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c --- linux-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +++ linux-6.5.0/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c @@ -694,15 +694,8 @@ if (adev->gfx.gfx_off_req_count == 0 && !adev->gfx.gfx_off_state) { - /* If going to s2idle, no need to wait */ - if (adev->in_s0ix) { - if (!amdgpu_dpm_set_powergating_by_smu(adev, - AMD_IP_BLOCK_TYPE_GFX, true)) - adev->gfx.gfx_off_state = true; - } else { - schedule_delayed_work(&adev->gfx.gfx_off_delay_work, + schedule_delayed_work(&adev->gfx.gfx_off_delay_work, delay); - } } } else { if (adev->gfx.gfx_off_req_count == 0) { diff -u linux-6.5.0/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c linux-6.5.0/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c --- linux-6.5.0/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +++ linux-6.5.0/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c @@ -4034,6 +4034,8 @@ err = 0; adev->gfx.mec2_fw = NULL; } + amdgpu_gfx_cp_init_microcode(adev, AMDGPU_UCODE_ID_CP_MEC2); + amdgpu_gfx_cp_init_microcode(adev, AMDGPU_UCODE_ID_CP_MEC2_JT); gfx_v10_0_check_fw_write_wait(adev); out: diff -u linux-6.5.0/drivers/gpu/drm/amd/amdgpu/soc21.c linux-6.5.0/drivers/gpu/drm/amd/amdgpu/soc21.c --- linux-6.5.0/drivers/gpu/drm/amd/amdgpu/soc21.c +++ linux-6.5.0/drivers/gpu/drm/amd/amdgpu/soc21.c @@ -51,14 +51,14 @@ static const struct amdgpu_video_codec_info vcn_4_0_0_video_codecs_encode_array_vcn0[] = { {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC, 4096, 2304, 0)}, - {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC, 8192, 4352, 0)}, + {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC, 4096, 2304, 0)}, {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_AV1, 8192, 4352, 0)}, }; static const struct amdgpu_video_codec_info vcn_4_0_0_video_codecs_encode_array_vcn1[] = { {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC, 4096, 2304, 0)}, - {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC, 8192, 4352, 0)}, + {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC, 4096, 2304, 0)}, }; static const struct amdgpu_video_codecs vcn_4_0_0_video_codecs_encode_vcn0 = diff -u linux-6.5.0/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c linux-6.5.0/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c --- linux-6.5.0/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ linux-6.5.0/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -6063,9 +6063,7 @@ if (recalculate_timing) { freesync_mode = get_highest_refresh_rate_mode(aconnector, false); drm_mode_copy(&saved_mode, &mode); - saved_mode.picture_aspect_ratio = mode.picture_aspect_ratio; drm_mode_copy(&mode, freesync_mode); - mode.picture_aspect_ratio = saved_mode.picture_aspect_ratio; } else { decide_crtc_timing_for_drm_display_mode( &mode, preferred_mode, scale); @@ -10353,13 +10351,11 @@ goto fail; } - if (dc_resource_is_dsc_encoding_supported(dc)) { - ret = compute_mst_dsc_configs_for_state(state, dm_state->context, vars); - if (ret) { - DRM_DEBUG_DRIVER("compute_mst_dsc_configs_for_state() failed\n"); - ret = -EINVAL; - goto fail; - } + ret = compute_mst_dsc_configs_for_state(state, dm_state->context, vars); + if (ret) { + DRM_DEBUG_DRIVER("compute_mst_dsc_configs_for_state() failed\n"); + ret = -EINVAL; + goto fail; } ret = dm_update_mst_vcpi_slots_for_dsc(state, dm_state->context, vars); diff -u linux-6.5.0/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c linux-6.5.0/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c --- linux-6.5.0/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c +++ linux-6.5.0/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c @@ -206,32 +206,28 @@ void dcn21_set_pipe(struct pipe_ctx *pipe_ctx) { struct abm *abm = pipe_ctx->stream_res.abm; - struct timing_generator *tg = pipe_ctx->stream_res.tg; + uint32_t otg_inst = pipe_ctx->stream_res.tg->inst; struct panel_cntl *panel_cntl = pipe_ctx->stream->link->panel_cntl; struct dmcu *dmcu = pipe_ctx->stream->ctx->dc->res_pool->dmcu; - uint32_t otg_inst; - - if (!abm && !tg && !panel_cntl) - return; - - otg_inst = tg->inst; if (dmcu) { dce110_set_pipe(pipe_ctx); return; } - if (abm->funcs && abm->funcs->set_pipe_ex) { - abm->funcs->set_pipe_ex(abm, + if (abm && panel_cntl) { + if (abm->funcs && abm->funcs->set_pipe_ex) { + abm->funcs->set_pipe_ex(abm, otg_inst, SET_ABM_PIPE_NORMAL, panel_cntl->inst, panel_cntl->pwrseq_inst); - } else { - dmub_abm_set_pipe(abm, otg_inst, - SET_ABM_PIPE_NORMAL, - panel_cntl->inst, - panel_cntl->pwrseq_inst); + } else { + dmub_abm_set_pipe(abm, otg_inst, + SET_ABM_PIPE_NORMAL, + panel_cntl->inst, + panel_cntl->pwrseq_inst); + } } } @@ -241,35 +237,34 @@ { struct dc_context *dc = pipe_ctx->stream->ctx; struct abm *abm = pipe_ctx->stream_res.abm; - struct timing_generator *tg = pipe_ctx->stream_res.tg; struct panel_cntl *panel_cntl = pipe_ctx->stream->link->panel_cntl; - uint32_t otg_inst; - - if (!abm && !tg && !panel_cntl) - return false; - - otg_inst = tg->inst; if (dc->dc->res_pool->dmcu) { dce110_set_backlight_level(pipe_ctx, backlight_pwm_u16_16, frame_ramp); return true; } - if (abm->funcs && abm->funcs->set_pipe_ex) { - abm->funcs->set_pipe_ex(abm, - otg_inst, - SET_ABM_PIPE_NORMAL, - panel_cntl->inst, - panel_cntl->pwrseq_inst); - } else { - dmub_abm_set_pipe(abm, - otg_inst, - SET_ABM_PIPE_NORMAL, - panel_cntl->inst, - panel_cntl->pwrseq_inst); + if (abm != NULL) { + uint32_t otg_inst = pipe_ctx->stream_res.tg->inst; + + if (abm && panel_cntl) { + if (abm->funcs && abm->funcs->set_pipe_ex) { + abm->funcs->set_pipe_ex(abm, + otg_inst, + SET_ABM_PIPE_NORMAL, + panel_cntl->inst, + panel_cntl->pwrseq_inst); + } else { + dmub_abm_set_pipe(abm, + otg_inst, + SET_ABM_PIPE_NORMAL, + panel_cntl->inst, + panel_cntl->pwrseq_inst); + } + } } - if (abm->funcs && abm->funcs->set_backlight_level_pwm) + if (abm && abm->funcs && abm->funcs->set_backlight_level_pwm) abm->funcs->set_backlight_level_pwm(abm, backlight_pwm_u16_16, frame_ramp, 0, panel_cntl->inst); else reverted: --- linux-6.5.0/drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c +++ linux-6.5.0.orig/drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c @@ -996,7 +996,7 @@ vpg = dcn301_vpg_create(ctx, vpg_inst); afmt = dcn301_afmt_create(ctx, afmt_inst); + if (!enc1 || !vpg || !afmt) { - if (!enc1 || !vpg || !afmt || eng_id >= ARRAY_SIZE(stream_enc_regs)) { kfree(enc1); kfree(vpg); kfree(afmt); diff -u linux-6.5.0/drivers/gpu/drm/amd/display/dc/dml/Makefile linux-6.5.0/drivers/gpu/drm/amd/display/dc/dml/Makefile --- linux-6.5.0/drivers/gpu/drm/amd/display/dc/dml/Makefile +++ linux-6.5.0/drivers/gpu/drm/amd/display/dc/dml/Makefile @@ -72,11 +72,11 @@ CFLAGS_$(AMDDALPATH)/dc/dml/display_mode_vba.o := $(dml_ccflags) CFLAGS_$(AMDDALPATH)/dc/dml/dcn10/dcn10_fpu.o := $(dml_ccflags) CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/dcn20_fpu.o := $(dml_ccflags) -CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_mode_vba_20.o := $(dml_ccflags) $(frame_warn_flag) +CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_mode_vba_20.o := $(dml_ccflags) CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_rq_dlg_calc_20.o := $(dml_ccflags) -CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_mode_vba_20v2.o := $(dml_ccflags) $(frame_warn_flag) +CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_mode_vba_20v2.o := $(dml_ccflags) CFLAGS_$(AMDDALPATH)/dc/dml/dcn20/display_rq_dlg_calc_20v2.o := $(dml_ccflags) -CFLAGS_$(AMDDALPATH)/dc/dml/dcn21/display_mode_vba_21.o := $(dml_ccflags) $(frame_warn_flag) +CFLAGS_$(AMDDALPATH)/dc/dml/dcn21/display_mode_vba_21.o := $(dml_ccflags) CFLAGS_$(AMDDALPATH)/dc/dml/dcn21/display_rq_dlg_calc_21.o := $(dml_ccflags) CFLAGS_$(AMDDALPATH)/dc/dml/dcn30/display_mode_vba_30.o := $(dml_ccflags) $(frame_warn_flag) CFLAGS_$(AMDDALPATH)/dc/dml/dcn30/display_rq_dlg_calc_30.o := $(dml_ccflags) diff -u linux-6.5.0/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c linux-6.5.0/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c --- linux-6.5.0/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c +++ linux-6.5.0/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c @@ -517,7 +517,6 @@ { enum link_training_result status = LINK_TRAINING_SUCCESS; union lane_status lane_status; - union lane_align_status_updated dpcd_lane_status_updated; uint8_t dpcd_buf[6] = {0}; uint32_t lane; @@ -533,12 +532,10 @@ * check lanes status */ lane_status.raw = dp_get_nibble_at_index(&dpcd_buf[2], lane); - dpcd_lane_status_updated.raw = dpcd_buf[4]; if (!lane_status.bits.CHANNEL_EQ_DONE_0 || !lane_status.bits.CR_DONE_0 || - !lane_status.bits.SYMBOL_LOCKED_0 || - !dp_is_interlane_aligned(dpcd_lane_status_updated)) { + !lane_status.bits.SYMBOL_LOCKED_0) { /* if one of the channel equalization, clock * recovery or symbol lock is dropped * consider it as (link has been reverted: --- linux-6.5.0/drivers/gpu/drm/drm_prime.c +++ linux-6.5.0.orig/drivers/gpu/drm/drm_prime.c @@ -834,7 +834,7 @@ if (max_segment == 0) max_segment = UINT_MAX; err = sg_alloc_table_from_pages_segment(sg, pages, nr_pages, 0, + nr_pages << PAGE_SHIFT, - (unsigned long)nr_pages << PAGE_SHIFT, max_segment, GFP_KERNEL); if (err) { kfree(sg); reverted: --- linux-6.5.0/drivers/gpu/drm/i915/gvt/handlers.c +++ linux-6.5.0.orig/drivers/gpu/drm/i915/gvt/handlers.c @@ -2850,7 +2850,8 @@ for (i = start; i < end; i += 4) { p = intel_gvt_find_mmio_info(gvt, i); if (p) { + WARN(1, "dup mmio definition offset %x\n", + info->offset); - WARN(1, "dup mmio definition offset %x\n", i); /* We return -EEXIST here to make GVT-g load fail. * So duplicated MMIO can be found as soon as diff -u linux-6.5.0/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c linux-6.5.0/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c --- linux-6.5.0/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ linux-6.5.0/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -2103,7 +2103,7 @@ } /* reset the merge 3D HW block */ - if (phys_enc->hw_pp && phys_enc->hw_pp->merge_3d) { + if (phys_enc->hw_pp->merge_3d) { phys_enc->hw_pp->merge_3d->ops.setup_3d_mode(phys_enc->hw_pp->merge_3d, BLEND_3D_NONE); if (phys_enc->hw_ctl->ops.update_pending_flush_merge_3d) @@ -2123,7 +2123,7 @@ if (phys_enc->hw_wb) intf_cfg.wb = phys_enc->hw_wb->idx; - if (phys_enc->hw_pp && phys_enc->hw_pp->merge_3d) + if (phys_enc->hw_pp->merge_3d) intf_cfg.merge_3d = phys_enc->hw_pp->merge_3d->idx; if (ctl->ops.reset_intf_cfg) diff -u linux-6.5.0/drivers/gpu/drm/msm/dp/dp_ctrl.c linux-6.5.0/drivers/gpu/drm/msm/dp/dp_ctrl.c --- linux-6.5.0/drivers/gpu/drm/msm/dp/dp_ctrl.c +++ linux-6.5.0/drivers/gpu/drm/msm/dp/dp_ctrl.c @@ -135,6 +135,11 @@ tbd = dp_link_get_test_bits_depth(ctrl->link, ctrl->panel->dp_mode.bpp); + if (tbd == DP_TEST_BIT_DEPTH_UNKNOWN) { + pr_debug("BIT_DEPTH not set. Configure default\n"); + tbd = DP_TEST_BIT_DEPTH_8; + } + config |= tbd << DP_CONFIGURATION_CTRL_BPC_SHIFT; /* Num of Lanes */ diff -u linux-6.5.0/drivers/gpu/drm/msm/dp/dp_link.c linux-6.5.0/drivers/gpu/drm/msm/dp/dp_link.c --- linux-6.5.0/drivers/gpu/drm/msm/dp/dp_link.c +++ linux-6.5.0/drivers/gpu/drm/msm/dp/dp_link.c @@ -7,7 +7,6 @@ #include -#include "dp_reg.h" #include "dp_link.h" #include "dp_panel.h" @@ -1115,7 +1114,7 @@ int dp_link_get_colorimetry_config(struct dp_link *dp_link) { - u32 cc = DP_MISC0_COLORIMERY_CFG_LEGACY_RGB; + u32 cc; struct dp_link_private *link; if (!dp_link) { @@ -1129,11 +1128,10 @@ * Unless a video pattern CTS test is ongoing, use RGB_VESA * Only RGB_VESA and RGB_CEA supported for now */ - if (dp_link_is_video_pattern_requested(link)) { - if (link->dp_link.test_video.test_dyn_range & - DP_TEST_DYNAMIC_RANGE_CEA) - cc = DP_MISC0_COLORIMERY_CFG_CEA_RGB; - } + if (dp_link_is_video_pattern_requested(link)) + cc = link->dp_link.test_video.test_dyn_range; + else + cc = DP_TEST_DYNAMIC_RANGE_VESA; return cc; } @@ -1213,9 +1211,6 @@ u32 dp_link_get_test_bits_depth(struct dp_link *dp_link, u32 bpp) { u32 tbd; - struct dp_link_private *link; - - link = container_of(dp_link, struct dp_link_private, dp_link); /* * Few simplistic rules and assumptions made here: @@ -1233,13 +1228,12 @@ tbd = DP_TEST_BIT_DEPTH_10; break; default: - drm_dbg_dp(link->drm_dev, "bpp=%d not supported, use bpc=8\n", - bpp); - tbd = DP_TEST_BIT_DEPTH_8; + tbd = DP_TEST_BIT_DEPTH_UNKNOWN; break; } - tbd = (tbd >> DP_TEST_BIT_DEPTH_SHIFT); + if (tbd != DP_TEST_BIT_DEPTH_UNKNOWN) + tbd = (tbd >> DP_TEST_BIT_DEPTH_SHIFT); return tbd; } reverted: --- linux-6.5.0/drivers/gpu/drm/msm/dp/dp_reg.h +++ linux-6.5.0.orig/drivers/gpu/drm/msm/dp/dp_reg.h @@ -143,9 +143,6 @@ #define DP_MISC0_COLORIMETRY_CFG_SHIFT (0x00000001) #define DP_MISC0_TEST_BITS_DEPTH_SHIFT (0x00000005) -#define DP_MISC0_COLORIMERY_CFG_LEGACY_RGB (0) -#define DP_MISC0_COLORIMERY_CFG_CEA_RGB (0x04) - #define REG_DP_VALID_BOUNDARY (0x00000030) #define REG_DP_VALID_BOUNDARY_2 (0x00000034) reverted: --- linux-6.5.0/drivers/gpu/drm/msm/msm_gem_prime.c +++ linux-6.5.0.orig/drivers/gpu/drm/msm/msm_gem_prime.c @@ -41,7 +41,7 @@ { void *vaddr; + vaddr = msm_gem_get_vaddr(obj); - vaddr = msm_gem_get_vaddr_locked(obj); if (IS_ERR(vaddr)) return PTR_ERR(vaddr); iosys_map_set_vaddr(map, vaddr); @@ -51,7 +51,7 @@ void msm_gem_prime_vunmap(struct drm_gem_object *obj, struct iosys_map *map) { + msm_gem_put_vaddr(obj); - msm_gem_put_vaddr_locked(obj); } struct drm_gem_object *msm_gem_prime_import_sg_table(struct drm_device *dev, reverted: --- linux-6.5.0/drivers/gpu/drm/msm/msm_iommu.c +++ linux-6.5.0.orig/drivers/gpu/drm/msm/msm_iommu.c @@ -21,8 +21,6 @@ struct msm_mmu base; struct msm_mmu *parent; struct io_pgtable_ops *pgtbl_ops; - const struct iommu_flush_ops *tlb; - struct device *iommu_dev; unsigned long pgsize_bitmap; /* Bitmap of page sizes in use */ phys_addr_t ttbr; u32 asid; @@ -203,33 +201,11 @@ static void msm_iommu_tlb_flush_all(void *cookie) { - struct msm_iommu_pagetable *pagetable = cookie; - struct adreno_smmu_priv *adreno_smmu; - - if (!pm_runtime_get_if_in_use(pagetable->iommu_dev)) - return; - - adreno_smmu = dev_get_drvdata(pagetable->parent->dev); - - pagetable->tlb->tlb_flush_all((void *)adreno_smmu->cookie); - - pm_runtime_put_autosuspend(pagetable->iommu_dev); } static void msm_iommu_tlb_flush_walk(unsigned long iova, size_t size, size_t granule, void *cookie) { - struct msm_iommu_pagetable *pagetable = cookie; - struct adreno_smmu_priv *adreno_smmu; - - if (!pm_runtime_get_if_in_use(pagetable->iommu_dev)) - return; - - adreno_smmu = dev_get_drvdata(pagetable->parent->dev); - - pagetable->tlb->tlb_flush_walk(iova, size, granule, (void *)adreno_smmu->cookie); - - pm_runtime_put_autosuspend(pagetable->iommu_dev); } static void msm_iommu_tlb_add_page(struct iommu_iotlb_gather *gather, @@ -237,7 +213,7 @@ { } +static const struct iommu_flush_ops null_tlb_ops = { -static const struct iommu_flush_ops tlb_ops = { .tlb_flush_all = msm_iommu_tlb_flush_all, .tlb_flush_walk = msm_iommu_tlb_flush_walk, .tlb_add_page = msm_iommu_tlb_add_page, @@ -278,10 +254,10 @@ /* The incoming cfg will have the TTBR1 quirk enabled */ ttbr0_cfg.quirks &= ~IO_PGTABLE_QUIRK_ARM_TTBR1; + ttbr0_cfg.tlb = &null_tlb_ops; - ttbr0_cfg.tlb = &tlb_ops; pagetable->pgtbl_ops = alloc_io_pgtable_ops(ARM_64_LPAE_S1, + &ttbr0_cfg, iommu->domain); - &ttbr0_cfg, pagetable); if (!pagetable->pgtbl_ops) { kfree(pagetable); @@ -303,8 +279,6 @@ /* Needed later for TLB flush */ pagetable->parent = parent; - pagetable->tlb = ttbr1_cfg->tlb; - pagetable->iommu_dev = ttbr1_cfg->iommu_dev; pagetable->pgsize_bitmap = ttbr0_cfg.pgsize_bitmap; pagetable->ttbr = ttbr0_cfg.arm_lpae_s1_cfg.ttbr; reverted: --- linux-6.5.0/drivers/gpu/drm/nouveau/nouveau_fence.c +++ linux-6.5.0.orig/drivers/gpu/drm/nouveau/nouveau_fence.c @@ -102,7 +102,6 @@ void nouveau_fence_context_del(struct nouveau_fence_chan *fctx) { - cancel_work_sync(&fctx->uevent_work); nouveau_fence_context_kill(fctx, 0); nvif_event_dtor(&fctx->event); fctx->dead = 1; @@ -145,13 +144,12 @@ return drop; } +static int +nouveau_fence_wait_uevent_handler(struct nvif_event *event, void *repv, u32 repc) -static void -nouveau_fence_uevent_work(struct work_struct *work) { + struct nouveau_fence_chan *fctx = container_of(event, typeof(*fctx), event); - struct nouveau_fence_chan *fctx = container_of(work, struct nouveau_fence_chan, - uevent_work); unsigned long flags; + int ret = NVIF_EVENT_KEEP; - int drop = 0; spin_lock_irqsave(&fctx->lock, flags); if (!list_empty(&fctx->pending)) { @@ -161,20 +159,11 @@ fence = list_entry(fctx->pending.next, typeof(*fence), head); chan = rcu_dereference_protected(fence->channel, lockdep_is_held(&fctx->lock)); if (nouveau_fence_update(chan, fctx)) + ret = NVIF_EVENT_DROP; - drop = 1; } - if (drop) - nvif_event_block(&fctx->event); - spin_unlock_irqrestore(&fctx->lock, flags); -} + return ret; -static int -nouveau_fence_wait_uevent_handler(struct nvif_event *event, void *repv, u32 repc) -{ - struct nouveau_fence_chan *fctx = container_of(event, typeof(*fctx), event); - schedule_work(&fctx->uevent_work); - return NVIF_EVENT_KEEP; } void @@ -188,7 +177,6 @@ } args; int ret; - INIT_WORK(&fctx->uevent_work, nouveau_fence_uevent_work); INIT_LIST_HEAD(&fctx->flip); INIT_LIST_HEAD(&fctx->pending); spin_lock_init(&fctx->lock); reverted: --- linux-6.5.0/drivers/gpu/drm/nouveau/nouveau_fence.h +++ linux-6.5.0.orig/drivers/gpu/drm/nouveau/nouveau_fence.h @@ -44,7 +44,6 @@ u32 context; char name[32]; - struct work_struct uevent_work; struct nvif_event event; int notify_ref, dead; }; reverted: --- linux-6.5.0/drivers/gpu/drm/nouveau/nouveau_svm.c +++ linux-6.5.0.orig/drivers/gpu/drm/nouveau/nouveau_svm.c @@ -1011,7 +1011,7 @@ if (ret) return ret; + buffer->fault = kvcalloc(sizeof(*buffer->fault), buffer->entries, GFP_KERNEL); - buffer->fault = kvcalloc(buffer->entries, sizeof(*buffer->fault), GFP_KERNEL); if (!buffer->fault) return -ENOMEM; diff -u linux-6.5.0/drivers/gpu/drm/virtio/virtgpu_drv.c linux-6.5.0/drivers/gpu/drm/virtio/virtgpu_drv.c --- linux-6.5.0/drivers/gpu/drm/virtio/virtgpu_drv.c +++ linux-6.5.0/drivers/gpu/drm/virtio/virtgpu_drv.c @@ -94,7 +94,6 @@ goto err_free; } - dma_set_max_seg_size(dev->dev, dma_max_mapping_size(dev->dev) ?: UINT_MAX); ret = virtio_gpu_init(vdev, dev); if (ret) goto err_free; reverted: --- linux-6.5.0/drivers/hid/bpf/hid_bpf_dispatch.c +++ linux-6.5.0.orig/drivers/hid/bpf/hid_bpf_dispatch.c @@ -241,39 +241,6 @@ return 0; } -static int do_hid_bpf_attach_prog(struct hid_device *hdev, int prog_fd, struct bpf_prog *prog, - __u32 flags) -{ - int fd, err, prog_type; - - prog_type = hid_bpf_get_prog_attach_type(prog); - if (prog_type < 0) - return prog_type; - - if (prog_type >= HID_BPF_PROG_TYPE_MAX) - return -EINVAL; - - if (prog_type == HID_BPF_PROG_TYPE_DEVICE_EVENT) { - err = hid_bpf_allocate_event_data(hdev); - if (err) - return err; - } - - fd = __hid_bpf_attach_prog(hdev, prog_type, prog_fd, prog, flags); - if (fd < 0) - return fd; - - if (prog_type == HID_BPF_PROG_TYPE_RDESC_FIXUP) { - err = hid_bpf_reconnect(hdev); - if (err) { - close_fd(fd); - return err; - } - } - - return fd; -} - /** * hid_bpf_attach_prog - Attach the given @prog_fd to the given HID device * @@ -290,13 +257,18 @@ hid_bpf_attach_prog(unsigned int hid_id, int prog_fd, __u32 flags) { struct hid_device *hdev; - struct bpf_prog *prog; struct device *dev; + int fd, err, prog_type = hid_bpf_get_prog_attach_type(prog_fd); - int err, fd; if (!hid_bpf_ops) return -EINVAL; + if (prog_type < 0) + return prog_type; + + if (prog_type >= HID_BPF_PROG_TYPE_MAX) + return -EINVAL; + if ((flags & ~HID_BPF_FLAG_MASK)) return -EINVAL; @@ -306,29 +278,25 @@ hdev = to_hid_device(dev); + if (prog_type == HID_BPF_PROG_TYPE_DEVICE_EVENT) { + err = hid_bpf_allocate_event_data(hdev); + if (err) + return err; - /* - * take a ref on the prog itself, it will be released - * on errors or when it'll be detached - */ - prog = bpf_prog_get(prog_fd); - if (IS_ERR(prog)) { - err = PTR_ERR(prog); - goto out_dev_put; } + fd = __hid_bpf_attach_prog(hdev, prog_type, prog_fd, flags); + if (fd < 0) + return fd; + + if (prog_type == HID_BPF_PROG_TYPE_RDESC_FIXUP) { + err = hid_bpf_reconnect(hdev); + if (err) { + close_fd(fd); + return err; + } - fd = do_hid_bpf_attach_prog(hdev, prog_fd, prog, flags); - if (fd < 0) { - err = fd; - goto out_prog_put; } return fd; - - out_prog_put: - bpf_prog_put(prog); - out_dev_put: - put_device(dev); - return err; } /** @@ -355,10 +323,8 @@ hdev = to_hid_device(dev); ctx_kern = kzalloc(sizeof(*ctx_kern), GFP_KERNEL); + if (!ctx_kern) - if (!ctx_kern) { - put_device(dev); return NULL; - } ctx_kern->ctx.hid = hdev; @@ -375,15 +341,10 @@ hid_bpf_release_context(struct hid_bpf_ctx *ctx) { struct hid_bpf_ctx_kern *ctx_kern; - struct hid_device *hid; ctx_kern = container_of(ctx, struct hid_bpf_ctx_kern, ctx); - hid = (struct hid_device *)ctx_kern->ctx.hid; /* ignore const */ kfree(ctx_kern); - - /* get_device() is called by bus_find_device() */ - put_device(&hid->dev); } /** reverted: --- linux-6.5.0/drivers/hid/bpf/hid_bpf_dispatch.h +++ linux-6.5.0.orig/drivers/hid/bpf/hid_bpf_dispatch.h @@ -12,9 +12,9 @@ int hid_bpf_preload_skel(void); void hid_bpf_free_links_and_skel(void); +int hid_bpf_get_prog_attach_type(int prog_fd); -int hid_bpf_get_prog_attach_type(struct bpf_prog *prog); int __hid_bpf_attach_prog(struct hid_device *hdev, enum hid_bpf_prog_type prog_type, int prog_fd, + __u32 flags); - struct bpf_prog *prog, __u32 flags); void __hid_bpf_destroy_device(struct hid_device *hdev); int hid_bpf_prog_run(struct hid_device *hdev, enum hid_bpf_prog_type type, struct hid_bpf_ctx_kern *ctx_kern); reverted: --- linux-6.5.0/drivers/hid/bpf/hid_bpf_jmp_table.c +++ linux-6.5.0.orig/drivers/hid/bpf/hid_bpf_jmp_table.c @@ -196,7 +196,6 @@ static void hid_bpf_release_progs(struct work_struct *work) { int i, j, n, map_fd = -1; - bool hdev_destroyed; if (!jmp_table.map) return; @@ -221,12 +220,6 @@ if (entry->hdev) { hdev = entry->hdev; type = entry->type; - /* - * hdev is still valid, even if we are called after hid_destroy_device(): - * when hid_bpf_attach() gets called, it takes a ref on the dev through - * bus_find_device() - */ - hdev_destroyed = hdev->bpf.destroyed; hid_bpf_populate_hdev(hdev, type); @@ -239,19 +232,12 @@ if (test_bit(next->idx, jmp_table.enabled)) continue; + if (next->hdev == hdev && next->type == type) - if (next->hdev == hdev && next->type == type) { - /* - * clear the hdev reference and decrement the device ref - * that was taken during bus_find_device() while calling - * hid_bpf_attach() - */ next->hdev = NULL; - put_device(&hdev->dev); - } } + /* if type was rdesc fixup, reconnect device */ + if (type == HID_BPF_PROG_TYPE_RDESC_FIXUP) - /* if type was rdesc fixup and the device is not gone, reconnect device */ - if (type == HID_BPF_PROG_TYPE_RDESC_FIXUP && !hdev_destroyed) hid_bpf_reconnect(hdev); } } @@ -347,10 +333,15 @@ return err; } +int hid_bpf_get_prog_attach_type(int prog_fd) -int hid_bpf_get_prog_attach_type(struct bpf_prog *prog) { + struct bpf_prog *prog = NULL; + int i; int prog_type = HID_BPF_PROG_TYPE_UNDEF; + + prog = bpf_prog_get(prog_fd); + if (IS_ERR(prog)) + return PTR_ERR(prog); - int i; for (i = 0; i < HID_BPF_PROG_TYPE_MAX; i++) { if (hid_bpf_btf_ids[i] == prog->aux->attach_btf_id) { @@ -359,6 +350,8 @@ } } + bpf_prog_put(prog); + return prog_type; } @@ -395,13 +388,19 @@ /* called from syscall */ noinline int __hid_bpf_attach_prog(struct hid_device *hdev, enum hid_bpf_prog_type prog_type, + int prog_fd, __u32 flags) - int prog_fd, struct bpf_prog *prog, __u32 flags) { struct bpf_link_primer link_primer; struct hid_bpf_link *link; + struct bpf_prog *prog = NULL; struct hid_bpf_prog_entry *prog_entry; int cnt, err = -EINVAL, prog_table_idx = -1; + /* take a ref on the prog itself */ + prog = bpf_prog_get(prog_fd); + if (IS_ERR(prog)) + return PTR_ERR(prog); + mutex_lock(&hid_bpf_attach_lock); link = kzalloc(sizeof(*link), GFP_USER); @@ -468,6 +467,7 @@ err_unlock: mutex_unlock(&hid_bpf_attach_lock); + bpf_prog_put(prog); kfree(link); return err; reverted: --- linux-6.5.0/drivers/hid/i2c-hid/i2c-hid-of.c +++ linux-6.5.0.orig/drivers/hid/i2c-hid/i2c-hid-of.c @@ -87,7 +87,6 @@ if (!ihid_of) return -ENOMEM; - ihid_of->client = client; ihid_of->ops.power_up = i2c_hid_of_power_up; ihid_of->ops.power_down = i2c_hid_of_power_down; diff -u linux-6.5.0/drivers/hid/wacom_sys.c linux-6.5.0/drivers/hid/wacom_sys.c --- linux-6.5.0/drivers/hid/wacom_sys.c +++ linux-6.5.0/drivers/hid/wacom_sys.c @@ -2080,7 +2080,7 @@ return 0; } -static int wacom_setup_inputs(struct wacom *wacom) +static int wacom_register_inputs(struct wacom *wacom) { struct input_dev *pen_input_dev, *touch_input_dev, *pad_input_dev; struct wacom_wac *wacom_wac = &(wacom->wacom_wac); @@ -2099,6 +2099,10 @@ input_free_device(pen_input_dev); wacom_wac->pen_input = NULL; pen_input_dev = NULL; + } else { + error = input_register_device(pen_input_dev); + if (error) + goto fail; } error = wacom_setup_touch_input_capabilities(touch_input_dev, wacom_wac); @@ -2107,6 +2111,10 @@ input_free_device(touch_input_dev); wacom_wac->touch_input = NULL; touch_input_dev = NULL; + } else { + error = input_register_device(touch_input_dev); + if (error) + goto fail; } error = wacom_setup_pad_input_capabilities(pad_input_dev, wacom_wac); @@ -2115,34 +2123,7 @@ input_free_device(pad_input_dev); wacom_wac->pad_input = NULL; pad_input_dev = NULL; - } - - return 0; -} - -static int wacom_register_inputs(struct wacom *wacom) -{ - struct input_dev *pen_input_dev, *touch_input_dev, *pad_input_dev; - struct wacom_wac *wacom_wac = &(wacom->wacom_wac); - int error = 0; - - pen_input_dev = wacom_wac->pen_input; - touch_input_dev = wacom_wac->touch_input; - pad_input_dev = wacom_wac->pad_input; - - if (pen_input_dev) { - error = input_register_device(pen_input_dev); - if (error) - goto fail; - } - - if (touch_input_dev) { - error = input_register_device(touch_input_dev); - if (error) - goto fail; - } - - if (pad_input_dev) { + } else { error = input_register_device(pad_input_dev); if (error) goto fail; @@ -2395,20 +2376,6 @@ if (error) goto fail; - error = wacom_setup_inputs(wacom); - if (error) - goto fail; - - if (features->type == HID_GENERIC) - connect_mask |= HID_CONNECT_DRIVER; - - /* Regular HID work starts now */ - error = hid_hw_start(hdev, connect_mask); - if (error) { - hid_err(hdev, "hw start failed\n"); - goto fail; - } - error = wacom_register_inputs(wacom); if (error) goto fail; @@ -2423,6 +2390,16 @@ goto fail; } + if (features->type == HID_GENERIC) + connect_mask |= HID_CONNECT_DRIVER; + + /* Regular HID work starts now */ + error = hid_hw_start(hdev, connect_mask); + if (error) { + hid_err(hdev, "hw start failed\n"); + goto fail; + } + if (!wireless) { /* Note that if query fails it is not a hard failure */ wacom_query_tablet_data(wacom); diff -u linux-6.5.0/drivers/hid/wacom_wac.c linux-6.5.0/drivers/hid/wacom_wac.c --- linux-6.5.0/drivers/hid/wacom_wac.c +++ linux-6.5.0/drivers/hid/wacom_wac.c @@ -2576,14 +2576,7 @@ wacom_wac->hid_data.tipswitch); input_report_key(input, wacom_wac->tool[0], sense); if (wacom_wac->serial[0]) { - /* - * xf86-input-wacom does not accept a serial number - * of '0'. Report the low 32 bits if possible, but - * if they are zero, report the upper ones instead. - */ - __u32 serial_lo = wacom_wac->serial[0] & 0xFFFFFFFFu; - __u32 serial_hi = wacom_wac->serial[0] >> 32; - input_event(input, EV_MSC, MSC_SERIAL, (int)(serial_lo ? serial_lo : serial_hi)); + input_event(input, EV_MSC, MSC_SERIAL, wacom_wac->serial[0]); input_report_abs(input, ABS_MISC, sense ? id : 0); } diff -u linux-6.5.0/drivers/hwmon/acpi_power_meter.c linux-6.5.0/drivers/hwmon/acpi_power_meter.c --- linux-6.5.0/drivers/hwmon/acpi_power_meter.c +++ linux-6.5.0/drivers/hwmon/acpi_power_meter.c @@ -884,22 +884,6 @@ strcpy(acpi_device_class(device), ACPI_POWER_METER_CLASS); device->driver_data = resource; -#if IS_REACHABLE(CONFIG_ACPI_IPMI) - /* - * On Dell systems several methods of acpi_power_meter access - * variables in IPMI region, so wait until IPMI space handler is - * installed by acpi_ipmi and also wait until SMI is selected to make - * the space handler fully functional. - */ - if (dmi_match(DMI_SYS_VENDOR, "Dell Inc.")) { - struct acpi_device *ipi_device = acpi_dev_get_first_match_dev("IPI0001", NULL, -1); - - if (ipi_device && acpi_wait_for_acpi_ipmi()) - dev_warn(&device->dev, "Waiting for ACPI IPMI timeout"); - acpi_dev_put(ipi_device); - } -#endif - res = read_capabilities(resource); if (res) goto exit_free; reverted: --- linux-6.5.0/drivers/hwmon/aspeed-pwm-tacho.c +++ linux-6.5.0.orig/drivers/hwmon/aspeed-pwm-tacho.c @@ -194,8 +194,6 @@ u8 fan_tach_ch_source[16]; struct aspeed_cooling_device *cdev[8]; const struct attribute_group *groups[3]; - /* protects access to shared ASPEED_PTCR_RESULT */ - struct mutex tach_lock; }; enum type { TYPEM, TYPEN, TYPEO }; @@ -530,8 +528,6 @@ u8 fan_tach_ch_source, type, mode, both; int ret; - mutex_lock(&priv->tach_lock); - regmap_write(priv->regmap, ASPEED_PTCR_TRIGGER, 0); regmap_write(priv->regmap, ASPEED_PTCR_TRIGGER, 0x1 << fan_tach_ch); @@ -549,8 +545,6 @@ ASPEED_RPM_STATUS_SLEEP_USEC, usec); - mutex_unlock(&priv->tach_lock); - /* return -ETIMEDOUT if we didn't get an answer. */ if (ret) return ret; @@ -910,7 +904,6 @@ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; - mutex_init(&priv->tach_lock); priv->regmap = devm_regmap_init(dev, NULL, (__force void *)regs, &aspeed_pwm_tacho_regmap_config); if (IS_ERR(priv->regmap)) diff -u linux-6.5.0/drivers/hwmon/coretemp.c linux-6.5.0/drivers/hwmon/coretemp.c --- linux-6.5.0/drivers/hwmon/coretemp.c +++ linux-6.5.0/drivers/hwmon/coretemp.c @@ -419,7 +419,7 @@ } static int create_core_attrs(struct temp_data *tdata, struct device *dev, - int index) + int attr_no) { int i; static ssize_t (*const rd_ptr[TOTAL_ATTRS]) (struct device *dev, @@ -431,20 +431,13 @@ }; for (i = 0; i < tdata->attr_size; i++) { - /* - * We map the attr number to core id of the CPU - * The attr number is always core id + 2 - * The Pkgtemp will always show up as temp1_*, if available - */ - int attr_no = tdata->is_pkg_data ? 1 : tdata->cpu_core_id + 2; - snprintf(tdata->attr_name[i], CORETEMP_NAME_LENGTH, "temp%d_%s", attr_no, suffixes[i]); sysfs_attr_init(&tdata->sd_attrs[i].dev_attr.attr); tdata->sd_attrs[i].dev_attr.attr.name = tdata->attr_name[i]; tdata->sd_attrs[i].dev_attr.attr.mode = 0444; tdata->sd_attrs[i].dev_attr.show = rd_ptr[i]; - tdata->sd_attrs[i].index = index; + tdata->sd_attrs[i].index = attr_no; tdata->attrs[i] = &tdata->sd_attrs[i].dev_attr.attr; } tdata->attr_group.attrs = tdata->attrs; @@ -502,25 +495,30 @@ struct platform_data *pdata = platform_get_drvdata(pdev); struct cpuinfo_x86 *c = &cpu_data(cpu); u32 eax, edx; - int err, index; + int err, index, attr_no; if (!housekeeping_cpu(cpu, HK_TYPE_MISC)) return 0; /* - * Get the index of tdata in pdata->core_data[] - * tdata for package: pdata->core_data[1] - * tdata for core: pdata->core_data[2] .. pdata->core_data[NUM_REAL_CORES + 1] + * Find attr number for sysfs: + * We map the attr number to core id of the CPU + * The attr number is always core id + 2 + * The Pkgtemp will always show up as temp1_*, if available */ if (pkg_flag) { - index = PKG_SYSFS_ATTR_NO; + attr_no = PKG_SYSFS_ATTR_NO; } else { - index = ida_alloc_max(&pdata->ida, NUM_REAL_CORES - 1, GFP_KERNEL); + index = ida_alloc(&pdata->ida, GFP_KERNEL); if (index < 0) return index; - pdata->cpu_map[index] = topology_core_id(cpu); - index += BASE_SYSFS_ATTR_NO; + attr_no = index + BASE_SYSFS_ATTR_NO; + } + + if (attr_no > MAX_CORE_DATA - 1) { + err = -ERANGE; + goto ida_free; } tdata = init_temp_data(cpu, pkg_flag); @@ -546,20 +544,20 @@ if (get_ttarget(tdata, &pdev->dev) >= 0) tdata->attr_size++; - pdata->core_data[index] = tdata; + pdata->core_data[attr_no] = tdata; /* Create sysfs interfaces */ - err = create_core_attrs(tdata, pdata->hwmon_dev, index); + err = create_core_attrs(tdata, pdata->hwmon_dev, attr_no); if (err) goto exit_free; return 0; exit_free: - pdata->core_data[index] = NULL; + pdata->core_data[attr_no] = NULL; kfree(tdata); ida_free: if (!pkg_flag) - ida_free(&pdata->ida, index - BASE_SYSFS_ATTR_NO); + ida_free(&pdata->ida, index); return err; } reverted: --- linux-6.5.0/drivers/i2c/busses/Makefile +++ linux-6.5.0.orig/drivers/i2c/busses/Makefile @@ -90,8 +90,10 @@ obj-$(CONFIG_I2C_OCORES) += i2c-ocores.o obj-$(CONFIG_I2C_OMAP) += i2c-omap.o obj-$(CONFIG_I2C_OWL) += i2c-owl.o +i2c-pasemi-objs := i2c-pasemi-core.o i2c-pasemi-pci.o +obj-$(CONFIG_I2C_PASEMI) += i2c-pasemi.o +i2c-apple-objs := i2c-pasemi-core.o i2c-pasemi-platform.o +obj-$(CONFIG_I2C_APPLE) += i2c-apple.o -obj-$(CONFIG_I2C_PASEMI) += i2c-pasemi-core.o i2c-pasemi-pci.o -obj-$(CONFIG_I2C_APPLE) += i2c-pasemi-core.o i2c-pasemi-platform.o obj-$(CONFIG_I2C_PCA_PLATFORM) += i2c-pca-platform.o obj-$(CONFIG_I2C_PNX) += i2c-pnx.o obj-$(CONFIG_I2C_PXA) += i2c-pxa.o diff -u linux-6.5.0/drivers/i2c/busses/i2c-i801.c linux-6.5.0/drivers/i2c/busses/i2c-i801.c --- linux-6.5.0/drivers/i2c/busses/i2c-i801.c +++ linux-6.5.0/drivers/i2c/busses/i2c-i801.c @@ -500,10 +500,11 @@ /* Set block buffer mode */ outb_p(inb_p(SMBAUXCTL(priv)) | SMBAUXCTL_E32B, SMBAUXCTL(priv)); + inb_p(SMBHSTCNT(priv)); /* reset the data buffer index */ + if (read_write == I2C_SMBUS_WRITE) { len = data->block[0]; outb_p(len, SMBHSTDAT0(priv)); - inb_p(SMBHSTCNT(priv)); /* reset the data buffer index */ for (i = 0; i < len; i++) outb_p(data->block[i+1], SMBBLKDAT(priv)); } @@ -521,7 +522,6 @@ } data->block[0] = len; - inb_p(SMBHSTCNT(priv)); /* reset the data buffer index */ for (i = 0; i < len; i++) data->block[i + 1] = inb_p(SMBBLKDAT(priv)); } reverted: --- linux-6.5.0/drivers/i2c/busses/i2c-pasemi-core.c +++ linux-6.5.0.orig/drivers/i2c/busses/i2c-pasemi-core.c @@ -369,7 +369,6 @@ return 0; } -EXPORT_SYMBOL_GPL(pasemi_i2c_common_probe); irqreturn_t pasemi_irq_handler(int irq, void *dev_id) { @@ -379,8 +378,3 @@ complete(&smbus->irq_completion); return IRQ_HANDLED; } -EXPORT_SYMBOL_GPL(pasemi_irq_handler); - -MODULE_LICENSE("GPL"); -MODULE_AUTHOR("Olof Johansson "); -MODULE_DESCRIPTION("PA Semi PWRficient SMBus driver"); diff -u linux-6.5.0/drivers/i2c/busses/i2c-qcom-geni.c linux-6.5.0/drivers/i2c/busses/i2c-qcom-geni.c --- linux-6.5.0/drivers/i2c/busses/i2c-qcom-geni.c +++ linux-6.5.0/drivers/i2c/busses/i2c-qcom-geni.c @@ -613,20 +613,20 @@ peripheral.addr = msgs[i].addr; - ret = geni_i2c_gpi(gi2c, &msgs[i], &config, - &tx_addr, &tx_buf, I2C_WRITE, gi2c->tx_c); - if (ret) - goto err; - if (msgs[i].flags & I2C_M_RD) { ret = geni_i2c_gpi(gi2c, &msgs[i], &config, &rx_addr, &rx_buf, I2C_READ, gi2c->rx_c); if (ret) goto err; - - dma_async_issue_pending(gi2c->rx_c); } + ret = geni_i2c_gpi(gi2c, &msgs[i], &config, + &tx_addr, &tx_buf, I2C_WRITE, gi2c->tx_c); + if (ret) + goto err; + + if (msgs[i].flags & I2C_M_RD) + dma_async_issue_pending(gi2c->rx_c); dma_async_issue_pending(gi2c->tx_c); timeout = wait_for_completion_timeout(&gi2c->done, XFER_TIMEOUT); reverted: --- linux-6.5.0/drivers/iio/accel/Kconfig +++ linux-6.5.0.orig/drivers/iio/accel/Kconfig @@ -219,12 +219,10 @@ config BMA400_I2C tristate - select REGMAP_I2C depends on BMA400 config BMA400_SPI tristate - select REGMAP_SPI depends on BMA400 config BMC150_ACCEL reverted: --- linux-6.5.0/drivers/iio/adc/ad4130.c +++ linux-6.5.0.orig/drivers/iio/adc/ad4130.c @@ -1826,7 +1826,7 @@ { struct device *dev = &st->spi->dev; struct device_node *of_node = dev_of_node(dev); + struct clk_init_data init; - struct clk_init_data init = {}; const char *clk_name; struct clk *clk; int ret; @@ -1900,14 +1900,10 @@ return ret; /* + * Configure all GPIOs for output. If configured, the interrupt function + * of P2 takes priority over the GPIO out function. - * Configure unused GPIOs for output. If configured, the interrupt - * function of P2 takes priority over the GPIO out function. */ + val = AD4130_IO_CONTROL_GPIO_CTRL_MASK; - val = 0; - for (i = 0; i < AD4130_MAX_GPIOS; i++) - if (st->pins_fn[i + AD4130_AIN2_P1] == AD4130_PIN_FN_NONE) - val |= FIELD_PREP(AD4130_IO_CONTROL_GPIO_CTRL_MASK, BIT(i)); - val |= FIELD_PREP(AD4130_IO_CONTROL_INT_PIN_SEL_MASK, st->int_pin_sel); ret = regmap_write(st->regmap, AD4130_IO_CONTROL_REG, val); diff -u linux-6.5.0/drivers/iio/imu/bno055/Kconfig linux-6.5.0/drivers/iio/imu/bno055/Kconfig --- linux-6.5.0/drivers/iio/imu/bno055/Kconfig +++ linux-6.5.0/drivers/iio/imu/bno055/Kconfig @@ -8,7 +8,6 @@ config BOSCH_BNO055_SERIAL tristate "Bosch BNO055 attached via UART" depends on SERIAL_DEV_BUS - select REGMAP select BOSCH_BNO055 help Enable this to support Bosch BNO055 IMUs attached via UART. reverted: --- linux-6.5.0/drivers/iio/industrialio-core.c +++ linux-6.5.0.orig/drivers/iio/industrialio-core.c @@ -1573,13 +1573,10 @@ ret = iio_device_register_sysfs_group(indio_dev, &iio_dev_opaque->chan_attr_group); if (ret) + goto error_clear_attrs; - goto error_free_chan_attrs; return 0; -error_free_chan_attrs: - kfree(iio_dev_opaque->chan_attr_group.attrs); - iio_dev_opaque->chan_attr_group.attrs = NULL; error_clear_attrs: iio_free_chan_devattr_list(&iio_dev_opaque->channel_attr_list); reverted: --- linux-6.5.0/drivers/iio/light/hid-sensor-als.c +++ linux-6.5.0.orig/drivers/iio/light/hid-sensor-als.c @@ -226,7 +226,6 @@ case HID_USAGE_SENSOR_TIME_TIMESTAMP: als_state->timestamp = hid_sensor_convert_timestamp(&als_state->common_attributes, *(s64 *)raw_data); - ret = 0; break; default: break; reverted: --- linux-6.5.0/drivers/iio/magnetometer/rm3100-core.c +++ linux-6.5.0.orig/drivers/iio/magnetometer/rm3100-core.c @@ -530,7 +530,6 @@ struct rm3100_data *data; unsigned int tmp; int ret; - int samp_rate_index; indio_dev = devm_iio_device_alloc(dev, sizeof(*data)); if (!indio_dev) @@ -587,14 +586,9 @@ ret = regmap_read(regmap, RM3100_REG_TMRC, &tmp); if (ret < 0) return ret; - - samp_rate_index = tmp - RM3100_TMRC_OFFSET; - if (samp_rate_index < 0 || samp_rate_index >= RM3100_SAMP_NUM) { - dev_err(dev, "The value read from RM3100_REG_TMRC is invalid!\n"); - return -EINVAL; - } /* Initializing max wait time, which is double conversion time. */ + data->conversion_time = rm3100_samp_rates[tmp - RM3100_TMRC_OFFSET][2] + * 2; - data->conversion_time = rm3100_samp_rates[samp_rate_index][2] * 2; /* Cycle count values may not be what we want. */ if ((tmp - RM3100_TMRC_OFFSET) == 0) reverted: --- linux-6.5.0/drivers/iio/pressure/bmp280-spi.c +++ linux-6.5.0.orig/drivers/iio/pressure/bmp280-spi.c @@ -91,7 +91,6 @@ MODULE_DEVICE_TABLE(of, bmp280_of_spi_match); static const struct spi_device_id bmp280_spi_id[] = { - { "bmp085", (kernel_ulong_t)&bmp180_chip_info }, { "bmp180", (kernel_ulong_t)&bmp180_chip_info }, { "bmp181", (kernel_ulong_t)&bmp180_chip_info }, { "bmp280", (kernel_ulong_t)&bmp280_chip_info }, diff -u linux-6.5.0/drivers/input/keyboard/atkbd.c linux-6.5.0/drivers/input/keyboard/atkbd.c --- linux-6.5.0/drivers/input/keyboard/atkbd.c +++ linux-6.5.0/drivers/input/keyboard/atkbd.c @@ -811,6 +811,7 @@ { struct ps2dev *ps2dev = &atkbd->ps2dev; unsigned char param[2]; + bool skip_getid; /* * Some systems, where the bit-twiddling when testing the io-lines of the @@ -824,11 +825,6 @@ "keyboard reset failed on %s\n", ps2dev->serio->phys); - if (atkbd_skip_getid(atkbd)) { - atkbd->id = 0xab83; - goto deactivate_kbd; - } - /* * Then we check the keyboard ID. We should get 0xab83 under normal conditions. * Some keyboards report different values, but the first byte is always 0xab or @@ -837,17 +833,18 @@ */ param[0] = param[1] = 0xa5; /* initialize with invalid values */ - if (ps2_command(ps2dev, param, ATKBD_CMD_GETID)) { + skip_getid = atkbd_skip_getid(atkbd); + if (skip_getid || ps2_command(ps2dev, param, ATKBD_CMD_GETID)) { /* - * If the get ID command failed, we check if we can at least set + * If the get ID command was skipped or failed, we check if we can at least set * the LEDs on the keyboard. This should work on every keyboard out there. * It also turns the LEDs off, which we want anyway. */ param[0] = 0; if (ps2_command(ps2dev, param, ATKBD_CMD_SETLEDS)) return -1; - atkbd->id = 0xabba; + atkbd->id = skip_getid ? 0xab83 : 0xabba; return 0; } @@ -863,7 +860,6 @@ return -1; } -deactivate_kbd: /* * Make sure nothing is coming from the keyboard and disturbs our * internal state. diff -u linux-6.5.0/drivers/input/serio/i8042-acpipnpio.h linux-6.5.0/drivers/input/serio/i8042-acpipnpio.h --- linux-6.5.0/drivers/input/serio/i8042-acpipnpio.h +++ linux-6.5.0/drivers/input/serio/i8042-acpipnpio.h @@ -1210,12 +1210,6 @@ }, { .matches = { - DMI_MATCH(DMI_BOARD_NAME, "NS5x_7xPU"), - }, - .driver_data = (void *)(SERIO_QUIRK_NOAUX) - }, - { - .matches = { DMI_MATCH(DMI_BOARD_NAME, "NJ50_70CU"), }, .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | diff -u linux-6.5.0/drivers/interconnect/qcom/sc8180x.c linux-6.5.0/drivers/interconnect/qcom/sc8180x.c --- linux-6.5.0/drivers/interconnect/qcom/sc8180x.c +++ linux-6.5.0/drivers/interconnect/qcom/sc8180x.c @@ -1371,7 +1371,6 @@ static struct qcom_icc_bcm bcm_co0 = { .name = "CO0", - .keepalive = true, .num_nodes = 1, .nodes = { &slv_qns_cdsp_mem_noc } }; reverted: --- linux-6.5.0/drivers/interconnect/qcom/sm8550.c +++ linux-6.5.0.orig/drivers/interconnect/qcom/sm8550.c @@ -2221,7 +2221,6 @@ .driver = { .name = "qnoc-sm8550", .of_match_table = qnoc_of_match, - .sync_state = icc_sync_state, }, }; reverted: --- linux-6.5.0/drivers/irqchip/irq-brcmstb-l2.c +++ linux-6.5.0.orig/drivers/irqchip/irq-brcmstb-l2.c @@ -2,7 +2,7 @@ /* * Generic Broadcom Set Top Box Level 2 Interrupt controller driver * + * Copyright (C) 2014-2017 Broadcom - * Copyright (C) 2014-2024 Broadcom */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt @@ -113,9 +113,6 @@ generic_handle_domain_irq(b->domain, irq); } while (status); out: - /* Don't ack parent before all device writes are done */ - wmb(); - chained_irq_exit(chip, desc); } diff -u linux-6.5.0/drivers/irqchip/irq-gic-v3-its.c linux-6.5.0/drivers/irqchip/irq-gic-v3-its.c --- linux-6.5.0/drivers/irqchip/irq-gic-v3-its.c +++ linux-6.5.0/drivers/irqchip/irq-gic-v3-its.c @@ -211,11 +211,6 @@ return (gic_rdists->has_rvpeid || vm->vlpi_count[its->list_nr]); } -static bool rdists_support_shareable(void) -{ - return !(gic_rdists->flags & RDIST_FLAGS_FORCE_NON_SHAREABLE); -} - static u16 get_its_list(struct its_vm *vm) { struct its_node *its; @@ -2719,12 +2714,10 @@ break; } val |= FIELD_PREP(GICR_VPROPBASER_4_1_ADDR, addr >> 12); - if (rdists_support_shareable()) { - val |= FIELD_PREP(GICR_VPROPBASER_SHAREABILITY_MASK, - FIELD_GET(GITS_BASER_SHAREABILITY_MASK, baser)); - val |= FIELD_PREP(GICR_VPROPBASER_INNER_CACHEABILITY_MASK, - FIELD_GET(GITS_BASER_INNER_CACHEABILITY_MASK, baser)); - } + val |= FIELD_PREP(GICR_VPROPBASER_SHAREABILITY_MASK, + FIELD_GET(GITS_BASER_SHAREABILITY_MASK, baser)); + val |= FIELD_PREP(GICR_VPROPBASER_INNER_CACHEABILITY_MASK, + FIELD_GET(GITS_BASER_INNER_CACHEABILITY_MASK, baser)); val |= FIELD_PREP(GICR_VPROPBASER_4_1_SIZE, GITS_BASER_NR_PAGES(baser) - 1); return val; @@ -2947,10 +2940,8 @@ WARN_ON(!IS_ALIGNED(pa, psz)); val |= FIELD_PREP(GICR_VPROPBASER_4_1_ADDR, pa >> 12); - if (rdists_support_shareable()) { - val |= GICR_VPROPBASER_RaWb; - val |= GICR_VPROPBASER_InnerShareable; - } + val |= GICR_VPROPBASER_RaWb; + val |= GICR_VPROPBASER_InnerShareable; val |= GICR_VPROPBASER_4_1_Z; val |= GICR_VPROPBASER_4_1_VALID; @@ -3139,7 +3130,7 @@ gicr_write_propbaser(val, rbase + GICR_PROPBASER); tmp = gicr_read_propbaser(rbase + GICR_PROPBASER); - if (!rdists_support_shareable()) + if (gic_rdists->flags & RDIST_FLAGS_FORCE_NON_SHAREABLE) tmp &= ~GICR_PROPBASER_SHAREABILITY_MASK; if ((tmp ^ val) & GICR_PROPBASER_SHAREABILITY_MASK) { @@ -3166,7 +3157,7 @@ gicr_write_pendbaser(val, rbase + GICR_PENDBASER); tmp = gicr_read_pendbaser(rbase + GICR_PENDBASER); - if (!rdists_support_shareable()) + if (gic_rdists->flags & RDIST_FLAGS_FORCE_NON_SHAREABLE) tmp &= ~GICR_PENDBASER_SHAREABILITY_MASK; if (!(tmp & GICR_PENDBASER_SHAREABILITY_MASK)) { @@ -3830,9 +3821,8 @@ bool force) { struct its_vpe *vpe = irq_data_get_irq_chip_data(d); - struct cpumask common, *table_mask; + int from, cpu = cpumask_first(mask_val); unsigned long flags; - int from, cpu; /* * Changing affinity is mega expensive, so let's be as lazy as @@ -3848,22 +3838,19 @@ * taken on any vLPI handling path that evaluates vpe->col_idx. */ from = vpe_to_cpuid_lock(vpe, &flags); - table_mask = gic_data_rdist_cpu(from)->vpe_table_mask; - - /* - * If we are offered another CPU in the same GICv4.1 ITS - * affinity, pick this one. Otherwise, any CPU will do. - */ - if (table_mask && cpumask_and(&common, mask_val, table_mask)) - cpu = cpumask_test_cpu(from, &common) ? from : cpumask_first(&common); - else - cpu = cpumask_first(mask_val); - if (from == cpu) goto out; vpe->col_idx = cpu; + /* + * GICv4.1 allows us to skip VMOVP if moving to a cpu whose RD + * is sharing its VPE table with the current one. + */ + if (gic_data_rdist_cpu(cpu)->vpe_table_mask && + cpumask_test_cpu(from, gic_data_rdist_cpu(cpu)->vpe_table_mask)) + goto out; + its_send_vmovp(vpe); its_vpe_db_proxy_move(vpe, from, cpu); @@ -3897,18 +3884,14 @@ val = virt_to_phys(page_address(vpe->its_vm->vprop_page)) & GENMASK_ULL(51, 12); val |= (LPI_NRBITS - 1) & GICR_VPROPBASER_IDBITS_MASK; - if (rdists_support_shareable()) { - val |= GICR_VPROPBASER_RaWb; - val |= GICR_VPROPBASER_InnerShareable; - } + val |= GICR_VPROPBASER_RaWb; + val |= GICR_VPROPBASER_InnerShareable; gicr_write_vpropbaser(val, vlpi_base + GICR_VPROPBASER); val = virt_to_phys(page_address(vpe->vpt_page)) & GENMASK_ULL(51, 16); - if (rdists_support_shareable()) { - val |= GICR_VPENDBASER_RaWaWb; - val |= GICR_VPENDBASER_InnerShareable; - } + val |= GICR_VPENDBASER_RaWaWb; + val |= GICR_VPENDBASER_InnerShareable; /* * There is no good way of finding out if the pending table is * empty as we can race against the doorbell interrupt very diff -u linux-6.5.0/drivers/irqchip/irq-loongson-eiointc.c linux-6.5.0/drivers/irqchip/irq-loongson-eiointc.c --- linux-6.5.0/drivers/irqchip/irq-loongson-eiointc.c +++ linux-6.5.0/drivers/irqchip/irq-loongson-eiointc.c @@ -241,7 +241,7 @@ int ret; unsigned int i, type; unsigned long hwirq = 0; - struct eiointc_priv *priv = domain->host_data; + struct eiointc *priv = domain->host_data; ret = irq_domain_translate_onecell(domain, arg, &hwirq, &type); if (ret) diff -u linux-6.5.0/drivers/md/dm-crypt.c linux-6.5.0/drivers/md/dm-crypt.c --- linux-6.5.0/drivers/md/dm-crypt.c +++ linux-6.5.0/drivers/md/dm-crypt.c @@ -73,8 +73,10 @@ struct bio *base_bio; u8 *integrity_metadata; bool integrity_metadata_from_pool:1; + bool in_tasklet:1; struct work_struct work; + struct tasklet_struct tasklet; struct convert_context ctx; @@ -1767,6 +1769,7 @@ io->ctx.r.req = NULL; io->integrity_metadata = NULL; io->integrity_metadata_from_pool = false; + io->in_tasklet = false; atomic_set(&io->io_pending, 0); } @@ -1775,6 +1778,13 @@ atomic_inc(&io->io_pending); } +static void kcryptd_io_bio_endio(struct work_struct *work) +{ + struct dm_crypt_io *io = container_of(work, struct dm_crypt_io, work); + + bio_endio(io->base_bio); +} + /* * One of the bios was finished. Check for completion of * the whole request and correctly clean up the buffer. @@ -1798,6 +1808,20 @@ base_bio->bi_status = error; + /* + * If we are running this function from our tasklet, + * we can't call bio_endio() here, because it will call + * clone_endio() from dm.c, which in turn will + * free the current struct dm_crypt_io structure with + * our tasklet. In this case we need to delay bio_endio() + * execution to after the tasklet is done and dequeued. + */ + if (io->in_tasklet) { + INIT_WORK(&io->work, kcryptd_io_bio_endio); + queue_work(cc->io_queue, &io->work); + return; + } + bio_endio(base_bio); } @@ -2229,6 +2253,11 @@ kcryptd_crypt_write_convert(io); } +static void kcryptd_crypt_tasklet(unsigned long work) +{ + kcryptd_crypt((struct work_struct *)work); +} + static void kcryptd_queue_crypt(struct dm_crypt_io *io) { struct crypt_config *cc = io->cc; @@ -2240,10 +2269,15 @@ * irqs_disabled(): the kernel may run some IO completion from the idle thread, but * it is being executed with irqs disabled. */ - if (!(in_hardirq() || irqs_disabled())) { - kcryptd_crypt(&io->work); + if (in_hardirq() || irqs_disabled()) { + io->in_tasklet = true; + tasklet_init(&io->tasklet, kcryptd_crypt_tasklet, (unsigned long)&io->work); + tasklet_schedule(&io->tasklet); return; } + + kcryptd_crypt(&io->work); + return; } INIT_WORK(&io->work, kcryptd_crypt); diff -u linux-6.5.0/drivers/md/dm-verity-target.c linux-6.5.0/drivers/md/dm-verity-target.c --- linux-6.5.0/drivers/md/dm-verity-target.c +++ linux-6.5.0/drivers/md/dm-verity-target.c @@ -645,6 +645,23 @@ verity_finish_io(io, errno_to_blk_status(verity_verify_io(io))); } +static void verity_tasklet(unsigned long data) +{ + struct dm_verity_io *io = (struct dm_verity_io *)data; + int err; + + io->in_tasklet = true; + err = verity_verify_io(io); + if (err == -EAGAIN || err == -ENOMEM) { + /* fallback to retrying with work-queue */ + INIT_WORK(&io->work, verity_work); + queue_work(io->v->verify_wq, &io->work); + return; + } + + verity_finish_io(io, errno_to_blk_status(err)); +} + static void verity_end_io(struct bio *bio) { struct dm_verity_io *io = bio->bi_private; @@ -657,8 +674,13 @@ return; } - INIT_WORK(&io->work, verity_work); - queue_work(io->v->verify_wq, &io->work); + if (static_branch_unlikely(&use_tasklet_enabled) && io->v->use_tasklet) { + tasklet_init(&io->tasklet, verity_tasklet, (unsigned long)io); + tasklet_schedule(&io->tasklet); + } else { + INIT_WORK(&io->work, verity_work); + queue_work(io->v->verify_wq, &io->work); + } } /* diff -u linux-6.5.0/drivers/md/dm-verity.h linux-6.5.0/drivers/md/dm-verity.h --- linux-6.5.0/drivers/md/dm-verity.h +++ linux-6.5.0/drivers/md/dm-verity.h @@ -83,6 +83,7 @@ struct bvec_iter iter; struct work_struct work; + struct tasklet_struct tasklet; /* * Three variably-size fields follow this struct: diff -u linux-6.5.0/drivers/md/md.c linux-6.5.0/drivers/md/md.c --- linux-6.5.0/drivers/md/md.c +++ linux-6.5.0/drivers/md/md.c @@ -940,10 +940,9 @@ return; bio = bio_alloc_bioset(rdev->meta_bdev ? rdev->meta_bdev : rdev->bdev, - 1, - REQ_OP_WRITE | REQ_SYNC | REQ_IDLE | REQ_META - | REQ_PREFLUSH | REQ_FUA, - GFP_NOIO, &mddev->sync_set); + 1, + REQ_OP_WRITE | REQ_SYNC | REQ_PREFLUSH | REQ_FUA, + GFP_NOIO, &mddev->sync_set); atomic_inc(&rdev->nr_pending); reverted: --- linux-6.5.0/drivers/media/pci/solo6x10/solo6x10-offsets.h +++ linux-6.5.0.orig/drivers/media/pci/solo6x10/solo6x10-offsets.h @@ -57,16 +57,16 @@ #define SOLO_MP4E_EXT_ADDR(__solo) \ (SOLO_EREF_EXT_ADDR(__solo) + SOLO_EREF_EXT_AREA(__solo)) #define SOLO_MP4E_EXT_SIZE(__solo) \ + max((__solo->nr_chans * 0x00080000), \ + min(((__solo->sdram_size - SOLO_MP4E_EXT_ADDR(__solo)) - \ + __SOLO_JPEG_MIN_SIZE(__solo)), 0x00ff0000)) - clamp(__solo->sdram_size - SOLO_MP4E_EXT_ADDR(__solo) - \ - __SOLO_JPEG_MIN_SIZE(__solo), \ - __solo->nr_chans * 0x00080000, 0x00ff0000) #define __SOLO_JPEG_MIN_SIZE(__solo) (__solo->nr_chans * 0x00080000) #define SOLO_JPEG_EXT_ADDR(__solo) \ (SOLO_MP4E_EXT_ADDR(__solo) + SOLO_MP4E_EXT_SIZE(__solo)) #define SOLO_JPEG_EXT_SIZE(__solo) \ + max(__SOLO_JPEG_MIN_SIZE(__solo), \ + min((__solo->sdram_size - SOLO_JPEG_EXT_ADDR(__solo)), 0x00ff0000)) - clamp(__solo->sdram_size - SOLO_JPEG_EXT_ADDR(__solo), \ - __SOLO_JPEG_MIN_SIZE(__solo), 0x00ff0000) #define SOLO_SDRAM_END(__solo) \ (SOLO_JPEG_EXT_ADDR(__solo) + SOLO_JPEG_EXT_SIZE(__solo)) reverted: --- linux-6.5.0/drivers/media/rc/bpf-lirc.c +++ linux-6.5.0.orig/drivers/media/rc/bpf-lirc.c @@ -253,7 +253,7 @@ if (attr->attach_flags) return -EINVAL; + rcdev = rc_dev_get_from_fd(attr->target_fd); - rcdev = rc_dev_get_from_fd(attr->target_fd, true); if (IS_ERR(rcdev)) return PTR_ERR(rcdev); @@ -278,7 +278,7 @@ if (IS_ERR(prog)) return PTR_ERR(prog); + rcdev = rc_dev_get_from_fd(attr->target_fd); - rcdev = rc_dev_get_from_fd(attr->target_fd, true); if (IS_ERR(rcdev)) { bpf_prog_put(prog); return PTR_ERR(rcdev); @@ -303,7 +303,7 @@ if (attr->query.query_flags) return -EINVAL; + rcdev = rc_dev_get_from_fd(attr->query.target_fd); - rcdev = rc_dev_get_from_fd(attr->query.target_fd, false); if (IS_ERR(rcdev)) return PTR_ERR(rcdev); reverted: --- linux-6.5.0/drivers/media/rc/ir_toy.c +++ linux-6.5.0.orig/drivers/media/rc/ir_toy.c @@ -332,7 +332,6 @@ sizeof(COMMAND_SMODE_EXIT), STATE_COMMAND_NO_RESP); if (err) { dev_err(irtoy->dev, "exit sample mode: %d\n", err); - kfree(buf); return err; } @@ -340,7 +339,6 @@ sizeof(COMMAND_SMODE_ENTER), STATE_COMMAND); if (err) { dev_err(irtoy->dev, "enter sample mode: %d\n", err); - kfree(buf); return err; } diff -u linux-6.5.0/drivers/media/rc/lirc_dev.c linux-6.5.0/drivers/media/rc/lirc_dev.c --- linux-6.5.0/drivers/media/rc/lirc_dev.c +++ linux-6.5.0/drivers/media/rc/lirc_dev.c @@ -814,7 +814,7 @@ unregister_chrdev_region(lirc_base_dev, RC_DEV_MAX); } -struct rc_dev *rc_dev_get_from_fd(int fd, bool write) +struct rc_dev *rc_dev_get_from_fd(int fd) { struct fd f = fdget(fd); struct lirc_fh *fh; @@ -828,9 +828,6 @@ return ERR_PTR(-EINVAL); } - if (write && !(f.file->f_mode & FMODE_WRITE)) - return ERR_PTR(-EPERM); - fh = f.file->private_data; dev = fh->rc; reverted: --- linux-6.5.0/drivers/media/rc/rc-core-priv.h +++ linux-6.5.0.orig/drivers/media/rc/rc-core-priv.h @@ -325,7 +325,7 @@ void lirc_scancode_event(struct rc_dev *dev, struct lirc_scancode *lsc); int lirc_register(struct rc_dev *dev); void lirc_unregister(struct rc_dev *dev); +struct rc_dev *rc_dev_get_from_fd(int fd); -struct rc_dev *rc_dev_get_from_fd(int fd, bool write); #else static inline int lirc_dev_init(void) { return 0; } static inline void lirc_dev_exit(void) {} diff -u linux-6.5.0/drivers/misc/fastrpc.c linux-6.5.0/drivers/misc/fastrpc.c --- linux-6.5.0/drivers/misc/fastrpc.c +++ linux-6.5.0/drivers/misc/fastrpc.c @@ -2190,7 +2190,7 @@ int i; spin_lock_irqsave(&cctx->lock, flags); - for (i = 0; i < FASTRPC_MAX_SESSIONS; i++) { + for (i = 1; i < FASTRPC_MAX_SESSIONS; i++) { if (cctx->session[i].sid == sess->sid) { cctx->session[i].valid = false; cctx->sesscount--; reverted: --- linux-6.5.0/drivers/mmc/core/slot-gpio.c +++ linux-6.5.0.orig/drivers/mmc/core/slot-gpio.c @@ -75,15 +75,11 @@ int mmc_gpio_get_ro(struct mmc_host *host) { struct mmc_gpio *ctx = host->slot.handler_priv; - int cansleep; if (!ctx || !ctx->ro_gpio) return -ENOSYS; + return gpiod_get_value_cansleep(ctx->ro_gpio); - cansleep = gpiod_cansleep(ctx->ro_gpio); - return cansleep ? - gpiod_get_value_cansleep(ctx->ro_gpio) : - gpiod_get_value(ctx->ro_gpio); } EXPORT_SYMBOL(mmc_gpio_get_ro); reverted: --- linux-6.5.0/drivers/mmc/host/sdhci-pci-o2micro.c +++ linux-6.5.0.orig/drivers/mmc/host/sdhci-pci-o2micro.c @@ -603,35 +603,6 @@ sdhci_o2_enable_clk(host, clk); } -static void sdhci_pci_o2_set_power(struct sdhci_host *host, unsigned char mode, unsigned short vdd) -{ - struct sdhci_pci_chip *chip; - struct sdhci_pci_slot *slot = sdhci_priv(host); - u32 scratch_32 = 0; - u8 scratch_8 = 0; - - chip = slot->chip; - - if (mode == MMC_POWER_OFF) { - /* UnLock WP */ - pci_read_config_byte(chip->pdev, O2_SD_LOCK_WP, &scratch_8); - scratch_8 &= 0x7f; - pci_write_config_byte(chip->pdev, O2_SD_LOCK_WP, scratch_8); - - /* Set PCR 0x354[16] to switch Clock Source back to OPE Clock */ - pci_read_config_dword(chip->pdev, O2_SD_OUTPUT_CLK_SOURCE_SWITCH, &scratch_32); - scratch_32 &= ~(O2_SD_SEL_DLL); - pci_write_config_dword(chip->pdev, O2_SD_OUTPUT_CLK_SOURCE_SWITCH, scratch_32); - - /* Lock WP */ - pci_read_config_byte(chip->pdev, O2_SD_LOCK_WP, &scratch_8); - scratch_8 |= 0x80; - pci_write_config_byte(chip->pdev, O2_SD_LOCK_WP, scratch_8); - } - - sdhci_set_power(host, mode, vdd); -} - static int sdhci_pci_o2_probe_slot(struct sdhci_pci_slot *slot) { struct sdhci_pci_chip *chip; @@ -941,7 +912,6 @@ .set_bus_width = sdhci_set_bus_width, .reset = sdhci_reset, .set_uhs_signaling = sdhci_set_uhs_signaling, - .set_power = sdhci_pci_o2_set_power, }; const struct sdhci_pci_fixes sdhci_o2 = { diff -u linux-6.5.0/drivers/net/bonding/bond_main.c linux-6.5.0/drivers/net/bonding/bond_main.c --- linux-6.5.0/drivers/net/bonding/bond_main.c +++ linux-6.5.0/drivers/net/bonding/bond_main.c @@ -1818,8 +1818,6 @@ bond_for_each_slave(bond, slave, iter) val &= slave->dev->xdp_features; - val &= ~NETDEV_XDP_ACT_XSK_ZEROCOPY; - xdp_set_features_flag(bond_dev, val); } @@ -5922,6 +5920,9 @@ if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP) bond_dev->features |= BOND_XFRM_FEATURES; #endif /* CONFIG_XFRM_OFFLOAD */ + + if (bond_xdp_check(bond)) + bond_dev->xdp_features = NETDEV_XDP_ACT_MASK; } /* Destroy a bonding device. reverted: --- linux-6.5.0/drivers/net/can/dev/netlink.c +++ linux-6.5.0.orig/drivers/net/can/dev/netlink.c @@ -346,7 +346,7 @@ /* Neither of TDC parameters nor TDC flags are * provided: do calculation */ + can_calc_tdco(&priv->tdc, priv->tdc_const, &priv->data_bittiming, - can_calc_tdco(&priv->tdc, priv->tdc_const, &dbt, &priv->ctrlmode, priv->ctrlmode_supported); } /* else: both CAN_CTRLMODE_TDC_{AUTO,MANUAL} are explicitly * turned off. TDC is disabled: do nothing diff -u linux-6.5.0/drivers/net/dsa/mv88e6xxx/chip.c linux-6.5.0/drivers/net/dsa/mv88e6xxx/chip.c --- linux-6.5.0/drivers/net/dsa/mv88e6xxx/chip.c +++ linux-6.5.0/drivers/net/dsa/mv88e6xxx/chip.c @@ -3784,7 +3784,7 @@ int err; if (!chip->info->ops->phy_read_c45) - return 0xffff; + return -EOPNOTSUPP; mv88e6xxx_reg_lock(chip); err = chip->info->ops->phy_read_c45(chip, bus, phy, devad, reg, &val); diff -u linux-6.5.0/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c linux-6.5.0/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c --- linux-6.5.0/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c +++ linux-6.5.0/drivers/net/ethernet/aquantia/atlantic/aq_ptp.c @@ -993,7 +993,7 @@ return 0; err_exit_hwts_rx: - aq_ring_hwts_rx_free(&aq_ptp->hwts_rx); + aq_ring_free(&aq_ptp->hwts_rx); err_exit_ptp_rx: aq_ring_free(&aq_ptp->ptp_rx); err_exit_ptp_tx: @@ -1011,7 +1011,7 @@ aq_ring_free(&aq_ptp->ptp_tx); aq_ring_free(&aq_ptp->ptp_rx); - aq_ring_hwts_rx_free(&aq_ptp->hwts_rx); + aq_ring_free(&aq_ptp->hwts_rx); aq_ptp_skb_ring_release(&aq_ptp->skb_ring); } diff -u linux-6.5.0/drivers/net/ethernet/aquantia/atlantic/aq_ring.c linux-6.5.0/drivers/net/ethernet/aquantia/atlantic/aq_ring.c --- linux-6.5.0/drivers/net/ethernet/aquantia/atlantic/aq_ring.c +++ linux-6.5.0/drivers/net/ethernet/aquantia/atlantic/aq_ring.c @@ -921,15 +921,2 @@ -void aq_ring_hwts_rx_free(struct aq_ring_s *self) -{ - if (!self) - return; - - if (self->dx_ring) { - dma_free_coherent(aq_nic_get_dev(self->aq_nic), - self->size * self->dx_size + AQ_CFG_RXDS_DEF, - self->dx_ring, self->dx_ring_pa); - self->dx_ring = NULL; - } -} - unsigned int aq_ring_fill_stats_data(struct aq_ring_s *self, u64 *data) diff -u linux-6.5.0/drivers/net/ethernet/aquantia/atlantic/aq_ring.h linux-6.5.0/drivers/net/ethernet/aquantia/atlantic/aq_ring.h --- linux-6.5.0/drivers/net/ethernet/aquantia/atlantic/aq_ring.h +++ linux-6.5.0/drivers/net/ethernet/aquantia/atlantic/aq_ring.h @@ -210,7 +210,6 @@ int aq_ring_hwts_rx_alloc(struct aq_ring_s *self, struct aq_nic_s *aq_nic, unsigned int idx, unsigned int size, unsigned int dx_size); -void aq_ring_hwts_rx_free(struct aq_ring_s *self); void aq_ring_hwts_rx_clean(struct aq_ring_s *self, struct aq_nic_s *aq_nic); unsigned int aq_ring_fill_stats_data(struct aq_ring_s *self, u64 *data); diff -u linux-6.5.0/drivers/net/ethernet/engleder/tsnep_main.c linux-6.5.0/drivers/net/ethernet/engleder/tsnep_main.c --- linux-6.5.0/drivers/net/ethernet/engleder/tsnep_main.c +++ linux-6.5.0/drivers/net/ethernet/engleder/tsnep_main.c @@ -667,25 +667,17 @@ static bool tsnep_xdp_xmit_back(struct tsnep_adapter *adapter, struct xdp_buff *xdp, - struct netdev_queue *tx_nq, struct tsnep_tx *tx, - bool zc) + struct netdev_queue *tx_nq, struct tsnep_tx *tx) { struct xdp_frame *xdpf = xdp_convert_buff_to_frame(xdp); bool xmit; - u32 type; if (unlikely(!xdpf)) return false; - /* no page pool for zero copy */ - if (zc) - type = TSNEP_TX_TYPE_XDP_NDO; - else - type = TSNEP_TX_TYPE_XDP_TX; - __netif_tx_lock(tx_nq, smp_processor_id()); - xmit = tsnep_xdp_xmit_frame_ring(xdpf, tx, type); + xmit = tsnep_xdp_xmit_frame_ring(xdpf, tx, TSNEP_TX_TYPE_XDP_TX); /* Avoid transmit queue timeout since we share it with the slow path */ if (xmit) @@ -1229,7 +1221,7 @@ case XDP_PASS: return false; case XDP_TX: - if (!tsnep_xdp_xmit_back(rx->adapter, xdp, tx_nq, tx, false)) + if (!tsnep_xdp_xmit_back(rx->adapter, xdp, tx_nq, tx)) goto out_failure; *status |= TSNEP_XDP_TX; return true; @@ -1279,7 +1271,7 @@ case XDP_PASS: return false; case XDP_TX: - if (!tsnep_xdp_xmit_back(rx->adapter, xdp, tx_nq, tx, true)) + if (!tsnep_xdp_xmit_back(rx->adapter, xdp, tx_nq, tx)) goto out_failure; *status |= TSNEP_XDP_TX; return true; diff -u linux-6.5.0/drivers/net/ethernet/intel/i40e/i40e_main.c linux-6.5.0/drivers/net/ethernet/intel/i40e/i40e_main.c --- linux-6.5.0/drivers/net/ethernet/intel/i40e/i40e_main.c +++ linux-6.5.0/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -5349,7 +5349,7 @@ { int v, ret = 0; - for (v = 0; v < pf->num_alloc_vsi; v++) { + for (v = 0; v < pf->hw.func_caps.num_vsis; v++) { if (pf->vsi[v]) { ret = i40e_vsi_wait_queues_disabled(pf->vsi[v]); if (ret) diff -u linux-6.5.0/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c linux-6.5.0/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c --- linux-6.5.0/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +++ linux-6.5.0/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c @@ -2847,24 +2847,6 @@ (u8 *)&stats, sizeof(stats)); } -/** - * i40e_can_vf_change_mac - * @vf: pointer to the VF info - * - * Return true if the VF is allowed to change its MAC filters, false otherwise - */ -static bool i40e_can_vf_change_mac(struct i40e_vf *vf) -{ - /* If the VF MAC address has been set administratively (via the - * ndo_set_vf_mac command), then deny permission to the VF to - * add/delete unicast MAC addresses, unless the VF is trusted - */ - if (vf->pf_set_mac && !vf->trusted) - return false; - - return true; -} - #define I40E_MAX_MACVLAN_PER_HW 3072 #define I40E_MAX_MACVLAN_PER_PF(num_ports) (I40E_MAX_MACVLAN_PER_HW / \ (num_ports)) @@ -2924,8 +2906,8 @@ * The VF may request to set the MAC address filter already * assigned to it so do not return an error in that case. */ - if (!i40e_can_vf_change_mac(vf) && - !is_multicast_ether_addr(addr) && + if (!test_bit(I40E_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps) && + !is_multicast_ether_addr(addr) && vf->pf_set_mac && !ether_addr_equal(addr, vf->default_lan_addr.addr)) { dev_err(&pf->pdev->dev, "VF attempting to override administratively set MAC address, bring down and up the VF interface to resume normal operation\n"); @@ -3131,29 +3113,19 @@ ret = I40E_ERR_INVALID_MAC_ADDR; goto error_param; } + if (ether_addr_equal(al->list[i].addr, vf->default_lan_addr.addr)) + was_unimac_deleted = true; } vsi = pf->vsi[vf->lan_vsi_idx]; spin_lock_bh(&vsi->mac_filter_hash_lock); /* delete addresses from the list */ - for (i = 0; i < al->num_elements; i++) { - const u8 *addr = al->list[i].addr; - - /* Allow to delete VF primary MAC only if it was not set - * administratively by PF or if VF is trusted. - */ - if (ether_addr_equal(addr, vf->default_lan_addr.addr) && - i40e_can_vf_change_mac(vf)) - was_unimac_deleted = true; - else - continue; - + for (i = 0; i < al->num_elements; i++) if (i40e_del_mac_filter(vsi, al->list[i].addr)) { ret = I40E_ERR_INVALID_MAC_ADDR; spin_unlock_bh(&vsi->mac_filter_hash_lock); goto error_param; } - } spin_unlock_bh(&vsi->mac_filter_hash_lock); diff -u linux-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c linux-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c --- linux-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c +++ linux-6.5.0/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c @@ -949,11 +949,8 @@ if (pfvf->ptp && qidx < pfvf->hw.tx_queues) { err = qmem_alloc(pfvf->dev, &sq->timestamps, qset->sqe_cnt, sizeof(*sq->timestamps)); - if (err) { - kfree(sq->sg); - sq->sg = NULL; + if (err) return err; - } } sq->head = 0; @@ -969,14 +966,7 @@ sq->stats.bytes = 0; sq->stats.pkts = 0; - err = pfvf->hw_ops->sq_aq_init(pfvf, qidx, sqb_aura); - if (err) { - kfree(sq->sg); - sq->sg = NULL; - return err; - } - - return 0; + return pfvf->hw_ops->sq_aq_init(pfvf, qidx, sqb_aura); } reverted: --- linux-6.5.0/drivers/net/ethernet/microchip/lan966x/lan966x_lag.c +++ linux-6.5.0.orig/drivers/net/ethernet/microchip/lan966x/lan966x_lag.c @@ -37,24 +37,19 @@ /* Now, set PGIDs for each active LAG */ for (lag = 0; lag < lan966x->num_phys_ports; ++lag) { + struct net_device *bond = lan966x->ports[lag]->bond; - struct lan966x_port *port = lan966x->ports[lag]; int num_active_ports = 0; - struct net_device *bond; unsigned long bond_mask; u8 aggr_idx[16]; + if (!bond || (visited & BIT(lag))) - if (!port || !port->bond || (visited & BIT(lag))) continue; - bond = port->bond; bond_mask = lan966x_lag_get_mask(lan966x, bond); for_each_set_bit(p, &bond_mask, lan966x->num_phys_ports) { struct lan966x_port *port = lan966x->ports[p]; - if (!port) - continue; - lan_wr(ANA_PGID_PGID_SET(bond_mask), lan966x, ANA_PGID(p)); if (port->lag_tx_active) diff -u linux-6.5.0/drivers/net/ethernet/netronome/nfp/flower/conntrack.c linux-6.5.0/drivers/net/ethernet/netronome/nfp/flower/conntrack.c --- linux-6.5.0/drivers/net/ethernet/netronome/nfp/flower/conntrack.c +++ linux-6.5.0/drivers/net/ethernet/netronome/nfp/flower/conntrack.c @@ -1423,30 +1423,10 @@ mangle_action->mangle.mask = (__force u32)cpu_to_be32(mangle_action->mangle.mask); return; - /* Both struct tcphdr and struct udphdr start with - * __be16 source; - * __be16 dest; - * so we can use the same code for both. - */ case FLOW_ACT_MANGLE_HDR_TYPE_TCP: case FLOW_ACT_MANGLE_HDR_TYPE_UDP: - if (mangle_action->mangle.offset == offsetof(struct tcphdr, source)) { - mangle_action->mangle.val = - (__force u32)cpu_to_be32(mangle_action->mangle.val << 16); - /* The mask of mangle action is inverse mask, - * so clear the dest tp port with 0xFFFF to - * instead of rotate-left operation. - */ - mangle_action->mangle.mask = - (__force u32)cpu_to_be32(mangle_action->mangle.mask << 16 | 0xFFFF); - } - if (mangle_action->mangle.offset == offsetof(struct tcphdr, dest)) { - mangle_action->mangle.offset = 0; - mangle_action->mangle.val = - (__force u32)cpu_to_be32(mangle_action->mangle.val); - mangle_action->mangle.mask = - (__force u32)cpu_to_be32(mangle_action->mangle.mask); - } + mangle_action->mangle.val = (__force u16)cpu_to_be16(mangle_action->mangle.val); + mangle_action->mangle.mask = (__force u16)cpu_to_be16(mangle_action->mangle.mask); return; default: @@ -1883,30 +1863,10 @@ { struct flow_rule *rule = flow_cls_offload_flow_rule(flow); struct nfp_fl_ct_flow_entry *ct_entry; - struct flow_action_entry *ct_goto; struct nfp_fl_ct_zone_entry *zt; - struct flow_action_entry *act; bool wildcarded = false; struct flow_match_ct ct; - int i; - - flow_action_for_each(i, act, &rule->action) { - switch (act->id) { - case FLOW_ACTION_REDIRECT: - case FLOW_ACTION_REDIRECT_INGRESS: - case FLOW_ACTION_MIRRED: - case FLOW_ACTION_MIRRED_INGRESS: - if (act->dev->rtnl_link_ops && - !strcmp(act->dev->rtnl_link_ops->kind, "openvswitch")) { - NL_SET_ERR_MSG_MOD(extack, - "unsupported offload: out port is openvswitch internal port"); - return -EOPNOTSUPP; - } - break; - default: - break; - } - } + struct flow_action_entry *ct_goto; flow_rule_match_ct(rule, &ct); if (!ct.mask->ct_zone) { diff -u linux-6.5.0/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c linux-6.5.0/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c --- linux-6.5.0/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c +++ linux-6.5.0/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c @@ -1084,7 +1084,7 @@ u16 nfp_mac_idx = 0; entry = nfp_tunnel_lookup_offloaded_macs(app, netdev->dev_addr); - if (entry && (nfp_tunnel_is_mac_idx_global(entry->index) || netif_is_lag_port(netdev))) { + if (entry && nfp_tunnel_is_mac_idx_global(entry->index)) { if (entry->bridge_count || !nfp_flower_is_supported_bridge(netdev)) { nfp_tunnel_offloaded_macs_inc_ref_and_link(entry, reverted: --- linux-6.5.0/drivers/net/ethernet/netronome/nfp/nfp_net_common.c +++ linux-6.5.0.orig/drivers/net/ethernet/netronome/nfp/nfp_net_common.c @@ -2551,7 +2551,6 @@ case NFP_NFD_VER_NFD3: netdev->netdev_ops = &nfp_nfd3_netdev_ops; netdev->xdp_features |= NETDEV_XDP_ACT_XSK_ZEROCOPY; - netdev->xdp_features |= NETDEV_XDP_ACT_REDIRECT; break; case NFP_NFD_VER_NFDK: netdev->netdev_ops = &nfp_nfdk_netdev_ops; reverted: --- linux-6.5.0/drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c +++ linux-6.5.0.orig/drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c @@ -537,13 +537,11 @@ const u32 barcfg_msix_general = NFP_PCIE_BAR_PCIE2CPP_MapType( NFP_PCIE_BAR_PCIE2CPP_MapType_GENERAL) | + NFP_PCIE_BAR_PCIE2CPP_LengthSelect_32BIT; - NFP_PCIE_BAR_PCIE2CPP_LengthSelect( - NFP_PCIE_BAR_PCIE2CPP_LengthSelect_32BIT); const u32 barcfg_msix_xpb = NFP_PCIE_BAR_PCIE2CPP_MapType( NFP_PCIE_BAR_PCIE2CPP_MapType_BULK) | + NFP_PCIE_BAR_PCIE2CPP_LengthSelect_32BIT | - NFP_PCIE_BAR_PCIE2CPP_LengthSelect( - NFP_PCIE_BAR_PCIE2CPP_LengthSelect_32BIT) | NFP_PCIE_BAR_PCIE2CPP_Target_BaseAddress( NFP_CPP_TARGET_ISLAND_XPB); const u32 barcfg_explicit[4] = { reverted: --- linux-6.5.0/drivers/net/ethernet/stmicro/stmmac/common.h +++ linux-6.5.0.orig/drivers/net/ethernet/stmicro/stmmac/common.h @@ -209,7 +209,6 @@ unsigned long mac_errors[32]; unsigned long mtl_errors[32]; unsigned long dma_errors[32]; - unsigned long dma_dpp_errors[32]; }; /* Number of fields in Safety Stats */ diff -u linux-6.5.0/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h linux-6.5.0/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h --- linux-6.5.0/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h +++ linux-6.5.0/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h @@ -282,8 +282,6 @@ #define XGMAC_RXCEIE BIT(4) #define XGMAC_TXCEIE BIT(0) #define XGMAC_MTL_ECC_INT_STATUS 0x000010cc -#define XGMAC_MTL_DPP_CONTROL 0x000010e0 -#define XGMAC_DPP_DISABLE BIT(0) #define XGMAC_MTL_TXQ_OPMODE(x) (0x00001100 + (0x80 * (x))) #define XGMAC_TQS GENMASK(25, 16) #define XGMAC_TQS_SHIFT 16 @@ -366,7 +364,6 @@ #define XGMAC_DCEIE BIT(1) #define XGMAC_TCEIE BIT(0) #define XGMAC_DMA_ECC_INT_STATUS 0x0000306c -#define XGMAC_DMA_DPP_INT_STATUS 0x00003074 #define XGMAC_DMA_CH_CONTROL(x) (0x00003100 + (0x80 * (x))) #define XGMAC_SPH BIT(24) #define XGMAC_PBLx8 BIT(16) diff -u linux-6.5.0/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c linux-6.5.0/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c --- linux-6.5.0/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c +++ linux-6.5.0/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c @@ -792,44 +792,6 @@ { false, "UNKNOWN", "Unknown Error" }, /* 31 */ }; -#define DPP_RX_ERR "Read Rx Descriptor Parity checker Error" -#define DPP_TX_ERR "Read Tx Descriptor Parity checker Error" - -static const struct dwxgmac3_error_desc dwxgmac3_dma_dpp_errors[32] = { - { true, "TDPES0", DPP_TX_ERR }, - { true, "TDPES1", DPP_TX_ERR }, - { true, "TDPES2", DPP_TX_ERR }, - { true, "TDPES3", DPP_TX_ERR }, - { true, "TDPES4", DPP_TX_ERR }, - { true, "TDPES5", DPP_TX_ERR }, - { true, "TDPES6", DPP_TX_ERR }, - { true, "TDPES7", DPP_TX_ERR }, - { true, "TDPES8", DPP_TX_ERR }, - { true, "TDPES9", DPP_TX_ERR }, - { true, "TDPES10", DPP_TX_ERR }, - { true, "TDPES11", DPP_TX_ERR }, - { true, "TDPES12", DPP_TX_ERR }, - { true, "TDPES13", DPP_TX_ERR }, - { true, "TDPES14", DPP_TX_ERR }, - { true, "TDPES15", DPP_TX_ERR }, - { true, "RDPES0", DPP_RX_ERR }, - { true, "RDPES1", DPP_RX_ERR }, - { true, "RDPES2", DPP_RX_ERR }, - { true, "RDPES3", DPP_RX_ERR }, - { true, "RDPES4", DPP_RX_ERR }, - { true, "RDPES5", DPP_RX_ERR }, - { true, "RDPES6", DPP_RX_ERR }, - { true, "RDPES7", DPP_RX_ERR }, - { true, "RDPES8", DPP_RX_ERR }, - { true, "RDPES9", DPP_RX_ERR }, - { true, "RDPES10", DPP_RX_ERR }, - { true, "RDPES11", DPP_RX_ERR }, - { true, "RDPES12", DPP_RX_ERR }, - { true, "RDPES13", DPP_RX_ERR }, - { true, "RDPES14", DPP_RX_ERR }, - { true, "RDPES15", DPP_RX_ERR }, -}; - static void dwxgmac3_handle_dma_err(struct net_device *ndev, void __iomem *ioaddr, bool correctable, struct stmmac_safety_stats *stats) @@ -841,13 +803,6 @@ dwxgmac3_log_error(ndev, value, correctable, "DMA", dwxgmac3_dma_errors, STAT_OFF(dma_errors), stats); - - value = readl(ioaddr + XGMAC_DMA_DPP_INT_STATUS); - writel(value, ioaddr + XGMAC_DMA_DPP_INT_STATUS); - - dwxgmac3_log_error(ndev, value, false, "DMA_DPP", - dwxgmac3_dma_dpp_errors, - STAT_OFF(dma_dpp_errors), stats); } static int @@ -886,12 +841,6 @@ value |= XGMAC_TMOUTEN; /* FSM Timeout Feature */ writel(value, ioaddr + XGMAC_MAC_FSM_CONTROL); - /* 5. Enable Data Path Parity Protection */ - value = readl(ioaddr + XGMAC_MTL_DPP_CONTROL); - /* already enabled by default, explicit enable it again */ - value &= ~XGMAC_DPP_DISABLE; - writel(value, ioaddr + XGMAC_MTL_DPP_CONTROL); - return 0; } @@ -925,11 +874,7 @@ ret |= !corr; } - /* DMA_DPP_Interrupt_Status is indicated by MCSIS bit in - * DMA_Safety_Interrupt_Status, so we handle DMA Data Path - * Parity Errors here - */ - err = dma & (XGMAC_DEUIS | XGMAC_DECIS | XGMAC_MCSIS); + err = dma & (XGMAC_DEUIS | XGMAC_DECIS); corr = dma & XGMAC_DECIS; if (err) { dwxgmac3_handle_dma_err(ndev, ioaddr, corr, stats); @@ -945,7 +890,6 @@ { dwxgmac3_mac_errors }, { dwxgmac3_mtl_errors }, { dwxgmac3_dma_errors }, - { dwxgmac3_dma_dpp_errors }, }; static int dwxgmac3_safety_feat_dump(struct stmmac_safety_stats *stats, diff -u linux-6.5.0/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c linux-6.5.0/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c --- linux-6.5.0/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ linux-6.5.0/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3838,9 +3838,6 @@ priv->rx_copybreak = STMMAC_RX_COPYBREAK; buf_sz = dma_conf->dma_buf_sz; - for (int i = 0; i < MTL_MAX_TX_QUEUES; i++) - if (priv->dma_conf.tx_queue[i].tbs & STMMAC_TBS_EN) - dma_conf->tx_queue[i].tbs = priv->dma_conf.tx_queue[i].tbs; memcpy(&priv->dma_conf, dma_conf, sizeof(*dma_conf)); stmmac_reset_queues_param(priv); reverted: --- linux-6.5.0/drivers/net/ethernet/ti/cpsw.c +++ linux-6.5.0.orig/drivers/net/ethernet/ti/cpsw.c @@ -631,8 +631,6 @@ } } - phy->mac_managed_pm = true; - slave->phy = phy; phy_attached_info(slave->phy); reverted: --- linux-6.5.0/drivers/net/ethernet/ti/cpsw_new.c +++ linux-6.5.0.orig/drivers/net/ethernet/ti/cpsw_new.c @@ -773,9 +773,6 @@ slave->slave_num); return; } - - phy->mac_managed_pm = true; - slave->phy = phy; phy_attached_info(slave->phy); reverted: --- linux-6.5.0/drivers/net/hyperv/netvsc.c +++ linux-6.5.0.orig/drivers/net/hyperv/netvsc.c @@ -708,10 +708,7 @@ /* Disable NAPI and disassociate its context from the device. */ for (i = 0; i < net_device->num_chn; i++) { /* See also vmbus_reset_channel_cb(). */ + napi_disable(&net_device->chan_table[i].napi); - /* only disable enabled NAPI channel */ - if (i < ndev->real_num_rx_queues) - napi_disable(&net_device->chan_table[i].napi); - netif_napi_del(&net_device->chan_table[i].napi); } diff -u linux-6.5.0/drivers/net/hyperv/netvsc_drv.c linux-6.5.0/drivers/net/hyperv/netvsc_drv.c --- linux-6.5.0/drivers/net/hyperv/netvsc_drv.c +++ linux-6.5.0/drivers/net/hyperv/netvsc_drv.c @@ -42,10 +42,6 @@ #define LINKCHANGE_INT (2 * HZ) #define VF_TAKEOVER_INT (HZ / 10) -/* Macros to define the context of vf registration */ -#define VF_REG_IN_PROBE 1 -#define VF_REG_IN_NOTIFIER 2 - static unsigned int ring_size __ro_after_init = 128; module_param(ring_size, uint, 0444); MODULE_PARM_DESC(ring_size, "Ring buffer size (# of 4K pages)"); @@ -2187,7 +2183,7 @@ } static int netvsc_vf_join(struct net_device *vf_netdev, - struct net_device *ndev, int context) + struct net_device *ndev) { struct net_device_context *ndev_ctx = netdev_priv(ndev); int ret; @@ -2210,11 +2206,7 @@ goto upper_link_failed; } - /* If this registration is called from probe context vf_takeover - * is taken care of later in probe itself. - */ - if (context == VF_REG_IN_NOTIFIER) - schedule_delayed_work(&ndev_ctx->vf_takeover, VF_TAKEOVER_INT); + schedule_delayed_work(&ndev_ctx->vf_takeover, VF_TAKEOVER_INT); call_netdevice_notifiers(NETDEV_JOIN, vf_netdev); @@ -2352,7 +2344,7 @@ return NOTIFY_DONE; } -static int netvsc_register_vf(struct net_device *vf_netdev, int context) +static int netvsc_register_vf(struct net_device *vf_netdev) { struct net_device_context *net_device_ctx; struct netvsc_device *netvsc_dev; @@ -2392,7 +2384,7 @@ netdev_info(ndev, "VF registering: %s\n", vf_netdev->name); - if (netvsc_vf_join(vf_netdev, ndev, context) != 0) + if (netvsc_vf_join(vf_netdev, ndev) != 0) return NOTIFY_DONE; dev_hold(vf_netdev); @@ -2490,31 +2482,10 @@ return NOTIFY_OK; } -static int check_dev_is_matching_vf(struct net_device *event_ndev) -{ - /* Skip NetVSC interfaces */ - if (event_ndev->netdev_ops == &device_ops) - return -ENODEV; - - /* Avoid non-Ethernet type devices */ - if (event_ndev->type != ARPHRD_ETHER) - return -ENODEV; - - /* Avoid Vlan dev with same MAC registering as VF */ - if (is_vlan_dev(event_ndev)) - return -ENODEV; - - /* Avoid Bonding master dev with same MAC registering as VF */ - if (netif_is_bond_master(event_ndev)) - return -ENODEV; - - return 0; -} - static int netvsc_probe(struct hv_device *dev, const struct hv_vmbus_device_id *dev_id) { - struct net_device *net = NULL, *vf_netdev; + struct net_device *net = NULL; struct net_device_context *net_device_ctx; struct netvsc_device_info *device_info = NULL; struct netvsc_device *nvdev; @@ -2626,30 +2597,6 @@ } list_add(&net_device_ctx->list, &netvsc_dev_list); - - /* When the hv_netvsc driver is unloaded and reloaded, the - * NET_DEVICE_REGISTER for the vf device is replayed before probe - * is complete. This is because register_netdevice_notifier() gets - * registered before vmbus_driver_register() so that callback func - * is set before probe and we don't miss events like NETDEV_POST_INIT - * So, in this section we try to register the matching vf device that - * is present as a netdevice, knowing that its register call is not - * processed in the netvsc_netdev_notifier(as probing is progress and - * get_netvsc_byslot fails). - */ - for_each_netdev(dev_net(net), vf_netdev) { - ret = check_dev_is_matching_vf(vf_netdev); - if (ret != 0) - continue; - - if (net != get_netvsc_byslot(vf_netdev)) - continue; - - netvsc_prepare_bonding(vf_netdev); - netvsc_register_vf(vf_netdev, VF_REG_IN_PROBE); - __netvsc_vf_setup(net, vf_netdev); - break; - } rtnl_unlock(); netvsc_devinfo_put(device_info); @@ -2805,17 +2752,28 @@ unsigned long event, void *ptr) { struct net_device *event_dev = netdev_notifier_info_to_dev(ptr); - int ret = 0; - ret = check_dev_is_matching_vf(event_dev); - if (ret != 0) + /* Skip our own events */ + if (event_dev->netdev_ops == &device_ops) + return NOTIFY_DONE; + + /* Avoid non-Ethernet type devices */ + if (event_dev->type != ARPHRD_ETHER) + return NOTIFY_DONE; + + /* Avoid Vlan dev with same MAC registering as VF */ + if (is_vlan_dev(event_dev)) + return NOTIFY_DONE; + + /* Avoid Bonding master dev with same MAC registering as VF */ + if (netif_is_bond_master(event_dev)) return NOTIFY_DONE; switch (event) { case NETDEV_POST_INIT: return netvsc_prepare_bonding(event_dev); case NETDEV_REGISTER: - return netvsc_register_vf(event_dev, VF_REG_IN_NOTIFIER); + return netvsc_register_vf(event_dev); case NETDEV_UNREGISTER: return netvsc_unregister_vf(event_dev); case NETDEV_UP: reverted: --- linux-6.5.0/drivers/net/netdevsim/dev.c +++ linux-6.5.0.orig/drivers/net/netdevsim/dev.c @@ -835,14 +835,14 @@ trap_report_dw.work); nsim_dev = nsim_trap_data->nsim_dev; + /* For each running port and enabled packet trap, generate a UDP + * packet with a random 5-tuple and report it. + */ if (!devl_trylock(priv_to_devlink(nsim_dev))) { + schedule_delayed_work(&nsim_dev->trap_data->trap_report_dw, 0); - schedule_delayed_work(&nsim_dev->trap_data->trap_report_dw, 1); return; } - /* For each running port and enabled packet trap, generate a UDP - * packet with a random 5-tuple and report it. - */ list_for_each_entry(nsim_dev_port, &nsim_dev->port_list, list) { if (!netif_running(nsim_dev_port->ns->netdev)) continue; reverted: --- linux-6.5.0/drivers/net/ppp/ppp_async.c +++ linux-6.5.0.orig/drivers/net/ppp/ppp_async.c @@ -469,10 +469,6 @@ case PPPIOCSMRU: if (get_user(val, p)) break; - if (val > U16_MAX) { - err = -EINVAL; - break; - } if (val < PPP_MRU) val = PPP_MRU; ap->mru = val; diff -u linux-6.5.0/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c linux-6.5.0/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c --- linux-6.5.0/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ linux-6.5.0/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -3779,10 +3779,8 @@ if (req->channels[i] == chan) break; } - if (i == req->n_channels) { - req->n_channels++; - req->channels[i] = chan; - } + if (i == req->n_channels) + req->channels[req->n_channels++] = chan; for (i = 0; i < req->n_ssids; i++) { if (req->ssids[i].ssid_len == ssid_len && reverted: --- linux-6.5.0/drivers/net/wireless/intel/iwlwifi/fw/acpi.c +++ linux-6.5.0.orig/drivers/net/wireless/intel/iwlwifi/fw/acpi.c @@ -613,7 +613,7 @@ &tbl_rev); if (!IS_ERR(wifi_pkg)) { if (tbl_rev != 2) { + ret = PTR_ERR(wifi_pkg); - ret = -EINVAL; goto out_free; } @@ -629,7 +629,7 @@ &tbl_rev); if (!IS_ERR(wifi_pkg)) { if (tbl_rev != 1) { + ret = PTR_ERR(wifi_pkg); - ret = -EINVAL; goto out_free; } @@ -645,7 +645,7 @@ &tbl_rev); if (!IS_ERR(wifi_pkg)) { if (tbl_rev != 0) { + ret = PTR_ERR(wifi_pkg); - ret = -EINVAL; goto out_free; } @@ -702,7 +702,7 @@ &tbl_rev); if (!IS_ERR(wifi_pkg)) { if (tbl_rev != 2) { + ret = PTR_ERR(wifi_pkg); - ret = -EINVAL; goto out_free; } @@ -718,7 +718,7 @@ &tbl_rev); if (!IS_ERR(wifi_pkg)) { if (tbl_rev != 1) { + ret = PTR_ERR(wifi_pkg); - ret = -EINVAL; goto out_free; } @@ -734,7 +734,7 @@ &tbl_rev); if (!IS_ERR(wifi_pkg)) { if (tbl_rev != 0) { + ret = PTR_ERR(wifi_pkg); - ret = -EINVAL; goto out_free; } @@ -1083,9 +1083,6 @@ goto read_table; } - ret = PTR_ERR(wifi_pkg); - goto out_free; - read_table: fwrt->ppag_ver = tbl_rev; flags = &wifi_pkg->package.elements[1]; diff -u linux-6.5.0/drivers/net/wireless/intel/iwlwifi/iwl-drv.c linux-6.5.0/drivers/net/wireless/intel/iwlwifi/iwl-drv.c --- linux-6.5.0/drivers/net/wireless/intel/iwlwifi/iwl-drv.c +++ linux-6.5.0/drivers/net/wireless/intel/iwlwifi/iwl-drv.c @@ -128,7 +128,6 @@ kfree(drv->fw.ucode_capa.cmd_versions); kfree(drv->fw.phy_integration_ver); kfree(drv->trans->dbg.pc_data); - drv->trans->dbg.pc_data = NULL; for (i = 0; i < IWL_UCODE_TYPE_MAX; i++) iwl_free_fw_img(drv, drv->fw.img + i); diff -u linux-6.5.0/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c linux-6.5.0/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c --- linux-6.5.0/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ linux-6.5.0/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -3665,9 +3665,6 @@ NL80211_TDLS_SETUP); } - if (ret) - return ret; - for_each_sta_active_link(vif, sta, link_sta, i) link_sta->agg.max_rc_amsdu_len = 1; diff -u linux-6.5.0/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c linux-6.5.0/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c --- linux-6.5.0/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +++ linux-6.5.0/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c @@ -435,9 +435,6 @@ mvmvif->ap_ibss_active = false; } - iwl_mvm_link_changed(mvm, vif, link_conf, - LINK_CONTEXT_MODIFY_ACTIVE, false); - if (iwl_mvm_is_esr_supported(mvm->fwrt.trans) && n_active > 1) { int ret = iwl_mvm_esr_mode_inactive(mvm, vif); @@ -449,6 +446,9 @@ if (vif->type == NL80211_IFTYPE_MONITOR) iwl_mvm_mld_rm_snif_sta(mvm, vif); + iwl_mvm_link_changed(mvm, vif, link_conf, + LINK_CONTEXT_MODIFY_ACTIVE, false); + if (switching_chanctx) return; mvmvif->link[link_id]->phy_ctxt = NULL; reverted: --- linux-6.5.0/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +++ linux-6.5.0.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c @@ -503,10 +503,6 @@ return false; mvm_sta = iwl_mvm_sta_from_mac80211(sta); - - if (WARN_ON_ONCE(!mvm_sta->dup_data)) - return false; - dup_data = &mvm_sta->dup_data[queue]; /* diff -u linux-6.5.0/drivers/net/wireless/realtek/rtw89/fw.c linux-6.5.0/drivers/net/wireless/realtek/rtw89/fw.c --- linux-6.5.0/drivers/net/wireless/realtek/rtw89/fw.c +++ linux-6.5.0/drivers/net/wireless/realtek/rtw89/fw.c @@ -556,18 +556,18 @@ static void rtw89_fw_dl_fail_dump(struct rtw89_dev *rtwdev) { u32 val32; + u16 val16; val32 = rtw89_read32(rtwdev, R_AX_WCPU_FW_CTRL); rtw89_err(rtwdev, "[ERR]fwdl 0x1E0 = 0x%x\n", val32); - val32 = rtw89_read32(rtwdev, R_AX_BOOT_DBG); - rtw89_err(rtwdev, "[ERR]fwdl 0x83F0 = 0x%x\n", val32); + val16 = rtw89_read16(rtwdev, R_AX_BOOT_DBG + 2); + rtw89_err(rtwdev, "[ERR]fwdl 0x83F2 = 0x%x\n", val16); rtw89_fw_prog_cnt_dump(rtwdev); } -static -int __rtw89_fw_download(struct rtw89_dev *rtwdev, enum rtw89_fw_type type) +int rtw89_fw_download(struct rtw89_dev *rtwdev, enum rtw89_fw_type type) { struct rtw89_fw_info *fw_info = &rtwdev->fw; struct rtw89_fw_suit *fw_suit = rtw89_fw_suit_get(rtwdev, type); @@ -627,20 +627,6 @@ return ret; } -int rtw89_fw_download(struct rtw89_dev *rtwdev, enum rtw89_fw_type type) -{ - int retry; - int ret; - - for (retry = 0; retry < 5; retry++) { - ret = __rtw89_fw_download(rtwdev, type); - if (!ret) - return 0; - } - - return ret; -} - int rtw89_wait_firmware_completion(struct rtw89_dev *rtwdev) { struct rtw89_fw_info *fw = &rtwdev->fw; diff -u linux-6.5.0/drivers/net/xen-netback/netback.c linux-6.5.0/drivers/net/xen-netback/netback.c --- linux-6.5.0/drivers/net/xen-netback/netback.c +++ linux-6.5.0/drivers/net/xen-netback/netback.c @@ -104,12 +104,13 @@ module_param(provides_xdp_headroom, bool, 0644); static void xenvif_idx_release(struct xenvif_queue *queue, u16 pending_idx, - s8 status); + u8 status); static void make_tx_response(struct xenvif_queue *queue, - const struct xen_netif_tx_request *txp, + struct xen_netif_tx_request *txp, unsigned int extra_count, - s8 status); + s8 st); +static void push_tx_responses(struct xenvif_queue *queue); static void xenvif_idx_unmap(struct xenvif_queue *queue, u16 pending_idx); @@ -207,9 +208,13 @@ unsigned int extra_count, RING_IDX end) { RING_IDX cons = queue->tx.req_cons; + unsigned long flags; do { + spin_lock_irqsave(&queue->response_lock, flags); make_tx_response(queue, txp, extra_count, XEN_NETIF_RSP_ERROR); + push_tx_responses(queue); + spin_unlock_irqrestore(&queue->response_lock, flags); if (cons == end) break; RING_COPY_REQUEST(&queue->tx, cons++, txp); @@ -460,7 +465,12 @@ for (shinfo->nr_frags = 0; nr_slots > 0 && shinfo->nr_frags < MAX_SKB_FRAGS; nr_slots--) { if (unlikely(!txp->size)) { + unsigned long flags; + + spin_lock_irqsave(&queue->response_lock, flags); make_tx_response(queue, txp, 0, XEN_NETIF_RSP_OKAY); + push_tx_responses(queue); + spin_unlock_irqrestore(&queue->response_lock, flags); ++txp; continue; } @@ -486,8 +496,14 @@ for (shinfo->nr_frags = 0; shinfo->nr_frags < nr_slots; ++txp) { if (unlikely(!txp->size)) { + unsigned long flags; + + spin_lock_irqsave(&queue->response_lock, flags); make_tx_response(queue, txp, 0, XEN_NETIF_RSP_OKAY); + push_tx_responses(queue); + spin_unlock_irqrestore(&queue->response_lock, + flags); continue; } @@ -979,6 +995,7 @@ (ret == 0) ? XEN_NETIF_RSP_OKAY : XEN_NETIF_RSP_ERROR); + push_tx_responses(queue); continue; } @@ -990,6 +1007,7 @@ make_tx_response(queue, &txreq, extra_count, XEN_NETIF_RSP_OKAY); + push_tx_responses(queue); continue; } @@ -1415,35 +1433,8 @@ return work_done; } -static void _make_tx_response(struct xenvif_queue *queue, - const struct xen_netif_tx_request *txp, - unsigned int extra_count, - s8 status) -{ - RING_IDX i = queue->tx.rsp_prod_pvt; - struct xen_netif_tx_response *resp; - - resp = RING_GET_RESPONSE(&queue->tx, i); - resp->id = txp->id; - resp->status = status; - - while (extra_count-- != 0) - RING_GET_RESPONSE(&queue->tx, ++i)->status = XEN_NETIF_RSP_NULL; - - queue->tx.rsp_prod_pvt = ++i; -} - -static void push_tx_responses(struct xenvif_queue *queue) -{ - int notify; - - RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&queue->tx, notify); - if (notify) - notify_remote_via_irq(queue->tx_irq); -} - static void xenvif_idx_release(struct xenvif_queue *queue, u16 pending_idx, - s8 status) + u8 status) { struct pending_tx_info *pending_tx_info; pending_ring_idx_t index; @@ -1453,8 +1444,8 @@ spin_lock_irqsave(&queue->response_lock, flags); - _make_tx_response(queue, &pending_tx_info->req, - pending_tx_info->extra_count, status); + make_tx_response(queue, &pending_tx_info->req, + pending_tx_info->extra_count, status); /* Release the pending index before pusing the Tx response so * its available before a new Tx request is pushed by the @@ -1468,19 +1459,32 @@ spin_unlock_irqrestore(&queue->response_lock, flags); } + static void make_tx_response(struct xenvif_queue *queue, - const struct xen_netif_tx_request *txp, + struct xen_netif_tx_request *txp, unsigned int extra_count, - s8 status) + s8 st) { - unsigned long flags; + RING_IDX i = queue->tx.rsp_prod_pvt; + struct xen_netif_tx_response *resp; - spin_lock_irqsave(&queue->response_lock, flags); + resp = RING_GET_RESPONSE(&queue->tx, i); + resp->id = txp->id; + resp->status = st; - _make_tx_response(queue, txp, extra_count, status); - push_tx_responses(queue); + while (extra_count-- != 0) + RING_GET_RESPONSE(&queue->tx, ++i)->status = XEN_NETIF_RSP_NULL; - spin_unlock_irqrestore(&queue->response_lock, flags); + queue->tx.rsp_prod_pvt = ++i; +} + +static void push_tx_responses(struct xenvif_queue *queue) +{ + int notify; + + RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&queue->tx, notify); + if (notify) + notify_remote_via_irq(queue->tx_irq); } static void xenvif_idx_unmap(struct xenvif_queue *queue, u16 pending_idx) diff -u linux-6.5.0/drivers/of/property.c linux-6.5.0/drivers/of/property.c --- linux-6.5.0/drivers/of/property.c +++ linux-6.5.0/drivers/of/property.c @@ -762,9 +762,7 @@ /* Walk 3 levels up only if there is 'ports' node. */ for (depth = 3; depth && node; depth--) { node = of_get_next_parent(node); - if (depth == 2 && !of_node_name_eq(node, "ports") && - !of_node_name_eq(node, "in-ports") && - !of_node_name_eq(node, "out-ports")) + if (depth == 2 && !of_node_name_eq(node, "ports")) break; } return node; @@ -1064,6 +1062,36 @@ return of_device_get_match_data(dev); } +static struct device_node *of_get_compat_node(struct device_node *np) +{ + of_node_get(np); + + while (np) { + if (!of_device_is_available(np)) { + of_node_put(np); + np = NULL; + } + + if (of_property_present(np, "compatible")) + break; + + np = of_get_next_parent(np); + } + + return np; +} + +static struct device_node *of_get_compat_node_parent(struct device_node *np) +{ + struct device_node *parent, *node; + + parent = of_get_parent(np); + node = of_get_compat_node(parent); + of_node_put(parent); + + return node; +} + static void of_link_to_phandle(struct device_node *con_np, struct device_node *sup_np) { @@ -1193,10 +1221,10 @@ * @parse_prop.prop_name: Name of property holding a phandle value * @parse_prop.index: For properties holding a list of phandles, this is the * index into the list - * @get_con_dev: If the consumer node containing the property is never converted - * to a struct device, implement this ops so fw_devlink can use it - * to find the true consumer. * @optional: Describes whether a supplier is mandatory or not + * @node_not_dev: The consumer node containing the property is never converted + * to a struct device. Instead, parse ancestor nodes for the + * compatible property to find a node corresponding to a device. * * Returns: * parse_prop() return values are @@ -1207,15 +1235,15 @@ struct supplier_bindings { struct device_node *(*parse_prop)(struct device_node *np, const char *prop_name, int index); - struct device_node *(*get_con_dev)(struct device_node *np); bool optional; + bool node_not_dev; }; DEFINE_SIMPLE_PROP(clocks, "clocks", "#clock-cells") DEFINE_SIMPLE_PROP(interconnects, "interconnects", "#interconnect-cells") DEFINE_SIMPLE_PROP(iommus, "iommus", "#iommu-cells") DEFINE_SIMPLE_PROP(mboxes, "mboxes", "#mbox-cells") -DEFINE_SIMPLE_PROP(io_channels, "io-channels", "#io-channel-cells") +DEFINE_SIMPLE_PROP(io_channels, "io-channel", "#io-channel-cells") DEFINE_SIMPLE_PROP(interrupt_parent, "interrupt-parent", NULL) DEFINE_SIMPLE_PROP(dmas, "dmas", "#dma-cells") DEFINE_SIMPLE_PROP(power_domains, "power-domains", "#power-domain-cells") @@ -1233,6 +1261,7 @@ DEFINE_SIMPLE_PROP(pinctrl6, "pinctrl-6", NULL) DEFINE_SIMPLE_PROP(pinctrl7, "pinctrl-7", NULL) DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL) +DEFINE_SIMPLE_PROP(remote_endpoint, "remote-endpoint", NULL) DEFINE_SIMPLE_PROP(pwms, "pwms", "#pwm-cells") DEFINE_SIMPLE_PROP(resets, "resets", "#reset-cells") DEFINE_SIMPLE_PROP(leds, "leds", NULL) @@ -1297,17 +1326,6 @@ return of_irq_parse_one(np, index, &sup_args) ? NULL : sup_args.np; } -static struct device_node *parse_remote_endpoint(struct device_node *np, - const char *prop_name, - int index) -{ - /* Return NULL for index > 0 to signify end of remote-endpoints. */ - if (!index || strcmp(prop_name, "remote-endpoint")) - return NULL; - - return of_graph_get_remote_port_parent(np); -} - static const struct supplier_bindings of_supplier_bindings[] = { { .parse_prop = parse_clocks, }, { .parse_prop = parse_interconnects, }, @@ -1332,10 +1350,7 @@ { .parse_prop = parse_pinctrl6, }, { .parse_prop = parse_pinctrl7, }, { .parse_prop = parse_pinctrl8, }, - { - .parse_prop = parse_remote_endpoint, - .get_con_dev = of_graph_get_port_parent, - }, + { .parse_prop = parse_remote_endpoint, .node_not_dev = true, }, { .parse_prop = parse_pwms, }, { .parse_prop = parse_resets, }, { .parse_prop = parse_leds, }, @@ -1385,8 +1400,8 @@ while ((phandle = s->parse_prop(con_np, prop_name, i))) { struct device_node *con_dev_np; - con_dev_np = s->get_con_dev - ? s->get_con_dev(con_np) + con_dev_np = s->node_not_dev + ? of_get_compat_node_parent(con_np) : of_node_get(con_np); matched = true; i++; diff -u linux-6.5.0/drivers/of/unittest.c linux-6.5.0/drivers/of/unittest.c --- linux-6.5.0/drivers/of/unittest.c +++ linux-6.5.0/drivers/of/unittest.c @@ -49,12 +49,6 @@ failed; \ }) -#ifdef CONFIG_OF_KOBJ -#define OF_KREF_READ(NODE) kref_read(&(NODE)->kobj.kref) -#else -#define OF_KREF_READ(NODE) 1 -#endif - /* * Expected message may have a message level other than KERN_INFO. * Print the expected message only if the current loglevel will allow @@ -575,7 +569,7 @@ pr_err("missing testcase data\n"); return; } - prefs[i] = OF_KREF_READ(p[i]); + prefs[i] = kref_read(&p[i]->kobj.kref); } rc = of_count_phandle_with_args(np, "phandle-list", "#phandle-cells"); @@ -698,9 +692,9 @@ unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); for (i = 0; i < ARRAY_SIZE(p); ++i) { - unittest(prefs[i] == OF_KREF_READ(p[i]), + unittest(prefs[i] == kref_read(&p[i]->kobj.kref), "provider%d: expected:%d got:%d\n", - i, prefs[i], OF_KREF_READ(p[i])); + i, prefs[i], kref_read(&p[i]->kobj.kref)); of_node_put(p[i]); } } reverted: --- linux-6.5.0/drivers/perf/cxl_pmu.c +++ linux-6.5.0.orig/drivers/perf/cxl_pmu.c @@ -419,7 +419,7 @@ CXL_PMU_EVENT_CXL_ATTR(s2m_ndr_cmp, CXL_PMU_GID_S2M_NDR, BIT(0)), CXL_PMU_EVENT_CXL_ATTR(s2m_ndr_cmps, CXL_PMU_GID_S2M_NDR, BIT(1)), CXL_PMU_EVENT_CXL_ATTR(s2m_ndr_cmpe, CXL_PMU_GID_S2M_NDR, BIT(2)), + CXL_PMU_EVENT_CXL_ATTR(s2m_ndr_biconflictack, CXL_PMU_GID_S2M_NDR, BIT(3)), - CXL_PMU_EVENT_CXL_ATTR(s2m_ndr_biconflictack, CXL_PMU_GID_S2M_NDR, BIT(4)), /* CXL rev 3.0 Table 3-46 S2M DRS opcodes */ CXL_PMU_EVENT_CXL_ATTR(s2m_drs_memdata, CXL_PMU_GID_S2M_DRS, BIT(0)), CXL_PMU_EVENT_CXL_ATTR(s2m_drs_memdatanxm, CXL_PMU_GID_S2M_DRS, BIT(1)), reverted: --- linux-6.5.0/drivers/phy/renesas/phy-rcar-gen3-usb2.c +++ linux-6.5.0.orig/drivers/phy/renesas/phy-rcar-gen3-usb2.c @@ -675,6 +675,8 @@ channel->irq = platform_get_irq_optional(pdev, 0); channel->dr_mode = rcar_gen3_get_dr_mode(dev->of_node); if (channel->dr_mode != USB_DR_MODE_UNKNOWN) { + int ret; + channel->is_otg_channel = true; channel->uses_otg_pins = !of_property_read_bool(dev->of_node, "renesas,no-otg-pins"); @@ -738,6 +740,8 @@ ret = PTR_ERR(provider); goto error; } else if (channel->is_otg_channel) { + int ret; + ret = device_create_file(dev, &dev_attr_role); if (ret < 0) goto error; reverted: --- linux-6.5.0/drivers/phy/ti/phy-omap-usb2.c +++ linux-6.5.0.orig/drivers/phy/ti/phy-omap-usb2.c @@ -116,7 +116,7 @@ { struct omap_usb *phy = phy_to_omapusb(otg->usb_phy); + if (!phy->comparator) - if (!phy->comparator || !phy->comparator->set_vbus) return -ENODEV; return phy->comparator->set_vbus(phy->comparator, enabled); @@ -126,7 +126,7 @@ { struct omap_usb *phy = phy_to_omapusb(otg->usb_phy); + if (!phy->comparator) - if (!phy->comparator || !phy->comparator->start_srp) return -ENODEV; return phy->comparator->start_srp(phy->comparator); diff -u linux-6.5.0/drivers/platform/x86/asus-wmi.c linux-6.5.0/drivers/platform/x86/asus-wmi.c --- linux-6.5.0/drivers/platform/x86/asus-wmi.c +++ linux-6.5.0/drivers/platform/x86/asus-wmi.c @@ -447,17 +447,7 @@ static int asus_wmi_get_devstate(struct asus_wmi *asus, u32 dev_id, u32 *retval) { - int err; - - err = asus_wmi_evaluate_method(asus->dsts_id, dev_id, 0, retval); - - if (err) - return err; - - if (*retval == ~0) - return -ENODEV; - - return 0; + return asus_wmi_evaluate_method(asus->dsts_id, dev_id, 0, retval); } static int asus_wmi_set_devstate(u32 dev_id, u32 ctrl_param, reverted: --- linux-6.5.0/drivers/s390/net/qeth_l3_main.c +++ linux-6.5.0.orig/drivers/s390/net/qeth_l3_main.c @@ -255,10 +255,9 @@ if (!recover) { hash_del(&addr->hnode); kfree(addr); + continue; - } else { - /* prepare for recovery */ - addr->disp_flag = QETH_DISP_ADDR_ADD; } + addr->disp_flag = QETH_DISP_ADDR_ADD; } mutex_unlock(&card->ip_lock); @@ -279,11 +278,9 @@ if (addr->disp_flag == QETH_DISP_ADDR_ADD) { rc = qeth_l3_register_addr_entry(card, addr); + if (!rc) { - if (!rc || rc == -EADDRINUSE || rc == -ENETDOWN) { - /* keep it in the records */ addr->disp_flag = QETH_DISP_ADDR_DO_NOTHING; } else { - /* bad address */ hash_del(&addr->hnode); kfree(addr); } diff -u linux-6.5.0/drivers/scsi/scsi_error.c linux-6.5.0/drivers/scsi/scsi_error.c --- linux-6.5.0/drivers/scsi/scsi_error.c +++ linux-6.5.0/drivers/scsi/scsi_error.c @@ -282,12 +282,11 @@ { struct scsi_cmnd *scmd = container_of(head, typeof(*scmd), rcu); struct Scsi_Host *shost = scmd->device->host; - unsigned int busy = scsi_host_busy(shost); unsigned long flags; spin_lock_irqsave(shost->host_lock, flags); shost->host_failed++; - scsi_eh_wakeup(shost, busy); + scsi_eh_wakeup(shost, scsi_host_busy(shost)); spin_unlock_irqrestore(shost->host_lock, flags); } diff -u linux-6.5.0/drivers/scsi/scsi_lib.c linux-6.5.0/drivers/scsi/scsi_lib.c --- linux-6.5.0/drivers/scsi/scsi_lib.c +++ linux-6.5.0/drivers/scsi/scsi_lib.c @@ -278,11 +278,9 @@ rcu_read_lock(); __clear_bit(SCMD_STATE_INFLIGHT, &cmd->state); if (unlikely(scsi_host_in_recovery(shost))) { - unsigned int busy = scsi_host_busy(shost); - spin_lock_irqsave(shost->host_lock, flags); if (shost->host_failed || shost->host_eh_scheduled) - scsi_eh_wakeup(shost, busy); + scsi_eh_wakeup(shost, scsi_host_busy(shost)); spin_unlock_irqrestore(shost->host_lock, flags); } rcu_read_unlock(); diff -u linux-6.5.0/drivers/scsi/storvsc_drv.c linux-6.5.0/drivers/scsi/storvsc_drv.c --- linux-6.5.0/drivers/scsi/storvsc_drv.c +++ linux-6.5.0/drivers/scsi/storvsc_drv.c @@ -327,7 +327,6 @@ */ static int storvsc_ringbuffer_size = (128 * 1024); -static int aligned_ringbuffer_size; static u32 max_outstanding_req_per_channel; static int storvsc_change_queue_depth(struct scsi_device *sdev, int queue_depth); @@ -685,8 +684,8 @@ new_sc->next_request_id_callback = storvsc_next_request_id; ret = vmbus_open(new_sc, - aligned_ringbuffer_size, - aligned_ringbuffer_size, + storvsc_ringbuffer_size, + storvsc_ringbuffer_size, (void *)&props, sizeof(struct vmstorage_channel_properties), storvsc_on_channel_callback, new_sc); @@ -1967,7 +1966,7 @@ dma_set_min_align_mask(&device->device, HV_HYP_PAGE_SIZE - 1); stor_device->port_number = host->host_no; - ret = storvsc_connect_to_vsp(device, aligned_ringbuffer_size, is_fc); + ret = storvsc_connect_to_vsp(device, storvsc_ringbuffer_size, is_fc); if (ret) goto err_out1; @@ -2158,7 +2157,7 @@ { int ret; - ret = storvsc_connect_to_vsp(hv_dev, aligned_ringbuffer_size, + ret = storvsc_connect_to_vsp(hv_dev, storvsc_ringbuffer_size, hv_dev_is_fc(hv_dev)); return ret; } @@ -2192,9 +2191,8 @@ * the ring buffer indices) by the max request size (which is * vmbus_channel_packet_multipage_buffer + struct vstor_packet + u64) */ - aligned_ringbuffer_size = VMBUS_RING_SIZE(storvsc_ringbuffer_size); max_outstanding_req_per_channel = - ((aligned_ringbuffer_size - PAGE_SIZE) / + ((storvsc_ringbuffer_size - PAGE_SIZE) / ALIGN(MAX_MULTIPAGE_BUFFER_PACKET + sizeof(struct vstor_packet) + sizeof(u64), sizeof(u64))); reverted: --- linux-6.5.0/drivers/soc/mediatek/mtk-pm-domains.c +++ linux-6.5.0.orig/drivers/soc/mediatek/mtk-pm-domains.c @@ -508,11 +508,6 @@ goto err_put_node; } - /* recursive call to add all subdomains */ - ret = scpsys_add_subdomain(scpsys, child); - if (ret) - goto err_put_node; - ret = pm_genpd_add_subdomain(parent_pd, child_pd); if (ret) { dev_err(scpsys->dev, "failed to add %s subdomain to parent %s\n", @@ -522,6 +517,11 @@ dev_dbg(scpsys->dev, "%s add subdomain: %s\n", parent_pd->name, child_pd->name); } + + /* recursive call to add all subdomains */ + ret = scpsys_add_subdomain(scpsys, child); + if (ret) + goto err_put_node; } return 0; @@ -535,6 +535,9 @@ { int ret; + if (scpsys_domain_is_on(pd)) + scpsys_power_off(&pd->genpd); + /* * We're in the error cleanup already, so we only complain, * but won't emit another error on top of the original one. @@ -544,8 +547,6 @@ dev_err(pd->scpsys->dev, "failed to remove domain '%s' : %d - state may be inconsistent\n", pd->genpd.name, ret); - if (scpsys_domain_is_on(pd)) - scpsys_power_off(&pd->genpd); clk_bulk_put(pd->num_clks, pd->clks); clk_bulk_put(pd->num_subsys_clks, pd->subsys_clks); reverted: --- linux-6.5.0/drivers/soc/renesas/r8a77980-sysc.c +++ linux-6.5.0.orig/drivers/soc/renesas/r8a77980-sysc.c @@ -25,8 +25,7 @@ PD_CPU_NOCR }, { "ca53-cpu3", 0x200, 3, R8A77980_PD_CA53_CPU3, R8A77980_PD_CA53_SCU, PD_CPU_NOCR }, + { "cr7", 0x240, 0, R8A77980_PD_CR7, R8A77980_PD_ALWAYS_ON }, - { "cr7", 0x240, 0, R8A77980_PD_CR7, R8A77980_PD_ALWAYS_ON, - PD_CPU_NOCR }, { "a3ir", 0x180, 0, R8A77980_PD_A3IR, R8A77980_PD_ALWAYS_ON }, { "a2ir0", 0x400, 0, R8A77980_PD_A2IR0, R8A77980_PD_A3IR }, { "a2ir1", 0x400, 1, R8A77980_PD_A2IR1, R8A77980_PD_A3IR }, reverted: --- linux-6.5.0/drivers/spi/spi-ppc4xx.c +++ linux-6.5.0.orig/drivers/spi/spi-ppc4xx.c @@ -166,8 +166,10 @@ int scr; u8 cdm = 0; u32 speed; + u8 bits_per_word; /* Start with the generic configuration for this device. */ + bits_per_word = spi->bits_per_word; speed = spi->max_speed_hz; /* @@ -175,6 +177,9 @@ * the transfer to overwrite the generic configuration with zeros. */ if (t) { + if (t->bits_per_word) + bits_per_word = t->bits_per_word; + if (t->speed_hz) speed = min(t->speed_hz, spi->max_speed_hz); } reverted: --- linux-6.5.0/drivers/staging/iio/impedance-analyzer/ad5933.c +++ linux-6.5.0.orig/drivers/staging/iio/impedance-analyzer/ad5933.c @@ -608,7 +608,7 @@ struct ad5933_state, work.work); struct iio_dev *indio_dev = i2c_get_clientdata(st->client); __be16 buf[2]; + int val[2]; - u16 val[2]; unsigned char status; int ret; reverted: --- linux-6.5.0/drivers/thunderbolt/tb_regs.h +++ linux-6.5.0.orig/drivers/thunderbolt/tb_regs.h @@ -203,7 +203,7 @@ #define ROUTER_CS_5_WOP BIT(1) #define ROUTER_CS_5_WOU BIT(2) #define ROUTER_CS_5_WOD BIT(3) +#define ROUTER_CS_5_C3S BIT(23) -#define ROUTER_CS_5_CNS BIT(23) #define ROUTER_CS_5_PTO BIT(24) #define ROUTER_CS_5_UTO BIT(25) #define ROUTER_CS_5_HCO BIT(26) reverted: --- linux-6.5.0/drivers/thunderbolt/usb4.c +++ linux-6.5.0.orig/drivers/thunderbolt/usb4.c @@ -290,7 +290,7 @@ } /* TBT3 supported by the CM */ + val |= ROUTER_CS_5_C3S; - val &= ~ROUTER_CS_5_CNS; return tb_sw_write(sw, &val, TB_CFG_SWITCH, ROUTER_CS_5, 1); } reverted: --- linux-6.5.0/drivers/tty/serial/max310x.c +++ linux-6.5.0.orig/drivers/tty/serial/max310x.c @@ -237,14 +237,6 @@ #define MAX310x_REV_MASK (0xf8) #define MAX310X_WRITE_BIT 0x80 -/* Port startup definitions */ -#define MAX310X_PORT_STARTUP_WAIT_RETRIES 20 /* Number of retries */ -#define MAX310X_PORT_STARTUP_WAIT_DELAY_MS 10 /* Delay between retries */ - -/* Crystal-related definitions */ -#define MAX310X_XTAL_WAIT_RETRIES 20 /* Number of retries */ -#define MAX310X_XTAL_WAIT_DELAY_MS 10 /* Delay between retries */ - /* MAX3107 specific */ #define MAX3107_REV_ID (0xa0) @@ -591,7 +583,7 @@ return 1; } +static u32 max310x_set_ref_clk(struct device *dev, struct max310x_port *s, -static s32 max310x_set_ref_clk(struct device *dev, struct max310x_port *s, unsigned long freq, bool xtal) { unsigned int div, clksrc, pllcfg = 0; @@ -649,20 +641,12 @@ /* Wait for crystal */ if (xtal) { + unsigned int val; + msleep(10); + regmap_read(s->regmap, MAX310X_STS_IRQSTS_REG, &val); + if (!(val & MAX310X_STS_CLKREADY_BIT)) { + dev_warn(dev, "clock is not stable yet\n"); + } - bool stable = false; - unsigned int try = 0, val = 0; - - do { - msleep(MAX310X_XTAL_WAIT_DELAY_MS); - regmap_read(s->regmap, MAX310X_STS_IRQSTS_REG, &val); - - if (val & MAX310X_STS_CLKREADY_BIT) - stable = true; - } while (!stable && (++try < MAX310X_XTAL_WAIT_RETRIES)); - - if (!stable) - return dev_err_probe(dev, -EAGAIN, - "clock is not stable\n"); } return bestfreq; @@ -1286,7 +1270,7 @@ { int i, ret, fmin, fmax, freq; struct max310x_port *s; + u32 uartclk = 0; - s32 uartclk = 0; bool xtal; for (i = 0; i < devtype->nr; i++) @@ -1349,9 +1333,6 @@ goto out_clk; for (i = 0; i < devtype->nr; i++) { - bool started = false; - unsigned int try = 0, val = 0; - /* Reset port */ regmap_write(regmaps[i], MAX310X_MODE2_REG, MAX310X_MODE2_RST_BIT); @@ -1360,27 +1341,13 @@ /* Wait for port startup */ do { + regmap_read(regmaps[i], MAX310X_BRGDIVLSB_REG, &ret); + } while (ret != 0x01); - msleep(MAX310X_PORT_STARTUP_WAIT_DELAY_MS); - regmap_read(regmaps[i], MAX310X_BRGDIVLSB_REG, &val); - - if (val == 0x01) - started = true; - } while (!started && (++try < MAX310X_PORT_STARTUP_WAIT_RETRIES)); - - if (!started) { - ret = dev_err_probe(dev, -EAGAIN, "port reset failed\n"); - goto out_uart; - } regmap_write(regmaps[i], MAX310X_MODE1_REG, devtype->mode1); } uartclk = max310x_set_ref_clk(dev, s, freq, xtal); - if (uartclk < 0) { - ret = uartclk; - goto out_uart; - } - dev_dbg(dev, "Reference clock set to %i Hz\n", uartclk); for (i = 0; i < devtype->nr; i++) { reverted: --- linux-6.5.0/drivers/tty/serial/mxs-auart.c +++ linux-6.5.0.orig/drivers/tty/serial/mxs-auart.c @@ -605,16 +605,13 @@ return; } + pending = uart_port_tx(&s->port, ch, - pending = uart_port_tx_flags(&s->port, ch, UART_TX_NOSTOP, !(mxs_read(s, REG_STAT) & AUART_STAT_TXFF), mxs_write(ch, s, REG_DATA)); if (pending) mxs_set(AUART_INTR_TXIEN, s, REG_INTR); else mxs_clr(AUART_INTR_TXIEN, s, REG_INTR); - - if (uart_tx_stopped(&s->port)) - mxs_auart_stop_tx(&s->port); } static void mxs_auart_rx_char(struct mxs_auart_port *s) diff -u linux-6.5.0/drivers/usb/cdns3/cdns3-gadget.c linux-6.5.0/drivers/usb/cdns3/cdns3-gadget.c --- linux-6.5.0/drivers/usb/cdns3/cdns3-gadget.c +++ linux-6.5.0/drivers/usb/cdns3/cdns3-gadget.c @@ -827,11 +827,7 @@ return; } - /* - * zlp request is appended by driver, needn't call usb_gadget_giveback_request() to notify - * gadget composite driver. - */ - if (request->complete && request->buf != priv_dev->zlp_buf) { + if (request->complete) { spin_unlock(&priv_dev->lock); usb_gadget_giveback_request(&priv_ep->endpoint, request); diff -u linux-6.5.0/drivers/usb/chipidea/ci.h linux-6.5.0/drivers/usb/chipidea/ci.h --- linux-6.5.0/drivers/usb/chipidea/ci.h +++ linux-6.5.0/drivers/usb/chipidea/ci.h @@ -176,7 +176,6 @@ * @enabled_otg_timer_bits: bits of enabled otg timers * @next_otg_timer: next nearest enabled timer to be expired * @work: work for role changing - * @power_lost_work: work for power lost handling * @wq: workqueue thread * @qh_pool: allocation pool for queue heads * @td_pool: allocation pool for transfer descriptors @@ -227,7 +226,6 @@ enum otg_fsm_timer next_otg_timer; struct usb_role_switch *role_switch; struct work_struct work; - struct work_struct power_lost_work; struct workqueue_struct *wq; struct dma_pool *qh_pool; diff -u linux-6.5.0/drivers/usb/chipidea/core.c linux-6.5.0/drivers/usb/chipidea/core.c --- linux-6.5.0/drivers/usb/chipidea/core.c +++ linux-6.5.0/drivers/usb/chipidea/core.c @@ -856,27 +856,6 @@ return 0; } -static void ci_power_lost_work(struct work_struct *work) -{ - struct ci_hdrc *ci = container_of(work, struct ci_hdrc, power_lost_work); - enum ci_role role; - - disable_irq_nosync(ci->irq); - pm_runtime_get_sync(ci->dev); - if (!ci_otg_is_fsm_mode(ci)) { - role = ci_get_role(ci); - - if (ci->role != role) { - ci_handle_id_switch(ci); - } else if (role == CI_ROLE_GADGET) { - if (ci->is_otg && hw_read_otgsc(ci, OTGSC_BSV)) - usb_gadget_vbus_connect(&ci->gadget); - } - } - pm_runtime_put_sync(ci->dev); - enable_irq(ci->irq); -} - static DEFINE_IDA(ci_ida); struct platform_device *ci_hdrc_add_device(struct device *dev, @@ -1067,8 +1046,6 @@ spin_lock_init(&ci->lock); mutex_init(&ci->mutex); - INIT_WORK(&ci->power_lost_work, ci_power_lost_work); - ci->dev = dev; ci->platdata = dev_get_platdata(dev); ci->imx28_write_fix = !!(ci->platdata->flags & @@ -1420,6 +1397,25 @@ return 0; } +static void ci_handle_power_lost(struct ci_hdrc *ci) +{ + enum ci_role role; + + disable_irq_nosync(ci->irq); + if (!ci_otg_is_fsm_mode(ci)) { + role = ci_get_role(ci); + + if (ci->role != role) { + ci_handle_id_switch(ci); + } else if (role == CI_ROLE_GADGET) { + if (ci->is_otg && hw_read_otgsc(ci, OTGSC_BSV)) + usb_gadget_vbus_connect(&ci->gadget); + } + } + + enable_irq(ci->irq); +} + static int ci_resume(struct device *dev) { struct ci_hdrc *ci = dev_get_drvdata(dev); @@ -1451,7 +1447,7 @@ ci_role(ci)->resume(ci, power_lost); if (power_lost) - queue_work(system_freezable_wq, &ci->power_lost_work); + ci_handle_power_lost(ci); if (ci->supports_runtime_pm) { pm_runtime_disable(dev); reverted: --- linux-6.5.0/drivers/usb/common/ulpi.c +++ linux-6.5.0.orig/drivers/usb/common/ulpi.c @@ -301,7 +301,7 @@ return ret; } + root = debugfs_create_dir(dev_name(dev), ulpi_root); - root = debugfs_create_dir(dev_name(&ulpi->dev), ulpi_root); debugfs_create_file("regs", 0444, root, ulpi, &ulpi_regs_fops); dev_dbg(&ulpi->dev, "registered ULPI PHY: vendor %04x, product %04x\n", diff -u linux-6.5.0/drivers/usb/core/hub.c linux-6.5.0/drivers/usb/core/hub.c --- linux-6.5.0/drivers/usb/core/hub.c +++ linux-6.5.0/drivers/usb/core/hub.c @@ -2047,19 +2047,9 @@ if (udev->parent) { hub = usb_hub_to_struct_hub(udev->parent); - - /* - * The Link Layer Validation System Driver (lvstest) - * has a test step to unbind the hub before running the - * rest of the procedure. This triggers hub_disconnect - * which will set the hub's maxchild to 0, further - * resulting in usb_hub_to_struct_hub returning NULL. - */ - if (hub) { - port_dev = hub->ports[udev->portnum - 1]; - WRITE_ONCE(port_dev->state, udev->state); - sysfs_notify_dirent(port_dev->state_kn); - } + port_dev = hub->ports[udev->portnum - 1]; + WRITE_ONCE(port_dev->state, udev->state); + sysfs_notify_dirent(port_dev->state_kn); } } @@ -2414,25 +2404,17 @@ } } else if (desc->bLength == sizeof (struct usb_otg_descriptor)) { - /* - * We are operating on a legacy OTP device - * These should be told that they are operating - * on the wrong port if we have another port that does - * support HNP - */ - if (bus->otg_port != 0) { - /* Set a_alt_hnp_support for legacy otg device */ - err = usb_control_msg(udev, - usb_sndctrlpipe(udev, 0), - USB_REQ_SET_FEATURE, 0, - USB_DEVICE_A_ALT_HNP_SUPPORT, - 0, NULL, 0, - USB_CTRL_SET_TIMEOUT); - if (err < 0) - dev_err(&udev->dev, - "set a_alt_hnp_support failed: %d\n", - err); - } + /* Set a_alt_hnp_support for legacy otg device */ + err = usb_control_msg(udev, + usb_sndctrlpipe(udev, 0), + USB_REQ_SET_FEATURE, 0, + USB_DEVICE_A_ALT_HNP_SUPPORT, + 0, NULL, 0, + USB_CTRL_SET_TIMEOUT); + if (err < 0) + dev_err(&udev->dev, + "set a_alt_hnp_support failed: %d\n", + err); } } #endif reverted: --- linux-6.5.0/drivers/usb/core/port.c +++ linux-6.5.0.orig/drivers/usb/core/port.c @@ -418,10 +418,8 @@ { struct usb_port *port_dev = to_usb_port(dev); + if (port_dev->child) - if (port_dev->child) { usb_disable_usb2_hardware_lpm(port_dev->child); - usb_unlocked_disable_lpm(port_dev->child); - } } static const struct dev_pm_ops usb_port_pm_ops = { reverted: --- linux-6.5.0/drivers/usb/dwc3/dwc3-pci.c +++ linux-6.5.0.orig/drivers/usb/dwc3/dwc3-pci.c @@ -51,8 +51,6 @@ #define PCI_DEVICE_ID_INTEL_MTLP 0x7ec1 #define PCI_DEVICE_ID_INTEL_MTLS 0x7f6f #define PCI_DEVICE_ID_INTEL_MTL 0x7e7e -#define PCI_DEVICE_ID_INTEL_ARLH 0x7ec1 -#define PCI_DEVICE_ID_INTEL_ARLH_PCH 0x777e #define PCI_DEVICE_ID_INTEL_TGL 0x9a15 #define PCI_DEVICE_ID_AMD_MR 0x163a @@ -423,8 +421,6 @@ { PCI_DEVICE_DATA(INTEL, MTLP, &dwc3_pci_intel_swnode) }, { PCI_DEVICE_DATA(INTEL, MTL, &dwc3_pci_intel_swnode) }, { PCI_DEVICE_DATA(INTEL, MTLS, &dwc3_pci_intel_swnode) }, - { PCI_DEVICE_DATA(INTEL, ARLH, &dwc3_pci_intel_swnode) }, - { PCI_DEVICE_DATA(INTEL, ARLH_PCH, &dwc3_pci_intel_swnode) }, { PCI_DEVICE_DATA(INTEL, TGL, &dwc3_pci_intel_swnode) }, { PCI_DEVICE_DATA(AMD, NL_USB, &dwc3_pci_amd_swnode) }, diff -u linux-6.5.0/drivers/usb/dwc3/gadget.c linux-6.5.0/drivers/usb/dwc3/gadget.c --- linux-6.5.0/drivers/usb/dwc3/gadget.c +++ linux-6.5.0/drivers/usb/dwc3/gadget.c @@ -4703,13 +4703,15 @@ unsigned long flags; int ret; + if (!dwc->gadget_driver) + return 0; + ret = dwc3_gadget_soft_disconnect(dwc); if (ret) goto err; spin_lock_irqsave(&dwc->lock, flags); - if (dwc->gadget_driver) - dwc3_disconnect_gadget(dwc); + dwc3_disconnect_gadget(dwc); spin_unlock_irqrestore(&dwc->lock, flags); return 0; reverted: --- linux-6.5.0/drivers/usb/dwc3/host.c +++ linux-6.5.0.orig/drivers/usb/dwc3/host.c @@ -61,7 +61,7 @@ int dwc3_host_init(struct dwc3 *dwc) { + struct property_entry props[4]; - struct property_entry props[5]; struct platform_device *xhci; int ret, irq; int prop_idx = 0; @@ -89,8 +89,6 @@ memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props)); - props[prop_idx++] = PROPERTY_ENTRY_BOOL("xhci-sg-trb-cache-size-quirk"); - if (dwc->usb3_lpm_capable) props[prop_idx++] = PROPERTY_ENTRY_BOOL("usb3-lpm-capable"); diff -u linux-6.5.0/drivers/usb/gadget/function/f_mass_storage.c linux-6.5.0/drivers/usb/gadget/function/f_mass_storage.c --- linux-6.5.0/drivers/usb/gadget/function/f_mass_storage.c +++ linux-6.5.0/drivers/usb/gadget/function/f_mass_storage.c @@ -545,37 +545,21 @@ static bool start_in_transfer(struct fsg_common *common, struct fsg_buffhd *bh) { - int rc; - if (!fsg_is_set(common)) return false; bh->state = BUF_STATE_SENDING; - rc = start_transfer(common->fsg, common->fsg->bulk_in, bh->inreq); - if (rc) { + if (start_transfer(common->fsg, common->fsg->bulk_in, bh->inreq)) bh->state = BUF_STATE_EMPTY; - if (rc == -ESHUTDOWN) { - common->running = 0; - return false; - } - } return true; } static bool start_out_transfer(struct fsg_common *common, struct fsg_buffhd *bh) { - int rc; - if (!fsg_is_set(common)) return false; bh->state = BUF_STATE_RECEIVING; - rc = start_transfer(common->fsg, common->fsg->bulk_out, bh->outreq); - if (rc) { + if (start_transfer(common->fsg, common->fsg->bulk_out, bh->outreq)) bh->state = BUF_STATE_FULL; - if (rc == -ESHUTDOWN) { - common->running = 0; - return false; - } - } return true; } diff -u linux-6.5.0/drivers/usb/host/xhci-plat.c linux-6.5.0/drivers/usb/host/xhci-plat.c --- linux-6.5.0/drivers/usb/host/xhci-plat.c +++ linux-6.5.0/drivers/usb/host/xhci-plat.c @@ -250,9 +250,6 @@ if (device_property_read_bool(tmpdev, "quirk-broken-port-ped")) xhci->quirks |= XHCI_BROKEN_PORT_PED; - if (device_property_read_bool(tmpdev, "xhci-sg-trb-cache-size-quirk")) - xhci->quirks |= XHCI_SG_TRB_CACHE_SIZE_QUIRK; - device_property_read_u32(tmpdev, "imod-interval-ns", &xhci->imod_interval); } diff -u linux-6.5.0/drivers/usb/host/xhci-ring.c linux-6.5.0/drivers/usb/host/xhci-ring.c --- linux-6.5.0/drivers/usb/host/xhci-ring.c +++ linux-6.5.0/drivers/usb/host/xhci-ring.c @@ -2377,9 +2377,6 @@ /* handle completion code */ switch (trb_comp_code) { case COMP_SUCCESS: - /* Don't overwrite status if TD had an error, see xHCI 4.9.1 */ - if (td->error_mid_td) - break; if (remaining) { frame->status = short_framestatus; if (xhci->quirks & XHCI_TRUST_TX_LENGTH) @@ -2395,13 +2392,9 @@ case COMP_BANDWIDTH_OVERRUN_ERROR: frame->status = -ECOMM; break; - case COMP_BABBLE_DETECTED_ERROR: - sum_trbs_for_length = true; - fallthrough; case COMP_ISOCH_BUFFER_OVERRUN: + case COMP_BABBLE_DETECTED_ERROR: frame->status = -EOVERFLOW; - if (ep_trb != td->last_trb) - td->error_mid_td = true; break; case COMP_INCOMPATIBLE_DEVICE_ERROR: case COMP_STALL_ERROR: @@ -2409,9 +2402,8 @@ break; case COMP_USB_TRANSACTION_ERROR: frame->status = -EPROTO; - sum_trbs_for_length = true; if (ep_trb != td->last_trb) - td->error_mid_td = true; + return 0; break; case COMP_STOPPED: sum_trbs_for_length = true; @@ -2431,9 +2423,6 @@ break; } - if (td->urb_length_set) - goto finish_td; - if (sum_trbs_for_length) frame->actual_length = sum_trb_lengths(xhci, ep->ring, ep_trb) + ep_trb_len - remaining; @@ -2442,14 +2431,6 @@ td->urb->actual_length += frame->actual_length; -finish_td: - /* Don't give back TD yet if we encountered an error mid TD */ - if (td->error_mid_td && ep_trb != td->last_trb) { - xhci_dbg(xhci, "Error mid isoc TD, wait for final completion event\n"); - td->urb_length_set = true; - return 0; - } - return finish_td(xhci, ep, ep_ring, td, trb_comp_code); } @@ -2828,51 +2809,17 @@ } if (!ep_seg) { - - if (ep->skip && usb_endpoint_xfer_isoc(&td->urb->ep->desc)) { - skip_isoc_td(xhci, td, ep, status); - goto cleanup; - } - - /* - * Some hosts give a spurious success event after a short - * transfer. Ignore it. - */ - if ((xhci->quirks & XHCI_SPURIOUS_SUCCESS) && - ep_ring->last_td_was_short) { - ep_ring->last_td_was_short = false; - goto cleanup; - } - - /* - * xhci 4.10.2 states isoc endpoints should continue - * processing the next TD if there was an error mid TD. - * So host like NEC don't generate an event for the last - * isoc TRB even if the IOC flag is set. - * xhci 4.9.1 states that if there are errors in mult-TRB - * TDs xHC should generate an error for that TRB, and if xHC - * proceeds to the next TD it should genete an event for - * any TRB with IOC flag on the way. Other host follow this. - * So this event might be for the next TD. - */ - if (td->error_mid_td && - !list_is_last(&td->td_list, &ep_ring->td_list)) { - struct xhci_td *td_next = list_next_entry(td, td_list); - - ep_seg = trb_in_td(xhci, td_next->start_seg, td_next->first_trb, - td_next->last_trb, ep_trb_dma, false); - if (ep_seg) { - /* give back previous TD, start handling new */ - xhci_dbg(xhci, "Missing TD completion event after mid TD error\n"); - ep_ring->dequeue = td->last_trb; - ep_ring->deq_seg = td->last_trb_seg; - inc_deq(xhci, ep_ring); - xhci_td_cleanup(xhci, td, ep_ring, td->status); - td = td_next; + if (!ep->skip || + !usb_endpoint_xfer_isoc(&td->urb->ep->desc)) { + /* Some host controllers give a spurious + * successful event after a short transfer. + * Ignore it. + */ + if ((xhci->quirks & XHCI_SPURIOUS_SUCCESS) && + ep_ring->last_td_was_short) { + ep_ring->last_td_was_short = false; + goto cleanup; } - } - - if (!ep_seg) { /* HC is busted, give up! */ xhci_err(xhci, "ERROR Transfer event TRB DMA ptr not " @@ -2884,6 +2831,9 @@ ep_trb_dma, true); return -ESHUTDOWN; } + + skip_isoc_td(xhci, td, ep, status); + goto cleanup; } if (trb_comp_code == COMP_SHORT_PACKET) ep_ring->last_td_was_short = true; diff -u linux-6.5.0/drivers/usb/host/xhci.h linux-6.5.0/drivers/usb/host/xhci.h --- linux-6.5.0/drivers/usb/host/xhci.h +++ linux-6.5.0/drivers/usb/host/xhci.h @@ -1573,7 +1573,6 @@ struct xhci_segment *bounce_seg; /* actual_length of the URB has already been set */ bool urb_length_set; - bool error_mid_td; unsigned int num_trbs; }; reverted: --- linux-6.5.0/drivers/usb/serial/cp210x.c +++ linux-6.5.0.orig/drivers/usb/serial/cp210x.c @@ -146,7 +146,6 @@ { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */ { USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */ { USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */ - { USB_DEVICE(0x10C4, 0x87ED) }, /* IMST USB-Stick for Smart Meter */ { USB_DEVICE(0x10C4, 0x8856) }, /* CEL EM357 ZigBee USB Stick - LR */ { USB_DEVICE(0x10C4, 0x8857) }, /* CEL EM357 ZigBee USB Stick */ { USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */ diff -u linux-6.5.0/drivers/usb/serial/option.c linux-6.5.0/drivers/usb/serial/option.c --- linux-6.5.0/drivers/usb/serial/option.c +++ linux-6.5.0/drivers/usb/serial/option.c @@ -2269,7 +2269,6 @@ { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0111, 0xff) }, /* Fibocom FM160 (MBIM mode) */ { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a0, 0xff) }, /* Fibocom NL668-AM/NL652-EU (laptop MBIM) */ { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a2, 0xff) }, /* Fibocom FM101-GL (laptop MBIM) */ - { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a3, 0xff) }, /* Fibocom FM101-GL (laptop MBIM) */ { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a4, 0xff), /* Fibocom FM101-GL (laptop MBIM) */ .driver_info = RSVD(4) }, { USB_DEVICE_INTERFACE_CLASS(0x2df3, 0x9d03, 0xff) }, /* LongSung M5710 */ reverted: --- linux-6.5.0/drivers/usb/serial/qcserial.c +++ linux-6.5.0.orig/drivers/usb/serial/qcserial.c @@ -184,8 +184,6 @@ {DEVICE_SWI(0x413c, 0x81d0)}, /* Dell Wireless 5819 */ {DEVICE_SWI(0x413c, 0x81d1)}, /* Dell Wireless 5818 */ {DEVICE_SWI(0x413c, 0x81d2)}, /* Dell Wireless 5818 */ - {DEVICE_SWI(0x413c, 0x8217)}, /* Dell Wireless DW5826e */ - {DEVICE_SWI(0x413c, 0x8218)}, /* Dell Wireless DW5826e QDL */ /* Huawei devices */ {DEVICE_HWI(0x03f0, 0x581d)}, /* HP lt4112 LTE/HSPA+ Gobi 4G Modem (Huawei me906e) */ diff -u linux-6.5.0/drivers/usb/typec/ucsi/ucsi.c linux-6.5.0/drivers/usb/typec/ucsi/ucsi.c --- linux-6.5.0/drivers/usb/typec/ucsi/ucsi.c +++ linux-6.5.0/drivers/usb/typec/ucsi/ucsi.c @@ -935,9 +935,7 @@ clear_bit(EVENT_PENDING, &con->ucsi->flags); - mutex_lock(&ucsi->ppm_lock); ret = ucsi_acknowledge_connector_change(ucsi); - mutex_unlock(&ucsi->ppm_lock); if (ret) dev_err(ucsi->dev, "%s: ACK failed (%d)", __func__, ret); reverted: --- linux-6.5.0/drivers/usb/typec/ucsi/ucsi_acpi.c +++ linux-6.5.0.orig/drivers/usb/typec/ucsi/ucsi_acpi.c @@ -73,13 +73,9 @@ const void *val, size_t val_len) { struct ucsi_acpi *ua = ucsi_get_drvdata(ucsi); - bool ack = UCSI_COMMAND(*(u64 *)val) == UCSI_ACK_CC_CI; int ret; + set_bit(COMMAND_PENDING, &ua->flags); - if (ack) - set_bit(ACK_PENDING, &ua->flags); - else - set_bit(COMMAND_PENDING, &ua->flags); ret = ucsi_acpi_async_write(ucsi, offset, val, val_len); if (ret) @@ -89,10 +85,7 @@ ret = -ETIMEDOUT; out_clear_bit: + clear_bit(COMMAND_PENDING, &ua->flags); - if (ack) - clear_bit(ACK_PENDING, &ua->flags); - else - clear_bit(COMMAND_PENDING, &ua->flags); return ret; } @@ -149,10 +142,8 @@ if (UCSI_CCI_CONNECTOR(cci)) ucsi_connector_change(ua->ucsi, UCSI_CCI_CONNECTOR(cci)); + if (test_bit(COMMAND_PENDING, &ua->flags) && + cci & (UCSI_CCI_ACK_COMPLETE | UCSI_CCI_COMMAND_COMPLETE)) - if (cci & UCSI_CCI_ACK_COMPLETE && test_bit(ACK_PENDING, &ua->flags)) - complete(&ua->complete); - if (cci & UCSI_CCI_COMMAND_COMPLETE && - test_bit(COMMAND_PENDING, &ua->flags)) complete(&ua->complete); } diff -u linux-6.5.0/fs/afs/volume.c linux-6.5.0/fs/afs/volume.c --- linux-6.5.0/fs/afs/volume.c +++ linux-6.5.0/fs/afs/volume.c @@ -337,7 +337,7 @@ { struct afs_server_list *new, *old, *discard; struct afs_vldb_entry *vldb; - char idbuf[24]; + char idbuf[16]; int ret, idsz; _enter(""); @@ -345,7 +345,7 @@ /* We look up an ID by passing it as a decimal string in the * operation's name parameter. */ - idsz = snprintf(idbuf, sizeof(idbuf), "%llu", volume->vid); + idsz = sprintf(idbuf, "%llu", volume->vid); vldb = afs_vl_lookup_vldb(volume->cell, key, idbuf, idsz); if (IS_ERR(vldb)) { diff -u linux-6.5.0/fs/btrfs/block-group.c linux-6.5.0/fs/btrfs/block-group.c --- linux-6.5.0/fs/btrfs/block-group.c +++ linux-6.5.0/fs/btrfs/block-group.c @@ -1455,7 +1455,6 @@ */ void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info) { - LIST_HEAD(retry_list); struct btrfs_block_group *block_group; struct btrfs_space_info *space_info; struct btrfs_trans_handle *trans; @@ -1477,7 +1476,6 @@ spin_lock(&fs_info->unused_bgs_lock); while (!list_empty(&fs_info->unused_bgs)) { - u64 used; int trimming; block_group = list_first_entry(&fs_info->unused_bgs, @@ -1513,9 +1511,9 @@ goto next; } - spin_lock(&space_info->lock); spin_lock(&block_group->lock); - if (btrfs_is_block_group_used(block_group) || block_group->ro || + if (block_group->reserved || block_group->pinned || + block_group->used || block_group->ro || list_is_singular(&block_group->list)) { /* * We want to bail if we made new allocations or have @@ -1525,49 +1523,10 @@ */ trace_btrfs_skip_unused_block_group(block_group); spin_unlock(&block_group->lock); - spin_unlock(&space_info->lock); up_write(&space_info->groups_sem); goto next; } - - /* - * The block group may be unused but there may be space reserved - * accounting with the existence of that block group, that is, - * space_info->bytes_may_use was incremented by a task but no - * space was yet allocated from the block group by the task. - * That space may or may not be allocated, as we are generally - * pessimistic about space reservation for metadata as well as - * for data when using compression (as we reserve space based on - * the worst case, when data can't be compressed, and before - * actually attempting compression, before starting writeback). - * - * So check if the total space of the space_info minus the size - * of this block group is less than the used space of the - * space_info - if that's the case, then it means we have tasks - * that might be relying on the block group in order to allocate - * extents, and add back the block group to the unused list when - * we finish, so that we retry later in case no tasks ended up - * needing to allocate extents from the block group. - */ - used = btrfs_space_info_used(space_info, true); - if (space_info->total_bytes - block_group->length < used) { - /* - * Add a reference for the list, compensate for the ref - * drop under the "next" label for the - * fs_info->unused_bgs list. - */ - btrfs_get_block_group(block_group); - list_add_tail(&block_group->bg_list, &retry_list); - - trace_btrfs_skip_unused_block_group(block_group); - spin_unlock(&block_group->lock); - spin_unlock(&space_info->lock); - up_write(&space_info->groups_sem); - goto next; - } - spin_unlock(&block_group->lock); - spin_unlock(&space_info->lock); /* We don't want to force the issue, only flip if it's ok. */ ret = inc_block_group_ro(block_group, 0); @@ -1691,16 +1650,12 @@ btrfs_put_block_group(block_group); spin_lock(&fs_info->unused_bgs_lock); } - list_splice_tail(&retry_list, &fs_info->unused_bgs); spin_unlock(&fs_info->unused_bgs_lock); mutex_unlock(&fs_info->reclaim_bgs_lock); return; flip_async: btrfs_end_transaction(trans); - spin_lock(&fs_info->unused_bgs_lock); - list_splice_tail(&retry_list, &fs_info->unused_bgs); - spin_unlock(&fs_info->unused_bgs_lock); mutex_unlock(&fs_info->reclaim_bgs_lock); btrfs_put_block_group(block_group); btrfs_discard_punt_unused_bgs_list(fs_info); reverted: --- linux-6.5.0/fs/btrfs/block-group.h +++ linux-6.5.0.orig/fs/btrfs/block-group.h @@ -255,13 +255,6 @@ return (block_group->start + block_group->length); } -static inline bool btrfs_is_block_group_used(const struct btrfs_block_group *bg) -{ - lockdep_assert_held(&bg->lock); - - return (bg->used > 0 || bg->reserved > 0 || bg->pinned > 0); -} - static inline bool btrfs_is_block_group_data_only( struct btrfs_block_group *block_group) { diff -u linux-6.5.0/fs/btrfs/delalloc-space.c linux-6.5.0/fs/btrfs/delalloc-space.c --- linux-6.5.0/fs/btrfs/delalloc-space.c +++ linux-6.5.0/fs/btrfs/delalloc-space.c @@ -245,6 +245,7 @@ struct btrfs_block_rsv *block_rsv = &inode->block_rsv; u64 reserve_size = 0; u64 qgroup_rsv_size = 0; + u64 csum_leaves; unsigned outstanding_extents; lockdep_assert_held(&inode->lock); @@ -259,12 +260,10 @@ outstanding_extents); reserve_size += btrfs_calc_metadata_size(fs_info, 1); } - if (!(inode->flags & BTRFS_INODE_NODATASUM)) { - u64 csum_leaves; - - csum_leaves = btrfs_csum_bytes_to_leaves(fs_info, inode->csum_bytes); - reserve_size += btrfs_calc_insert_metadata_size(fs_info, csum_leaves); - } + csum_leaves = btrfs_csum_bytes_to_leaves(fs_info, + inode->csum_bytes); + reserve_size += btrfs_calc_insert_metadata_size(fs_info, + csum_leaves); /* * For qgroup rsv, the calculation is very simple: * account one nodesize for each outstanding extent @@ -279,20 +278,14 @@ spin_unlock(&block_rsv->lock); } -static void calc_inode_reservations(struct btrfs_inode *inode, +static void calc_inode_reservations(struct btrfs_fs_info *fs_info, u64 num_bytes, u64 disk_num_bytes, u64 *meta_reserve, u64 *qgroup_reserve) { - struct btrfs_fs_info *fs_info = inode->root->fs_info; u64 nr_extents = count_max_extents(fs_info, num_bytes); - u64 csum_leaves; + u64 csum_leaves = btrfs_csum_bytes_to_leaves(fs_info, disk_num_bytes); u64 inode_update = btrfs_calc_metadata_size(fs_info, 1); - if (inode->flags & BTRFS_INODE_NODATASUM) - csum_leaves = 0; - else - csum_leaves = btrfs_csum_bytes_to_leaves(fs_info, disk_num_bytes); - *meta_reserve = btrfs_calc_insert_metadata_size(fs_info, nr_extents + csum_leaves); @@ -344,7 +337,7 @@ * everything out and try again, which is bad. This way we just * over-reserve slightly, and clean up the mess when we are done. */ - calc_inode_reservations(inode, num_bytes, disk_num_bytes, + calc_inode_reservations(fs_info, num_bytes, disk_num_bytes, &meta_reserve, &qgroup_reserve); ret = btrfs_qgroup_reserve_meta_prealloc(root, qgroup_reserve, true, noflush); @@ -365,8 +358,7 @@ nr_extents = count_max_extents(fs_info, num_bytes); spin_lock(&inode->lock); btrfs_mod_outstanding_extents(inode, nr_extents); - if (!(inode->flags & BTRFS_INODE_NODATASUM)) - inode->csum_bytes += disk_num_bytes; + inode->csum_bytes += disk_num_bytes; btrfs_calculate_inode_block_rsv_size(fs_info, inode); spin_unlock(&inode->lock); @@ -400,8 +392,7 @@ num_bytes = ALIGN(num_bytes, fs_info->sectorsize); spin_lock(&inode->lock); - if (!(inode->flags & BTRFS_INODE_NODATASUM)) - inode->csum_bytes -= num_bytes; + inode->csum_bytes -= num_bytes; btrfs_calculate_inode_block_rsv_size(fs_info, inode); spin_unlock(&inode->lock); diff -u linux-6.5.0/fs/btrfs/disk-io.c linux-6.5.0/fs/btrfs/disk-io.c --- linux-6.5.0/fs/btrfs/disk-io.c +++ linux-6.5.0/fs/btrfs/disk-io.c @@ -1287,12 +1287,12 @@ * * @objectid: root id * @anon_dev: preallocated anonymous block device number for new roots, - * pass NULL for a new allocation. + * pass 0 for new allocation. * @check_ref: whether to check root item references, If true, return -ENOENT * for orphan roots */ static struct btrfs_root *btrfs_get_root_ref(struct btrfs_fs_info *fs_info, - u64 objectid, dev_t *anon_dev, + u64 objectid, dev_t anon_dev, bool check_ref) { struct btrfs_root *root; @@ -1322,9 +1322,9 @@ * that common but still possible. In that case, we just need * to free the anon_dev. */ - if (unlikely(anon_dev && *anon_dev)) { - free_anon_bdev(*anon_dev); - *anon_dev = 0; + if (unlikely(anon_dev)) { + free_anon_bdev(anon_dev); + anon_dev = 0; } if (check_ref && btrfs_root_refs(&root->root_item) == 0) { @@ -1346,7 +1346,7 @@ goto fail; } - ret = btrfs_init_fs_root(root, anon_dev ? *anon_dev : 0); + ret = btrfs_init_fs_root(root, anon_dev); if (ret) goto fail; @@ -1382,7 +1382,7 @@ * root's anon_dev to 0 to avoid a double free, once by btrfs_put_root() * and once again by our caller. */ - if (anon_dev && *anon_dev) + if (anon_dev) root->anon_dev = 0; btrfs_put_root(root); return ERR_PTR(ret); @@ -1398,7 +1398,7 @@ struct btrfs_root *btrfs_get_fs_root(struct btrfs_fs_info *fs_info, u64 objectid, bool check_ref) { - return btrfs_get_root_ref(fs_info, objectid, NULL, check_ref); + return btrfs_get_root_ref(fs_info, objectid, 0, check_ref); } /* @@ -1406,11 +1406,11 @@ * the anonymous block device id * * @objectid: tree objectid - * @anon_dev: if NULL, allocate a new anonymous block device or use the - * parameter value if not NULL + * @anon_dev: if zero, allocate a new anonymous block device or use the + * parameter value */ struct btrfs_root *btrfs_get_new_fs_root(struct btrfs_fs_info *fs_info, - u64 objectid, dev_t *anon_dev) + u64 objectid, dev_t anon_dev) { return btrfs_get_root_ref(fs_info, objectid, anon_dev, true); } diff -u linux-6.5.0/fs/btrfs/disk-io.h linux-6.5.0/fs/btrfs/disk-io.h --- linux-6.5.0/fs/btrfs/disk-io.h +++ linux-6.5.0/fs/btrfs/disk-io.h @@ -64,7 +64,7 @@ struct btrfs_root *btrfs_get_fs_root(struct btrfs_fs_info *fs_info, u64 objectid, bool check_ref); struct btrfs_root *btrfs_get_new_fs_root(struct btrfs_fs_info *fs_info, - u64 objectid, dev_t *anon_dev); + u64 objectid, dev_t anon_dev); struct btrfs_root *btrfs_get_fs_root_commit_root(struct btrfs_fs_info *fs_info, struct btrfs_path *path, u64 objectid); diff -u linux-6.5.0/fs/btrfs/inode.c linux-6.5.0/fs/btrfs/inode.c --- linux-6.5.0/fs/btrfs/inode.c +++ linux-6.5.0/fs/btrfs/inode.c @@ -3328,23 +3328,8 @@ unwritten_start += logical_len; clear_extent_uptodate(io_tree, unwritten_start, end, NULL); - /* - * Drop extent maps for the part of the extent we didn't write. - * - * We have an exception here for the free_space_inode, this is - * because when we do btrfs_get_extent() on the free space inode - * we will search the commit root. If this is a new block group - * we won't find anything, and we will trip over the assert in - * writepage where we do ASSERT(em->block_start != - * EXTENT_MAP_HOLE). - * - * Theoretically we could also skip this for any NOCOW extent as - * we don't mess with the extent map tree in the NOCOW case, but - * for now simply skip this if we are the free space inode. - */ - if (!btrfs_is_free_space_inode(inode)) - btrfs_drop_extent_map_range(inode, unwritten_start, - end, false); + /* Drop extent maps for the part of the extent we didn't write. */ + btrfs_drop_extent_map_range(inode, unwritten_start, end, false); /* * If the ordered extent had an IOERR or something else went @@ -10422,13 +10407,6 @@ if (encoded->encryption != BTRFS_ENCODED_IO_ENCRYPTION_NONE) return -EINVAL; - /* - * Compressed extents should always have checksums, so error out if we - * have a NOCOW file or inode was created while mounted with NODATASUM. - */ - if (inode->flags & BTRFS_INODE_NODATASUM) - return -EINVAL; - orig_count = iov_iter_count(from); /* The extent size must be sane. */ diff -u linux-6.5.0/fs/btrfs/ioctl.c linux-6.5.0/fs/btrfs/ioctl.c --- linux-6.5.0/fs/btrfs/ioctl.c +++ linux-6.5.0/fs/btrfs/ioctl.c @@ -721,7 +721,7 @@ free_extent_buffer(leaf); leaf = NULL; - new_root = btrfs_get_new_fs_root(fs_info, objectid, &anon_dev); + new_root = btrfs_get_new_fs_root(fs_info, objectid, anon_dev); if (IS_ERR(new_root)) { ret = PTR_ERR(new_root); btrfs_abort_transaction(trans, ret); @@ -3810,11 +3810,6 @@ goto out; } - if (sa->create && is_fstree(sa->qgroupid)) { - ret = -EINVAL; - goto out; - } - trans = btrfs_join_transaction(root); if (IS_ERR(trans)) { ret = PTR_ERR(trans); diff -u linux-6.5.0/fs/btrfs/qgroup.c linux-6.5.0/fs/btrfs/qgroup.c --- linux-6.5.0/fs/btrfs/qgroup.c +++ linux-6.5.0/fs/btrfs/qgroup.c @@ -1659,15 +1659,6 @@ return ret; } -static bool qgroup_has_usage(struct btrfs_qgroup *qgroup) -{ - return (qgroup->rfer > 0 || qgroup->rfer_cmpr > 0 || - qgroup->excl > 0 || qgroup->excl_cmpr > 0 || - qgroup->rsv.values[BTRFS_QGROUP_RSV_DATA] > 0 || - qgroup->rsv.values[BTRFS_QGROUP_RSV_META_PREALLOC] > 0 || - qgroup->rsv.values[BTRFS_QGROUP_RSV_META_PERTRANS] > 0); -} - int btrfs_remove_qgroup(struct btrfs_trans_handle *trans, u64 qgroupid) { struct btrfs_fs_info *fs_info = trans->fs_info; @@ -1687,11 +1678,6 @@ goto out; } - if (is_fstree(qgroupid) && qgroup_has_usage(qgroup)) { - ret = -EBUSY; - goto out; - } - /* Check if there are no children of this qgroup */ if (!list_empty(&qgroup->members)) { ret = -EBUSY; diff -u linux-6.5.0/fs/btrfs/send.c linux-6.5.0/fs/btrfs/send.c --- linux-6.5.0/fs/btrfs/send.c +++ linux-6.5.0/fs/btrfs/send.c @@ -8113,7 +8113,7 @@ } if (arg->flags & ~BTRFS_SEND_FLAG_MASK) { - ret = -EOPNOTSUPP; + ret = -EINVAL; goto out; } diff -u linux-6.5.0/fs/btrfs/transaction.c linux-6.5.0/fs/btrfs/transaction.c --- linux-6.5.0/fs/btrfs/transaction.c +++ linux-6.5.0/fs/btrfs/transaction.c @@ -1812,7 +1812,7 @@ } key.offset = (u64)-1; - pending->snap = btrfs_get_new_fs_root(fs_info, objectid, &pending->anon_dev); + pending->snap = btrfs_get_new_fs_root(fs_info, objectid, pending->anon_dev); if (IS_ERR(pending->snap)) { ret = PTR_ERR(pending->snap); pending->snap = NULL; diff -u linux-6.5.0/fs/ceph/caps.c linux-6.5.0/fs/ceph/caps.c --- linux-6.5.0/fs/ceph/caps.c +++ linux-6.5.0/fs/ceph/caps.c @@ -1452,7 +1452,7 @@ if (flushing & CEPH_CAP_XATTR_EXCL) { arg->old_xattr_buf = __ceph_build_xattrs_blob(ci); arg->xattr_version = ci->i_xattrs.version; - arg->xattr_buf = ceph_buffer_get(ci->i_xattrs.blob); + arg->xattr_buf = ci->i_xattrs.blob; } else { arg->xattr_buf = NULL; arg->old_xattr_buf = NULL; @@ -1553,7 +1553,6 @@ encode_cap_msg(msg, arg); ceph_con_send(&arg->session->s_con, msg); ceph_buffer_put(arg->old_xattr_buf); - ceph_buffer_put(arg->xattr_buf); if (arg->wake) wake_up_all(&ci->i_cap_wq); } diff -u linux-6.5.0/fs/ext4/mballoc.c linux-6.5.0/fs/ext4/mballoc.c --- linux-6.5.0/fs/ext4/mballoc.c +++ linux-6.5.0/fs/ext4/mballoc.c @@ -1234,24 +1234,6 @@ atomic64_add(period, &sbi->s_mb_generation_time); } -static void mb_regenerate_buddy(struct ext4_buddy *e4b) -{ - int count; - int order = 1; - void *buddy; - - while ((buddy = mb_find_buddy(e4b, order++, &count))) - mb_set_bits(buddy, 0, count); - - e4b->bd_info->bb_fragments = 0; - memset(e4b->bd_info->bb_counters, 0, - sizeof(*e4b->bd_info->bb_counters) * - (e4b->bd_sb->s_blocksize_bits + 2)); - - ext4_mb_generate_buddy(e4b->bd_sb, e4b->bd_buddy, - e4b->bd_bitmap, e4b->bd_group, e4b->bd_info); -} - /* The buddy information is attached the buddy cache inode * for convenience. The information regarding each group * is loaded via ext4_mb_load_buddy. The information involve @@ -1911,6 +1893,11 @@ mb_check_buddy(e4b); mb_free_blocks_double(inode, e4b, first, count); + this_cpu_inc(discard_pa_seq); + e4b->bd_info->bb_free += count; + if (first < e4b->bd_info->bb_first_free) + e4b->bd_info->bb_first_free = first; + /* access memory sequentially: check left neighbour, * clear range and then check right neighbour */ @@ -1924,31 +1911,21 @@ struct ext4_sb_info *sbi = EXT4_SB(sb); ext4_fsblk_t blocknr; - /* - * Fastcommit replay can free already freed blocks which - * corrupts allocation info. Regenerate it. - */ - if (sbi->s_mount_state & EXT4_FC_REPLAY) { - mb_regenerate_buddy(e4b); - goto check; - } - blocknr = ext4_group_first_block_no(sb, e4b->bd_group); blocknr += EXT4_C2B(sbi, block); - ext4_grp_locked_error(sb, e4b->bd_group, - inode ? inode->i_ino : 0, blocknr, - "freeing already freed block (bit %u); block bitmap corrupt.", - block); - ext4_mark_group_bitmap_corrupted(sb, e4b->bd_group, + if (!(sbi->s_mount_state & EXT4_FC_REPLAY)) { + ext4_grp_locked_error(sb, e4b->bd_group, + inode ? inode->i_ino : 0, + blocknr, + "freeing already freed block (bit %u); block bitmap corrupt.", + block); + ext4_mark_group_bitmap_corrupted( + sb, e4b->bd_group, EXT4_GROUP_INFO_BBITMAP_CORRUPT); - return; + } + goto done; } - this_cpu_inc(discard_pa_seq); - e4b->bd_info->bb_free += count; - if (first < e4b->bd_info->bb_first_free) - e4b->bd_info->bb_first_free = first; - /* let's maintain fragments counter */ if (left_is_free && right_is_free) e4b->bd_info->bb_fragments--; @@ -1973,9 +1950,9 @@ if (first <= last) mb_buddy_mark_free(e4b, first >> 1, last >> 1); +done: mb_set_largest_free_order(sb, e4b->bd_info); mb_update_avg_fragment_size(sb, e4b->bd_info); -check: mb_check_buddy(e4b); } reverted: --- linux-6.5.0/fs/hugetlbfs/inode.c +++ linux-6.5.0.orig/fs/hugetlbfs/inode.c @@ -123,7 +123,6 @@ loff_t len, vma_len; int ret; struct hstate *h = hstate_file(file); - vm_flags_t vm_flags; /* * vma address alignment (but not the pgoff alignment) has @@ -165,20 +164,10 @@ file_accessed(file); ret = -ENOMEM; - - vm_flags = vma->vm_flags; - /* - * for SHM_HUGETLB, the pages are reserved in the shmget() call so skip - * reserving here. Note: only for SHM hugetlbfs file, the inode - * flag S_PRIVATE is set. - */ - if (inode->i_flags & S_PRIVATE) - vm_flags |= VM_NORESERVE; - if (!hugetlb_reserve_pages(inode, vma->vm_pgoff >> huge_page_order(h), len >> huge_page_shift(h), vma, + vma->vm_flags)) - vm_flags)) goto out; ret = 0; @@ -1356,7 +1345,6 @@ { struct hugetlbfs_fs_context *ctx = fc->fs_private; struct fs_parse_result result; - struct hstate *h; char *rest; unsigned long ps; int opt; @@ -1401,12 +1389,11 @@ case Opt_pagesize: ps = memparse(param->string, &rest); + ctx->hstate = size_to_hstate(ps); + if (!ctx->hstate) { - h = size_to_hstate(ps); - if (!h) { pr_err("Unsupported page size %lu MB\n", ps / SZ_1M); return -EINVAL; } - ctx->hstate = h; return 0; case Opt_min_size: diff -u linux-6.5.0/fs/namespace.c linux-6.5.0/fs/namespace.c --- linux-6.5.0/fs/namespace.c +++ linux-6.5.0/fs/namespace.c @@ -4470,15 +4470,10 @@ /* * If this is an attached mount make sure it's located in the callers * mount namespace. If it's not don't let the caller interact with it. - * - * If this mount doesn't have a parent it's most often simply a - * detached mount with an anonymous mount namespace. IOW, something - * that's simply not attached yet. But there are apparently also users - * that do change mount properties on the rootfs itself. That obviously - * neither has a parent nor is it a detached mount so we cannot - * unconditionally check for detached mounts. + * If this is a detached mount make sure it has an anonymous mount + * namespace attached to it, i.e. we've created it via OPEN_TREE_CLONE. */ - if ((mnt_has_parent(mnt) || !is_anon_ns(mnt->mnt_ns)) && !check_mnt(mnt)) + if (!(mnt_has_parent(mnt) ? check_mnt(mnt) : is_anon_ns(mnt->mnt_ns))) goto out; /* diff -u linux-6.5.0/fs/nfsd/nfs4state.c linux-6.5.0/fs/nfsd/nfs4state.c --- linux-6.5.0/fs/nfsd/nfs4state.c +++ linux-6.5.0/fs/nfsd/nfs4state.c @@ -4932,8 +4932,10 @@ */ fl->fl_break_time = 0; + spin_lock(&fp->fi_lock); fp->fi_had_conflict = true; nfsd_break_one_deleg(dp); + spin_unlock(&fp->fi_lock); return false; } @@ -5521,13 +5523,12 @@ if (status) goto out_unlock; - status = -EAGAIN; - if (fp->fi_had_conflict) - goto out_unlock; - spin_lock(&state_lock); spin_lock(&fp->fi_lock); - status = hash_delegation_locked(dp, fp); + if (fp->fi_had_conflict) + status = -EAGAIN; + else + status = hash_delegation_locked(dp, fp); spin_unlock(&fp->fi_lock); spin_unlock(&state_lock); reverted: --- linux-6.5.0/fs/nilfs2/file.c +++ linux-6.5.0.orig/fs/nilfs2/file.c @@ -105,13 +105,7 @@ nilfs_transaction_commit(inode->i_sb); mapped: + wait_for_stable_page(page); - /* - * Since checksumming including data blocks is performed to determine - * the validity of the log to be written and used for recovery, it is - * necessary to wait for writeback to finish here, regardless of the - * stable write requirement of the backing device. - */ - wait_on_page_writeback(page); out: sb_end_pagefault(inode->i_sb); return block_page_mkwrite_return(ret); reverted: --- linux-6.5.0/fs/nilfs2/recovery.c +++ linux-6.5.0.orig/fs/nilfs2/recovery.c @@ -472,10 +472,9 @@ static int nilfs_recovery_copy_block(struct the_nilfs *nilfs, struct nilfs_recovery_block *rb, + struct page *page) - loff_t pos, struct page *page) { struct buffer_head *bh_org; - size_t from = pos & ~PAGE_MASK; void *kaddr; bh_org = __bread(nilfs->ns_bdev, rb->blocknr, nilfs->ns_blocksize); @@ -483,7 +482,7 @@ return -EIO; kaddr = kmap_atomic(page); + memcpy(kaddr + bh_offset(bh_org), bh_org->b_data, bh_org->b_size); - memcpy(kaddr + from, bh_org->b_data, bh_org->b_size); kunmap_atomic(kaddr); brelse(bh_org); return 0; @@ -522,7 +521,7 @@ goto failed_inode; } + err = nilfs_recovery_copy_block(nilfs, rb, page); - err = nilfs_recovery_copy_block(nilfs, rb, pos, page); if (unlikely(err)) goto failed_page; reverted: --- linux-6.5.0/fs/nilfs2/segment.c +++ linux-6.5.0.orig/fs/nilfs2/segment.c @@ -1704,6 +1704,7 @@ list_for_each_entry(bh, &segbuf->sb_payload_buffers, b_assoc_buffers) { + set_buffer_async_write(bh); if (bh == segbuf->sb_super_root) { if (bh->b_page != bd_page) { lock_page(bd_page); @@ -1714,7 +1715,6 @@ } break; } - set_buffer_async_write(bh); if (bh->b_page != fs_page) { nilfs_begin_page_io(fs_page); fs_page = bh->b_page; @@ -1800,6 +1800,7 @@ list_for_each_entry(bh, &segbuf->sb_payload_buffers, b_assoc_buffers) { + clear_buffer_async_write(bh); if (bh == segbuf->sb_super_root) { clear_buffer_uptodate(bh); if (bh->b_page != bd_page) { @@ -1808,7 +1809,6 @@ } break; } - clear_buffer_async_write(bh); if (bh->b_page != fs_page) { nilfs_end_page_io(fs_page, err); fs_page = bh->b_page; @@ -1896,9 +1896,8 @@ BIT(BH_Delay) | BIT(BH_NILFS_Volatile) | BIT(BH_NILFS_Redirected)); + set_mask_bits(&bh->b_state, clear_bits, set_bits); if (bh == segbuf->sb_super_root) { - set_buffer_uptodate(bh); - clear_buffer_dirty(bh); if (bh->b_page != bd_page) { end_page_writeback(bd_page); bd_page = bh->b_page; @@ -1906,7 +1905,6 @@ update_sr = true; break; } - set_mask_bits(&bh->b_state, clear_bits, set_bits); if (bh->b_page != fs_page) { nilfs_end_page_io(fs_page, 0); fs_page = bh->b_page; diff -u linux-6.5.0/fs/ntfs3/ntfs_fs.h linux-6.5.0/fs/ntfs3/ntfs_fs.h --- linux-6.5.0/fs/ntfs3/ntfs_fs.h +++ linux-6.5.0/fs/ntfs3/ntfs_fs.h @@ -473,7 +473,7 @@ int al_update(struct ntfs_inode *ni, int sync); static inline size_t al_aligned(size_t size) { - return size_add(size, 1023) & ~(size_t)1023; + return (size + 1023) & ~(size_t)1023; } /* Globals from bitfunc.c */ reverted: --- linux-6.5.0/fs/proc/array.c +++ linux-6.5.0.orig/fs/proc/array.c @@ -505,7 +505,7 @@ sigemptyset(&sigign); sigemptyset(&sigcatch); + cutime = cstime = utime = stime = 0; - cutime = cstime = 0; cgtime = gtime = 0; if (lock_task_sighand(task, &flags)) { @@ -539,6 +539,7 @@ min_flt += sig->min_flt; maj_flt += sig->maj_flt; + thread_group_cputime_adjusted(task, &utime, &stime); gtime += sig->gtime; if (sig->flags & (SIGNAL_GROUP_EXIT | SIGNAL_STOP_STOPPED)) @@ -554,13 +555,10 @@ if (permitted && (!whole || num_threads < 2)) wchan = !task_is_running(task); + if (!whole) { - - if (whole) { - thread_group_cputime_adjusted(task, &utime, &stime); - } else { - task_cputime_adjusted(task, &utime, &stime); min_flt = task->min_flt; maj_flt = task->maj_flt; + task_cputime_adjusted(task, &utime, &stime); gtime = task_gtime(task); } reverted: --- linux-6.5.0/fs/smb/client/cifs_dfs_ref.c +++ linux-6.5.0.orig/fs/smb/client/cifs_dfs_ref.c @@ -129,21 +129,6 @@ return rc; } -static void fs_context_set_ids(struct smb3_fs_context *ctx) -{ - kuid_t uid = current_fsuid(); - kgid_t gid = current_fsgid(); - - if (ctx->multiuser) { - if (!ctx->uid_specified) - ctx->linux_uid = uid; - if (!ctx->gid_specified) - ctx->linux_gid = gid; - } - if (!ctx->cruid_specified) - ctx->cred_uid = uid; -} - /* * Create a vfsmount that we can automount */ @@ -192,7 +177,6 @@ tmp.leaf_fullpath = NULL; tmp.UNC = tmp.prepath = NULL; tmp.dfs_root_ses = NULL; - fs_context_set_ids(&tmp); rc = smb3_fs_context_dup(ctx, &tmp); if (rc) { diff -u linux-6.5.0/fs/smb/client/sess.c linux-6.5.0/fs/smb/client/sess.c --- linux-6.5.0/fs/smb/client/sess.c +++ linux-6.5.0/fs/smb/client/sess.c @@ -263,8 +263,6 @@ &iface->sockaddr, rc); kref_put(&iface->refcount, release_iface); - /* failure to add chan should increase weight */ - iface->weight_fulfilled++; continue; } diff -u linux-6.5.0/fs/smb/client/smb2ops.c linux-6.5.0/fs/smb/client/smb2ops.c --- linux-6.5.0/fs/smb/client/smb2ops.c +++ linux-6.5.0/fs/smb/client/smb2ops.c @@ -619,7 +619,7 @@ goto out; } - while (bytes_left >= (ssize_t)sizeof(*p)) { + while (bytes_left >= sizeof(*p)) { memset(&tmp_iface, 0, sizeof(tmp_iface)); tmp_iface.speed = le64_to_cpu(p->LinkSpeed); tmp_iface.rdma_capable = le32_to_cpu(p->Capability & RDMA_CAPABLE) ? 1 : 0; diff -u linux-6.5.0/fs/smb/client/smb2pdu.c linux-6.5.0/fs/smb/client/smb2pdu.c --- linux-6.5.0/fs/smb/client/smb2pdu.c +++ linux-6.5.0/fs/smb/client/smb2pdu.c @@ -404,7 +404,7 @@ rc = SMB3_request_interfaces(xid, tcon, false); free_xid(xid); - if (rc == -EOPNOTSUPP && ses->chan_count > 1) { + if (rc == -EOPNOTSUPP) { /* * some servers like Azure SMB server do not advertise * that multichannel has been disabled with server diff -u linux-6.5.0/fs/smb/server/smb2pdu.c linux-6.5.0/fs/smb/server/smb2pdu.c --- linux-6.5.0/fs/smb/server/smb2pdu.c +++ linux-6.5.0/fs/smb/server/smb2pdu.c @@ -6172,10 +6172,8 @@ err = ksmbd_iov_pin_rsp_read(work, (void *)rsp, offsetof(struct smb2_read_rsp, Buffer), aux_payload_buf, nbytes); - if (err) { - kvfree(aux_payload_buf); + if (err) goto out; - } kvfree(rpc_resp); } else { err = ksmbd_iov_pin_rsp(work, (void *)rsp, @@ -6385,10 +6383,8 @@ err = ksmbd_iov_pin_rsp_read(work, (void *)rsp, offsetof(struct smb2_read_rsp, Buffer), aux_payload_buf, nbytes); - if (err) { - kvfree(aux_payload_buf); + if (err) goto out; - } ksmbd_fd_put(work, fp); return 0; diff -u linux-6.5.0/fs/tracefs/inode.c linux-6.5.0/fs/tracefs/inode.c --- linux-6.5.0/fs/tracefs/inode.c +++ linux-6.5.0/fs/tracefs/inode.c @@ -194,10 +194,6 @@ struct dentry *dentry = list_entry(tmp, struct dentry, d_child); next = tmp->next; - /* Note, getdents() can add a cursor dentry with no inode */ - if (!dentry->d_inode) - continue; - spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); change_gid(dentry, gid); reverted: --- linux-6.5.0/fs/xfs/libxfs/xfs_alloc.c +++ linux-6.5.0.orig/fs/xfs/libxfs/xfs_alloc.c @@ -2275,37 +2275,16 @@ ASSERT(mp->m_alloc_maxlevels > 0); - /* - * For a btree shorter than the maximum height, the worst case is that - * every level gets split and a new level is added, then while inserting - * another entry to refill the AGFL, every level under the old root gets - * split again. This is: - * - * (full height split reservation) + (AGFL refill split height) - * = (current height + 1) + (current height - 1) - * = (new height) + (new height - 2) - * = 2 * new height - 2 - * - * For a btree of maximum height, the worst case is that every level - * under the root gets split, then while inserting another entry to - * refill the AGFL, every level under the root gets split again. This is - * also: - * - * 2 * (current height - 1) - * = 2 * (new height - 1) - * = 2 * new height - 2 - */ - /* space needed by-bno freespace btree */ min_free = min_t(unsigned int, levels[XFS_BTNUM_BNOi] + 1, + mp->m_alloc_maxlevels); - mp->m_alloc_maxlevels) * 2 - 2; /* space needed by-size freespace btree */ min_free += min_t(unsigned int, levels[XFS_BTNUM_CNTi] + 1, + mp->m_alloc_maxlevels); - mp->m_alloc_maxlevels) * 2 - 2; /* space needed reverse mapping used space btree */ if (xfs_has_rmapbt(mp)) min_free += min_t(unsigned int, levels[XFS_BTNUM_RMAPi] + 1, + mp->m_rmap_maxlevels); - mp->m_rmap_maxlevels) * 2 - 2; return min_free; } reverted: --- linux-6.5.0/fs/xfs/libxfs/xfs_bmap.c +++ linux-6.5.0.orig/fs/xfs/libxfs/xfs_bmap.c @@ -4827,7 +4827,7 @@ ASSERT(got_endoff >= del_endoff); if (isrt) { + uint64_t rtexts = XFS_FSB_TO_B(mp, del->br_blockcount); - uint64_t rtexts = del->br_blockcount; do_div(rtexts, mp->m_sb.sb_rextsize); xfs_mod_frextents(mp, rtexts); @@ -5057,20 +5057,33 @@ flags = XFS_ILOG_CORE; if (whichfork == XFS_DATA_FORK && XFS_IS_REALTIME_INODE(ip)) { + xfs_filblks_t len; + xfs_extlen_t mod; + + len = div_u64_rem(del->br_blockcount, mp->m_sb.sb_rextsize, + &mod); + ASSERT(mod == 0); + if (!(bflags & XFS_BMAPI_REMAP)) { + xfs_fsblock_t bno; + + bno = div_u64_rem(del->br_startblock, + mp->m_sb.sb_rextsize, &mod); + ASSERT(mod == 0); + + error = xfs_rtfree_extent(tp, bno, (xfs_extlen_t)len); - error = xfs_rtfree_blocks(tp, del->br_startblock, - del->br_blockcount); if (error) goto done; } do_fx = 0; + nblks = len * mp->m_sb.sb_rextsize; qfield = XFS_TRANS_DQ_RTBCOUNT; } else { do_fx = 1; + nblks = del->br_blockcount; qfield = XFS_TRANS_DQ_BCOUNT; } - nblks = del->br_blockcount; del_endblock = del->br_startblock + del->br_blockcount; if (cur) { reverted: --- linux-6.5.0/fs/xfs/libxfs/xfs_defer.c +++ linux-6.5.0.orig/fs/xfs/libxfs/xfs_defer.c @@ -245,18 +245,21 @@ return ret; } +/* Abort all the intents that were committed. */ STATIC void +xfs_defer_trans_abort( + struct xfs_trans *tp, + struct list_head *dop_pending) -xfs_defer_pending_abort( - struct xfs_mount *mp, - struct list_head *dop_list) { struct xfs_defer_pending *dfp; const struct xfs_defer_op_type *ops; + trace_xfs_defer_trans_abort(tp, _RET_IP_); + /* Abort intent items that don't have a done item. */ + list_for_each_entry(dfp, dop_pending, dfp_list) { - list_for_each_entry(dfp, dop_list, dfp_list) { ops = defer_op_types[dfp->dfp_type]; + trace_xfs_defer_pending_abort(tp->t_mountp, dfp); - trace_xfs_defer_pending_abort(mp, dfp); if (dfp->dfp_intent && !dfp->dfp_done) { ops->abort_intent(dfp->dfp_intent); dfp->dfp_intent = NULL; @@ -264,16 +267,6 @@ } } -/* Abort all the intents that were committed. */ -STATIC void -xfs_defer_trans_abort( - struct xfs_trans *tp, - struct list_head *dop_pending) -{ - trace_xfs_defer_trans_abort(tp, _RET_IP_); - xfs_defer_pending_abort(tp->t_mountp, dop_pending); -} - /* * Capture resources that the caller said not to release ("held") when the * transaction commits. Caller is responsible for zero-initializing @dres. @@ -763,13 +756,12 @@ /* Release all resources that we used to capture deferred ops. */ void +xfs_defer_ops_capture_free( -xfs_defer_ops_capture_abort( struct xfs_mount *mp, struct xfs_defer_capture *dfc) { unsigned short i; - xfs_defer_pending_abort(mp, &dfc->dfc_dfops); xfs_defer_cancel_list(mp, &dfc->dfc_dfops); for (i = 0; i < dfc->dfc_held.dr_bufs; i++) @@ -810,7 +802,7 @@ /* Commit the transaction and add the capture structure to the list. */ error = xfs_trans_commit(tp); if (error) { + xfs_defer_ops_capture_free(mp, dfc); - xfs_defer_ops_capture_abort(mp, dfc); return error; } reverted: --- linux-6.5.0/fs/xfs/libxfs/xfs_defer.h +++ linux-6.5.0.orig/fs/xfs/libxfs/xfs_defer.h @@ -121,7 +121,7 @@ struct list_head *capture_list); void xfs_defer_ops_continue(struct xfs_defer_capture *d, struct xfs_trans *tp, struct xfs_defer_resources *dres); +void xfs_defer_ops_capture_free(struct xfs_mount *mp, -void xfs_defer_ops_capture_abort(struct xfs_mount *mp, struct xfs_defer_capture *d); void xfs_defer_resources_rele(struct xfs_defer_resources *dres); reverted: --- linux-6.5.0/fs/xfs/libxfs/xfs_inode_buf.c +++ linux-6.5.0.orig/fs/xfs/libxfs/xfs_inode_buf.c @@ -507,9 +507,6 @@ if (mode && nextents + naextents > nblocks) return __this_address; - if (nextents + naextents == 0 && nblocks != 0) - return __this_address; - if (S_ISDIR(mode) && nextents > mp->m_dir_geo->max_extents) return __this_address; reverted: --- linux-6.5.0/fs/xfs/libxfs/xfs_rtbitmap.c +++ linux-6.5.0.orig/fs/xfs/libxfs/xfs_rtbitmap.c @@ -1005,39 +1005,6 @@ return 0; } -/* - * Free some blocks in the realtime subvolume. rtbno and rtlen are in units of - * rt blocks, not rt extents; must be aligned to the rt extent size; and rtlen - * cannot exceed XFS_MAX_BMBT_EXTLEN. - */ -int -xfs_rtfree_blocks( - struct xfs_trans *tp, - xfs_fsblock_t rtbno, - xfs_filblks_t rtlen) -{ - struct xfs_mount *mp = tp->t_mountp; - xfs_rtblock_t bno; - xfs_filblks_t len; - xfs_extlen_t mod; - - ASSERT(rtlen <= XFS_MAX_BMBT_EXTLEN); - - len = div_u64_rem(rtlen, mp->m_sb.sb_rextsize, &mod); - if (mod) { - ASSERT(mod == 0); - return -EIO; - } - - bno = div_u64_rem(rtbno, mp->m_sb.sb_rextsize, &mod); - if (mod) { - ASSERT(mod == 0); - return -EIO; - } - - return xfs_rtfree_extent(tp, bno, len); -} - /* Find all the free records within a given range. */ int xfs_rtalloc_query_range( reverted: --- linux-6.5.0/fs/xfs/libxfs/xfs_sb.h +++ linux-6.5.0.orig/fs/xfs/libxfs/xfs_sb.h @@ -25,7 +25,7 @@ extern int xfs_update_secondary_sbs(struct xfs_mount *mp); +#define XFS_FS_GEOM_MAX_STRUCT_VER (4) -#define XFS_FS_GEOM_MAX_STRUCT_VER (5) extern void xfs_fs_geometry(struct xfs_mount *mp, struct xfs_fsop_geom *geo, int struct_version); extern int xfs_sb_read_secondary(struct xfs_mount *mp, reverted: --- linux-6.5.0/fs/xfs/xfs_bmap_util.c +++ linux-6.5.0.orig/fs/xfs/xfs_bmap_util.c @@ -780,10 +780,12 @@ { xfs_mount_t *mp = ip->i_mount; xfs_off_t count; + xfs_filblks_t allocated_fsb; xfs_filblks_t allocatesize_fsb; xfs_extlen_t extsz, temp; xfs_fileoff_t startoffset_fsb; xfs_fileoff_t endoffset_fsb; + int nimaps; int rt; xfs_trans_t *tp; xfs_bmbt_irec_t imaps[1], *imapp; @@ -806,6 +808,7 @@ count = len; imapp = &imaps[0]; + nimaps = 1; startoffset_fsb = XFS_B_TO_FSBT(mp, offset); endoffset_fsb = XFS_B_TO_FSB(mp, offset + count); allocatesize_fsb = endoffset_fsb - startoffset_fsb; @@ -816,7 +819,6 @@ while (allocatesize_fsb && !error) { xfs_fileoff_t s, e; unsigned int dblocks, rblocks, resblks; - int nimaps = 1; /* * Determine space reservations for data/realtime. @@ -882,19 +884,15 @@ if (error) break; + allocated_fsb = imapp->br_blockcount; + + if (nimaps == 0) { + error = -ENOSPC; + break; - /* - * If the allocator cannot find a single free extent large - * enough to cover the start block of the requested range, - * xfs_bmapi_write will return 0 but leave *nimaps set to 0. - * - * In that case we simply need to keep looping with the same - * startoffset_fsb so that one of the following allocations - * will eventually reach the requested range. - */ - if (nimaps) { - startoffset_fsb += imapp->br_blockcount; - allocatesize_fsb -= imapp->br_blockcount; } + + startoffset_fsb += allocated_fsb; + allocatesize_fsb -= allocated_fsb; } return error; reverted: --- linux-6.5.0/fs/xfs/xfs_dquot.c +++ linux-6.5.0.orig/fs/xfs/xfs_dquot.c @@ -562,8 +562,7 @@ struct xfs_dquot *dqp, struct xfs_buf *bp) { + struct xfs_disk_dquot *ddqp = bp->b_addr + dqp->q_bufoffset; - struct xfs_dqblk *dqb = xfs_buf_offset(bp, dqp->q_bufoffset); - struct xfs_disk_dquot *ddqp = &dqb->dd_diskdq; /* * Ensure that we got the type and ID we were looking for. @@ -1251,7 +1250,7 @@ } /* Flush the incore dquot to the ondisk buffer. */ + dqblk = bp->b_addr + dqp->q_bufoffset; - dqblk = xfs_buf_offset(bp, dqp->q_bufoffset); xfs_dquot_to_disk(&dqblk->dd_diskdq, dqp); /* reverted: --- linux-6.5.0/fs/xfs/xfs_dquot_item_recover.c +++ linux-6.5.0.orig/fs/xfs/xfs_dquot_item_recover.c @@ -19,7 +19,6 @@ #include "xfs_log.h" #include "xfs_log_priv.h" #include "xfs_log_recover.h" -#include "xfs_error.h" STATIC void xlog_recover_dquot_ra_pass2( @@ -66,7 +65,6 @@ { struct xfs_mount *mp = log->l_mp; struct xfs_buf *bp; - struct xfs_dqblk *dqb; struct xfs_disk_dquot *ddq, *recddq; struct xfs_dq_logformat *dq_f; xfs_failaddr_t fa; @@ -132,14 +130,14 @@ return error; ASSERT(bp); + ddq = xfs_buf_offset(bp, dq_f->qlf_boffset); - dqb = xfs_buf_offset(bp, dq_f->qlf_boffset); - ddq = &dqb->dd_diskdq; /* * If the dquot has an LSN in it, recover the dquot only if it's less * than the lsn of the transaction we are replaying. */ if (xfs_has_crc(mp)) { + struct xfs_dqblk *dqb = (struct xfs_dqblk *)ddq; xfs_lsn_t lsn = be64_to_cpu(dqb->dd_lsn); if (lsn && lsn != -1 && XFS_LSN_CMP(lsn, current_lsn) >= 0) { @@ -149,23 +147,10 @@ memcpy(ddq, recddq, item->ri_buf[1].i_len); if (xfs_has_crc(mp)) { + xfs_update_cksum((char *)ddq, sizeof(struct xfs_dqblk), - xfs_update_cksum((char *)dqb, sizeof(struct xfs_dqblk), XFS_DQUOT_CRC_OFF); } - /* Validate the recovered dquot. */ - fa = xfs_dqblk_verify(log->l_mp, dqb, dq_f->qlf_id); - if (fa) { - XFS_CORRUPTION_ERROR("Bad dquot after recovery", - XFS_ERRLEVEL_LOW, mp, dqb, - sizeof(struct xfs_dqblk)); - xfs_alert(mp, - "Metadata corruption detected at %pS, dquot 0x%x", - fa, dq_f->qlf_id); - error = -EFSCORRUPTED; - goto out_release; - } - ASSERT(dq_f->qlf_size == 2); ASSERT(bp->b_mount == mp); bp->b_flags |= _XBF_LOGRECOVERY; reverted: --- linux-6.5.0/fs/xfs/xfs_file.c +++ linux-6.5.0.orig/fs/xfs/xfs_file.c @@ -214,43 +214,6 @@ return 0; } -static int -xfs_ilock_iocb_for_write( - struct kiocb *iocb, - unsigned int *lock_mode) -{ - ssize_t ret; - struct xfs_inode *ip = XFS_I(file_inode(iocb->ki_filp)); - - ret = xfs_ilock_iocb(iocb, *lock_mode); - if (ret) - return ret; - - if (*lock_mode == XFS_IOLOCK_EXCL) - return 0; - if (!xfs_iflags_test(ip, XFS_IREMAPPING)) - return 0; - - xfs_iunlock(ip, *lock_mode); - *lock_mode = XFS_IOLOCK_EXCL; - return xfs_ilock_iocb(iocb, *lock_mode); -} - -static unsigned int -xfs_ilock_for_write_fault( - struct xfs_inode *ip) -{ - /* get a shared lock if no remapping in progress */ - xfs_ilock(ip, XFS_MMAPLOCK_SHARED); - if (!xfs_iflags_test(ip, XFS_IREMAPPING)) - return XFS_MMAPLOCK_SHARED; - - /* wait for remapping to complete */ - xfs_iunlock(ip, XFS_MMAPLOCK_SHARED); - xfs_ilock(ip, XFS_MMAPLOCK_EXCL); - return XFS_MMAPLOCK_EXCL; -} - STATIC ssize_t xfs_file_dio_read( struct kiocb *iocb, @@ -588,7 +551,7 @@ unsigned int iolock = XFS_IOLOCK_SHARED; ssize_t ret; + ret = xfs_ilock_iocb(iocb, iolock); - ret = xfs_ilock_iocb_for_write(iocb, &iolock); if (ret) return ret; ret = xfs_file_write_checks(iocb, from, &iolock); @@ -655,7 +618,7 @@ flags = IOMAP_DIO_FORCE_WAIT; } + ret = xfs_ilock_iocb(iocb, iolock); - ret = xfs_ilock_iocb_for_write(iocb, &iolock); if (ret) return ret; @@ -1217,7 +1180,7 @@ if (xfs_file_sync_writes(file_in) || xfs_file_sync_writes(file_out)) xfs_log_force_inode(dest); out_unlock: + xfs_iunlock2_io_mmap(src, dest); - xfs_iunlock2_remapping(src, dest); if (ret) trace_xfs_reflink_remap_range_error(dest, ret, _RET_IP_); return remapped > 0 ? remapped : ret; @@ -1365,7 +1328,6 @@ struct inode *inode = file_inode(vmf->vma->vm_file); struct xfs_inode *ip = XFS_I(inode); vm_fault_t ret; - unsigned int lock_mode = 0; trace_xfs_filemap_fault(ip, pe_size, write_fault); @@ -1374,24 +1336,25 @@ file_update_time(vmf->vma->vm_file); } - if (IS_DAX(inode) || write_fault) - lock_mode = xfs_ilock_for_write_fault(XFS_I(inode)); - if (IS_DAX(inode)) { pfn_t pfn; + xfs_ilock(XFS_I(inode), XFS_MMAPLOCK_SHARED); ret = xfs_dax_fault(vmf, pe_size, write_fault, &pfn); if (ret & VM_FAULT_NEEDDSYNC) ret = dax_finish_sync_fault(vmf, pe_size, pfn); + xfs_iunlock(XFS_I(inode), XFS_MMAPLOCK_SHARED); - } else if (write_fault) { - ret = iomap_page_mkwrite(vmf, &xfs_page_mkwrite_iomap_ops); } else { + if (write_fault) { + xfs_ilock(XFS_I(inode), XFS_MMAPLOCK_SHARED); + ret = iomap_page_mkwrite(vmf, + &xfs_page_mkwrite_iomap_ops); + xfs_iunlock(XFS_I(inode), XFS_MMAPLOCK_SHARED); + } else { + ret = filemap_fault(vmf); + } - ret = filemap_fault(vmf); } - if (lock_mode) - xfs_iunlock(XFS_I(inode), lock_mode); - if (write_fault) sb_end_pagefault(inode->i_sb); return ret; reverted: --- linux-6.5.0/fs/xfs/xfs_inode.c +++ linux-6.5.0.orig/fs/xfs/xfs_inode.c @@ -919,13 +919,6 @@ xfs_trans_t *tp, xfs_inode_t *ip) { - if (VFS_I(ip)->i_nlink == 0) { - xfs_alert(ip->i_mount, - "%s: Attempt to drop inode (%llu) with nlink zero.", - __func__, ip->i_ino); - return -EFSCORRUPTED; - } - xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_CHG); drop_nlink(VFS_I(ip)); @@ -3489,23 +3482,6 @@ return 0; } -/* Drop the MMAPLOCK and the IOLOCK after a remap completes. */ -void -xfs_iunlock2_remapping( - struct xfs_inode *ip1, - struct xfs_inode *ip2) -{ - xfs_iflags_clear(ip1, XFS_IREMAPPING); - - if (ip1 != ip2) - xfs_iunlock(ip1, XFS_MMAPLOCK_SHARED); - xfs_iunlock(ip2, XFS_MMAPLOCK_EXCL); - - if (ip1 != ip2) - inode_unlock_shared(VFS_I(ip1)); - inode_unlock(VFS_I(ip2)); -} - /* * Lock two inodes so that userspace cannot initiate I/O via file syscalls or * mmap activity. reverted: --- linux-6.5.0/fs/xfs/xfs_inode.h +++ linux-6.5.0.orig/fs/xfs/xfs_inode.h @@ -326,14 +326,6 @@ */ #define XFS_INACTIVATING (1 << 13) -/* - * Remap in progress. Callers that wish to update file data while - * holding a shared IOLOCK or MMAPLOCK must drop the lock and retake - * the lock in exclusive mode. Relocking the file will block until - * IREMAPPING is cleared. - */ -#define XFS_IREMAPPING (1U << 15) - /* All inode state flags related to inode reclaim. */ #define XFS_ALL_IRECLAIM_FLAGS (XFS_IRECLAIMABLE | \ XFS_IRECLAIM | \ @@ -548,14 +540,6 @@ extern void xfs_setup_iops(struct xfs_inode *ip); extern void xfs_diflags_to_iflags(struct xfs_inode *ip, bool init); -static inline void xfs_update_stable_writes(struct xfs_inode *ip) -{ - if (bdev_stable_writes(xfs_inode_buftarg(ip)->bt_bdev)) - mapping_set_stable_writes(VFS_I(ip)->i_mapping); - else - mapping_clear_stable_writes(VFS_I(ip)->i_mapping); -} - /* * When setting up a newly allocated inode, we need to call * xfs_finish_inode_setup() once the inode is fully instantiated at @@ -590,6 +574,5 @@ int xfs_ilock2_io_mmap(struct xfs_inode *ip1, struct xfs_inode *ip2); void xfs_iunlock2_io_mmap(struct xfs_inode *ip1, struct xfs_inode *ip2); -void xfs_iunlock2_remapping(struct xfs_inode *ip1, struct xfs_inode *ip2); #endif /* __XFS_INODE_H__ */ diff -u linux-6.5.0/fs/xfs/xfs_inode_item_recover.c linux-6.5.0/fs/xfs/xfs_inode_item_recover.c --- linux-6.5.0/fs/xfs/xfs_inode_item_recover.c +++ linux-6.5.0/fs/xfs/xfs_inode_item_recover.c @@ -286,7 +286,6 @@ struct xfs_log_dinode *ldip; uint isize; int need_free = 0; - xfs_failaddr_t fa; if (item->ri_buf[0].i_len == sizeof(struct xfs_inode_log_format)) { in_f = item->ri_buf[0].i_addr; @@ -531,19 +530,8 @@ (dip->di_mode != 0)) error = xfs_recover_inode_owner_change(mp, dip, in_f, buffer_list); - /* re-generate the checksum and validate the recovered inode. */ + /* re-generate the checksum. */ xfs_dinode_calc_crc(log->l_mp, dip); - fa = xfs_dinode_verify(log->l_mp, in_f->ilf_ino, dip); - if (fa) { - XFS_CORRUPTION_ERROR( - "Bad dinode after recovery", - XFS_ERRLEVEL_LOW, mp, dip, sizeof(*dip)); - xfs_alert(mp, - "Metadata corruption detected at %pS, inode 0x%llx", - fa, in_f->ilf_ino); - error = -EFSCORRUPTED; - goto out_release; - } ASSERT(bp->b_mount == mp); bp->b_flags |= _XBF_LOGRECOVERY; reverted: --- linux-6.5.0/fs/xfs/xfs_ioctl.c +++ linux-6.5.0.orig/fs/xfs/xfs_ioctl.c @@ -1120,25 +1120,23 @@ struct fileattr *fa) { struct xfs_mount *mp = ip->i_mount; - bool rtflag = (fa->fsx_xflags & FS_XFLAG_REALTIME); uint64_t i_flags2; + /* Can't change realtime flag if any extents are allocated. */ + if ((ip->i_df.if_nextents || ip->i_delayed_blks) && + XFS_IS_REALTIME_INODE(ip) != (fa->fsx_xflags & FS_XFLAG_REALTIME)) + return -EINVAL; - if (rtflag != XFS_IS_REALTIME_INODE(ip)) { - /* Can't change realtime flag if any extents are allocated. */ - if (ip->i_df.if_nextents || ip->i_delayed_blks) - return -EINVAL; - } + /* If realtime flag is set then must have realtime device */ + if (fa->fsx_xflags & FS_XFLAG_REALTIME) { - if (rtflag) { - /* If realtime flag is set then must have realtime device */ if (mp->m_sb.sb_rblocks == 0 || mp->m_sb.sb_rextsize == 0 || (ip->i_extsize % mp->m_sb.sb_rextsize)) return -EINVAL; + } + /* Clear reflink if we are actually able to set the rt flag. */ + if ((fa->fsx_xflags & FS_XFLAG_REALTIME) && xfs_is_reflink_inode(ip)) + ip->i_diflags2 &= ~XFS_DIFLAG2_REFLINK; - /* Clear reflink if we are actually able to set the rt flag. */ - if (xfs_is_reflink_inode(ip)) - ip->i_diflags2 &= ~XFS_DIFLAG2_REFLINK; - } /* diflags2 only valid for v3 inodes. */ i_flags2 = xfs_flags2diflags2(ip, fa->fsx_xflags); @@ -1149,14 +1147,6 @@ ip->i_diflags2 = i_flags2; xfs_diflags_to_iflags(ip, false); - - /* - * Make the stable writes flag match that of the device the inode - * resides on when flipping the RT flag. - */ - if (rtflag != XFS_IS_REALTIME_INODE(ip) && S_ISREG(VFS_I(ip)->i_mode)) - xfs_update_stable_writes(ip); - xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_CHG); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); XFS_STATS_INC(mp, xs_ig_attrchg); reverted: --- linux-6.5.0/fs/xfs/xfs_iops.c +++ linux-6.5.0.orig/fs/xfs/xfs_iops.c @@ -1289,13 +1289,6 @@ mapping_set_gfp_mask(inode->i_mapping, (gfp_mask & ~(__GFP_FS))); /* - * For real-time inodes update the stable write flags to that of the RT - * device instead of the data device. - */ - if (S_ISREG(inode->i_mode) && XFS_IS_REALTIME_INODE(ip)) - xfs_update_stable_writes(ip); - - /* * If there is no attribute fork no ACL can exist on this inode, * and it can't have any file capabilities attached to it either. */ reverted: --- linux-6.5.0/fs/xfs/xfs_log.c +++ linux-6.5.0.orig/fs/xfs/xfs_log.c @@ -1910,7 +1910,9 @@ * the buffer manually, the code needs to be kept in sync * with the I/O completion path. */ + xlog_state_done_syncing(iclog); + up(&iclog->ic_sema); + return; - goto sync; } /* @@ -1940,17 +1942,20 @@ * avoid shutdown re-entering this path and erroring out again. */ if (log->l_targ != log->l_mp->m_ddev_targp && + blkdev_issue_flush(log->l_mp->m_ddev_targp->bt_bdev)) { + xlog_force_shutdown(log, SHUTDOWN_LOG_IO_ERROR); + return; + } - blkdev_issue_flush(log->l_mp->m_ddev_targp->bt_bdev)) - goto shutdown; } if (iclog->ic_flags & XLOG_ICL_NEED_FUA) iclog->ic_bio.bi_opf |= REQ_FUA; iclog->ic_flags &= ~(XLOG_ICL_NEED_FLUSH | XLOG_ICL_NEED_FUA); + if (xlog_map_iclog_data(&iclog->ic_bio, iclog->ic_data, count)) { + xlog_force_shutdown(log, SHUTDOWN_LOG_IO_ERROR); + return; + } - if (xlog_map_iclog_data(&iclog->ic_bio, iclog->ic_data, count)) - goto shutdown; - if (is_vmalloc_addr(iclog->ic_data)) flush_kernel_vmap_range(iclog->ic_data, count); @@ -1971,12 +1976,6 @@ } submit_bio(&iclog->ic_bio); - return; -shutdown: - xlog_force_shutdown(log, SHUTDOWN_LOG_IO_ERROR); -sync: - xlog_state_done_syncing(iclog); - up(&iclog->ic_sema); } /* reverted: --- linux-6.5.0/fs/xfs/xfs_log_recover.c +++ linux-6.5.0.orig/fs/xfs/xfs_log_recover.c @@ -2511,7 +2511,7 @@ list_for_each_entry_safe(dfc, next, capture_list, dfc_list) { list_del_init(&dfc->dfc_list); + xfs_defer_ops_capture_free(mp, dfc); - xfs_defer_ops_capture_abort(mp, dfc); } } reverted: --- linux-6.5.0/fs/xfs/xfs_reflink.c +++ linux-6.5.0.orig/fs/xfs/xfs_reflink.c @@ -784,7 +784,6 @@ } } del = got; - xfs_trim_extent(&del, *offset_fsb, end_fsb - *offset_fsb); /* Grab the corresponding mapping in the data fork. */ nmaps = 1; @@ -1541,10 +1540,6 @@ if (ret) goto out_unlock; - xfs_iflags_set(src, XFS_IREMAPPING); - if (inode_in != inode_out) - xfs_ilock_demote(src, XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL); - return 0; out_unlock: xfs_iunlock2_io_mmap(src, dest); reverted: --- linux-6.5.0/fs/xfs/xfs_rtalloc.c +++ linux-6.5.0.orig/fs/xfs/xfs_rtalloc.c @@ -212,23 +212,6 @@ } /* - * Make sure we don't run off the end of the rt volume. Be careful that - * adjusting maxlen downwards doesn't cause us to fail the alignment checks. - */ -static inline xfs_extlen_t -xfs_rtallocate_clamp_len( - struct xfs_mount *mp, - xfs_rtblock_t startrtx, - xfs_extlen_t rtxlen, - xfs_extlen_t prod) -{ - xfs_extlen_t ret; - - ret = min(mp->m_sb.sb_rextents, startrtx + rtxlen) - startrtx; - return rounddown(ret, prod); -} - -/* * Attempt to allocate an extent minlen<=len<=maxlen starting from * bitmap block bbno. If we don't get maxlen then use prod to trim * the length, if given. Returns error; returns starting block in *rtblock. @@ -265,7 +248,7 @@ i <= end; i++) { /* Make sure we don't scan off the end of the rt volume. */ + maxlen = min(mp->m_sb.sb_rextents, i + maxlen) - i; - maxlen = xfs_rtallocate_clamp_len(mp, i, maxlen, prod); /* * See if there's a free extent of maxlen starting at i. @@ -372,8 +355,7 @@ int isfree; /* extent is free */ xfs_rtblock_t next; /* next block to try (dummy) */ + ASSERT(minlen % prod == 0 && maxlen % prod == 0); - ASSERT(minlen % prod == 0); - ASSERT(maxlen % prod == 0); /* * Check if the range in question (for maxlen) is free. */ @@ -456,9 +438,7 @@ xfs_rtblock_t n; /* next block to try */ xfs_rtblock_t r; /* result block */ + ASSERT(minlen % prod == 0 && maxlen % prod == 0); - ASSERT(minlen % prod == 0); - ASSERT(maxlen % prod == 0); - /* * If the block number given is off the end, silently set it to * the last block. @@ -467,7 +447,7 @@ bno = mp->m_sb.sb_rextents - 1; /* Make sure we don't run off the end of the rt volume. */ + maxlen = min(mp->m_sb.sb_rextents, bno + maxlen) - bno; - maxlen = xfs_rtallocate_clamp_len(mp, bno, maxlen, prod); if (maxlen < minlen) { *rtblock = NULLRTBLOCK; return 0; @@ -658,8 +638,7 @@ xfs_rtblock_t r; /* result block number */ xfs_suminfo_t sum; /* summary information for extents */ + ASSERT(minlen % prod == 0 && maxlen % prod == 0); - ASSERT(minlen % prod == 0); - ASSERT(maxlen % prod == 0); ASSERT(maxlen != 0); /* @@ -975,7 +954,7 @@ return -EINVAL; /* Unsupported realtime features. */ + if (xfs_has_rmapbt(mp) || xfs_has_reflink(mp)) - if (xfs_has_rmapbt(mp) || xfs_has_reflink(mp) || xfs_has_quota(mp)) return -EOPNOTSUPP; nrblocks = in->newblocks; reverted: --- linux-6.5.0/fs/xfs/xfs_rtalloc.h +++ linux-6.5.0.orig/fs/xfs/xfs_rtalloc.h @@ -58,10 +58,6 @@ xfs_rtblock_t bno, /* starting block number to free */ xfs_extlen_t len); /* length of extent freed */ -/* Same as above, but in units of rt blocks. */ -int xfs_rtfree_blocks(struct xfs_trans *tp, xfs_fsblock_t rtbno, - xfs_filblks_t rtlen); - /* * Initialize realtime fields in the mount structure. */ @@ -141,17 +137,16 @@ bool *is_free); int xfs_rtalloc_reinit_frextents(struct xfs_mount *mp); #else +# define xfs_rtallocate_extent(t,b,min,max,l,f,p,rb) (ENOSYS) +# define xfs_rtfree_extent(t,b,l) (ENOSYS) +# define xfs_rtpick_extent(m,t,l,rb) (ENOSYS) +# define xfs_growfs_rt(mp,in) (ENOSYS) +# define xfs_rtalloc_query_range(t,l,h,f,p) (ENOSYS) +# define xfs_rtalloc_query_all(m,t,f,p) (ENOSYS) +# define xfs_rtbuf_get(m,t,b,i,p) (ENOSYS) +# define xfs_verify_rtbno(m, r) (false) +# define xfs_rtalloc_extent_is_free(m,t,s,l,i) (ENOSYS) +# define xfs_rtalloc_reinit_frextents(m) (0) -# define xfs_rtallocate_extent(t,b,min,max,l,f,p,rb) (-ENOSYS) -# define xfs_rtfree_extent(t,b,l) (-ENOSYS) -# define xfs_rtfree_blocks(t,rb,rl) (-ENOSYS) -# define xfs_rtpick_extent(m,t,l,rb) (-ENOSYS) -# define xfs_growfs_rt(mp,in) (-ENOSYS) -# define xfs_rtalloc_query_range(m,t,l,h,f,p) (-ENOSYS) -# define xfs_rtalloc_query_all(m,t,f,p) (-ENOSYS) -# define xfs_rtbuf_get(m,t,b,i,p) (-ENOSYS) -# define xfs_verify_rtbno(m, r) (false) -# define xfs_rtalloc_extent_is_free(m,t,s,l,i) (-ENOSYS) -# define xfs_rtalloc_reinit_frextents(m) (0) static inline int /* error */ xfs_rtmount_init( xfs_mount_t *mp) /* file system mount structure */ @@ -162,7 +157,7 @@ xfs_warn(mp, "Not built with CONFIG_XFS_RT"); return -ENOSYS; } +# define xfs_rtmount_inodes(m) (((mp)->m_sb.sb_rblocks == 0)? 0 : (ENOSYS)) -# define xfs_rtmount_inodes(m) (((mp)->m_sb.sb_rblocks == 0)? 0 : (-ENOSYS)) # define xfs_rtunmount_inodes(m) #endif /* CONFIG_XFS_RT */ reverted: --- linux-6.5.0/fs/zonefs/file.c +++ linux-6.5.0.orig/fs/zonefs/file.c @@ -348,12 +348,7 @@ struct zonefs_inode_info *zi = ZONEFS_I(inode); if (error) { + zonefs_io_error(inode, true); - /* - * For Sync IOs, error recovery is called from - * zonefs_file_dio_write(). - */ - if (!is_sync_kiocb(iocb)) - zonefs_io_error(inode, true); return error; } @@ -496,14 +491,6 @@ ret = -EINVAL; goto inode_unlock; } - /* - * Advance the zone write pointer offset. This assumes that the - * IO will succeed, which is OK to do because we do not allow - * partial writes (IOMAP_DIO_PARTIAL is not set) and if the IO - * fails, the error path will correct the write pointer offset. - */ - z->z_wpoffset += count; - zonefs_inode_account_active(inode); mutex_unlock(&zi->i_truncate_mutex); } @@ -517,19 +504,20 @@ if (ret == -ENOTBLK) ret = -EBUSY; + if (zonefs_zone_is_seq(z) && + (ret > 0 || ret == -EIOCBQUEUED)) { + if (ret > 0) + count = ret; + + /* + * Update the zone write pointer offset assuming the write + * operation succeeded. If it did not, the error recovery path + * will correct it. Also do active seq file accounting. + */ + mutex_lock(&zi->i_truncate_mutex); + z->z_wpoffset += count; + zonefs_inode_account_active(inode); + mutex_unlock(&zi->i_truncate_mutex); - /* - * For a failed IO or partial completion, trigger error recovery - * to update the zone write pointer offset to a correct value. - * For asynchronous IOs, zonefs_file_write_dio_end_io() may already - * have executed error recovery if the IO already completed when we - * reach here. However, we cannot know that and execute error recovery - * again (that will not change anything). - */ - if (zonefs_zone_is_seq(z)) { - if (ret > 0 && ret != count) - ret = -EIO; - if (ret < 0 && ret != -EIOCBQUEUED) - zonefs_io_error(inode, true); } inode_unlock: reverted: --- linux-6.5.0/fs/zonefs/super.c +++ linux-6.5.0.orig/fs/zonefs/super.c @@ -246,18 +246,16 @@ z->z_mode = inode->i_mode; } +struct zonefs_ioerr_data { + struct inode *inode; + bool write; +}; + static int zonefs_io_error_cb(struct blk_zone *zone, unsigned int idx, void *data) { + struct zonefs_ioerr_data *err = data; + struct inode *inode = err->inode; - struct blk_zone *z = data; - - *z = *zone; - return 0; -} - -static void zonefs_handle_io_error(struct inode *inode, struct blk_zone *zone, - bool write) -{ struct zonefs_zone *z = zonefs_inode_zone(inode); struct super_block *sb = inode->i_sb; struct zonefs_sb_info *sbi = ZONEFS_SB(sb); @@ -272,8 +270,8 @@ data_size = zonefs_check_zone_condition(sb, z, zone); isize = i_size_read(inode); if (!(z->z_flags & (ZONEFS_ZONE_READONLY | ZONEFS_ZONE_OFFLINE)) && + !err->write && isize == data_size) + return 0; - !write && isize == data_size) - return; /* * At this point, we detected either a bad zone or an inconsistency @@ -294,7 +292,7 @@ * In all cases, warn about inode size inconsistency and handle the * IO error according to the zone condition and to the mount options. */ + if (zonefs_zone_is_seq(z) && isize != data_size) - if (isize != data_size) zonefs_warn(sb, "inode %lu: invalid size %lld (should be %lld)\n", inode->i_ino, isize, data_size); @@ -354,6 +352,8 @@ zonefs_i_size_write(inode, data_size); z->z_wpoffset = data_size; zonefs_inode_account_active(inode); + + return 0; } /* @@ -367,25 +367,23 @@ { struct zonefs_zone *z = zonefs_inode_zone(inode); struct super_block *sb = inode->i_sb; + struct zonefs_sb_info *sbi = ZONEFS_SB(sb); unsigned int noio_flag; + unsigned int nr_zones = 1; + struct zonefs_ioerr_data err = { + .inode = inode, + .write = write, + }; - struct blk_zone zone; int ret; /* + * The only files that have more than one zone are conventional zone + * files with aggregated conventional zones, for which the inode zone + * size is always larger than the device zone size. + */ + if (z->z_size > bdev_zone_sectors(sb->s_bdev)) + nr_zones = z->z_size >> + (sbi->s_zone_sectors_shift + SECTOR_SHIFT); - * Conventional zone have no write pointer and cannot become read-only - * or offline. So simply fake a report for a single or aggregated zone - * and let zonefs_handle_io_error() correct the zone inode information - * according to the mount options. - */ - if (!zonefs_zone_is_seq(z)) { - zone.start = z->z_sector; - zone.len = z->z_size >> SECTOR_SHIFT; - zone.wp = zone.start + zone.len; - zone.type = BLK_ZONE_TYPE_CONVENTIONAL; - zone.cond = BLK_ZONE_COND_NOT_WP; - zone.capacity = zone.len; - goto handle_io_error; - } /* * Memory allocations in blkdev_report_zones() can trigger a memory @@ -396,20 +394,12 @@ * the GFP_NOIO context avoids both problems. */ noio_flag = memalloc_noio_save(); + ret = blkdev_report_zones(sb->s_bdev, z->z_sector, nr_zones, + zonefs_io_error_cb, &err); + if (ret != nr_zones) - ret = blkdev_report_zones(sb->s_bdev, z->z_sector, 1, - zonefs_io_error_cb, &zone); - memalloc_noio_restore(noio_flag); - - if (ret != 1) { zonefs_err(sb, "Get inode %lu zone information failed %d\n", inode->i_ino, ret); + memalloc_noio_restore(noio_flag); - zonefs_warn(sb, "remounting filesystem read-only\n"); - sb->s_flags |= SB_RDONLY; - return; - } - -handle_io_error: - zonefs_handle_io_error(inode, &zone, write); } static struct kmem_cache *zonefs_inode_cachep; diff -u linux-6.5.0/include/acpi/acpi_bus.h linux-6.5.0/include/acpi/acpi_bus.h --- linux-6.5.0/include/acpi/acpi_bus.h +++ linux-6.5.0/include/acpi/acpi_bus.h @@ -816,16 +816,11 @@ { acpi_dev_put(adev); } - -int acpi_wait_for_acpi_ipmi(void); - #else /* CONFIG_ACPI */ static inline int register_acpi_bus_type(void *bus) { return 0; } static inline int unregister_acpi_bus_type(void *bus) { return 0; } -static inline int acpi_wait_for_acpi_ipmi(void) { return 0; } - #endif /* CONFIG_ACPI */ #endif /*__ACPI_BUS_H__*/ reverted: --- linux-6.5.0/include/asm-generic/cacheflush.h +++ linux-6.5.0.orig/include/asm-generic/cacheflush.h @@ -98,12 +98,6 @@ } #endif -#ifndef flush_cache_vmap_early -static inline void flush_cache_vmap_early(unsigned long start, unsigned long end) -{ -} -#endif - #ifndef flush_cache_vunmap static inline void flush_cache_vunmap(unsigned long start, unsigned long end) { reverted: --- linux-6.5.0/include/asm-generic/vmlinux.lds.h +++ linux-6.5.0.orig/include/asm-generic/vmlinux.lds.h @@ -363,6 +363,7 @@ *(.ref.data) \ *(.data..shared_aligned) /* percpu related */ \ MEM_KEEP(init.data*) \ + MEM_KEEP(exit.data*) \ *(.data.unlikely) \ __start_once = .; \ *(.data.once) \ @@ -527,6 +528,7 @@ __init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \ *(.ref.rodata) \ MEM_KEEP(init.rodata) \ + MEM_KEEP(exit.rodata) \ } \ \ /* Built-in module parameters. */ \ @@ -579,6 +581,7 @@ *(.ref.text) \ *(.text.asan.* .text.tsan.*) \ MEM_KEEP(init.text*) \ + MEM_KEEP(exit.text*) \ /* sched.text is aling to function alignment to secure we have same @@ -718,10 +721,13 @@ *(.exit.data .exit.data.*) \ *(.fini_array .fini_array.*) \ *(.dtors .dtors.*) \ + MEM_DISCARD(exit.data*) \ + MEM_DISCARD(exit.rodata*) #define EXIT_TEXT \ *(.exit.text) \ *(.text.exit) \ + MEM_DISCARD(exit.text) #define EXIT_CALL \ *(.exitcall.exit) reverted: --- linux-6.5.0/include/linux/backing-dev-defs.h +++ linux-6.5.0.orig/include/linux/backing-dev-defs.h @@ -141,6 +141,8 @@ struct delayed_work dwork; /* work item used for writeback */ struct delayed_work bw_dwork; /* work item used for bandwidth estimate */ + unsigned long dirty_sleep; /* last wait */ + struct list_head bdi_node; /* anchored at bdi->wb_list */ #ifdef CONFIG_CGROUP_WRITEBACK @@ -177,11 +179,6 @@ * any dirty wbs, which is depended upon by bdi_has_dirty(). */ atomic_long_t tot_write_bandwidth; - /* - * Jiffies when last process was dirty throttled on this bdi. Used by - * blk-wbt. - */ - unsigned long last_bdp_sleep; struct bdi_writeback wb; /* the root writeback info for this bdi */ struct list_head wb_list; /* list of all wbs */ diff -u linux-6.5.0/include/linux/ceph/messenger.h linux-6.5.0/include/linux/ceph/messenger.h --- linux-6.5.0/include/linux/ceph/messenger.h +++ linux-6.5.0/include/linux/ceph/messenger.h @@ -283,7 +283,7 @@ struct kref kref; bool more_to_follow; bool needs_out_seq; - u64 sparse_read_total; + bool sparse_read; int front_alloc_len; struct ceph_msgpool *pool; reverted: --- linux-6.5.0/include/linux/compiler-gcc.h +++ linux-6.5.0.orig/include/linux/compiler-gcc.h @@ -66,26 +66,6 @@ __builtin_unreachable(); \ } while (0) -/* - * GCC 'asm goto' with outputs miscompiles certain code sequences: - * - * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113921 - * - * Work around it via the same compiler barrier quirk that we used - * to use for the old 'asm goto' workaround. - * - * Also, always mark such 'asm goto' statements as volatile: all - * asm goto statements are supposed to be volatile as per the - * documentation, but some versions of gcc didn't actually do - * that for asms with outputs: - * - * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98619 - */ -#ifdef CONFIG_GCC_ASM_GOTO_OUTPUT_WORKAROUND -#define asm_goto_output(x...) \ - do { asm volatile goto(x); asm (""); } while (0) -#endif - #if defined(CONFIG_ARCH_USE_BUILTIN_BSWAP) #define __HAVE_BUILTIN_BSWAP32__ #define __HAVE_BUILTIN_BSWAP64__ reverted: --- linux-6.5.0/include/linux/compiler_types.h +++ linux-6.5.0.orig/include/linux/compiler_types.h @@ -324,15 +324,8 @@ # define __realloc_size(x, ...) #endif +#ifndef asm_volatile_goto +#define asm_volatile_goto(x...) asm goto(x) -/* - * Some versions of gcc do not mark 'asm goto' volatile: - * - * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103979 - * - * We do it here by hand, because it doesn't hurt. - */ -#ifndef asm_goto_output -#define asm_goto_output(x...) asm volatile goto(x) #endif #ifdef CONFIG_CC_HAS_ASM_INLINE reverted: --- linux-6.5.0/include/linux/dmaengine.h +++ linux-6.5.0.orig/include/linux/dmaengine.h @@ -955,8 +955,7 @@ static inline bool is_slave_direction(enum dma_transfer_direction direction) { + return (direction == DMA_MEM_TO_DEV) || (direction == DMA_DEV_TO_MEM); - return (direction == DMA_MEM_TO_DEV) || (direction == DMA_DEV_TO_MEM) || - (direction == DMA_DEV_TO_DEV); } static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single( diff -u linux-6.5.0/include/linux/hrtimer.h linux-6.5.0/include/linux/hrtimer.h --- linux-6.5.0/include/linux/hrtimer.h +++ linux-6.5.0/include/linux/hrtimer.h @@ -197,7 +197,6 @@ * @max_hang_time: Maximum time spent in hrtimer_interrupt * @softirq_expiry_lock: Lock which is taken while softirq based hrtimer are * expired - * @online: CPU is online from an hrtimers point of view * @timer_waiters: A hrtimer_cancel() invocation waits for the timer * callback to finish. * @expires_next: absolute time of the next event, is required for remote @@ -220,8 +219,7 @@ unsigned int hres_active : 1, in_hrtirq : 1, hang_detected : 1, - softirq_activated : 1, - online : 1; + softirq_activated : 1; #ifdef CONFIG_HIGH_RES_TIMERS unsigned int nr_events; unsigned short nr_retries; reverted: --- linux-6.5.0/include/linux/hyperv.h +++ linux-6.5.0.orig/include/linux/hyperv.h @@ -348,7 +348,7 @@ u8 sender_owns_set; u8 reserved; u32 range_cnt; + struct vmtransfer_page_range ranges[1]; - struct vmtransfer_page_range ranges[]; } __packed; struct vmgpadl_packet_header { reverted: --- linux-6.5.0/include/linux/iio/adc/ad_sigma_delta.h +++ linux-6.5.0.orig/include/linux/iio/adc/ad_sigma_delta.h @@ -8,8 +8,6 @@ #ifndef __AD_SIGMA_DELTA_H__ #define __AD_SIGMA_DELTA_H__ -#include - enum ad_sigma_delta_mode { AD_SD_MODE_CONTINUOUS = 0, AD_SD_MODE_SINGLE = 1, @@ -101,7 +99,7 @@ * 'rx_buf' is up to 32 bits per sample + 64 bit timestamp, * rounded to 16 bytes to take into account padding. */ + uint8_t tx_buf[4] ____cacheline_aligned; - uint8_t tx_buf[4] __aligned(IIO_DMA_MINALIGN); uint8_t rx_buf[16] __aligned(8); }; reverted: --- linux-6.5.0/include/linux/iio/common/st_sensors.h +++ linux-6.5.0.orig/include/linux/iio/common/st_sensors.h @@ -258,9 +258,9 @@ bool hw_irq_trigger; s64 hw_timestamp; + char buffer_data[ST_SENSORS_MAX_BUFFER_SIZE] ____cacheline_aligned; + struct mutex odr_lock; - - char buffer_data[ST_SENSORS_MAX_BUFFER_SIZE] __aligned(IIO_DMA_MINALIGN); }; #ifdef CONFIG_IIO_BUFFER reverted: --- linux-6.5.0/include/linux/iio/imu/adis.h +++ linux-6.5.0.orig/include/linux/iio/imu/adis.h @@ -11,7 +11,6 @@ #include #include -#include #include #define ADIS_WRITE_REG(reg) ((0x80 | (reg))) @@ -132,7 +131,7 @@ unsigned long irq_flag; void *buffer; + u8 tx[10] ____cacheline_aligned; - u8 tx[10] __aligned(IIO_DMA_MINALIGN); u8 rx[4]; }; reverted: --- linux-6.5.0/include/linux/init.h +++ linux-6.5.0.orig/include/linux/init.h @@ -89,6 +89,9 @@ __latent_entropy #define __meminitdata __section(".meminit.data") #define __meminitconst __section(".meminit.rodata") +#define __memexit __section(".memexit.text") __exitused __cold notrace +#define __memexitdata __section(".memexit.data") +#define __memexitconst __section(".memexit.rodata") /* For assembly routines */ #define __HEAD .section ".head.text","ax" reverted: --- linux-6.5.0/include/linux/netfilter/ipset/ip_set.h +++ linux-6.5.0.orig/include/linux/netfilter/ipset/ip_set.h @@ -186,8 +186,6 @@ /* Return true if "b" set is the same as "a" * according to the create set parameters */ bool (*same_set)(const struct ip_set *a, const struct ip_set *b); - /* Cancel ongoing garbage collectors before destroying the set*/ - void (*cancel_gc)(struct ip_set *set); /* Region-locking is used */ bool region_lock; }; @@ -244,8 +242,6 @@ /* A generic IP set */ struct ip_set { - /* For call_cru in destroy */ - struct rcu_head rcu; /* The name of the set */ char name[IPSET_MAXNAMELEN]; /* Lock protecting the set data */ reverted: --- linux-6.5.0/include/linux/ptrace.h +++ linux-6.5.0.orig/include/linux/ptrace.h @@ -393,10 +393,6 @@ #define current_user_stack_pointer() user_stack_pointer(current_pt_regs()) #endif -#ifndef exception_ip -#define exception_ip(x) instruction_pointer(x) -#endif - extern int task_current_syscall(struct task_struct *target, struct syscall_info *info); extern void sigaction_compat_abi(struct k_sigaction *act, struct k_sigaction *oact); diff -u linux-6.5.0/include/linux/serial_core.h linux-6.5.0/include/linux/serial_core.h --- linux-6.5.0/include/linux/serial_core.h +++ linux-6.5.0/include/linux/serial_core.h @@ -748,17 +748,8 @@ void uart_write_wakeup(struct uart_port *port); -/** - * enum UART_TX_FLAGS -- flags for uart_port_tx_flags() - * - * @UART_TX_NOSTOP: don't call port->ops->stop_tx() on empty buffer - */ -enum UART_TX_FLAGS { - UART_TX_NOSTOP = BIT(0), -}; - -#define __uart_port_tx(uport, ch, flags, tx_ready, put_char, tx_done, \ - for_test, for_post) \ +#define __uart_port_tx(uport, ch, tx_ready, put_char, tx_done, for_test, \ + for_post) \ ({ \ struct uart_port *__port = (uport); \ struct circ_buf *xmit = &__port->state->xmit; \ @@ -786,7 +777,7 @@ if (pending < WAKEUP_CHARS) { \ uart_write_wakeup(__port); \ \ - if (!((flags) & UART_TX_NOSTOP) && pending == 0) \ + if (pending == 0) \ __port->ops->stop_tx(__port); \ } \ \ @@ -821,7 +812,7 @@ */ #define uart_port_tx_limited(port, ch, count, tx_ready, put_char, tx_done) ({ \ unsigned int __count = (count); \ - __uart_port_tx(port, ch, 0, tx_ready, put_char, tx_done, __count, \ + __uart_port_tx(port, ch, tx_ready, put_char, tx_done, __count, \ __count--); \ }) @@ -835,21 +826,8 @@ * See uart_port_tx_limited() for more details. */ #define uart_port_tx(port, ch, tx_ready, put_char) \ - __uart_port_tx(port, ch, 0, tx_ready, put_char, ({}), true, ({})) - + __uart_port_tx(port, ch, tx_ready, put_char, ({}), true, ({})) -/** - * uart_port_tx_flags -- transmit helper for uart_port with flags - * @port: uart port - * @ch: variable to store a character to be written to the HW - * @flags: %UART_TX_NOSTOP or similar - * @tx_ready: can HW accept more data function - * @put_char: function to write a character - * - * See uart_port_tx_limited() for more details. - */ -#define uart_port_tx_flags(port, ch, flags, tx_ready, put_char) \ - __uart_port_tx(port, ch, flags, tx_ready, put_char, ({}), true, ({})) /* * Baud rate helpers. */ diff -u linux-6.5.0/include/trace/events/rxrpc.h linux-6.5.0/include/trace/events/rxrpc.h --- linux-6.5.0/include/trace/events/rxrpc.h +++ linux-6.5.0/include/trace/events/rxrpc.h @@ -128,7 +128,6 @@ EM(rxrpc_skb_eaten_by_unshare_nomem, "ETN unshar-nm") \ EM(rxrpc_skb_get_conn_secured, "GET conn-secd") \ EM(rxrpc_skb_get_conn_work, "GET conn-work") \ - EM(rxrpc_skb_get_last_nack, "GET last-nack") \ EM(rxrpc_skb_get_local_work, "GET locl-work") \ EM(rxrpc_skb_get_reject_work, "GET rej-work ") \ EM(rxrpc_skb_get_to_recvmsg, "GET to-recv ") \ @@ -142,7 +141,6 @@ EM(rxrpc_skb_put_error_report, "PUT error-rep") \ EM(rxrpc_skb_put_input, "PUT input ") \ EM(rxrpc_skb_put_jumbo_subpacket, "PUT jumbo-sub") \ - EM(rxrpc_skb_put_last_nack, "PUT last-nack") \ EM(rxrpc_skb_put_purge, "PUT purge ") \ EM(rxrpc_skb_put_rotate, "PUT rotate ") \ EM(rxrpc_skb_put_unknown, "PUT unknown ") \ @@ -1551,7 +1549,7 @@ memcpy(&__entry->sum, summary, sizeof(__entry->sum)); ), - TP_printk("c=%08x r=%08x %s q=%08x %s cw=%u ss=%u nA=%u,%u+%u,%u b=%u u=%u d=%u l=%x%s%s%s", + TP_printk("c=%08x r=%08x %s q=%08x %s cw=%u ss=%u nA=%u,%u+%u r=%u b=%u u=%u d=%u l=%x%s%s%s", __entry->call, __entry->ack_serial, __print_symbolic(__entry->sum.ack_reason, rxrpc_ack_names), @@ -1559,9 +1557,9 @@ __print_symbolic(__entry->sum.mode, rxrpc_congest_modes), __entry->sum.cwnd, __entry->sum.ssthresh, - __entry->sum.nr_acks, __entry->sum.nr_retained_nacks, + __entry->sum.nr_acks, __entry->sum.saw_nacks, __entry->sum.nr_new_acks, - __entry->sum.nr_new_nacks, + __entry->sum.nr_rot_new_acks, __entry->top - __entry->hard_ack, __entry->sum.cumulative_acks, __entry->sum.dup_acks, reverted: --- linux-6.5.0/include/uapi/linux/netfilter/nf_tables.h +++ linux-6.5.0.orig/include/uapi/linux/netfilter/nf_tables.h @@ -284,11 +284,9 @@ /** * enum nft_rule_compat_flags - nf_tables rule compat flags * - * @NFT_RULE_COMPAT_F_UNUSED: unused * @NFT_RULE_COMPAT_F_INV: invert the check result */ enum nft_rule_compat_flags { - NFT_RULE_COMPAT_F_UNUSED = (1 << 0), NFT_RULE_COMPAT_F_INV = (1 << 1), NFT_RULE_COMPAT_F_MASK = NFT_RULE_COMPAT_F_INV, }; diff -u linux-6.5.0/init/Kconfig linux-6.5.0/init/Kconfig --- linux-6.5.0/init/Kconfig +++ linux-6.5.0/init/Kconfig @@ -90,15 +90,6 @@ # Detect buggy gcc and clang, fixed in gcc-11 clang-14. def_bool $(success,echo 'int foo(int *x) { asm goto (".long (%l[bar]) - .": "+m"(*x) ::: bar); return *x; bar: return 0; }' | $CC -x c - -c -o /dev/null) -config GCC_ASM_GOTO_OUTPUT_WORKAROUND - bool - depends on CC_IS_GCC && CC_HAS_ASM_GOTO_OUTPUT - # Fixed in GCC 14, 13.3, 12.4 and 11.5 - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113921 - default y if GCC_VERSION < 110500 - default y if GCC_VERSION >= 120000 && GCC_VERSION < 120400 - default y if GCC_VERSION >= 130000 && GCC_VERSION < 130300 - config TOOLS_SUPPORT_RELR def_bool $(success,env "CC=$(CC)" "LD=$(LD)" "NM=$(NM)" "OBJCOPY=$(OBJCOPY)" $(srctree)/scripts/tools-support-relr.sh) diff -u linux-6.5.0/io_uring/io_uring.h linux-6.5.0/io_uring/io_uring.h --- linux-6.5.0/io_uring/io_uring.h +++ linux-6.5.0/io_uring/io_uring.h @@ -31,13 +31,6 @@ IOU_ISSUE_SKIP_COMPLETE = -EIOCBQUEUED, /* - * Requeue the task_work to restart operations on this request. The - * actual value isn't important, should just be not an otherwise - * valid error code, yet less than -MAX_ERRNO and valid internally. - */ - IOU_REQUEUE = -3072, - - /* * Intended only when both IO_URING_F_MULTISHOT is passed * to indicate to the poll runner that multishot should be * removed and the result is set on req->cqe.res. diff -u linux-6.5.0/io_uring/net.c linux-6.5.0/io_uring/net.c --- linux-6.5.0/io_uring/net.c +++ linux-6.5.0/io_uring/net.c @@ -60,7 +60,6 @@ unsigned len; unsigned done_io; unsigned msg_flags; - unsigned nr_multishot_loops; u16 flags; /* initialised and used only by !msg send variants */ u16 addr_len; @@ -71,13 +70,6 @@ struct io_kiocb *notif; }; -/* - * Number of times we'll try and do receives if there's more data. If we - * exceed this limit, then add us to the back of the queue and retry from - * there. This helps fairness between flooding clients. - */ -#define MULTISHOT_MAX_RETRY 32 - static inline bool io_check_multishot(struct io_kiocb *req, unsigned int issue_flags) { @@ -619,7 +611,6 @@ sr->msg_flags |= MSG_CMSG_COMPAT; #endif sr->done_io = 0; - sr->nr_multishot_loops = 0; return 0; } @@ -654,35 +645,23 @@ return true; } - if (mshot_finished) - goto finish; - - /* - * Fill CQE for this receive and see if we should keep trying to - * receive from this socket. - */ - if (io_fill_cqe_req_aux(req, issue_flags & IO_URING_F_COMPLETE_DEFER, - *ret, cflags | IORING_CQE_F_MORE)) { - struct io_sr_msg *sr = io_kiocb_to_cmd(req, struct io_sr_msg); - int mshot_retry_ret = IOU_ISSUE_SKIP_COMPLETE; - - io_recv_prep_retry(req); - /* Known not-empty or unknown state, retry */ - if (cflags & IORING_CQE_F_SOCK_NONEMPTY || msg->msg_inq == -1) { - if (sr->nr_multishot_loops++ < MULTISHOT_MAX_RETRY) + if (!mshot_finished) { + if (io_fill_cqe_req_aux(req, issue_flags & IO_URING_F_COMPLETE_DEFER, + *ret, cflags | IORING_CQE_F_MORE)) { + io_recv_prep_retry(req); + /* Known not-empty or unknown state, retry */ + if (cflags & IORING_CQE_F_SOCK_NONEMPTY || + msg->msg_inq == -1) return false; - /* mshot retries exceeded, force a requeue */ - sr->nr_multishot_loops = 0; - mshot_retry_ret = IOU_REQUEUE; + if (issue_flags & IO_URING_F_MULTISHOT) + *ret = IOU_ISSUE_SKIP_COMPLETE; + else + *ret = -EAGAIN; + return true; } - if (issue_flags & IO_URING_F_MULTISHOT) - *ret = mshot_retry_ret; - else - *ret = -EAGAIN; - return true; + /* Otherwise stop multishot but use the current result. */ } - /* Otherwise stop multishot but use the current result. */ -finish: + io_req_set_res(req, *ret, cflags); if (issue_flags & IO_URING_F_MULTISHOT) @@ -923,7 +902,6 @@ if (!buf) return -ENOBUFS; sr->buf = buf; - sr->len = len; } ret = import_ubuf(ITER_DEST, sr->buf, len, &msg.msg_iter); @@ -1372,7 +1350,7 @@ * has already been done */ if (issue_flags & IO_URING_F_MULTISHOT) - return IOU_ISSUE_SKIP_COMPLETE; + ret = IOU_ISSUE_SKIP_COMPLETE; return ret; } if (ret == -ERESTARTSYS) @@ -1397,8 +1375,7 @@ ret, IORING_CQE_F_MORE)) goto retry; - io_req_set_res(req, ret, 0); - return IOU_STOP_MULTISHOT; + return -ECANCELED; } int io_socket_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) diff -u linux-6.5.0/io_uring/poll.c linux-6.5.0/io_uring/poll.c --- linux-6.5.0/io_uring/poll.c +++ linux-6.5.0/io_uring/poll.c @@ -226,24 +226,8 @@ IOU_POLL_NO_ACTION = 1, IOU_POLL_REMOVE_POLL_USE_RES = 2, IOU_POLL_REISSUE = 3, - IOU_POLL_REQUEUE = 4, }; -static void __io_poll_execute(struct io_kiocb *req, int mask) -{ - io_req_set_res(req, mask, 0); - req->io_task_work.func = io_poll_task_func; - - trace_io_uring_task_add(req, mask); - io_req_task_work_add(req); -} - -static inline void io_poll_execute(struct io_kiocb *req, int res) -{ - if (io_poll_get_ownership(req)) - __io_poll_execute(req, res); -} - /* * All poll tw should go through this. Checks for poll events, manages * references, does rewait, etc. @@ -325,8 +309,6 @@ int ret = io_poll_issue(req, ts); if (ret == IOU_STOP_MULTISHOT) return IOU_POLL_REMOVE_POLL_USE_RES; - else if (ret == IOU_REQUEUE) - return IOU_POLL_REQUEUE; if (ret < 0) return ret; } @@ -349,12 +331,8 @@ int ret; ret = io_poll_check_events(req, ts); - if (ret == IOU_POLL_NO_ACTION) { - return; - } else if (ret == IOU_POLL_REQUEUE) { - __io_poll_execute(req, 0); + if (ret == IOU_POLL_NO_ACTION) return; - } io_poll_remove_entries(req); io_poll_tw_hash_eject(req, ts); @@ -386,6 +364,21 @@ } } +static void __io_poll_execute(struct io_kiocb *req, int mask) +{ + io_req_set_res(req, mask, 0); + req->io_task_work.func = io_poll_task_func; + + trace_io_uring_task_add(req, mask); + io_req_task_work_add(req); +} + +static inline void io_poll_execute(struct io_kiocb *req, int res) +{ + if (io_poll_get_ownership(req)) + __io_poll_execute(req, res); +} + static void io_poll_cancel_req(struct io_kiocb *req) { io_poll_mark_cancelled(req); reverted: --- linux-6.5.0/kernel/sched/membarrier.c +++ linux-6.5.0.orig/kernel/sched/membarrier.c @@ -162,9 +162,6 @@ | MEMBARRIER_PRIVATE_EXPEDITED_RSEQ_BITMASK \ | MEMBARRIER_CMD_GET_REGISTRATIONS) -static DEFINE_MUTEX(membarrier_ipi_mutex); -#define SERIALIZE_IPI() guard(mutex)(&membarrier_ipi_mutex) - static void ipi_mb(void *info) { smp_mb(); /* IPIs should be serializing but paranoid. */ @@ -262,7 +259,6 @@ if (!zalloc_cpumask_var(&tmpmask, GFP_KERNEL)) return -ENOMEM; - SERIALIZE_IPI(); cpus_read_lock(); rcu_read_lock(); for_each_online_cpu(cpu) { @@ -351,7 +347,6 @@ if (cpu_id < 0 && !zalloc_cpumask_var(&tmpmask, GFP_KERNEL)) return -ENOMEM; - SERIALIZE_IPI(); cpus_read_lock(); if (cpu_id >= 0) { @@ -465,7 +460,6 @@ * between threads which are users of @mm has its membarrier state * updated. */ - SERIALIZE_IPI(); cpus_read_lock(); rcu_read_lock(); for_each_online_cpu(cpu) { diff -u linux-6.5.0/kernel/sched/rt.c linux-6.5.0/kernel/sched/rt.c --- linux-6.5.0/kernel/sched/rt.c +++ linux-6.5.0/kernel/sched/rt.c @@ -37,8 +37,6 @@ .maxlen = sizeof(unsigned int), .mode = 0644, .proc_handler = sched_rt_handler, - .extra1 = SYSCTL_ONE, - .extra2 = SYSCTL_INT_MAX, }, { .procname = "sched_rt_runtime_us", @@ -46,8 +44,6 @@ .maxlen = sizeof(int), .mode = 0644, .proc_handler = sched_rt_handler, - .extra1 = SYSCTL_NEG_ONE, - .extra2 = SYSCTL_INT_MAX, }, { .procname = "sched_rr_timeslice_ms", @@ -2993,6 +2989,9 @@ #ifdef CONFIG_SYSCTL static int sched_rt_global_validate(void) { + if (sysctl_sched_rt_period <= 0) + return -EINVAL; + if ((sysctl_sched_rt_runtime != RUNTIME_INF) && ((sysctl_sched_rt_runtime > sysctl_sched_rt_period) || ((u64)sysctl_sched_rt_runtime * @@ -3023,7 +3022,7 @@ old_period = sysctl_sched_rt_period; old_runtime = sysctl_sched_rt_runtime; - ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos); + ret = proc_dointvec(table, write, buffer, lenp, ppos); if (!ret && write) { ret = sched_rt_global_validate(); @@ -3067,9 +3066,6 @@ sched_rr_timeslice = sysctl_sched_rr_timeslice <= 0 ? RR_TIMESLICE : msecs_to_jiffies(sysctl_sched_rr_timeslice); - - if (sysctl_sched_rr_timeslice <= 0) - sysctl_sched_rr_timeslice = jiffies_to_msecs(RR_TIMESLICE); } mutex_unlock(&mutex); diff -u linux-6.5.0/kernel/time/hrtimer.c linux-6.5.0/kernel/time/hrtimer.c --- linux-6.5.0/kernel/time/hrtimer.c +++ linux-6.5.0/kernel/time/hrtimer.c @@ -1085,7 +1085,6 @@ enum hrtimer_mode mode) { debug_activate(timer, mode); - WARN_ON_ONCE(!base->cpu_base->online); base->cpu_base->active_bases |= 1 << base->index; @@ -2184,7 +2183,6 @@ cpu_base->softirq_next_timer = NULL; cpu_base->expires_next = KTIME_MAX; cpu_base->softirq_expires_next = KTIME_MAX; - cpu_base->online = 1; hrtimer_cpu_base_init_expiry_lock(cpu_base); return 0; } @@ -2252,7 +2250,6 @@ smp_call_function_single(ncpu, retrigger_next_event, NULL, 0); raw_spin_unlock(&new_base->lock); - old_base->online = 0; raw_spin_unlock(&old_base->lock); return 0; diff -u linux-6.5.0/kernel/trace/ftrace.c linux-6.5.0/kernel/trace/ftrace.c --- linux-6.5.0/kernel/trace/ftrace.c +++ linux-6.5.0/kernel/trace/ftrace.c @@ -5325,17 +5325,7 @@ static int register_ftrace_function_nolock(struct ftrace_ops *ops); -/* - * If there are multiple ftrace_ops, use SAVE_REGS by default, so that direct - * call will be jumped from ftrace_regs_caller. Only if the architecture does - * not support ftrace_regs_caller but direct_call, use SAVE_ARGS so that it - * jumps from ftrace_caller for multiple ftrace_ops. - */ -#ifndef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS #define MULTI_FLAGS (FTRACE_OPS_FL_DIRECT | FTRACE_OPS_FL_SAVE_ARGS) -#else -#define MULTI_FLAGS (FTRACE_OPS_FL_DIRECT | FTRACE_OPS_FL_SAVE_REGS) -#endif static int check_direct_multi(struct ftrace_ops *ops) { diff -u linux-6.5.0/kernel/trace/ring_buffer.c linux-6.5.0/kernel/trace/ring_buffer.c --- linux-6.5.0/kernel/trace/ring_buffer.c +++ linux-6.5.0/kernel/trace/ring_buffer.c @@ -1094,7 +1094,7 @@ full = 0; } else { if (!cpumask_test_cpu(cpu, buffer->cpumask)) - return EPOLLERR; + return -EINVAL; cpu_buffer = buffer->buffers[cpu]; work = &cpu_buffer->irq_work; diff -u linux-6.5.0/kernel/trace/trace.c linux-6.5.0/kernel/trace/trace.c --- linux-6.5.0/kernel/trace/trace.c +++ linux-6.5.0/kernel/trace/trace.c @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include @@ -2312,7 +2311,7 @@ unsigned *map_cmdline_to_pid; unsigned cmdline_num; int cmdline_idx; - char saved_cmdlines[]; + char *saved_cmdlines; }; static struct saved_cmdlines_buffer *savedcmd; @@ -2326,60 +2325,47 @@ strncpy(get_saved_cmdlines(idx), cmdline, TASK_COMM_LEN); } -static void free_saved_cmdlines_buffer(struct saved_cmdlines_buffer *s) -{ - int order = get_order(sizeof(*s) + s->cmdline_num * TASK_COMM_LEN); - - kfree(s->map_cmdline_to_pid); - kmemleak_free(s); - free_pages((unsigned long)s, order); -} - -static struct saved_cmdlines_buffer *allocate_cmdlines_buffer(unsigned int val) +static int allocate_cmdlines_buffer(unsigned int val, + struct saved_cmdlines_buffer *s) { - struct saved_cmdlines_buffer *s; - struct page *page; - int orig_size, size; - int order; - - /* Figure out how much is needed to hold the given number of cmdlines */ - orig_size = sizeof(*s) + val * TASK_COMM_LEN; - order = get_order(orig_size); - size = 1 << (order + PAGE_SHIFT); - page = alloc_pages(GFP_KERNEL, order); - if (!page) - return NULL; - - s = page_address(page); - kmemleak_alloc(s, size, 1, GFP_KERNEL); - memset(s, 0, sizeof(*s)); - - /* Round up to actual allocation */ - val = (size - sizeof(*s)) / TASK_COMM_LEN; - s->cmdline_num = val; - s->map_cmdline_to_pid = kmalloc_array(val, sizeof(*s->map_cmdline_to_pid), GFP_KERNEL); - if (!s->map_cmdline_to_pid) { - free_saved_cmdlines_buffer(s); - return NULL; + if (!s->map_cmdline_to_pid) + return -ENOMEM; + + s->saved_cmdlines = kmalloc_array(TASK_COMM_LEN, val, GFP_KERNEL); + if (!s->saved_cmdlines) { + kfree(s->map_cmdline_to_pid); + return -ENOMEM; } s->cmdline_idx = 0; + s->cmdline_num = val; memset(&s->map_pid_to_cmdline, NO_CMDLINE_MAP, sizeof(s->map_pid_to_cmdline)); memset(s->map_cmdline_to_pid, NO_CMDLINE_MAP, val * sizeof(*s->map_cmdline_to_pid)); - return s; + return 0; } static int trace_create_savedcmd(void) { - savedcmd = allocate_cmdlines_buffer(SAVED_CMDLINES_DEFAULT); + int ret; - return savedcmd ? 0 : -ENOMEM; + savedcmd = kmalloc(sizeof(*savedcmd), GFP_KERNEL); + if (!savedcmd) + return -ENOMEM; + + ret = allocate_cmdlines_buffer(SAVED_CMDLINES_DEFAULT, savedcmd); + if (ret < 0) { + kfree(savedcmd); + savedcmd = NULL; + return -ENOMEM; + } + + return 0; } int is_tracing_stopped(void) @@ -6088,14 +6074,26 @@ return simple_read_from_buffer(ubuf, cnt, ppos, buf, r); } +static void free_saved_cmdlines_buffer(struct saved_cmdlines_buffer *s) +{ + kfree(s->saved_cmdlines); + kfree(s->map_cmdline_to_pid); + kfree(s); +} + static int tracing_resize_saved_cmdlines(unsigned int val) { struct saved_cmdlines_buffer *s, *savedcmd_temp; - s = allocate_cmdlines_buffer(val); + s = kmalloc(sizeof(*s), GFP_KERNEL); if (!s) return -ENOMEM; + if (allocate_cmdlines_buffer(val, s) < 0) { + kfree(s); + return -ENOMEM; + } + preempt_disable(); arch_spin_lock(&trace_cmdline_lock); savedcmd_temp = savedcmd; diff -u linux-6.5.0/kernel/trace/trace_events_synth.c linux-6.5.0/kernel/trace/trace_events_synth.c --- linux-6.5.0/kernel/trace/trace_events_synth.c +++ linux-6.5.0/kernel/trace/trace_events_synth.c @@ -441,9 +441,8 @@ if (is_dynamic) { union trace_synth_field *data = &entry->fields[*n_u64]; - len = fetch_store_strlen((unsigned long)str_val); data->as_dynamic.offset = struct_size(entry, fields, event->n_u64) + data_size; - data->as_dynamic.len = len; + data->as_dynamic.len = fetch_store_strlen((unsigned long)str_val); ret = fetch_store_string((unsigned long)str_val, &entry->fields[*n_u64], entry); reverted: --- linux-6.5.0/kernel/trace/trace_events_trigger.c +++ linux-6.5.0.orig/kernel/trace/trace_events_trigger.c @@ -1470,10 +1470,8 @@ struct event_trigger_data *data, struct trace_event_file *file) { + if (tracing_alloc_snapshot_instance(file->tr) != 0) + return 0; - int ret = tracing_alloc_snapshot_instance(file->tr); - - if (ret < 0) - return ret; return register_trigger(glob, data, file); } reverted: --- linux-6.5.0/kernel/trace/trace_osnoise.c +++ linux-6.5.0.orig/kernel/trace/trace_osnoise.c @@ -2444,9 +2444,6 @@ tlat = this_cpu_tmr_var(); tlat->count = 0; - hrtimer_init(&tlat->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNED_HARD); - tlat->timer.function = timerlat_irq; - migrate_enable(); return 0; }; @@ -2529,6 +2526,9 @@ tlat->tracing_thread = false; tlat->kthread = current; + hrtimer_init(&tlat->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNED_HARD); + tlat->timer.function = timerlat_irq; + /* Annotate now to drift new period */ tlat->abs_period = hrtimer_cb_get_time(&tlat->timer); reverted: --- linux-6.5.0/kernel/trace/trace_probe.c +++ linux-6.5.0.orig/kernel/trace/trace_probe.c @@ -936,12 +936,9 @@ if (!(ctx->flags & TPARG_FL_TEVENT) && (strcmp(arg, "$comm") == 0 || strcmp(arg, "$COMM") == 0 || strncmp(arg, "\\\"", 2) == 0)) { + /* The type of $comm must be "string", and not an array. */ + if (parg->count || (t && strcmp(t, "string"))) - /* The type of $comm must be "string", and not an array type. */ - if (parg->count || (t && strcmp(t, "string"))) { - trace_probe_log_err(ctx->offset + (t ? (t - arg) : 0), - NEED_STRING_TYPE); goto out; - } parg->type = find_fetch_type("string", ctx->flags); } else parg->type = find_fetch_type(t, ctx->flags); @@ -949,6 +946,18 @@ trace_probe_log_err(ctx->offset + (t ? (t - arg) : 0), BAD_TYPE); goto out; } + parg->offset = *size; + *size += parg->type->size * (parg->count ?: 1); + + ret = -ENOMEM; + if (parg->count) { + len = strlen(parg->type->fmttype) + 6; + parg->fmt = kmalloc(len, GFP_KERNEL); + if (!parg->fmt) + goto out; + snprintf(parg->fmt, len, "%s[%d]", parg->type->fmttype, + parg->count); + } code = tmp = kcalloc(FETCH_INSN_MAX, sizeof(*code), GFP_KERNEL); if (!code) @@ -967,19 +976,6 @@ else if (code->op == FETCH_OP_RETVAL) parg->type = parse_btf_retval_type(ctx); } - parg->offset = *size; - *size += parg->type->size * (parg->count ?: 1); - - if (parg->count) { - len = strlen(parg->type->fmttype) + 6; - parg->fmt = kmalloc(len, GFP_KERNEL); - if (!parg->fmt) { - ret = -ENOMEM; - goto out; - } - snprintf(parg->fmt, len, "%s[%d]", parg->type->fmttype, - parg->count); - } ret = -EINVAL; /* Store operation */ diff -u linux-6.5.0/kernel/trace/trace_probe.h linux-6.5.0/kernel/trace/trace_probe.h --- linux-6.5.0/kernel/trace/trace_probe.h +++ linux-6.5.0/kernel/trace/trace_probe.h @@ -496,8 +496,7 @@ C(BAD_VAR_ARGS, "$arg* must be an independent parameter without name etc."),\ C(NOFENTRY_ARGS, "$arg* can be used only on function entry"), \ C(DOUBLE_ARGS, "$arg* can be used only once in the parameters"), \ - C(ARGS_2LONG, "$arg* failed because the argument list is too long"), \ - C(NEED_STRING_TYPE, "$comm and immediate-string only accepts string type"), + C(ARGS_2LONG, "$arg* failed because the argument list is too long"), #undef C #define C(a, b) TP_ERR_##a diff -u linux-6.5.0/kernel/workqueue.c linux-6.5.0/kernel/workqueue.c --- linux-6.5.0/kernel/workqueue.c +++ linux-6.5.0/kernel/workqueue.c @@ -5742,9 +5742,13 @@ list_for_each_entry(wq, &workqueues, list) { if (!(wq->flags & WQ_UNBOUND)) continue; + /* creating multiple pwqs breaks ordering guarantee */ - if (wq->flags & __WQ_ORDERED) - continue; + if (!list_empty(&wq->pwqs)) { + if (wq->flags & __WQ_ORDERED_EXPLICIT) + continue; + wq->flags &= ~__WQ_ORDERED; + } ctx = apply_wqattrs_prepare(wq, wq->unbound_attrs, unbound_cpumask); if (!ctx) { reverted: --- linux-6.5.0/mm/backing-dev.c +++ linux-6.5.0.orig/mm/backing-dev.c @@ -437,6 +437,7 @@ INIT_LIST_HEAD(&wb->work_list); INIT_DELAYED_WORK(&wb->dwork, wb_workfn); INIT_DELAYED_WORK(&wb->bw_dwork, wb_update_bandwidth_workfn); + wb->dirty_sleep = jiffies; err = fprop_local_init_percpu(&wb->completions, gfp); if (err) @@ -924,7 +925,6 @@ INIT_LIST_HEAD(&bdi->bdi_list); INIT_LIST_HEAD(&bdi->wb_list); init_waitqueue_head(&bdi->wb_waitq); - bdi->last_bdp_sleep = jiffies; return cgwb_bdi_init(bdi); } diff -u linux-6.5.0/mm/memory.c linux-6.5.0/mm/memory.c --- linux-6.5.0/mm/memory.c +++ linux-6.5.0/mm/memory.c @@ -5262,7 +5262,7 @@ return true; if (regs && !user_mode(regs)) { - unsigned long ip = exception_ip(regs); + unsigned long ip = instruction_pointer(regs); if (!search_exception_tables(ip)) return false; } @@ -5287,7 +5287,7 @@ { mmap_read_unlock(mm); if (regs && !user_mode(regs)) { - unsigned long ip = exception_ip(regs); + unsigned long ip = instruction_pointer(regs); if (!search_exception_tables(ip)) return false; } diff -u linux-6.5.0/mm/page-writeback.c linux-6.5.0/mm/page-writeback.c --- linux-6.5.0/mm/page-writeback.c +++ linux-6.5.0/mm/page-writeback.c @@ -1638,7 +1638,7 @@ */ dtc->wb_thresh = __wb_calc_thresh(dtc); dtc->wb_bg_thresh = dtc->thresh ? - div64_u64(dtc->wb_thresh * dtc->bg_thresh, dtc->thresh) : 0; + div_u64((u64)dtc->wb_thresh * dtc->bg_thresh, dtc->thresh) : 0; /* * In order to avoid the stacked BDI deadlock we need @@ -1921,7 +1921,7 @@ break; } __set_current_state(TASK_KILLABLE); - bdi->last_bdp_sleep = jiffies; + wb->dirty_sleep = now; io_schedule_timeout(pause); current->dirty_paused_when = now + pause; reverted: --- linux-6.5.0/mm/percpu.c +++ linux-6.5.0.orig/mm/percpu.c @@ -3319,7 +3319,13 @@ if (rc < 0) panic("failed to map percpu area, err=%d\n", rc); + /* + * FIXME: Archs with virtual cache should flush local + * cache for the linear mapping here - something + * equivalent to flush_cache_vmap() on the local cpu. + * flush_cache_vmap() can't be used as most supporting + * data structures are not set up yet. + */ - flush_cache_vmap_early(unit_addr, unit_addr + ai->unit_size); /* copy static data */ memcpy((void *)unit_addr, __per_cpu_load, ai->static_size); reverted: --- linux-6.5.0/mm/userfaultfd.c +++ linux-6.5.0.orig/mm/userfaultfd.c @@ -317,7 +317,6 @@ unsigned long dst_start, unsigned long src_start, unsigned long len, - atomic_t *mmap_changing, uffd_flags_t flags) { struct mm_struct *dst_mm = dst_vma->vm_mm; @@ -433,15 +432,6 @@ goto out; } mmap_read_lock(dst_mm); - /* - * If memory mappings are changing because of non-cooperative - * operation (e.g. mremap) running in parallel, bail out and - * request the user to retry later - */ - if (mmap_changing && atomic_read(mmap_changing)) { - err = -EAGAIN; - break; - } dst_vma = NULL; goto retry; @@ -476,7 +466,6 @@ unsigned long dst_start, unsigned long src_start, unsigned long len, - atomic_t *mmap_changing, uffd_flags_t flags); #endif /* CONFIG_HUGETLB_PAGE */ @@ -590,8 +579,8 @@ * If this is a HUGETLB vma, pass off to appropriate routine */ if (is_vm_hugetlb_page(dst_vma)) + return mfill_atomic_hugetlb(dst_vma, dst_start, + src_start, len, flags); - return mfill_atomic_hugetlb(dst_vma, dst_start, src_start, - len, mmap_changing, flags); if (!vma_is_anonymous(dst_vma) && !vma_is_shmem(dst_vma)) goto out_unlock; diff -u linux-6.5.0/net/bluetooth/hci_event.c linux-6.5.0/net/bluetooth/hci_event.c --- linux-6.5.0/net/bluetooth/hci_event.c +++ linux-6.5.0/net/bluetooth/hci_event.c @@ -5306,12 +5306,9 @@ hci_dev_lock(hdev); conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); - if (!conn || !hci_dev_test_flag(hdev, HCI_SSP_ENABLED)) + if (!conn || !hci_conn_ssp_enabled(conn)) goto unlock; - /* Assume remote supports SSP since it has triggered this event */ - set_bit(HCI_CONN_SSP_ENABLED, &conn->flags); - hci_conn_hold(conn); if (!hci_dev_test_flag(hdev, HCI_MGMT)) reverted: --- linux-6.5.0/net/can/j1939/j1939-priv.h +++ linux-6.5.0.orig/net/can/j1939/j1939-priv.h @@ -86,7 +86,7 @@ unsigned int tp_max_packet_size; /* lock for j1939_socks list */ + spinlock_t j1939_socks_lock; - rwlock_t j1939_socks_lock; struct list_head j1939_socks; struct kref rx_kref; @@ -301,7 +301,6 @@ int ifindex; struct j1939_addr addr; - spinlock_t filters_lock; struct j1939_filter *filters; int nfilters; pgn_t pgn_rx_filter; reverted: --- linux-6.5.0/net/can/j1939/main.c +++ linux-6.5.0.orig/net/can/j1939/main.c @@ -274,7 +274,7 @@ return ERR_PTR(-ENOMEM); j1939_tp_init(priv); + spin_lock_init(&priv->j1939_socks_lock); - rwlock_init(&priv->j1939_socks_lock); INIT_LIST_HEAD(&priv->j1939_socks); mutex_lock(&j1939_netdev_lock); diff -u linux-6.5.0/net/can/j1939/socket.c linux-6.5.0/net/can/j1939/socket.c --- linux-6.5.0/net/can/j1939/socket.c +++ linux-6.5.0/net/can/j1939/socket.c @@ -80,16 +80,16 @@ jsk->state |= J1939_SOCK_BOUND; j1939_priv_get(priv); - write_lock_bh(&priv->j1939_socks_lock); + spin_lock_bh(&priv->j1939_socks_lock); list_add_tail(&jsk->list, &priv->j1939_socks); - write_unlock_bh(&priv->j1939_socks_lock); + spin_unlock_bh(&priv->j1939_socks_lock); } static void j1939_jsk_del(struct j1939_priv *priv, struct j1939_sock *jsk) { - write_lock_bh(&priv->j1939_socks_lock); + spin_lock_bh(&priv->j1939_socks_lock); list_del_init(&jsk->list); - write_unlock_bh(&priv->j1939_socks_lock); + spin_unlock_bh(&priv->j1939_socks_lock); j1939_priv_put(priv); jsk->state &= ~J1939_SOCK_BOUND; @@ -262,17 +262,12 @@ static bool j1939_sk_match_filter(struct j1939_sock *jsk, const struct j1939_sk_buff_cb *skcb) { - const struct j1939_filter *f; - int nfilter; - - spin_lock_bh(&jsk->filters_lock); - - f = jsk->filters; - nfilter = jsk->nfilters; + const struct j1939_filter *f = jsk->filters; + int nfilter = jsk->nfilters; if (!nfilter) /* receive all when no filters are assigned */ - goto filter_match_found; + return true; for (; nfilter; ++f, --nfilter) { if ((skcb->addr.pgn & f->pgn_mask) != f->pgn) @@ -281,15 +276,9 @@ continue; if ((skcb->addr.src_name & f->name_mask) != f->name) continue; - goto filter_match_found; + return true; } - - spin_unlock_bh(&jsk->filters_lock); return false; - -filter_match_found: - spin_unlock_bh(&jsk->filters_lock); - return true; } static bool j1939_sk_recv_match_one(struct j1939_sock *jsk, @@ -340,13 +329,13 @@ struct j1939_sock *jsk; bool match = false; - read_lock_bh(&priv->j1939_socks_lock); + spin_lock_bh(&priv->j1939_socks_lock); list_for_each_entry(jsk, &priv->j1939_socks, list) { match = j1939_sk_recv_match_one(jsk, skcb); if (match) break; } - read_unlock_bh(&priv->j1939_socks_lock); + spin_unlock_bh(&priv->j1939_socks_lock); return match; } @@ -355,11 +344,11 @@ { struct j1939_sock *jsk; - read_lock_bh(&priv->j1939_socks_lock); + spin_lock_bh(&priv->j1939_socks_lock); list_for_each_entry(jsk, &priv->j1939_socks, list) { j1939_sk_recv_one(jsk, skb); } - read_unlock_bh(&priv->j1939_socks_lock); + spin_unlock_bh(&priv->j1939_socks_lock); } static void j1939_sk_sock_destruct(struct sock *sk) @@ -412,7 +401,6 @@ atomic_set(&jsk->skb_pending, 0); spin_lock_init(&jsk->sk_session_queue_lock); INIT_LIST_HEAD(&jsk->sk_session_queue); - spin_lock_init(&jsk->filters_lock); /* j1939_sk_sock_destruct() depends on SOCK_RCU_FREE flag */ sock_set_flag(sk, SOCK_RCU_FREE); @@ -715,11 +703,9 @@ } lock_sock(&jsk->sk); - spin_lock_bh(&jsk->filters_lock); ofilters = jsk->filters; jsk->filters = filters; jsk->nfilters = count; - spin_unlock_bh(&jsk->filters_lock); release_sock(&jsk->sk); kfree(ofilters); return 0; @@ -1094,12 +1080,12 @@ } /* spread RX notifications to all sockets subscribed to this session */ - read_lock_bh(&priv->j1939_socks_lock); + spin_lock_bh(&priv->j1939_socks_lock); list_for_each_entry(jsk, &priv->j1939_socks, list) { if (j1939_sk_recv_match_one(jsk, &session->skcb)) __j1939_sk_errqueue(session, &jsk->sk, type); } - read_unlock_bh(&priv->j1939_socks_lock); + spin_unlock_bh(&priv->j1939_socks_lock); }; void j1939_sk_send_loop_abort(struct sock *sk, int err) @@ -1287,7 +1273,7 @@ struct j1939_sock *jsk; int error_code = ENETDOWN; - read_lock_bh(&priv->j1939_socks_lock); + spin_lock_bh(&priv->j1939_socks_lock); list_for_each_entry(jsk, &priv->j1939_socks, list) { jsk->sk.sk_err = error_code; if (!sock_flag(&jsk->sk, SOCK_DEAD)) @@ -1295,7 +1281,7 @@ j1939_sk_queue_drop_all(priv, jsk, error_code); } - read_unlock_bh(&priv->j1939_socks_lock); + spin_unlock_bh(&priv->j1939_socks_lock); } static int j1939_sk_no_ioctlcmd(struct socket *sock, unsigned int cmd, diff -u linux-6.5.0/net/ceph/messenger_v1.c linux-6.5.0/net/ceph/messenger_v1.c --- linux-6.5.0/net/ceph/messenger_v1.c +++ linux-6.5.0/net/ceph/messenger_v1.c @@ -160,9 +160,8 @@ static void prepare_message_data(struct ceph_msg *msg, u32 data_len) { /* Initialize data cursor if it's not a sparse read */ - u64 len = msg->sparse_read_total ? : data_len; - - ceph_msg_data_cursor_init(&msg->cursor, msg, len); + if (!msg->sparse_read) + ceph_msg_data_cursor_init(&msg->cursor, msg, data_len); } /* @@ -992,7 +991,7 @@ return read_partial_message_chunk(con, section, sec_len, crc); } -static int read_partial_sparse_msg_extent(struct ceph_connection *con, u32 *crc) +static int read_sparse_msg_extent(struct ceph_connection *con, u32 *crc) { struct ceph_msg_data_cursor *cursor = &con->in_msg->cursor; bool do_bounce = ceph_test_opt(from_msgr(con->msgr), RXBOUNCE); @@ -1027,7 +1026,7 @@ return 1; } -static int read_partial_sparse_msg_data(struct ceph_connection *con) +static int read_sparse_msg_data(struct ceph_connection *con) { struct ceph_msg_data_cursor *cursor = &con->in_msg->cursor; bool do_datacrc = !ceph_test_opt(from_msgr(con->msgr), NOCRC); @@ -1037,31 +1036,31 @@ if (do_datacrc) crc = con->in_data_crc; - while (cursor->total_resid) { + do { if (con->v1.in_sr_kvec.iov_base) ret = read_partial_message_chunk(con, &con->v1.in_sr_kvec, con->v1.in_sr_len, &crc); else if (cursor->sr_resid > 0) - ret = read_partial_sparse_msg_extent(con, &crc); - if (ret <= 0) - break; + ret = read_sparse_msg_extent(con, &crc); + + if (ret <= 0) { + if (do_datacrc) + con->in_data_crc = crc; + return ret; + } memset(&con->v1.in_sr_kvec, 0, sizeof(con->v1.in_sr_kvec)); ret = con->ops->sparse_read(con, cursor, (char **)&con->v1.in_sr_kvec.iov_base); - if (ret <= 0) { - ret = ret ? ret : 1; /* must return > 0 to indicate success */ - break; - } con->v1.in_sr_len = ret; - } + } while (ret > 0); if (do_datacrc) con->in_data_crc = crc; - return ret; + return ret < 0 ? ret : 1; /* must return > 0 to indicate success */ } static int read_partial_msg_data(struct ceph_connection *con) @@ -1254,8 +1253,8 @@ if (!m->num_data_items) return -EIO; - if (m->sparse_read_total) - ret = read_partial_sparse_msg_data(con); + if (m->sparse_read) + ret = read_sparse_msg_data(con); else if (ceph_test_opt(from_msgr(con->msgr), RXBOUNCE)) ret = read_partial_msg_data_bounce(con); else diff -u linux-6.5.0/net/ceph/messenger_v2.c linux-6.5.0/net/ceph/messenger_v2.c --- linux-6.5.0/net/ceph/messenger_v2.c +++ linux-6.5.0/net/ceph/messenger_v2.c @@ -1132,7 +1132,7 @@ struct sg_table enc_sgt = {}; struct sg_table sgt = {}; struct page **pages = NULL; - bool sparse = !!con->in_msg->sparse_read_total; + bool sparse = con->in_msg->sparse_read; int dpos = 0; int tail_len; int ret; @@ -2064,7 +2064,7 @@ } if (data_len(msg)) { - if (msg->sparse_read_total) + if (msg->sparse_read) con->v2.in_state = IN_S_PREPARE_SPARSE_DATA; else con->v2.in_state = IN_S_PREPARE_READ_DATA; diff -u linux-6.5.0/net/ceph/osd_client.c linux-6.5.0/net/ceph/osd_client.c --- linux-6.5.0/net/ceph/osd_client.c +++ linux-6.5.0/net/ceph/osd_client.c @@ -5510,7 +5510,7 @@ } m = ceph_msg_get(req->r_reply); - m->sparse_read_total = srlen; + m->sparse_read = (bool)srlen; dout("get_reply tid %lld %p\n", tid, m); @@ -5777,8 +5777,11 @@ } if (o->o_sparse_op_idx < 0) { - dout("%s: [%d] starting new sparse read req\n", - __func__, o->o_osd); + u64 srlen = sparse_data_requested(req); + + dout("%s: [%d] starting new sparse read req. srlen=0x%llx\n", + __func__, o->o_osd, srlen); + ceph_msg_data_cursor_init(cursor, con->in_msg, srlen); } else { u64 end; reverted: --- linux-6.5.0/net/devlink/core.c +++ linux-6.5.0.orig/net/devlink/core.c @@ -302,20 +302,14 @@ { int err; + err = genl_register_family(&devlink_nl_family); + if (err) + goto out; err = register_pernet_subsys(&devlink_pernet_ops); if (err) goto out; - err = genl_register_family(&devlink_nl_family); - if (err) - goto out_unreg_pernet_subsys; err = register_netdevice_notifier(&devlink_port_netdevice_nb); - if (!err) - return 0; - - genl_unregister_family(&devlink_nl_family); -out_unreg_pernet_subsys: - unregister_pernet_subsys(&devlink_pernet_ops); out: WARN_ON(err); return err; diff -u linux-6.5.0/net/handshake/handshake-test.c linux-6.5.0/net/handshake/handshake-test.c --- linux-6.5.0/net/handshake/handshake-test.c +++ linux-6.5.0/net/handshake/handshake-test.c @@ -471,10 +471,7 @@ handshake_req_cancel(sock->sk); /* Act */ - /* Ensure the close/release/put process has run to - * completion before checking the result. - */ - __fput_sync(filp); + fput(filp); /* Assert */ KUNIT_EXPECT_PTR_EQ(test, handshake_req_destroy_test, req); reverted: --- linux-6.5.0/net/hsr/hsr_device.c +++ linux-6.5.0.orig/net/hsr/hsr_device.c @@ -291,7 +291,7 @@ skb = hsr_init_skb(master); if (!skb) { + WARN_ONCE(1, "HSR: Could not send supervision frame\n"); - netdev_warn_once(master->dev, "HSR: Could not send supervision frame\n"); return; } @@ -338,7 +338,7 @@ skb = hsr_init_skb(master); if (!skb) { + WARN_ONCE(1, "PRP: Could not send supervision frame\n"); - netdev_warn_once(master->dev, "PRP: Could not send supervision frame\n"); return; } diff -u linux-6.5.0/net/ipv4/af_inet.c linux-6.5.0/net/ipv4/af_inet.c --- linux-6.5.0/net/ipv4/af_inet.c +++ linux-6.5.0/net/ipv4/af_inet.c @@ -1618,12 +1618,10 @@ int inet_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len) { - unsigned int family = READ_ONCE(sk->sk_family); - - if (family == AF_INET) + if (sk->sk_family == AF_INET) return ip_recv_error(sk, msg, len, addr_len); #if IS_ENABLED(CONFIG_IPV6) - if (family == AF_INET6) + if (sk->sk_family == AF_INET6) return pingv6_ops.ipv6_recv_error(sk, msg, len, addr_len); #endif return -EINVAL; reverted: --- linux-6.5.0/net/ipv4/arp.c +++ linux-6.5.0.orig/net/ipv4/arp.c @@ -1125,8 +1125,7 @@ if (neigh) { if (!(READ_ONCE(neigh->nud_state) & NUD_NOARP)) { read_lock_bh(&neigh->lock); + memcpy(r->arp_ha.sa_data, neigh->ha, dev->addr_len); - memcpy(r->arp_ha.sa_data, neigh->ha, - min(dev->addr_len, sizeof(r->arp_ha.sa_data_min))); r->arp_flags = arp_state_to_flags(neigh); read_unlock_bh(&neigh->lock); r->arp_ha.sa_family = dev->type; reverted: --- linux-6.5.0/net/ipv4/ip_tunnel_core.c +++ linux-6.5.0.orig/net/ipv4/ip_tunnel_core.c @@ -332,7 +332,7 @@ }; skb_reset_network_header(skb); + csum = csum_partial(icmp6h, len, 0); - csum = skb_checksum(skb, skb_transport_offset(skb), len, 0); icmp6h->icmp6_cksum = csum_ipv6_magic(&nip6h->saddr, &nip6h->daddr, len, IPPROTO_ICMPV6, csum); reverted: --- linux-6.5.0/net/ipv6/seg6.c +++ linux-6.5.0.orig/net/ipv6/seg6.c @@ -512,24 +512,22 @@ { int err; + err = genl_register_family(&seg6_genl_family); - err = register_pernet_subsys(&ip6_segments_ops); if (err) goto out; + err = register_pernet_subsys(&ip6_segments_ops); - err = genl_register_family(&seg6_genl_family); if (err) + goto out_unregister_genl; - goto out_unregister_pernet; #ifdef CONFIG_IPV6_SEG6_LWTUNNEL err = seg6_iptunnel_init(); if (err) + goto out_unregister_pernet; - goto out_unregister_genl; err = seg6_local_init(); + if (err) + goto out_unregister_pernet; - if (err) { - seg6_iptunnel_exit(); - goto out_unregister_genl; - } #endif #ifdef CONFIG_IPV6_SEG6_HMAC @@ -550,11 +548,11 @@ #endif #endif #ifdef CONFIG_IPV6_SEG6_LWTUNNEL +out_unregister_pernet: + unregister_pernet_subsys(&ip6_segments_ops); +#endif out_unregister_genl: genl_unregister_family(&seg6_genl_family); -#endif -out_unregister_pernet: - unregister_pernet_subsys(&ip6_segments_ops); goto out; } diff -u linux-6.5.0/net/mac80211/mlme.c linux-6.5.0/net/mac80211/mlme.c --- linux-6.5.0/net/mac80211/mlme.c +++ linux-6.5.0/net/mac80211/mlme.c @@ -7727,7 +7727,8 @@ rcu_read_lock(); beacon_ies = rcu_dereference(req->bss->beacon_ies); - if (!beacon_ies) { + + if (beacon_ies) { /* * Wait up to one beacon interval ... * should this be more if we miss one? diff -u linux-6.5.0/net/mac80211/tx.c linux-6.5.0/net/mac80211/tx.c --- linux-6.5.0/net/mac80211/tx.c +++ linux-6.5.0/net/mac80211/tx.c @@ -5,7 +5,7 @@ * Copyright 2006-2007 Jiri Benc * Copyright 2007 Johannes Berg * Copyright 2013-2014 Intel Mobile Communications GmbH - * Copyright (C) 2018-2024 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * Transmit and frame generation functions. */ @@ -3086,11 +3086,10 @@ /* DA SA BSSID */ build.da_offs = offsetof(struct ieee80211_hdr, addr1); build.sa_offs = offsetof(struct ieee80211_hdr, addr2); - rcu_read_lock(); link = rcu_dereference(sdata->link[tdls_link_id]); - if (!WARN_ON_ONCE(!link)) - memcpy(hdr->addr3, link->u.mgd.bssid, ETH_ALEN); - rcu_read_unlock(); + if (WARN_ON_ONCE(!link)) + break; + memcpy(hdr->addr3, link->u.mgd.bssid, ETH_ALEN); build.hdr_len = 24; break; } @@ -3913,7 +3912,6 @@ goto begin; skb = __skb_dequeue(&tx.skbs); - info = IEEE80211_SKB_CB(skb); if (!skb_queue_empty(&tx.skbs)) { spin_lock_bh(&fq->lock); @@ -3958,7 +3956,7 @@ } encap_out: - info->control.vif = vif; + IEEE80211_SKB_CB(skb)->control.vif = vif; if (tx.sta && wiphy_ext_feature_isset(local->hw.wiphy, NL80211_EXT_FEATURE_AQL)) { diff -u linux-6.5.0/net/mptcp/pm_userspace.c linux-6.5.0/net/mptcp/pm_userspace.c --- linux-6.5.0/net/mptcp/pm_userspace.c +++ linux-6.5.0/net/mptcp/pm_userspace.c @@ -130,21 +130,10 @@ int mptcp_userspace_pm_get_local_id(struct mptcp_sock *msk, struct mptcp_addr_info *skc) { - struct mptcp_pm_addr_entry *entry = NULL, *e, new_entry; + struct mptcp_pm_addr_entry new_entry; __be16 msk_sport = ((struct inet_sock *) inet_sk((struct sock *)msk))->inet_sport; - spin_lock_bh(&msk->pm.lock); - list_for_each_entry(e, &msk->pm.userspace_pm_local_addr_list, list) { - if (mptcp_addresses_equal(&e->addr, skc, false)) { - entry = e; - break; - } - } - spin_unlock_bh(&msk->pm.lock); - if (entry) - return entry->addr.id; - memset(&new_entry, 0, sizeof(struct mptcp_pm_addr_entry)); new_entry.addr = *skc; new_entry.addr.id = 0; diff -u linux-6.5.0/net/mptcp/protocol.c linux-6.5.0/net/mptcp/protocol.c --- linux-6.5.0/net/mptcp/protocol.c +++ linux-6.5.0/net/mptcp/protocol.c @@ -1544,11 +1544,8 @@ void mptcp_check_and_set_pending(struct sock *sk) { - if (mptcp_send_head(sk)) { - mptcp_data_lock(sk); - mptcp_sk(sk)->cb_flags |= BIT(MPTCP_PUSH_PENDING); - mptcp_data_unlock(sk); - } + if (mptcp_send_head(sk)) + mptcp_sk(sk)->push_pending |= BIT(MPTCP_PUSH_PENDING); } void __mptcp_push_pending(struct sock *sk, unsigned int flags) @@ -1939,9 +1936,6 @@ if (copied <= 0) return; - if (!msk->rcvspace_init) - mptcp_rcv_space_init(msk, msk->first); - msk->rcvq_space.copied += copied; mstamp = div_u64(tcp_clock_ns(), NSEC_PER_USEC); @@ -2312,6 +2306,9 @@ if (__mptcp_check_fallback(msk)) return false; + if (tcp_rtx_and_write_queues_empty(sk)) + return false; + /* the closing socket has some data untransmitted and/or unacked: * some data in the mptcp rtx queue has not really xmitted yet. * keep it simple and re-inject the whole mptcp level rtx queue @@ -2395,7 +2392,7 @@ goto out_release; } - dispose_it = msk->free_first || ssk != msk->first; + dispose_it = !msk->subflow || ssk != msk->subflow->sk; if (dispose_it) list_del(&subflow->node); @@ -2413,6 +2410,7 @@ need_push = (flags & MPTCP_CF_PUSH) && __mptcp_retransmit_pending_data(sk); if (!dispose_it) { __mptcp_subflow_disconnect(ssk, subflow, flags); + msk->subflow->state = SS_UNCONNECTED; release_sock(ssk); goto out; @@ -3111,6 +3109,7 @@ msk->last_snd = NULL; WRITE_ONCE(msk->flags, 0); msk->cb_flags = 0; + msk->push_pending = 0; msk->recovery = false; msk->can_ack = false; msk->fully_established = false; @@ -3125,7 +3124,6 @@ msk->bytes_received = 0; msk->bytes_sent = 0; msk->bytes_retrans = 0; - msk->rcvspace_init = 0; WRITE_ONCE(sk->sk_shutdown, 0); sk_error_report(sk); @@ -3139,50 +3137,8 @@ return (struct ipv6_pinfo *)(((u8 *)sk) + offset); } - -static void mptcp_copy_ip6_options(struct sock *newsk, const struct sock *sk) -{ - const struct ipv6_pinfo *np = inet6_sk(sk); - struct ipv6_txoptions *opt; - struct ipv6_pinfo *newnp; - - newnp = inet6_sk(newsk); - - rcu_read_lock(); - opt = rcu_dereference(np->opt); - if (opt) { - opt = ipv6_dup_options(newsk, opt); - if (!opt) - net_warn_ratelimited("%s: Failed to copy ip6 options\n", __func__); - } - RCU_INIT_POINTER(newnp->opt, opt); - rcu_read_unlock(); -} #endif -static void mptcp_copy_ip_options(struct sock *newsk, const struct sock *sk) -{ - struct ip_options_rcu *inet_opt, *newopt = NULL; - const struct inet_sock *inet = inet_sk(sk); - struct inet_sock *newinet; - - newinet = inet_sk(newsk); - - rcu_read_lock(); - inet_opt = rcu_dereference(inet->inet_opt); - if (inet_opt) { - newopt = sock_kmalloc(newsk, sizeof(*inet_opt) + - inet_opt->opt.optlen, GFP_ATOMIC); - if (newopt) - memcpy(newopt, inet_opt, sizeof(*inet_opt) + - inet_opt->opt.optlen); - else - net_warn_ratelimited("%s: Failed to copy ip options\n", __func__); - } - RCU_INIT_POINTER(newinet->inet_opt, newopt); - rcu_read_unlock(); -} - struct sock *mptcp_sk_clone_init(const struct sock *sk, const struct mptcp_options_received *mp_opt, struct sock *ssk, @@ -3202,13 +3158,6 @@ __mptcp_init_sock(nsk); -#if IS_ENABLED(CONFIG_MPTCP_IPV6) - if (nsk->sk_family == AF_INET6) - mptcp_copy_ip6_options(nsk, sk); - else -#endif - mptcp_copy_ip_options(nsk, sk); - msk = mptcp_sk(nsk); msk->local_key = subflow_req->local_key; msk->token = subflow_req->token; @@ -3262,7 +3211,6 @@ { const struct tcp_sock *tp = tcp_sk(ssk); - msk->rcvspace_init = 1; msk->rcvq_space.copied = 0; msk->rcvq_space.rtt_us = 0; @@ -3273,6 +3221,8 @@ TCP_INIT_CWND * tp->advmss); if (msk->rcvq_space.space == 0) msk->rcvq_space.space = TCP_INIT_CWND * TCP_MSS_DEFAULT; + + WRITE_ONCE(msk->wnd_end, msk->snd_nxt + tcp_sk(ssk)->snd_wnd); } static struct sock *mptcp_accept(struct sock *sk, int flags, int *err, @@ -3353,10 +3303,10 @@ { struct mptcp_sock *msk = mptcp_sk(sk); + /* clears msk->subflow, allowing the following to close + * even the initial subflow + */ mptcp_dispose_initial_subflow(msk); - - /* allow the following to close even the initial subflow */ - msk->free_first = 1; mptcp_destroy_common(msk, 0); sk_sockets_allocated_dec(sk); } @@ -3394,7 +3344,8 @@ struct mptcp_sock *msk = mptcp_sk(sk); for (;;) { - unsigned long flags = (msk->cb_flags & MPTCP_FLAGS_PROCESS_CTX_NEED); + unsigned long flags = (msk->cb_flags & MPTCP_FLAGS_PROCESS_CTX_NEED) | + msk->push_pending; struct list_head join_list; if (!flags) @@ -3410,6 +3361,7 @@ * datapath acquires the msk socket spinlock while helding * the subflow socket lock */ + msk->push_pending = 0; msk->cb_flags &= ~flags; spin_unlock_bh(&sk->sk_lock.slock); @@ -3544,9 +3496,10 @@ WRITE_ONCE(msk->write_seq, subflow->idsn + 1); WRITE_ONCE(msk->snd_nxt, msk->write_seq); WRITE_ONCE(msk->snd_una, msk->write_seq); - WRITE_ONCE(msk->wnd_end, msk->snd_nxt + tcp_sk(ssk)->snd_wnd); mptcp_pm_new_connection(msk, ssk, 0); + + mptcp_rcv_space_init(msk, ssk); } void mptcp_sock_graft(struct sock *sk, struct socket *parent) diff -u linux-6.5.0/net/mptcp/protocol.h linux-6.5.0/net/mptcp/protocol.h --- linux-6.5.0/net/mptcp/protocol.h +++ linux-6.5.0/net/mptcp/protocol.h @@ -285,6 +285,7 @@ int rmem_released; unsigned long flags; unsigned long cb_flags; + unsigned long push_pending; bool recovery; /* closing subflow write queue reinjected */ bool can_ack; bool fully_established; @@ -302,9 +303,7 @@ cork:1, nodelay:1, fastopening:1, - in_accept_queue:1, - free_first:1, - rcvspace_init:1; + in_accept_queue:1; struct work_struct work; struct sk_buff *ooo_last_skb; struct rb_root out_of_order_queue; @@ -1086,8 +1085,7 @@ { struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk); - return (1 << sk->sk_state) & - (TCPF_ESTABLISHED | TCPF_FIN_WAIT1 | TCPF_FIN_WAIT2 | TCPF_CLOSING) && + return (1 << sk->sk_state) & (TCPF_ESTABLISHED | TCPF_FIN_WAIT1) && is_active_ssk(subflow) && !subflow->conn_finished; } diff -u linux-6.5.0/net/mptcp/subflow.c linux-6.5.0/net/mptcp/subflow.c --- linux-6.5.0/net/mptcp/subflow.c +++ linux-6.5.0/net/mptcp/subflow.c @@ -424,8 +424,6 @@ struct mptcp_sock *msk = mptcp_sk(sk); __mptcp_propagate_sndbuf(sk, msk->first); - if (!msk->rcvspace_init) - mptcp_rcv_space_init(msk, msk->first); if (sk->sk_state == TCP_SYN_SENT) { inet_sk_state_store(sk, state); sk->sk_state_change(sk); @@ -547,6 +545,7 @@ } } else if (mptcp_check_fallback(sk)) { fallback: + mptcp_rcv_space_init(msk, sk); mptcp_propagate_state(parent, sk); } return; @@ -1737,6 +1736,7 @@ msk = mptcp_sk(parent); if (subflow_simultaneous_connect(sk)) { mptcp_do_fallback(sk); + mptcp_rcv_space_init(msk, sk); pr_fallback(msk); subflow->conn_finished = 1; mptcp_propagate_state(parent, sk); reverted: --- linux-6.5.0/net/netfilter/ipset/ip_set_bitmap_gen.h +++ linux-6.5.0.orig/net/netfilter/ipset/ip_set_bitmap_gen.h @@ -28,7 +28,6 @@ #define mtype_del IPSET_TOKEN(MTYPE, _del) #define mtype_list IPSET_TOKEN(MTYPE, _list) #define mtype_gc IPSET_TOKEN(MTYPE, _gc) -#define mtype_cancel_gc IPSET_TOKEN(MTYPE, _cancel_gc) #define mtype MTYPE #define get_ext(set, map, id) ((map)->extensions + ((set)->dsize * (id))) @@ -58,6 +57,9 @@ { struct mtype *map = set->data; + if (SET_WITH_TIMEOUT(set)) + del_timer_sync(&map->gc); + if (set->dsize && set->extensions & IPSET_EXT_DESTROY) mtype_ext_cleanup(set); ip_set_free(map->members); @@ -286,15 +288,6 @@ add_timer(&map->gc); } -static void -mtype_cancel_gc(struct ip_set *set) -{ - struct mtype *map = set->data; - - if (SET_WITH_TIMEOUT(set)) - del_timer_sync(&map->gc); -} - static const struct ip_set_type_variant mtype = { .kadt = mtype_kadt, .uadt = mtype_uadt, @@ -308,7 +301,6 @@ .head = mtype_head, .list = mtype_list, .same_set = mtype_same_set, - .cancel_gc = mtype_cancel_gc, }; #endif /* __IP_SET_BITMAP_IP_GEN_H */ diff -u linux-6.5.0/net/netfilter/ipset/ip_set_core.c linux-6.5.0/net/netfilter/ipset/ip_set_core.c --- linux-6.5.0/net/netfilter/ipset/ip_set_core.c +++ linux-6.5.0/net/netfilter/ipset/ip_set_core.c @@ -1154,7 +1154,6 @@ return ret; cleanup: - set->variant->cancel_gc(set); set->variant->destroy(set); put_out: module_put(set->type->me); @@ -1183,14 +1182,6 @@ kfree(set); } -static void -ip_set_destroy_set_rcu(struct rcu_head *head) -{ - struct ip_set *set = container_of(head, struct ip_set, rcu); - - ip_set_destroy_set(set); -} - static int ip_set_destroy(struct sk_buff *skb, const struct nfnl_info *info, const struct nlattr * const attr[]) { @@ -1202,6 +1193,8 @@ if (unlikely(protocol_min_failed(attr))) return -IPSET_ERR_PROTOCOL; + /* Must wait for flush to be really finished in list:set */ + rcu_barrier(); /* Commands are serialized and references are * protected by the ip_set_ref_lock. @@ -1213,10 +1206,8 @@ * counter, so if it's already zero, we can proceed * without holding the lock. */ + read_lock_bh(&ip_set_ref_lock); if (!attr[IPSET_ATTR_SETNAME]) { - /* Must wait for flush to be really finished in list:set */ - rcu_barrier(); - read_lock_bh(&ip_set_ref_lock); for (i = 0; i < inst->ip_set_max; i++) { s = ip_set(inst, i); if (s && (s->ref || s->ref_netlink)) { @@ -1230,8 +1221,6 @@ s = ip_set(inst, i); if (s) { ip_set(inst, i) = NULL; - /* Must cancel garbage collectors */ - s->variant->cancel_gc(s); ip_set_destroy_set(s); } } @@ -1239,9 +1228,6 @@ inst->is_destroyed = false; } else { u32 flags = flag_exist(info->nlh); - u16 features = 0; - - read_lock_bh(&ip_set_ref_lock); s = find_set_and_id(inst, nla_data(attr[IPSET_ATTR_SETNAME]), &i); if (!s) { @@ -1252,16 +1238,10 @@ ret = -IPSET_ERR_BUSY; goto out; } - features = s->type->features; ip_set(inst, i) = NULL; read_unlock_bh(&ip_set_ref_lock); - if (features & IPSET_TYPE_NAME) { - /* Must wait for flush to be really finished */ - rcu_barrier(); - } - /* Must cancel garbage collectors */ - s->variant->cancel_gc(s); - call_rcu(&s->rcu, ip_set_destroy_set_rcu); + + ip_set_destroy_set(s); } return 0; out: @@ -1414,6 +1394,9 @@ ip_set(inst, to_id) = from; write_unlock_bh(&ip_set_ref_lock); + /* Make sure all readers of the old set pointers are completed. */ + synchronize_rcu(); + return 0; } @@ -2379,7 +2362,6 @@ set = ip_set(inst, i); if (set) { ip_set(inst, i) = NULL; - set->variant->cancel_gc(set); ip_set_destroy_set(set); } } @@ -2427,11 +2409,8 @@ { nf_unregister_sockopt(&so_set); nfnetlink_subsys_unregister(&ip_set_netlink_subsys); - unregister_pernet_subsys(&ip_set_net_ops); - - /* Wait for call_rcu() in destroy */ - rcu_barrier(); + unregister_pernet_subsys(&ip_set_net_ops); pr_debug("these are the famous last words\n"); } reverted: --- linux-6.5.0/net/netfilter/ipset/ip_set_hash_gen.h +++ linux-6.5.0.orig/net/netfilter/ipset/ip_set_hash_gen.h @@ -221,7 +221,6 @@ #undef mtype_gc_do #undef mtype_gc #undef mtype_gc_init -#undef mtype_cancel_gc #undef mtype_variant #undef mtype_data_match @@ -266,7 +265,6 @@ #define mtype_gc_do IPSET_TOKEN(MTYPE, _gc_do) #define mtype_gc IPSET_TOKEN(MTYPE, _gc) #define mtype_gc_init IPSET_TOKEN(MTYPE, _gc_init) -#define mtype_cancel_gc IPSET_TOKEN(MTYPE, _cancel_gc) #define mtype_variant IPSET_TOKEN(MTYPE, _variant) #define mtype_data_match IPSET_TOKEN(MTYPE, _data_match) @@ -431,7 +429,7 @@ u32 i; for (i = 0; i < jhash_size(t->htable_bits); i++) { + n = __ipset_dereference(hbucket(t, i)); - n = (__force struct hbucket *)hbucket(t, i); if (!n) continue; if (set->extensions & IPSET_EXT_DESTROY && ext_destroy) @@ -451,7 +449,10 @@ struct htype *h = set->data; struct list_head *l, *lt; + if (SET_WITH_TIMEOUT(set)) + cancel_delayed_work_sync(&h->gc.dwork); + + mtype_ahash_destroy(set, ipset_dereference_nfnl(h->table), true); - mtype_ahash_destroy(set, (__force struct htable *)h->table, true); list_for_each_safe(l, lt, &h->ad) { list_del(l); kfree(l); @@ -597,15 +598,6 @@ queue_delayed_work(system_power_efficient_wq, &gc->dwork, HZ); } -static void -mtype_cancel_gc(struct ip_set *set) -{ - struct htype *h = set->data; - - if (SET_WITH_TIMEOUT(set)) - cancel_delayed_work_sync(&h->gc.dwork); -} - static int mtype_add(struct ip_set *set, void *value, const struct ip_set_ext *ext, struct ip_set_ext *mext, u32 flags); @@ -1448,7 +1440,6 @@ .uref = mtype_uref, .resize = mtype_resize, .same_set = mtype_same_set, - .cancel_gc = mtype_cancel_gc, .region_lock = true, }; reverted: --- linux-6.5.0/net/netfilter/ipset/ip_set_list_set.c +++ linux-6.5.0.orig/net/netfilter/ipset/ip_set_list_set.c @@ -426,6 +426,9 @@ struct list_set *map = set->data; struct set_elem *e, *n; + if (SET_WITH_TIMEOUT(set)) + timer_shutdown_sync(&map->gc); + list_for_each_entry_safe(e, n, &map->members, list) { list_del(&e->list); ip_set_put_byindex(map->net, e->id); @@ -542,15 +545,6 @@ a->extensions == b->extensions; } -static void -list_set_cancel_gc(struct ip_set *set) -{ - struct list_set *map = set->data; - - if (SET_WITH_TIMEOUT(set)) - timer_shutdown_sync(&map->gc); -} - static const struct ip_set_type_variant set_variant = { .kadt = list_set_kadt, .uadt = list_set_uadt, @@ -564,7 +558,6 @@ .head = list_set_head, .list = list_set_list, .same_set = list_set_same_set, - .cancel_gc = list_set_cancel_gc, }; static void diff -u linux-6.5.0/net/netfilter/nft_compat.c linux-6.5.0/net/netfilter/nft_compat.c --- linux-6.5.0/net/netfilter/nft_compat.c +++ linux-6.5.0/net/netfilter/nft_compat.c @@ -135,7 +135,7 @@ static const struct nla_policy nft_target_policy[NFTA_TARGET_MAX + 1] = { [NFTA_TARGET_NAME] = { .type = NLA_NUL_STRING }, - [NFTA_TARGET_REV] = NLA_POLICY_MAX(NLA_BE32, 255), + [NFTA_TARGET_REV] = { .type = NLA_U32 }, [NFTA_TARGET_INFO] = { .type = NLA_BINARY }, }; @@ -200,7 +200,6 @@ static int nft_parse_compat(const struct nlattr *attr, u16 *proto, bool *inv) { struct nlattr *tb[NFTA_RULE_COMPAT_MAX+1]; - u32 l4proto; u32 flags; int err; @@ -213,18 +212,12 @@ return -EINVAL; flags = ntohl(nla_get_be32(tb[NFTA_RULE_COMPAT_FLAGS])); - if (flags & NFT_RULE_COMPAT_F_UNUSED || - flags & ~NFT_RULE_COMPAT_F_MASK) + if (flags & ~NFT_RULE_COMPAT_F_MASK) return -EINVAL; if (flags & NFT_RULE_COMPAT_F_INV) *inv = true; - l4proto = ntohl(nla_get_be32(tb[NFTA_RULE_COMPAT_PROTO])); - if (l4proto > U16_MAX) - return -EINVAL; - - *proto = l4proto; - + *proto = ntohl(nla_get_be32(tb[NFTA_RULE_COMPAT_PROTO])); return 0; } @@ -426,7 +419,7 @@ static const struct nla_policy nft_match_policy[NFTA_MATCH_MAX + 1] = { [NFTA_MATCH_NAME] = { .type = NLA_NUL_STRING }, - [NFTA_MATCH_REV] = NLA_POLICY_MAX(NLA_BE32, 255), + [NFTA_MATCH_REV] = { .type = NLA_U32 }, [NFTA_MATCH_INFO] = { .type = NLA_BINARY }, }; @@ -731,7 +724,7 @@ static const struct nla_policy nfnl_compat_policy_get[NFTA_COMPAT_MAX+1] = { [NFTA_COMPAT_NAME] = { .type = NLA_NUL_STRING, .len = NFT_COMPAT_NAME_MAX-1 }, - [NFTA_COMPAT_REV] = NLA_POLICY_MAX(NLA_BE32, 255), + [NFTA_COMPAT_REV] = { .type = NLA_U32 }, [NFTA_COMPAT_TYPE] = { .type = NLA_U32 }, }; diff -u linux-6.5.0/net/netfilter/nft_ct.c linux-6.5.0/net/netfilter/nft_ct.c --- linux-6.5.0/net/netfilter/nft_ct.c +++ linux-6.5.0/net/netfilter/nft_ct.c @@ -474,9 +474,6 @@ break; #endif case NFT_CT_ID: - if (tb[NFTA_CT_DIRECTION]) - return -EINVAL; - len = sizeof(u32); break; default: diff -u linux-6.5.0/net/netfilter/nft_set_pipapo.c linux-6.5.0/net/netfilter/nft_set_pipapo.c --- linux-6.5.0/net/netfilter/nft_set_pipapo.c +++ linux-6.5.0/net/netfilter/nft_set_pipapo.c @@ -342,6 +342,9 @@ #include "nft_set_pipapo_avx2.h" #include "nft_set_pipapo.h" +/* Current working bitmap index, toggled between field matches */ +static DEFINE_PER_CPU(bool, nft_pipapo_scratch_index); + /** * pipapo_refill() - For each set bit, set bits from selected mapping table item * @map: Bitmap to be scanned for set bits @@ -409,7 +412,6 @@ const u32 *key, const struct nft_set_ext **ext) { struct nft_pipapo *priv = nft_set_priv(set); - struct nft_pipapo_scratch *scratch; unsigned long *res_map, *fill_map; u8 genmask = nft_genmask_cur(net); const u8 *rp = (const u8 *)key; @@ -420,17 +422,15 @@ local_bh_disable(); + map_index = raw_cpu_read(nft_pipapo_scratch_index); + m = rcu_dereference(priv->match); if (unlikely(!m || !*raw_cpu_ptr(m->scratch))) goto out; - scratch = *raw_cpu_ptr(m->scratch); - - map_index = scratch->map_index; - - res_map = scratch->map + (map_index ? m->bsize_max : 0); - fill_map = scratch->map + (map_index ? 0 : m->bsize_max); + res_map = *raw_cpu_ptr(m->scratch) + (map_index ? m->bsize_max : 0); + fill_map = *raw_cpu_ptr(m->scratch) + (map_index ? 0 : m->bsize_max); memset(res_map, 0xff, m->bsize_max * sizeof(*res_map)); @@ -460,7 +460,7 @@ b = pipapo_refill(res_map, f->bsize, f->rules, fill_map, f->mt, last); if (b < 0) { - scratch->map_index = map_index; + raw_cpu_write(nft_pipapo_scratch_index, map_index); local_bh_enable(); return false; @@ -477,7 +477,7 @@ * current inactive bitmap is clean and can be reused as * *next* bitmap (not initial) for the next packet. */ - scratch->map_index = map_index; + raw_cpu_write(nft_pipapo_scratch_index, map_index); local_bh_enable(); return true; @@ -1102,25 +1102,6 @@ } /** - * pipapo_free_scratch() - Free per-CPU map at original (not aligned) address - * @m: Matching data - * @cpu: CPU number - */ -static void pipapo_free_scratch(const struct nft_pipapo_match *m, unsigned int cpu) -{ - struct nft_pipapo_scratch *s; - void *mem; - - s = *per_cpu_ptr(m->scratch, cpu); - if (!s) - return; - - mem = s; - mem -= s->align_off; - kfree(mem); -} - -/** * pipapo_realloc_scratch() - Reallocate scratch maps for partial match results * @clone: Copy of matching data with pending insertions and deletions * @bsize_max: Maximum bucket size, scratch maps cover two buckets @@ -1133,13 +1114,12 @@ int i; for_each_possible_cpu(i) { - struct nft_pipapo_scratch *scratch; + unsigned long *scratch; #ifdef NFT_PIPAPO_ALIGN - void *scratch_aligned; - u32 align_off; + unsigned long *scratch_aligned; #endif - scratch = kzalloc_node(struct_size(scratch, map, - bsize_max * 2) + + + scratch = kzalloc_node(bsize_max * sizeof(*scratch) * 2 + NFT_PIPAPO_ALIGN_HEADROOM, GFP_KERNEL, cpu_to_node(i)); if (!scratch) { @@ -1153,25 +1133,14 @@ return -ENOMEM; } - pipapo_free_scratch(clone, i); + kfree(*per_cpu_ptr(clone->scratch, i)); -#ifdef NFT_PIPAPO_ALIGN - /* Align &scratch->map (not the struct itself): the extra - * %NFT_PIPAPO_ALIGN_HEADROOM bytes passed to kzalloc_node() - * above guarantee we can waste up to those bytes in order - * to align the map field regardless of its offset within - * the struct. - */ - BUILD_BUG_ON(offsetof(struct nft_pipapo_scratch, map) > NFT_PIPAPO_ALIGN_HEADROOM); - - scratch_aligned = NFT_PIPAPO_LT_ALIGN(&scratch->map); - scratch_aligned -= offsetof(struct nft_pipapo_scratch, map); - align_off = scratch_aligned - (void *)scratch; + *per_cpu_ptr(clone->scratch, i) = scratch; - scratch = scratch_aligned; - scratch->align_off = align_off; +#ifdef NFT_PIPAPO_ALIGN + scratch_aligned = NFT_PIPAPO_LT_ALIGN(scratch); + *per_cpu_ptr(clone->scratch_aligned, i) = scratch_aligned; #endif - *per_cpu_ptr(clone->scratch, i) = scratch; } return 0; @@ -1324,6 +1293,11 @@ if (!new->scratch) goto out_scratch; +#ifdef NFT_PIPAPO_ALIGN + new->scratch_aligned = alloc_percpu(*new->scratch_aligned); + if (!new->scratch_aligned) + goto out_scratch; +#endif for_each_possible_cpu(i) *per_cpu_ptr(new->scratch, i) = NULL; @@ -1375,7 +1349,10 @@ } out_scratch_realloc: for_each_possible_cpu(i) - pipapo_free_scratch(new, i); + kfree(*per_cpu_ptr(new->scratch, i)); +#ifdef NFT_PIPAPO_ALIGN + free_percpu(new->scratch_aligned); +#endif out_scratch: free_percpu(new->scratch); kfree(new); @@ -1660,9 +1637,13 @@ int i; for_each_possible_cpu(i) - pipapo_free_scratch(m, i); + kfree(*per_cpu_ptr(m->scratch, i)); +#ifdef NFT_PIPAPO_ALIGN + free_percpu(m->scratch_aligned); +#endif free_percpu(m->scratch); + pipapo_free_fields(m); kfree(m); @@ -2149,7 +2130,7 @@ m->field_count = field_count; m->bsize_max = 0; - m->scratch = alloc_percpu(struct nft_pipapo_scratch *); + m->scratch = alloc_percpu(unsigned long *); if (!m->scratch) { err = -ENOMEM; goto out_scratch; @@ -2157,6 +2138,16 @@ for_each_possible_cpu(i) *per_cpu_ptr(m->scratch, i) = NULL; +#ifdef NFT_PIPAPO_ALIGN + m->scratch_aligned = alloc_percpu(unsigned long *); + if (!m->scratch_aligned) { + err = -ENOMEM; + goto out_free; + } + for_each_possible_cpu(i) + *per_cpu_ptr(m->scratch_aligned, i) = NULL; +#endif + rcu_head_init(&m->rcu); nft_pipapo_for_each_field(f, i, m) { @@ -2187,6 +2178,9 @@ return 0; out_free: +#ifdef NFT_PIPAPO_ALIGN + free_percpu(m->scratch_aligned); +#endif free_percpu(m->scratch); out_scratch: kfree(m); @@ -2238,8 +2232,13 @@ if (m) { rcu_barrier(); + nft_set_pipapo_match_destroy(ctx, set, m); + +#ifdef NFT_PIPAPO_ALIGN + free_percpu(m->scratch_aligned); +#endif for_each_possible_cpu(cpu) - pipapo_free_scratch(m, cpu); + kfree(*per_cpu_ptr(m->scratch, cpu)); free_percpu(m->scratch); pipapo_free_fields(m); kfree(m); @@ -2249,10 +2248,14 @@ if (priv->clone) { m = priv->clone; - nft_set_pipapo_match_destroy(ctx, set, m); + if (priv->dirty) + nft_set_pipapo_match_destroy(ctx, set, m); +#ifdef NFT_PIPAPO_ALIGN + free_percpu(priv->clone->scratch_aligned); +#endif for_each_possible_cpu(cpu) - pipapo_free_scratch(priv->clone, cpu); + kfree(*per_cpu_ptr(priv->clone->scratch, cpu)); free_percpu(priv->clone->scratch); pipapo_free_fields(priv->clone); reverted: --- linux-6.5.0/net/netfilter/nft_set_pipapo.h +++ linux-6.5.0.orig/net/netfilter/nft_set_pipapo.h @@ -131,28 +131,20 @@ }; /** - * struct nft_pipapo_scratch - percpu data used for lookup and matching - * @map_index: Current working bitmap index, toggled between field matches - * @align_off: Offset to get the originally allocated address - * @map: store partial matching results during lookup - */ -struct nft_pipapo_scratch { - u8 map_index; - u32 align_off; - unsigned long map[]; -}; - -/** * struct nft_pipapo_match - Data used for lookup and matching * @field_count Amount of fields in set * @scratch: Preallocated per-CPU maps for partial matching results + * @scratch_aligned: Version of @scratch aligned to NFT_PIPAPO_ALIGN bytes * @bsize_max: Maximum lookup table bucket size of all fields, in longs * @rcu Matching data is swapped on commits * @f: Fields, with lookup and mapping tables */ struct nft_pipapo_match { int field_count; +#ifdef NFT_PIPAPO_ALIGN + unsigned long * __percpu *scratch_aligned; +#endif + unsigned long * __percpu *scratch; - struct nft_pipapo_scratch * __percpu *scratch; size_t bsize_max; struct rcu_head rcu; struct nft_pipapo_field f[]; reverted: --- linux-6.5.0/net/netfilter/nft_set_pipapo_avx2.c +++ linux-6.5.0.orig/net/netfilter/nft_set_pipapo_avx2.c @@ -57,7 +57,7 @@ /* Jump to label if @reg is zero */ #define NFT_PIPAPO_AVX2_NOMATCH_GOTO(reg, label) \ + asm_volatile_goto("vptest %%ymm" #reg ", %%ymm" #reg ";" \ - asm goto("vptest %%ymm" #reg ", %%ymm" #reg ";" \ "je %l[" #label "]" : : : : label) /* Store 256 bits from YMM register into memory. Contrary to bucket load @@ -71,6 +71,9 @@ #define NFT_PIPAPO_AVX2_ZERO(reg) \ asm volatile("vpxor %ymm" #reg ", %ymm" #reg ", %ymm" #reg) +/* Current working bitmap index, toggled between field matches */ +static DEFINE_PER_CPU(bool, nft_pipapo_avx2_scratch_index); + /** * nft_pipapo_avx2_prepare() - Prepare before main algorithm body * @@ -1117,12 +1120,11 @@ const u32 *key, const struct nft_set_ext **ext) { struct nft_pipapo *priv = nft_set_priv(set); + unsigned long *res, *fill, *scratch; - struct nft_pipapo_scratch *scratch; u8 genmask = nft_genmask_cur(net); const u8 *rp = (const u8 *)key; struct nft_pipapo_match *m; struct nft_pipapo_field *f; - unsigned long *res, *fill; bool map_index; int i, ret = 0; @@ -1139,16 +1141,15 @@ */ kernel_fpu_begin_mask(0); + scratch = *raw_cpu_ptr(m->scratch_aligned); - scratch = *raw_cpu_ptr(m->scratch); if (unlikely(!scratch)) { kernel_fpu_end(); return false; } + map_index = raw_cpu_read(nft_pipapo_avx2_scratch_index); + res = scratch + (map_index ? m->bsize_max : 0); + fill = scratch + (map_index ? 0 : m->bsize_max); - map_index = scratch->map_index; - - res = scratch->map + (map_index ? m->bsize_max : 0); - fill = scratch->map + (map_index ? 0 : m->bsize_max); /* Starting map doesn't need to be set for this implementation */ @@ -1220,7 +1221,7 @@ out: if (i % 2) + raw_cpu_write(nft_pipapo_avx2_scratch_index, !map_index); - scratch->map_index = !map_index; kernel_fpu_end(); return ret >= 0; diff -u linux-6.5.0/net/nfc/nci/core.c linux-6.5.0/net/nfc/nci/core.c --- linux-6.5.0/net/nfc/nci/core.c +++ linux-6.5.0/net/nfc/nci/core.c @@ -1208,10 +1208,6 @@ { nfc_free_device(ndev->nfc_dev); nci_hci_deallocate(ndev); - - /* drop partial rx data packet if present */ - if (ndev->rx_data_reassembly) - kfree_skb(ndev->rx_data_reassembly); kfree(ndev); } EXPORT_SYMBOL(nci_free_device); reverted: --- linux-6.5.0/net/openvswitch/flow_netlink.c +++ linux-6.5.0.orig/net/openvswitch/flow_netlink.c @@ -47,7 +47,6 @@ #define OVS_ATTR_NESTED -1 #define OVS_ATTR_VARIABLE -2 -#define OVS_COPY_ACTIONS_MAX_DEPTH 16 static bool actions_may_change_flow(const struct nlattr *actions) { @@ -2544,15 +2543,13 @@ const struct sw_flow_key *key, struct sw_flow_actions **sfa, __be16 eth_type, __be16 vlan_tci, + u32 mpls_label_count, bool log); - u32 mpls_label_count, bool log, - u32 depth); static int validate_and_copy_sample(struct net *net, const struct nlattr *attr, const struct sw_flow_key *key, struct sw_flow_actions **sfa, __be16 eth_type, __be16 vlan_tci, + u32 mpls_label_count, bool log, bool last) - u32 mpls_label_count, bool log, bool last, - u32 depth) { const struct nlattr *attrs[OVS_SAMPLE_ATTR_MAX + 1]; const struct nlattr *probability, *actions; @@ -2603,8 +2600,7 @@ return err; err = __ovs_nla_copy_actions(net, actions, key, sfa, + eth_type, vlan_tci, mpls_label_count, log); - eth_type, vlan_tci, mpls_label_count, log, - depth + 1); if (err) return err; @@ -2619,8 +2615,7 @@ const struct sw_flow_key *key, struct sw_flow_actions **sfa, __be16 eth_type, __be16 vlan_tci, + u32 mpls_label_count, bool log) - u32 mpls_label_count, bool log, - u32 depth) { const struct nlattr *attrs[OVS_DEC_TTL_ATTR_MAX + 1]; int start, action_start, err, rem; @@ -2663,8 +2658,7 @@ return action_start; err = __ovs_nla_copy_actions(net, actions, key, sfa, eth_type, + vlan_tci, mpls_label_count, log); - vlan_tci, mpls_label_count, log, - depth + 1); if (err) return err; @@ -2678,8 +2672,7 @@ const struct sw_flow_key *key, struct sw_flow_actions **sfa, __be16 eth_type, __be16 vlan_tci, + u32 mpls_label_count, bool log, bool last) - u32 mpls_label_count, bool log, bool last, - u32 depth) { int start, err; u32 exec; @@ -2699,8 +2692,7 @@ return err; err = __ovs_nla_copy_actions(net, attr, key, sfa, + eth_type, vlan_tci, mpls_label_count, log); - eth_type, vlan_tci, mpls_label_count, log, - depth + 1); if (err) return err; @@ -3069,7 +3061,7 @@ struct sw_flow_actions **sfa, __be16 eth_type, __be16 vlan_tci, u32 mpls_label_count, + bool log, bool last) - bool log, bool last, u32 depth) { const struct nlattr *acts_if_greater, *acts_if_lesser_eq; struct nlattr *a[OVS_CHECK_PKT_LEN_ATTR_MAX + 1]; @@ -3117,8 +3109,7 @@ return nested_acts_start; err = __ovs_nla_copy_actions(net, acts_if_lesser_eq, key, sfa, + eth_type, vlan_tci, mpls_label_count, log); - eth_type, vlan_tci, mpls_label_count, log, - depth + 1); if (err) return err; @@ -3131,8 +3122,7 @@ return nested_acts_start; err = __ovs_nla_copy_actions(net, acts_if_greater, key, sfa, + eth_type, vlan_tci, mpls_label_count, log); - eth_type, vlan_tci, mpls_label_count, log, - depth + 1); if (err) return err; @@ -3160,16 +3150,12 @@ const struct sw_flow_key *key, struct sw_flow_actions **sfa, __be16 eth_type, __be16 vlan_tci, + u32 mpls_label_count, bool log) - u32 mpls_label_count, bool log, - u32 depth) { u8 mac_proto = ovs_key_mac_proto(key); const struct nlattr *a; int rem, err; - if (depth > OVS_COPY_ACTIONS_MAX_DEPTH) - return -EOVERFLOW; - nla_for_each_nested(a, attr, rem) { /* Expected argument lengths, (u32)-1 for variable length. */ static const u32 action_lens[OVS_ACTION_ATTR_MAX + 1] = { @@ -3366,7 +3352,7 @@ err = validate_and_copy_sample(net, a, key, sfa, eth_type, vlan_tci, mpls_label_count, + log, last); - log, last, depth); if (err) return err; skip_copy = true; @@ -3437,7 +3423,7 @@ err = validate_and_copy_clone(net, a, key, sfa, eth_type, vlan_tci, mpls_label_count, + log, last); - log, last, depth); if (err) return err; skip_copy = true; @@ -3451,8 +3437,7 @@ eth_type, vlan_tci, mpls_label_count, + log, last); - log, last, - depth); if (err) return err; skip_copy = true; @@ -3462,8 +3447,7 @@ case OVS_ACTION_ATTR_DEC_TTL: err = validate_and_copy_dec_ttl(net, a, key, sfa, eth_type, vlan_tci, + mpls_label_count, log); - mpls_label_count, log, - depth); if (err) return err; skip_copy = true; @@ -3503,8 +3487,7 @@ (*sfa)->orig_len = nla_len(attr); err = __ovs_nla_copy_actions(net, attr, key, sfa, key->eth.type, + key->eth.vlan.tci, mpls_label_count, log); - key->eth.vlan.tci, mpls_label_count, log, - 0); if (err) ovs_nla_free_flow_actions(*sfa); diff -u linux-6.5.0/net/rxrpc/ar-internal.h linux-6.5.0/net/rxrpc/ar-internal.h --- linux-6.5.0/net/rxrpc/ar-internal.h +++ linux-6.5.0/net/rxrpc/ar-internal.h @@ -198,19 +198,11 @@ */ struct rxrpc_skb_priv { struct rxrpc_connection *conn; /* Connection referred to (poke packet) */ - union { - struct { - u16 offset; /* Offset of data */ - u16 len; /* Length of data */ - u8 flags; + u16 offset; /* Offset of data */ + u16 len; /* Length of data */ + u8 flags; #define RXRPC_RX_VERIFIED 0x01 - }; - struct { - rxrpc_seq_t first_ack; /* First packet in acks table */ - u8 nr_acks; /* Number of acks+nacks */ - u8 nr_nacks; /* Number of nacks */ - }; - }; + struct rxrpc_host_header hdr; /* RxRPC packet header from this packet */ }; @@ -514,7 +506,7 @@ enum rxrpc_call_completion completion; /* Completion condition */ s32 abort_code; /* Abort code of connection abort */ int debug_id; /* debug ID for printks */ - rxrpc_serial_t tx_serial; /* Outgoing packet serial number counter */ + atomic_t serial; /* packet serial number counter */ unsigned int hi_serial; /* highest serial number received */ u32 service_id; /* Service ID, possibly upgraded */ u32 security_level; /* Security level selected */ @@ -696,11 +688,11 @@ u8 cong_dup_acks; /* Count of ACKs showing missing packets */ u8 cong_cumul_acks; /* Cumulative ACK count */ ktime_t cong_tstamp; /* Last time cwnd was changed */ - struct sk_buff *cong_last_nack; /* Last ACK with nacks received */ /* Receive-phase ACK management (ACKs we send). */ u8 ackr_reason; /* reason to ACK */ u16 ackr_sack_base; /* Starting slot in SACK table ring */ + rxrpc_serial_t ackr_serial; /* serial of packet being ACK'd */ rxrpc_seq_t ackr_window; /* Base of SACK window */ rxrpc_seq_t ackr_wtop; /* Base of SACK window */ unsigned int ackr_nr_unacked; /* Number of unacked packets */ @@ -734,8 +726,7 @@ struct rxrpc_ack_summary { u16 nr_acks; /* Number of ACKs in packet */ u16 nr_new_acks; /* Number of new ACKs in packet */ - u16 nr_new_nacks; /* Number of new nacks in packet */ - u16 nr_retained_nacks; /* Number of nacks retained between ACKs */ + u16 nr_rot_new_acks; /* Number of rotated new ACKs */ u8 ack_reason; bool saw_nacks; /* Saw NACKs in packet */ bool new_low_nack; /* T if new low NACK found */ @@ -828,20 +819,6 @@ #include /* - * Allocate the next serial number on a connection. 0 must be skipped. - */ -static inline rxrpc_serial_t rxrpc_get_next_serial(struct rxrpc_connection *conn) -{ - rxrpc_serial_t serial; - - serial = conn->tx_serial; - if (serial == 0) - serial = 1; - conn->tx_serial = serial + 1; - return serial; -} - -/* * af_rxrpc.c */ extern atomic_t rxrpc_n_rx_skbs; reverted: --- linux-6.5.0/net/rxrpc/call_event.c +++ linux-6.5.0.orig/net/rxrpc/call_event.c @@ -43,6 +43,8 @@ unsigned long expiry = rxrpc_soft_ack_delay; unsigned long now = jiffies, ack_at; + call->ackr_serial = serial; + if (rxrpc_soft_ack_delay < expiry) expiry = rxrpc_soft_ack_delay; if (call->peer->srtt_us != 0) @@ -112,7 +114,6 @@ void rxrpc_resend(struct rxrpc_call *call, struct sk_buff *ack_skb) { struct rxrpc_ackpacket *ack = NULL; - struct rxrpc_skb_priv *sp; struct rxrpc_txbuf *txb; unsigned long resend_at; rxrpc_seq_t transmitted = READ_ONCE(call->tx_transmitted); @@ -140,15 +141,14 @@ * explicitly NAK'd packets. */ if (ack_skb) { - sp = rxrpc_skb(ack_skb); ack = (void *)ack_skb->data + sizeof(struct rxrpc_wire_header); + for (i = 0; i < ack->nAcks; i++) { - for (i = 0; i < sp->nr_acks; i++) { rxrpc_seq_t seq; if (ack->acks[i] & 1) continue; + seq = ntohl(ack->firstPacket) + i; - seq = sp->first_ack + i; if (after(txb->seq, transmitted)) break; if (after(txb->seq, seq)) @@ -373,6 +373,7 @@ bool rxrpc_input_call_event(struct rxrpc_call *call, struct sk_buff *skb) { unsigned long now, next, t; + rxrpc_serial_t ackr_serial; bool resend = false, expired = false; s32 abort_code; @@ -422,7 +423,8 @@ if (time_after_eq(now, t)) { trace_rxrpc_timer(call, rxrpc_timer_exp_ack, now); cmpxchg(&call->delay_ack_at, t, now + MAX_JIFFY_OFFSET); + ackr_serial = xchg(&call->ackr_serial, 0); + rxrpc_send_ACK(call, RXRPC_ACK_DELAY, ackr_serial, - rxrpc_send_ACK(call, RXRPC_ACK_DELAY, 0, rxrpc_propose_ack_ping_for_lost_ack); } diff -u linux-6.5.0/net/rxrpc/call_object.c linux-6.5.0/net/rxrpc/call_object.c --- linux-6.5.0/net/rxrpc/call_object.c +++ linux-6.5.0/net/rxrpc/call_object.c @@ -685,7 +685,6 @@ del_timer_sync(&call->timer); - rxrpc_free_skb(call->cong_last_nack, rxrpc_skb_put_last_nack); rxrpc_cleanup_ring(call); while ((txb = list_first_entry_or_null(&call->tx_sendmsg, struct rxrpc_txbuf, call_link))) { reverted: --- linux-6.5.0/net/rxrpc/conn_event.c +++ linux-6.5.0.orig/net/rxrpc/conn_event.c @@ -95,14 +95,6 @@ _enter("%d", conn->debug_id); - if (sp && sp->hdr.type == RXRPC_PACKET_TYPE_ACK) { - if (skb_copy_bits(skb, sizeof(struct rxrpc_wire_header), - &pkt.ack, sizeof(pkt.ack)) < 0) - return; - if (pkt.ack.reason == RXRPC_ACK_PING_RESPONSE) - return; - } - chan = &conn->channels[channel]; /* If the last call got moved on whilst we were waiting to run, just @@ -125,7 +117,7 @@ iov[2].iov_base = &ack_info; iov[2].iov_len = sizeof(ack_info); + serial = atomic_inc_return(&conn->serial); - serial = rxrpc_get_next_serial(conn); pkt.whdr.epoch = htonl(conn->proto.epoch); pkt.whdr.cid = htonl(conn->proto.cid | channel); diff -u linux-6.5.0/net/rxrpc/input.c linux-6.5.0/net/rxrpc/input.c --- linux-6.5.0/net/rxrpc/input.c +++ linux-6.5.0/net/rxrpc/input.c @@ -45,9 +45,11 @@ } cumulative_acks += summary->nr_new_acks; + cumulative_acks += summary->nr_rot_new_acks; if (cumulative_acks > 255) cumulative_acks = 255; + summary->mode = call->cong_mode; summary->cwnd = call->cong_cwnd; summary->ssthresh = call->cong_ssthresh; summary->cumulative_acks = cumulative_acks; @@ -149,7 +151,6 @@ cwnd = RXRPC_TX_MAX_WINDOW; call->cong_cwnd = cwnd; call->cong_cumul_acks = cumulative_acks; - summary->mode = call->cong_mode; trace_rxrpc_congest(call, summary, acked_serial, change); if (resend) rxrpc_resend(call, skb); @@ -212,6 +213,7 @@ list_for_each_entry_rcu(txb, &call->tx_buffer, call_link, false) { if (before_eq(txb->seq, call->acks_hard_ack)) continue; + summary->nr_rot_new_acks++; if (test_bit(RXRPC_TXBUF_LAST, &txb->flags)) { set_bit(RXRPC_CALL_TX_LAST, &call->flags); rot_last = true; @@ -252,11 +254,6 @@ { ASSERT(test_bit(RXRPC_CALL_TX_LAST, &call->flags)); - if (unlikely(call->cong_last_nack)) { - rxrpc_free_skb(call->cong_last_nack, rxrpc_skb_put_last_nack); - call->cong_last_nack = NULL; - } - switch (__rxrpc_call_state(call)) { case RXRPC_CALL_CLIENT_SEND_REQUEST: case RXRPC_CALL_CLIENT_AWAIT_REPLY: @@ -706,43 +703,6 @@ } /* - * Determine how many nacks from the previous ACK have now been satisfied. - */ -static rxrpc_seq_t rxrpc_input_check_prev_ack(struct rxrpc_call *call, - struct rxrpc_ack_summary *summary, - rxrpc_seq_t seq) -{ - struct sk_buff *skb = call->cong_last_nack; - struct rxrpc_ackpacket ack; - struct rxrpc_skb_priv *sp = rxrpc_skb(skb); - unsigned int i, new_acks = 0, retained_nacks = 0; - rxrpc_seq_t old_seq = sp->first_ack; - u8 *acks = skb->data + sizeof(struct rxrpc_wire_header) + sizeof(ack); - - if (after_eq(seq, old_seq + sp->nr_acks)) { - summary->nr_new_acks += sp->nr_nacks; - summary->nr_new_acks += seq - (old_seq + sp->nr_acks); - summary->nr_retained_nacks = 0; - } else if (seq == old_seq) { - summary->nr_retained_nacks = sp->nr_nacks; - } else { - for (i = 0; i < sp->nr_acks; i++) { - if (acks[i] == RXRPC_ACK_TYPE_NACK) { - if (before(old_seq + i, seq)) - new_acks++; - else - retained_nacks++; - } - } - - summary->nr_new_acks += new_acks; - summary->nr_retained_nacks = retained_nacks; - } - - return old_seq + sp->nr_acks; -} - -/* * Process individual soft ACKs. * * Each ACK in the array corresponds to one packet and can be either an ACK or @@ -751,51 +711,25 @@ * the timer on the basis that the peer might just not have processed them at * the time the ACK was sent. */ -static void rxrpc_input_soft_acks(struct rxrpc_call *call, - struct rxrpc_ack_summary *summary, - struct sk_buff *skb, - rxrpc_seq_t seq, - rxrpc_seq_t since) +static void rxrpc_input_soft_acks(struct rxrpc_call *call, u8 *acks, + rxrpc_seq_t seq, int nr_acks, + struct rxrpc_ack_summary *summary) { - struct rxrpc_skb_priv *sp = rxrpc_skb(skb); - unsigned int i, old_nacks = 0; - rxrpc_seq_t lowest_nak = seq + sp->nr_acks; - u8 *acks = skb->data + sizeof(struct rxrpc_wire_header) + sizeof(struct rxrpc_ackpacket); + unsigned int i; - for (i = 0; i < sp->nr_acks; i++) { + for (i = 0; i < nr_acks; i++) { if (acks[i] == RXRPC_ACK_TYPE_ACK) { summary->nr_acks++; - if (after_eq(seq, since)) - summary->nr_new_acks++; + summary->nr_new_acks++; } else { - summary->saw_nacks = true; - if (before(seq, since)) { - /* Overlap with previous ACK */ - old_nacks++; - } else { - summary->nr_new_nacks++; - sp->nr_nacks++; + if (!summary->saw_nacks && + call->acks_lowest_nak != seq + i) { + call->acks_lowest_nak = seq + i; + summary->new_low_nack = true; } - - if (before(seq, lowest_nak)) - lowest_nak = seq; + summary->saw_nacks = true; } - seq++; - } - - if (lowest_nak != call->acks_lowest_nak) { - call->acks_lowest_nak = lowest_nak; - summary->new_low_nack = true; } - - /* We *can* have more nacks than we did - the peer is permitted to drop - * packets it has soft-acked and re-request them. Further, it is - * possible for the nack distribution to change whilst the number of - * nacks stays the same or goes down. - */ - if (old_nacks < summary->nr_retained_nacks) - summary->nr_new_acks += summary->nr_retained_nacks - old_nacks; - summary->nr_retained_nacks = old_nacks; } /* @@ -839,7 +773,7 @@ struct rxrpc_skb_priv *sp = rxrpc_skb(skb); struct rxrpc_ackinfo info; rxrpc_serial_t ack_serial, acked_serial; - rxrpc_seq_t first_soft_ack, hard_ack, prev_pkt, since; + rxrpc_seq_t first_soft_ack, hard_ack, prev_pkt; int nr_acks, offset, ioffset; _enter(""); @@ -855,8 +789,6 @@ prev_pkt = ntohl(ack.previousPacket); hard_ack = first_soft_ack - 1; nr_acks = ack.nAcks; - sp->first_ack = first_soft_ack; - sp->nr_acks = nr_acks; summary.ack_reason = (ack.reason < RXRPC_ACK__INVALID ? ack.reason : RXRPC_ACK__INVALID); @@ -926,16 +858,6 @@ if (nr_acks > 0) skb_condense(skb); - if (call->cong_last_nack) { - since = rxrpc_input_check_prev_ack(call, &summary, first_soft_ack); - rxrpc_free_skb(call->cong_last_nack, rxrpc_skb_put_last_nack); - call->cong_last_nack = NULL; - } else { - summary.nr_new_acks = first_soft_ack - call->acks_first_seq; - call->acks_lowest_nak = first_soft_ack + nr_acks; - since = first_soft_ack; - } - call->acks_latest_ts = skb->tstamp; call->acks_first_seq = first_soft_ack; call->acks_prev_seq = prev_pkt; @@ -944,7 +866,7 @@ case RXRPC_ACK_PING: break; default: - if (acked_serial && after(acked_serial, call->acks_highest_serial)) + if (after(acked_serial, call->acks_highest_serial)) call->acks_highest_serial = acked_serial; break; } @@ -983,9 +905,8 @@ if (nr_acks > 0) { if (offset > (int)skb->len - nr_acks) return rxrpc_proto_abort(call, 0, rxrpc_eproto_ackr_short_sack); - rxrpc_input_soft_acks(call, &summary, skb, first_soft_ack, since); - rxrpc_get_skb(skb, rxrpc_skb_get_last_nack); - call->cong_last_nack = skb; + rxrpc_input_soft_acks(call, skb->data + offset, first_soft_ack, + nr_acks, &summary); } if (test_bit(RXRPC_CALL_TX_LAST, &call->flags) && diff -u linux-6.5.0/net/rxrpc/output.c linux-6.5.0/net/rxrpc/output.c --- linux-6.5.0/net/rxrpc/output.c +++ linux-6.5.0/net/rxrpc/output.c @@ -216,7 +216,7 @@ iov[0].iov_len = sizeof(txb->wire) + sizeof(txb->ack) + n; len = iov[0].iov_len; - serial = rxrpc_get_next_serial(conn); + serial = atomic_inc_return(&conn->serial); txb->wire.serial = htonl(serial); trace_rxrpc_tx_ack(call->debug_id, serial, ntohl(txb->ack.firstPacket), @@ -302,7 +302,7 @@ iov[0].iov_base = &pkt; iov[0].iov_len = sizeof(pkt); - serial = rxrpc_get_next_serial(conn); + serial = atomic_inc_return(&conn->serial); pkt.whdr.serial = htonl(serial); iov_iter_kvec(&msg.msg_iter, WRITE, iov, 1, sizeof(pkt)); @@ -334,7 +334,7 @@ _enter("%x,{%d}", txb->seq, txb->len); /* Each transmission of a Tx packet needs a new serial number */ - serial = rxrpc_get_next_serial(conn); + serial = atomic_inc_return(&conn->serial); txb->wire.serial = htonl(serial); if (test_bit(RXRPC_CONN_PROBING_FOR_UPGRADE, &conn->flags) && @@ -558,7 +558,7 @@ len = iov[0].iov_len + iov[1].iov_len; - serial = rxrpc_get_next_serial(conn); + serial = atomic_inc_return(&conn->serial); whdr.serial = htonl(serial); iov_iter_kvec(&msg.msg_iter, WRITE, iov, 2, len); reverted: --- linux-6.5.0/net/rxrpc/proc.c +++ linux-6.5.0.orig/net/rxrpc/proc.c @@ -181,7 +181,7 @@ atomic_read(&conn->active), state, key_serial(conn->key), + atomic_read(&conn->serial), - conn->tx_serial, conn->hi_serial, conn->channels[0].call_id, conn->channels[1].call_id, diff -u linux-6.5.0/net/rxrpc/rxkad.c linux-6.5.0/net/rxrpc/rxkad.c --- linux-6.5.0/net/rxrpc/rxkad.c +++ linux-6.5.0/net/rxrpc/rxkad.c @@ -664,7 +664,7 @@ len = iov[0].iov_len + iov[1].iov_len; - serial = rxrpc_get_next_serial(conn); + serial = atomic_inc_return(&conn->serial); whdr.serial = htonl(serial); ret = kernel_sendmsg(conn->local->socket, &msg, iov, 2, len); @@ -721,7 +721,7 @@ len = iov[0].iov_len + iov[1].iov_len + iov[2].iov_len; - serial = rxrpc_get_next_serial(conn); + serial = atomic_inc_return(&conn->serial); whdr.serial = htonl(serial); rxrpc_local_dont_fragment(conn->local, false); reverted: --- linux-6.5.0/net/tipc/bearer.c +++ linux-6.5.0.orig/net/tipc/bearer.c @@ -1086,12 +1086,6 @@ #ifdef CONFIG_TIPC_MEDIA_UDP if (attrs[TIPC_NLA_BEARER_UDP_OPTS]) { - if (b->media->type_id != TIPC_MEDIA_TYPE_UDP) { - rtnl_unlock(); - NL_SET_ERR_MSG(info->extack, "UDP option is unsupported"); - return -EINVAL; - } - err = tipc_udp_nl_bearer_add(b, attrs[TIPC_NLA_BEARER_UDP_OPTS]); if (err) { reverted: --- linux-6.5.0/net/unix/garbage.c +++ linux-6.5.0.orig/net/unix/garbage.c @@ -314,17 +314,6 @@ /* Here we are. Hitlist is filled. Die. */ __skb_queue_purge(&hitlist); -#if IS_ENABLED(CONFIG_AF_UNIX_OOB) - list_for_each_entry_safe(u, next, &gc_candidates, link) { - struct sk_buff *skb = u->oob_skb; - - if (skb) { - u->oob_skb = NULL; - kfree_skb(skb); - } - } -#endif - spin_lock(&unix_gc_lock); /* There could be io_uring registered files, just push them back to diff -u linux-6.5.0/net/wireless/core.c linux-6.5.0/net/wireless/core.c --- linux-6.5.0/net/wireless/core.c +++ linux-6.5.0/net/wireless/core.c @@ -1675,7 +1675,6 @@ unsigned long delay) { if (!delay) { - del_timer(&dwork->timer); wiphy_work_queue(wiphy, &dwork->work); return; } reverted: --- linux-6.5.0/rust/kernel/print.rs +++ linux-6.5.0.orig/rust/kernel/print.rs @@ -399,7 +399,6 @@ /// Mimics the interface of [`std::print!`]. See [`core::fmt`] and /// `alloc::format!` for information about the formatting syntax. /// -/// [`pr_info!`]: crate::pr_info! /// [`pr_cont`]: https://www.kernel.org/doc/html/latest/core-api/printk-basics.html#c.pr_cont /// [`std::print!`]: https://doc.rust-lang.org/std/macro.print.html /// reverted: --- linux-6.5.0/rust/kernel/sync/arc.rs +++ linux-6.5.0.orig/rust/kernel/sync/arc.rs @@ -299,7 +299,7 @@ // The count reached zero, we must free the memory. // // SAFETY: The pointer was initialised from the result of `Box::leak`. + unsafe { Box::from_raw(self.ptr.as_ptr()) }; - unsafe { drop(Box::from_raw(self.ptr.as_ptr())) }; } } } reverted: --- linux-6.5.0/rust/kernel/task.rs +++ linux-6.5.0.orig/rust/kernel/task.rs @@ -82,7 +82,7 @@ /// Returns a task reference for the currently executing task/thread. /// /// The recommended way to get the current task/thread is to use the + /// [`current`](crate::current) macro because it is safe. - /// [`current`] macro because it is safe. /// /// # Safety /// reverted: --- linux-6.5.0/samples/bpf/asm_goto_workaround.h +++ linux-6.5.0.orig/samples/bpf/asm_goto_workaround.h @@ -4,14 +4,14 @@ #define __ASM_GOTO_WORKAROUND_H /* + * This will bring in asm_volatile_goto and asm_inline macro definitions - * This will bring in asm_goto_output and asm_inline macro definitions * if enabled by compiler and config options. */ #include +#ifdef asm_volatile_goto +#undef asm_volatile_goto +#define asm_volatile_goto(x...) asm volatile("invalid use of asm_volatile_goto") -#ifdef asm_goto_output -#undef asm_goto_output -#define asm_goto_output(x...) asm volatile("invalid use of asm_goto_output") #endif /* reverted: --- linux-6.5.0/scripts/link-vmlinux.sh +++ linux-6.5.0.orig/scripts/link-vmlinux.sh @@ -135,13 +135,8 @@ ${OBJCOPY} --only-section=.BTF --set-section-flags .BTF=alloc,readonly \ --strip-all ${1} ${2} 2>/dev/null # Change e_type to ET_REL so that it can be used to link final vmlinux. + # Unlike GNU ld, lld does not allow an ET_EXEC input. + printf '\1' | dd of=${2} conv=notrunc bs=1 seek=16 status=none - # GNU ld 2.35+ and lld do not allow an ET_EXEC input. - if is_enabled CONFIG_CPU_BIG_ENDIAN; then - et_rel='\0\1' - else - et_rel='\1\0' - fi - printf "${et_rel}" | dd of=${2} conv=notrunc bs=1 seek=16 status=none } # Create ${2} .S file with all symbols from the ${1} object file reverted: --- linux-6.5.0/scripts/mksysmap +++ linux-6.5.0.orig/scripts/mksysmap @@ -48,8 +48,17 @@ / __kvm_nvhe_\\$/d / __kvm_nvhe_\.L/d +# arm64 lld +/ __AArch64ADRPThunk_/d + +# arm lld +/ __ARMV5PILongThunk_/d +/ __ARMV7PILongThunk_/d +/ __ThumbV7PILongThunk_/d + +# mips lld +/ __LA25Thunk_/d +/ __microLA25Thunk_/d -# lld arm/aarch64/mips thunks -/ __[[:alnum:]]*Thunk_/d # CFI type identifiers / __kcfi_typeid_/d diff -u linux-6.5.0/scripts/mod/modpost.c linux-6.5.0/scripts/mod/modpost.c --- linux-6.5.0/scripts/mod/modpost.c +++ linux-6.5.0/scripts/mod/modpost.c @@ -796,7 +796,7 @@ #define ALL_INIT_TEXT_SECTIONS \ ".init.text", ".meminit.text" #define ALL_EXIT_TEXT_SECTIONS \ - ".exit.text" + ".exit.text", ".memexit.text" #define ALL_PCI_INIT_SECTIONS \ ".pci_fixup_early", ".pci_fixup_header", ".pci_fixup_final", \ @@ -804,14 +804,14 @@ ".pci_fixup_resume_early", ".pci_fixup_suspend" #define ALL_XXXINIT_SECTIONS MEM_INIT_SECTIONS +#define ALL_XXXEXIT_SECTIONS MEM_EXIT_SECTIONS #define ALL_INIT_SECTIONS INIT_SECTIONS, ALL_XXXINIT_SECTIONS -#define ALL_EXIT_SECTIONS EXIT_SECTIONS +#define ALL_EXIT_SECTIONS EXIT_SECTIONS, ALL_XXXEXIT_SECTIONS #define DATA_SECTIONS ".data", ".data.rel" #define TEXT_SECTIONS ".text", ".text.*", ".sched.text", \ - ".kprobes.text", ".cpuidle.text", ".noinstr.text", \ - ".ltext", ".ltext.*" + ".kprobes.text", ".cpuidle.text", ".noinstr.text" #define OTHER_TEXT_SECTIONS ".ref.text", ".head.text", ".spinlock.text", \ ".fixup", ".entry.text", ".exception.text", \ ".coldtext", ".softirqentry.text" @@ -820,6 +820,7 @@ #define MEM_INIT_SECTIONS ".meminit.*" #define EXIT_SECTIONS ".exit.*" +#define MEM_EXIT_SECTIONS ".memexit.*" #define ALL_TEXT_SECTIONS ALL_INIT_TEXT_SECTIONS, ALL_EXIT_TEXT_SECTIONS, \ TEXT_SECTIONS, OTHER_TEXT_SECTIONS @@ -829,6 +830,7 @@ DATA_TO_ANY_INIT, TEXTDATA_TO_ANY_EXIT, XXXINIT_TO_SOME_INIT, + XXXEXIT_TO_SOME_EXIT, ANY_INIT_TO_ANY_EXIT, ANY_EXIT_TO_ANY_INIT, EXTABLE_TO_NON_TEXT, @@ -879,6 +881,12 @@ .bad_tosec = { INIT_SECTIONS, NULL }, .mismatch = XXXINIT_TO_SOME_INIT, }, +/* Do not reference exit code/data from memexit code/data */ +{ + .fromsec = { ALL_XXXEXIT_SECTIONS, NULL }, + .bad_tosec = { EXIT_SECTIONS, NULL }, + .mismatch = XXXEXIT_TO_SOME_EXIT, +}, /* Do not use exit code/data from init code */ { .fromsec = { ALL_INIT_SECTIONS, NULL }, @@ -1005,20 +1013,9 @@ "*_console"))) return 0; - /* symbols in data sections that may refer to meminit sections */ + /* symbols in data sections that may refer to meminit/exit sections */ if (match(fromsec, PATTERNS(DATA_SECTIONS)) && - match(tosec, PATTERNS(ALL_XXXINIT_SECTIONS)) && - match(fromsym, PATTERNS("*driver"))) - return 0; - - /* - * symbols in data sections must not refer to .exit.*, but there are - * quite a few offenders, so hide these unless for W=1 builds until - * these are fixed. - */ - if (!extra_warn && - match(fromsec, PATTERNS(DATA_SECTIONS)) && - match(tosec, PATTERNS(EXIT_SECTIONS)) && + match(tosec, PATTERNS(ALL_XXXINIT_SECTIONS, ALL_EXIT_SECTIONS)) && match(fromsym, PATTERNS("*driver"))) return 0; reverted: --- linux-6.5.0/scripts/mod/sumversion.c +++ linux-6.5.0.orig/scripts/mod/sumversion.c @@ -326,12 +326,7 @@ /* Sum all files in the same dir or subdirs. */ while ((line = get_line(&pos))) { + char* p = line; - char* p; - - /* trim the leading spaces away */ - while (isspace(*line)) - line++; - p = line; if (strncmp(line, "source_", sizeof("source_")-1) == 0) { p = strrchr(line, ' '); diff -u linux-6.5.0/security/security.c linux-6.5.0/security/security.c --- linux-6.5.0/security/security.c +++ linux-6.5.0/security/security.c @@ -4283,7 +4283,7 @@ return hp->hook.inode_getsecctx(inode, (void **)&cp->context, &cp->len); } - return LSM_RET_DEFAULT(inode_getsecctx); + return -EOPNOTSUPP; } EXPORT_SYMBOL(security_inode_getsecctx); diff -u linux-6.5.0/sound/pci/hda/patch_conexant.c linux-6.5.0/sound/pci/hda/patch_conexant.c --- linux-6.5.0/sound/pci/hda/patch_conexant.c +++ linux-6.5.0/sound/pci/hda/patch_conexant.c @@ -344,7 +344,6 @@ CXT_FIXUP_HP_ZBOOK_MUTE_LED, CXT_FIXUP_HEADSET_MIC, CXT_FIXUP_HP_MIC_NO_PRESENCE, - CXT_PINCFG_SWS_JS201D, }; /* for hda_fixup_thinkpad_acpi() */ @@ -842,17 +841,6 @@ {} }; -/* SuoWoSi/South-holding JS201D with sn6140 */ -static const struct hda_pintbl cxt_pincfg_sws_js201d[] = { - { 0x16, 0x03211040 }, /* hp out */ - { 0x17, 0x91170110 }, /* SPK/Class_D */ - { 0x18, 0x95a70130 }, /* Internal mic */ - { 0x19, 0x03a11020 }, /* Headset Mic */ - { 0x1a, 0x40f001f0 }, /* Not used */ - { 0x21, 0x40f001f0 }, /* Not used */ - {} -}; - static const struct hda_fixup cxt_fixups[] = { [CXT_PINCFG_LENOVO_X200] = { .type = HDA_FIXUP_PINS, @@ -1008,10 +996,6 @@ .chained = true, .chain_id = CXT_FIXUP_HEADSET_MIC, }, - [CXT_PINCFG_SWS_JS201D] = { - .type = HDA_FIXUP_PINS, - .v.pins = cxt_pincfg_sws_js201d, - }, }; static const struct snd_pci_quirk cxt5045_fixups[] = { @@ -1085,7 +1069,6 @@ SND_PCI_QUIRK(0x103c, 0x8457, "HP Z2 G4 mini", CXT_FIXUP_HP_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x103c, 0x8458, "HP Z2 G4 mini premium", CXT_FIXUP_HP_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1043, 0x138d, "Asus", CXT_FIXUP_HEADPHONE_MIC_PIN), - SND_PCI_QUIRK(0x14f1, 0x0265, "SWS JS201D", CXT_PINCFG_SWS_JS201D), SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT_FIXUP_OLPC_XO), SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400", CXT_PINCFG_LENOVO_TP410), SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo T410", CXT_PINCFG_LENOVO_TP410), @@ -1126,7 +1109,6 @@ { .id = CXT_FIXUP_HP_ZBOOK_MUTE_LED, .name = "hp-zbook-mute-led" }, { .id = CXT_FIXUP_HP_MIC_NO_PRESENCE, .name = "hp-mic-fix" }, { .id = CXT_PINCFG_LENOVO_NOTEBOOK, .name = "lenovo-20149" }, - { .id = CXT_PINCFG_SWS_JS201D, .name = "sws-js201d" }, {} }; diff -u linux-6.5.0/sound/pci/hda/patch_realtek.c linux-6.5.0/sound/pci/hda/patch_realtek.c --- linux-6.5.0/sound/pci/hda/patch_realtek.c +++ linux-6.5.0/sound/pci/hda/patch_realtek.c @@ -439,10 +439,6 @@ alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); fallthrough; case 0x10ec0215: - case 0x10ec0285: - case 0x10ec0289: - alc_update_coef_idx(codec, 0x36, 1<<13, 0); - fallthrough; case 0x10ec0230: case 0x10ec0233: case 0x10ec0235: @@ -456,7 +452,9 @@ case 0x10ec0283: case 0x10ec0286: case 0x10ec0288: + case 0x10ec0285: case 0x10ec0298: + case 0x10ec0289: case 0x10ec0300: alc_update_coef_idx(codec, 0x10, 1<<9, 0); break; @@ -9520,13 +9518,11 @@ .type = HDA_FIXUP_FUNC, .v.func = cs35l41_fixup_i2c_two, .chained = true, - .chain_id = ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK, + .chain_id = ALC269_FIXUP_THINKPAD_ACPI, }, [ALC287_FIXUP_THINKPAD_I2S_SPK] = { .type = HDA_FIXUP_FUNC, .v.func = alc287_fixup_bind_dacs, - .chained = true, - .chain_id = ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK, }, [ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD] = { .type = HDA_FIXUP_FUNC, @@ -9590,7 +9586,6 @@ SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS), SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1025, 0x1269, "Acer SWIFT SF314-54", ALC256_FIXUP_ACER_HEADSET_MIC), - SND_PCI_QUIRK(0x1025, 0x126a, "Acer Swift SF114-32", ALC256_FIXUP_ACER_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), @@ -9668,9 +9663,6 @@ SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS), SND_PCI_QUIRK(0x1028, 0x0beb, "Dell XPS 15 9530 (2023)", ALC289_FIXUP_DELL_CS35L41_SPI_2), SND_PCI_QUIRK(0x1028, 0x0c03, "Dell Precision 5340", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE), - SND_PCI_QUIRK(0x1028, 0x0c0b, "Dell Oasis 14 RPL-P", ALC289_FIXUP_RTK_AMP_DUAL_SPK), - SND_PCI_QUIRK(0x1028, 0x0c0d, "Dell Oasis", ALC289_FIXUP_RTK_AMP_DUAL_SPK), - SND_PCI_QUIRK(0x1028, 0x0c0e, "Dell Oasis 16", ALC289_FIXUP_RTK_AMP_DUAL_SPK), SND_PCI_QUIRK(0x1028, 0x0c19, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS), SND_PCI_QUIRK(0x1028, 0x0c1a, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS), SND_PCI_QUIRK(0x1028, 0x0c1b, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS), @@ -9790,7 +9782,6 @@ SND_PCI_QUIRK(0x103c, 0x8786, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED), SND_PCI_QUIRK(0x103c, 0x8787, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED), SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED), - SND_PCI_QUIRK(0x103c, 0x87b7, "HP Laptop 14-fq0xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), @@ -9860,7 +9851,6 @@ SND_PCI_QUIRK(0x103c, 0x8abb, "HP ZBook Firefly 14 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8ad1, "HP EliteBook 840 14 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8ad2, "HP EliteBook 860 16 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), - SND_PCI_QUIRK(0x103c, 0x8b0f, "HP Elite mt645 G7 Mobile Thin Client U81", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), SND_PCI_QUIRK(0x103c, 0x8b2f, "HP 255 15.6 inch G10 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), SND_PCI_QUIRK(0x103c, 0x8b42, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8b43, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), @@ -9868,7 +9858,6 @@ SND_PCI_QUIRK(0x103c, 0x8b45, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8b46, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8b47, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), - SND_PCI_QUIRK(0x103c, 0x8b59, "HP Elite mt645 G7 Mobile Thin Client U89", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), SND_PCI_QUIRK(0x103c, 0x8b5d, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), SND_PCI_QUIRK(0x103c, 0x8b5e, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), SND_PCI_QUIRK(0x103c, 0x8b63, "HP Elite Dragonfly 13.5 inch G4", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED), @@ -9898,8 +9887,6 @@ SND_PCI_QUIRK(0x103c, 0x8c72, "HP EliteBook 865 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8c96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), SND_PCI_QUIRK(0x103c, 0x8c97, "HP ZBook", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), - SND_PCI_QUIRK(0x103c, 0x8ca1, "HP ZBook Power", ALC236_FIXUP_HP_GPIO_LED), - SND_PCI_QUIRK(0x103c, 0x8ca2, "HP ZBook Power", ALC236_FIXUP_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8ca4, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8ca7, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), SND_PCI_QUIRK(0x103c, 0x8cf5, "HP ZBook Studio 16", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED), @@ -10239,7 +10226,6 @@ SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC), SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC), SND_PCI_QUIRK(0x2782, 0x0232, "CHUWI CoreBook XPro", ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO), - SND_PCI_QUIRK(0x2782, 0x1707, "Vaio VJFE-ADL", ALC298_FIXUP_SPK_VOLUME), SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC), SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED), SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10), diff -u linux-6.5.0/sound/soc/amd/yc/acp6x-mach.c linux-6.5.0/sound/soc/amd/yc/acp6x-mach.c --- linux-6.5.0/sound/soc/amd/yc/acp6x-mach.c +++ linux-6.5.0/sound/soc/amd/yc/acp6x-mach.c @@ -245,13 +245,6 @@ .driver_data = &acp6x_card, .matches = { DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "83AS"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), DMI_MATCH(DMI_PRODUCT_NAME, "82UG"), } }, @@ -335,13 +328,6 @@ { .driver_data = &acp6x_card, .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), - DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 15 C7VF"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { DMI_MATCH(DMI_BOARD_VENDOR, "Razer"), DMI_MATCH(DMI_PRODUCT_NAME, "Blade 14 (2022) - RZ09-0427"), } diff -u linux-6.5.0/sound/soc/codecs/rt5645.c linux-6.5.0/sound/soc/codecs/rt5645.c --- linux-6.5.0/sound/soc/codecs/rt5645.c +++ linux-6.5.0/sound/soc/codecs/rt5645.c @@ -3288,7 +3288,6 @@ report, SND_JACK_HEADPHONE); snd_soc_jack_report(rt5645->mic_jack, report, SND_JACK_MICROPHONE); - mutex_unlock(&rt5645->jd_mutex); return; case 4: val = snd_soc_component_read(rt5645->component, RT5645_A_JD_CTRL1) & 0x0020; diff -u linux-6.5.0/sound/soc/codecs/wcd938x.c linux-6.5.0/sound/soc/codecs/wcd938x.c --- linux-6.5.0/sound/soc/codecs/wcd938x.c +++ linux-6.5.0/sound/soc/codecs/wcd938x.c @@ -3589,7 +3589,7 @@ ret = wcd938x_populate_dt_data(wcd938x, dev); if (ret) { dev_err(dev, "%s: Fail to obtain platform data\n", __func__); - return ret; + return -EINVAL; } ret = wcd938x_add_slave_components(wcd938x, dev, &match); diff -u linux-6.5.0/sound/soc/sof/ipc3-topology.c linux-6.5.0/sound/soc/sof/ipc3-topology.c --- linux-6.5.0/sound/soc/sof/ipc3-topology.c +++ linux-6.5.0/sound/soc/sof/ipc3-topology.c @@ -2309,16 +2309,27 @@ return 0; } -static int sof_ipc3_free_widgets_in_list(struct snd_sof_dev *sdev, bool include_scheduler, - bool *dyn_widgets, bool verify) +/* + * For older firmware, this function doesn't free widgets for static pipelines during suspend. + * It only resets use_count for all widgets. + */ +static int sof_ipc3_tear_down_all_pipelines(struct snd_sof_dev *sdev, bool verify) { struct sof_ipc_fw_version *v = &sdev->fw_ready.version; struct snd_sof_widget *swidget; + struct snd_sof_route *sroute; + bool dyn_widgets = false; int ret; + /* + * This function is called during suspend and for one-time topology verification during + * first boot. In both cases, there is no need to protect swidget->use_count and + * sroute->setup because during suspend all running streams are suspended and during + * topology loading the sound card unavailable to open PCMs. + */ list_for_each_entry(swidget, &sdev->widget_list, list) { if (swidget->dynamic_pipeline_widget) { - *dyn_widgets = true; + dyn_widgets = true; continue; } @@ -2333,49 +2344,11 @@ continue; } - if (include_scheduler && swidget->id != snd_soc_dapm_scheduler) - continue; - - if (!include_scheduler && swidget->id == snd_soc_dapm_scheduler) - continue; - ret = sof_widget_free(sdev, swidget); if (ret < 0) return ret; } - return 0; -} - -/* - * For older firmware, this function doesn't free widgets for static pipelines during suspend. - * It only resets use_count for all widgets. - */ -static int sof_ipc3_tear_down_all_pipelines(struct snd_sof_dev *sdev, bool verify) -{ - struct sof_ipc_fw_version *v = &sdev->fw_ready.version; - struct snd_sof_widget *swidget; - struct snd_sof_route *sroute; - bool dyn_widgets = false; - int ret; - - /* - * This function is called during suspend and for one-time topology verification during - * first boot. In both cases, there is no need to protect swidget->use_count and - * sroute->setup because during suspend all running streams are suspended and during - * topology loading the sound card unavailable to open PCMs. Do not free the scheduler - * widgets yet so that the secondary cores do not get powered down before all the widgets - * associated with the scheduler are freed. - */ - ret = sof_ipc3_free_widgets_in_list(sdev, false, &dyn_widgets, verify); - if (ret < 0) - return ret; - - /* free all the scheduler widgets now */ - ret = sof_ipc3_free_widgets_in_list(sdev, true, &dyn_widgets, verify); - if (ret < 0) - return ret; - /* * Tear down all pipelines associated with PCMs that did not get suspended * and unset the prepare flag so that they can be set up again during resume. reverted: --- linux-6.5.0/sound/soc/sof/ipc3.c +++ linux-6.5.0.orig/sound/soc/sof/ipc3.c @@ -1070,7 +1070,7 @@ return; } + if (hdr.size < sizeof(hdr)) { - if (hdr.size < sizeof(hdr) || hdr.size > SOF_IPC_MSG_MAX_SIZE) { dev_err(sdev->dev, "The received message size is invalid\n"); return; } diff -u linux-6.5.0/sound/usb/quirks.c linux-6.5.0/sound/usb/quirks.c --- linux-6.5.0/sound/usb/quirks.c +++ linux-6.5.0/sound/usb/quirks.c @@ -2031,14 +2031,10 @@ QUIRK_FLAG_CTL_MSG_DELAY_1M | QUIRK_FLAG_IGNORE_CTL_ERROR), DEVICE_FLG(0x0499, 0x1509, /* Steinberg UR22 */ QUIRK_FLAG_GENERIC_IMPLICIT_FB), - DEVICE_FLG(0x0499, 0x3108, /* Yamaha YIT-W12TX */ - QUIRK_FLAG_GET_SAMPLE_RATE), DEVICE_FLG(0x04d8, 0xfeea, /* Benchmark DAC1 Pre */ QUIRK_FLAG_GET_SAMPLE_RATE), DEVICE_FLG(0x04e8, 0xa051, /* Samsung USBC Headset (AKG) */ QUIRK_FLAG_SKIP_CLOCK_SELECTOR | QUIRK_FLAG_CTL_MSG_DELAY_5M), - DEVICE_FLG(0x0525, 0xa4ad, /* Hamedal C20 usb camero */ - QUIRK_FLAG_IFACE_SKIP_CLOSE), DEVICE_FLG(0x054c, 0x0b8c, /* Sony WALKMAN NW-A45 DAC */ QUIRK_FLAG_SET_IFACE_FIRST), DEVICE_FLG(0x0556, 0x0014, /* Phoenix Audio TMX320VC */ @@ -2077,22 +2073,14 @@ QUIRK_FLAG_GENERIC_IMPLICIT_FB), DEVICE_FLG(0x0763, 0x2031, /* M-Audio Fast Track C600 */ QUIRK_FLAG_GENERIC_IMPLICIT_FB), - DEVICE_FLG(0x07fd, 0x000b, /* MOTU M Series 2nd hardware revision */ - QUIRK_FLAG_CTL_MSG_DELAY_1M), DEVICE_FLG(0x08bb, 0x2702, /* LineX FM Transmitter */ QUIRK_FLAG_IGNORE_CTL_ERROR), DEVICE_FLG(0x0951, 0x16ad, /* Kingston HyperX */ QUIRK_FLAG_CTL_MSG_DELAY_1M), DEVICE_FLG(0x0b0e, 0x0349, /* Jabra 550a */ QUIRK_FLAG_CTL_MSG_DELAY_1M), - DEVICE_FLG(0x0ecb, 0x205c, /* JBL Quantum610 Wireless */ - QUIRK_FLAG_FIXED_RATE), - DEVICE_FLG(0x0ecb, 0x2069, /* JBL Quantum810 Wireless */ - QUIRK_FLAG_FIXED_RATE), DEVICE_FLG(0x0fd9, 0x0008, /* Hauppauge HVR-950Q */ QUIRK_FLAG_SHARE_MEDIA_DEVICE | QUIRK_FLAG_ALIGN_TRANSFER), - DEVICE_FLG(0x1224, 0x2a25, /* Jieli Technology USB PHY 2.0 */ - QUIRK_FLAG_GET_SAMPLE_RATE), DEVICE_FLG(0x1395, 0x740a, /* Sennheiser DECT */ QUIRK_FLAG_GET_SAMPLE_RATE), DEVICE_FLG(0x1397, 0x0507, /* Behringer UMC202HD */ @@ -2125,10 +2113,6 @@ QUIRK_FLAG_ITF_USB_DSD_DAC | QUIRK_FLAG_CTL_MSG_DELAY), DEVICE_FLG(0x1901, 0x0191, /* GE B850V3 CP2114 audio interface */ QUIRK_FLAG_GET_SAMPLE_RATE), - DEVICE_FLG(0x19f7, 0x0035, /* RODE NT-USB+ */ - QUIRK_FLAG_GET_SAMPLE_RATE), - DEVICE_FLG(0x1bcf, 0x2283, /* NexiGo N930AF FHD Webcam */ - QUIRK_FLAG_GET_SAMPLE_RATE), DEVICE_FLG(0x2040, 0x7200, /* Hauppauge HVR-950Q */ QUIRK_FLAG_SHARE_MEDIA_DEVICE | QUIRK_FLAG_ALIGN_TRANSFER), DEVICE_FLG(0x2040, 0x7201, /* Hauppauge HVR-950Q-MXL */ @@ -2171,12 +2155,6 @@ QUIRK_FLAG_IGNORE_CTL_ERROR), DEVICE_FLG(0x2912, 0x30c8, /* Audioengine D1 */ QUIRK_FLAG_GET_SAMPLE_RATE), - DEVICE_FLG(0x2b53, 0x0023, /* Fiero SC-01 (firmware v1.0.0 @ 48 kHz) */ - QUIRK_FLAG_GENERIC_IMPLICIT_FB), - DEVICE_FLG(0x2b53, 0x0024, /* Fiero SC-01 (firmware v1.0.0 @ 96 kHz) */ - QUIRK_FLAG_GENERIC_IMPLICIT_FB), - DEVICE_FLG(0x2b53, 0x0031, /* Fiero SC-01 (firmware v1.1.0) */ - QUIRK_FLAG_GENERIC_IMPLICIT_FB), DEVICE_FLG(0x30be, 0x0101, /* Schiit Hel */ QUIRK_FLAG_IGNORE_CTL_ERROR), DEVICE_FLG(0x413c, 0xa506, /* Dell AE515 sound bar */ @@ -2185,6 +2163,22 @@ QUIRK_FLAG_ALIGN_TRANSFER), DEVICE_FLG(0x534d, 0x2109, /* MacroSilicon MS2109 */ QUIRK_FLAG_ALIGN_TRANSFER), + DEVICE_FLG(0x1224, 0x2a25, /* Jieli Technology USB PHY 2.0 */ + QUIRK_FLAG_GET_SAMPLE_RATE), + DEVICE_FLG(0x2b53, 0x0023, /* Fiero SC-01 (firmware v1.0.0 @ 48 kHz) */ + QUIRK_FLAG_GENERIC_IMPLICIT_FB), + DEVICE_FLG(0x2b53, 0x0024, /* Fiero SC-01 (firmware v1.0.0 @ 96 kHz) */ + QUIRK_FLAG_GENERIC_IMPLICIT_FB), + DEVICE_FLG(0x2b53, 0x0031, /* Fiero SC-01 (firmware v1.1.0) */ + QUIRK_FLAG_GENERIC_IMPLICIT_FB), + DEVICE_FLG(0x0525, 0xa4ad, /* Hamedal C20 usb camero */ + QUIRK_FLAG_IFACE_SKIP_CLOSE), + DEVICE_FLG(0x0ecb, 0x205c, /* JBL Quantum610 Wireless */ + QUIRK_FLAG_FIXED_RATE), + DEVICE_FLG(0x0ecb, 0x2069, /* JBL Quantum810 Wireless */ + QUIRK_FLAG_FIXED_RATE), + DEVICE_FLG(0x1bcf, 0x2283, /* NexiGo N930AF FHD Webcam */ + QUIRK_FLAG_GET_SAMPLE_RATE), /* Vendor matches */ VENDOR_FLG(0x045e, /* MS Lifecam */ reverted: --- linux-6.5.0/tools/arch/x86/include/asm/rmwcc.h +++ linux-6.5.0.orig/tools/arch/x86/include/asm/rmwcc.h @@ -4,7 +4,7 @@ #define __GEN_RMWcc(fullop, var, cc, ...) \ do { \ + asm_volatile_goto (fullop "; j" cc " %l[cc_label]" \ - asm goto (fullop "; j" cc " %l[cc_label]" \ : : "m" (var), ## __VA_ARGS__ \ : "memory" : cc_label); \ return 0; \ reverted: --- linux-6.5.0/tools/include/linux/compiler_types.h +++ linux-6.5.0.orig/tools/include/linux/compiler_types.h @@ -36,8 +36,8 @@ #include #endif +#ifndef asm_volatile_goto +#define asm_volatile_goto(x...) asm goto(x) -#ifndef asm_goto_output -#define asm_goto_output(x...) asm goto(x) #endif #endif /* __LINUX_COMPILER_TYPES_H */ diff -u linux-6.5.0/tools/perf/util/evlist.c linux-6.5.0/tools/perf/util/evlist.c --- linux-6.5.0/tools/perf/util/evlist.c +++ linux-6.5.0/tools/perf/util/evlist.c @@ -103,14 +103,7 @@ err = parse_event(evlist, can_profile_kernel ? "cycles:P" : "cycles:Pu"); if (err) { evlist__delete(evlist); - return NULL; - } - - if (evlist->core.nr_entries > 1) { - struct evsel *evsel; - - evlist__for_each_entry(evlist, evsel) - evsel__set_sample_id(evsel, /*can_sample_identifier=*/false); + evlist = NULL; } return evlist; reverted: --- linux-6.5.0/tools/testing/selftests/bpf/progs/verifier_iterating_callbacks.c +++ linux-6.5.0.orig/tools/testing/selftests/bpf/progs/verifier_iterating_callbacks.c @@ -1,147 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 - -#include -#include -#include "bpf_misc.h" - -struct { - __uint(type, BPF_MAP_TYPE_ARRAY); - __uint(max_entries, 8); - __type(key, __u32); - __type(value, __u64); -} map SEC(".maps"); - -struct { - __uint(type, BPF_MAP_TYPE_USER_RINGBUF); - __uint(max_entries, 8); -} ringbuf SEC(".maps"); - -struct vm_area_struct; -struct bpf_map; - -struct buf_context { - char *buf; -}; - -struct num_context { - __u64 i; -}; - -__u8 choice_arr[2] = { 0, 1 }; - -static int unsafe_on_2nd_iter_cb(__u32 idx, struct buf_context *ctx) -{ - if (idx == 0) { - ctx->buf = (char *)(0xDEAD); - return 0; - } - - if (bpf_probe_read_user(ctx->buf, 8, (void *)(0xBADC0FFEE))) - return 1; - - return 0; -} - -SEC("?raw_tp") -__failure __msg("R1 type=scalar expected=fp") -int unsafe_on_2nd_iter(void *unused) -{ - char buf[4]; - struct buf_context loop_ctx = { .buf = buf }; - - bpf_loop(100, unsafe_on_2nd_iter_cb, &loop_ctx, 0); - return 0; -} - -static int unsafe_on_zero_iter_cb(__u32 idx, struct num_context *ctx) -{ - ctx->i = 0; - return 0; -} - -SEC("?raw_tp") -__failure __msg("invalid access to map value, value_size=2 off=32 size=1") -int unsafe_on_zero_iter(void *unused) -{ - struct num_context loop_ctx = { .i = 32 }; - - bpf_loop(100, unsafe_on_zero_iter_cb, &loop_ctx, 0); - return choice_arr[loop_ctx.i]; -} - -static int loop_detection_cb(__u32 idx, struct num_context *ctx) -{ - for (;;) {} - return 0; -} - -SEC("?raw_tp") -__failure __msg("infinite loop detected") -int loop_detection(void *unused) -{ - struct num_context loop_ctx = { .i = 0 }; - - bpf_loop(100, loop_detection_cb, &loop_ctx, 0); - return 0; -} - -static __always_inline __u64 oob_state_machine(struct num_context *ctx) -{ - switch (ctx->i) { - case 0: - ctx->i = 1; - break; - case 1: - ctx->i = 32; - break; - } - return 0; -} - -static __u64 for_each_map_elem_cb(struct bpf_map *map, __u32 *key, __u64 *val, void *data) -{ - return oob_state_machine(data); -} - -SEC("?raw_tp") -__failure __msg("invalid access to map value, value_size=2 off=32 size=1") -int unsafe_for_each_map_elem(void *unused) -{ - struct num_context loop_ctx = { .i = 0 }; - - bpf_for_each_map_elem(&map, for_each_map_elem_cb, &loop_ctx, 0); - return choice_arr[loop_ctx.i]; -} - -static __u64 ringbuf_drain_cb(struct bpf_dynptr *dynptr, void *data) -{ - return oob_state_machine(data); -} - -SEC("?raw_tp") -__failure __msg("invalid access to map value, value_size=2 off=32 size=1") -int unsafe_ringbuf_drain(void *unused) -{ - struct num_context loop_ctx = { .i = 0 }; - - bpf_user_ringbuf_drain(&ringbuf, ringbuf_drain_cb, &loop_ctx, 0); - return choice_arr[loop_ctx.i]; -} - -static __u64 find_vma_cb(struct task_struct *task, struct vm_area_struct *vma, void *data) -{ - return oob_state_machine(data); -} - -SEC("?raw_tp") -__failure __msg("invalid access to map value, value_size=2 off=32 size=1") -int unsafe_find_vma(void *unused) -{ - struct task_struct *task = bpf_get_current_task_btf(); - struct num_context loop_ctx = { .i = 0 }; - - bpf_find_vma(task, 0, find_vma_cb, &loop_ctx, 0); - return choice_arr[loop_ctx.i]; -} - -char _license[] SEC("license") = "GPL"; reverted: --- linux-6.5.0/tools/testing/selftests/kvm/dirty_log_test.c +++ linux-6.5.0.orig/tools/testing/selftests/kvm/dirty_log_test.c @@ -376,10 +376,7 @@ cleared = kvm_vm_reset_dirty_ring(vcpu->vm); + /* Cleared pages should be the same as collected */ - /* - * Cleared pages should be the same as collected, as KVM is supposed to - * clear only the entries that have been harvested. - */ TEST_ASSERT(cleared == count, "Reset dirty pages (%u) mismatch " "with collected (%u)", cleared, count); @@ -418,6 +415,12 @@ } } +static void dirty_ring_before_vcpu_join(void) +{ + /* Kick another round of vcpu just to make sure it will quit */ + sem_post(&sem_vcpu_cont); +} + struct log_mode { const char *name; /* Return true if this mode is supported, otherwise false */ @@ -430,6 +433,7 @@ uint32_t *ring_buf_idx); /* Hook to call when after each vcpu run */ void (*after_vcpu_run)(struct kvm_vcpu *vcpu, int ret, int err); + void (*before_vcpu_join) (void); } log_modes[LOG_MODE_NUM] = { { .name = "dirty-log", @@ -448,6 +452,7 @@ .supported = dirty_ring_supported, .create_vm_done = dirty_ring_create_vm_done, .collect_dirty_pages = dirty_ring_collect_dirty_pages, + .before_vcpu_join = dirty_ring_before_vcpu_join, .after_vcpu_run = dirty_ring_after_vcpu_run, }, }; @@ -508,6 +513,14 @@ mode->after_vcpu_run(vcpu, ret, err); } +static void log_mode_before_vcpu_join(void) +{ + struct log_mode *mode = &log_modes[host_log_mode]; + + if (mode->before_vcpu_join) + mode->before_vcpu_join(); +} + static void generate_random_array(uint64_t *guest_array, uint64_t size) { uint64_t i; @@ -706,7 +719,6 @@ struct kvm_vm *vm; unsigned long *bmap; uint32_t ring_buf_idx = 0; - int sem_val; if (!log_mode_supported()) { print_skip("Log mode '%s' not supported", @@ -776,22 +788,12 @@ /* Start the iterations */ iteration = 1; sync_global_to_guest(vm, iteration); + host_quit = false; - WRITE_ONCE(host_quit, false); host_dirty_count = 0; host_clear_count = 0; host_track_next_count = 0; WRITE_ONCE(dirty_ring_vcpu_ring_full, false); - /* - * Ensure the previous iteration didn't leave a dangling semaphore, i.e. - * that the main task and vCPU worker were synchronized and completed - * verification of all iterations. - */ - sem_getvalue(&sem_vcpu_stop, &sem_val); - TEST_ASSERT_EQ(sem_val, 0); - sem_getvalue(&sem_vcpu_cont, &sem_val); - TEST_ASSERT_EQ(sem_val, 0); - pthread_create(&vcpu_thread, NULL, vcpu_worker, vcpu); while (iteration < p->iterations) { @@ -817,21 +819,15 @@ assert(host_log_mode == LOG_MODE_DIRTY_RING || atomic_read(&vcpu_sync_stop_requested) == false); vm_dirty_log_verify(mode, bmap); + sem_post(&sem_vcpu_cont); + iteration++; - /* - * Set host_quit before sem_vcpu_cont in the final iteration to - * ensure that the vCPU worker doesn't resume the guest. As - * above, the dirty ring test may stop and wait even when not - * explicitly request to do so, i.e. would hang waiting for a - * "continue" if it's allowed to resume the guest. - */ - if (++iteration == p->iterations) - WRITE_ONCE(host_quit, true); - - sem_post(&sem_vcpu_cont); sync_global_to_guest(vm, iteration); } + /* Tell the vcpu thread to quit */ + host_quit = true; + log_mode_before_vcpu_join(); pthread_join(vcpu_thread, NULL); pr_info("Total bits checked: dirty (%"PRIu64"), clear (%"PRIu64"), " reverted: --- linux-6.5.0/tools/testing/selftests/kvm/x86_64/amx_test.c +++ linux-6.5.0.orig/tools/testing/selftests/kvm/x86_64/amx_test.c @@ -221,7 +221,7 @@ vm_vaddr_t amx_cfg, tiledata, xstate; struct ucall uc; u32 amx_offset; + int stage, ret; - int ret; /* * Note, all off-by-default features must be enabled before anything @@ -263,7 +263,7 @@ memset(addr_gva2hva(vm, xstate), 0, PAGE_SIZE * DIV_ROUND_UP(XSAVE_SIZE, PAGE_SIZE)); vcpu_args_set(vcpu, 3, amx_cfg, tiledata, xstate); + for (stage = 1; ; stage++) { - for (;;) { vcpu_run(vcpu); TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO); reverted: --- linux-6.5.0/tools/testing/selftests/kvm/x86_64/hyperv_features.c +++ linux-6.5.0.orig/tools/testing/selftests/kvm/x86_64/hyperv_features.c @@ -445,7 +445,7 @@ case 44: /* MSR is not available when CPUID feature bit is unset */ if (!has_invtsc) + continue; - goto next_stage; msr->idx = HV_X64_MSR_TSC_INVARIANT_CONTROL; msr->write = false; msr->fault_expected = true; @@ -453,7 +453,7 @@ case 45: /* MSR is vailable when CPUID feature bit is set */ if (!has_invtsc) + continue; - goto next_stage; vcpu_set_cpuid_feature(vcpu, HV_ACCESS_TSC_INVARIANT); msr->idx = HV_X64_MSR_TSC_INVARIANT_CONTROL; msr->write = false; @@ -462,7 +462,7 @@ case 46: /* Writing bits other than 0 is forbidden */ if (!has_invtsc) + continue; - goto next_stage; msr->idx = HV_X64_MSR_TSC_INVARIANT_CONTROL; msr->write = true; msr->write_val = 0xdeadbeef; @@ -471,7 +471,7 @@ case 47: /* Setting bit 0 enables the feature */ if (!has_invtsc) + continue; - goto next_stage; msr->idx = HV_X64_MSR_TSC_INVARIANT_CONTROL; msr->write = true; msr->write_val = 1; @@ -504,7 +504,6 @@ return; } -next_stage: stage++; kvm_vm_free(vm); } diff -u linux-6.5.0/tools/testing/selftests/landlock/fs_test.c linux-6.5.0/tools/testing/selftests/landlock/fs_test.c --- linux-6.5.0/tools/testing/selftests/landlock/fs_test.c +++ linux-6.5.0/tools/testing/selftests/landlock/fs_test.c @@ -241,11 +241,9 @@ const char *const data; }; -#define MNT_TMP_DATA "size=4m,mode=700" - -static const struct mnt_opt mnt_tmp = { +const struct mnt_opt mnt_tmp = { .type = "tmpfs", - .data = MNT_TMP_DATA, + .data = "size=4m,mode=700", }; static int mount_opt(const struct mnt_opt *const mnt, const char *const target) @@ -4525,10 +4523,7 @@ /* clang-format off */ FIXTURE_VARIANT_ADD(layout3_fs, tmpfs) { /* clang-format on */ - .mnt = { - .type = "tmpfs", - .data = MNT_TMP_DATA, - }, + .mnt = mnt_tmp, .file_path = file1_s1d1, }; diff -u linux-6.5.0/tools/testing/selftests/mm/charge_reserved_hugetlb.sh linux-6.5.0/tools/testing/selftests/mm/charge_reserved_hugetlb.sh --- linux-6.5.0/tools/testing/selftests/mm/charge_reserved_hugetlb.sh +++ linux-6.5.0/tools/testing/selftests/mm/charge_reserved_hugetlb.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # SPDX-License-Identifier: GPL-2.0 # Kselftest framework requirement - SKIP code is 4. reverted: --- linux-6.5.0/tools/testing/selftests/mm/ksm_tests.c +++ linux-6.5.0.orig/tools/testing/selftests/mm/ksm_tests.c @@ -566,7 +566,7 @@ if (map_ptr_orig == MAP_FAILED) err(2, "initial mmap"); + if (madvise(map_ptr, len + HPAGE_SIZE, MADV_HUGEPAGE)) - if (madvise(map_ptr, len, MADV_HUGEPAGE)) err(2, "MADV_HUGEPAGE"); pagemap_fd = open("/proc/self/pagemap", O_RDONLY); reverted: --- linux-6.5.0/tools/testing/selftests/mm/map_hugetlb.c +++ linux-6.5.0.orig/tools/testing/selftests/mm/map_hugetlb.c @@ -15,7 +15,6 @@ #include #include #include -#include "vm_util.h" #define LENGTH (256UL*1024*1024) #define PROTECTION (PROT_READ | PROT_WRITE) @@ -59,16 +58,10 @@ { void *addr; int ret; - size_t hugepage_size; size_t length = LENGTH; int flags = FLAGS; int shift = 0; - hugepage_size = default_huge_page_size(); - /* munmap with fail if the length is not page aligned */ - if (hugepage_size > length) - length = hugepage_size; - if (argc > 1) length = atol(argv[1]) << 20; if (argc > 2) { reverted: --- linux-6.5.0/tools/testing/selftests/mm/va_high_addr_switch.sh +++ linux-6.5.0.orig/tools/testing/selftests/mm/va_high_addr_switch.sh @@ -29,15 +29,9 @@ # See man 1 gzip under '-f'. local pg_table_levels=$(gzip -dcfq "${config}" | grep PGTABLE_LEVELS | cut -d'=' -f 2) - local cpu_supports_pl5=$(awk '/^flags/ {if (/la57/) {print 0;} - else {print 1}; exit}' /proc/cpuinfo 2>/dev/null) - if [[ "${pg_table_levels}" -lt 5 ]]; then echo "$0: PGTABLE_LEVELS=${pg_table_levels}, must be >= 5 to run this test" exit $ksft_skip - elif [[ "${cpu_supports_pl5}" -ne 0 ]]; then - echo "$0: CPU does not have the necessary la57 flag to support page table level 5" - exit $ksft_skip fi } reverted: --- linux-6.5.0/tools/testing/selftests/mm/write_hugetlb_memory.sh +++ linux-6.5.0.orig/tools/testing/selftests/mm/write_hugetlb_memory.sh @@ -1,4 +1,4 @@ +#!/bin/sh -#!/bin/bash # SPDX-License-Identifier: GPL-2.0 set -e reverted: --- linux-6.5.0/tools/testing/selftests/net/big_tcp.sh +++ linux-6.5.0.orig/tools/testing/selftests/net/big_tcp.sh @@ -122,9 +122,7 @@ local netns=$1 [ "$NF" = "6" ] && serip=$SERVER_IP6 + ip net exec $netns netperf -$NF -t TCP_STREAM -H $serip 2>&1 >/dev/null - - # use large write to be sure to generate big tcp packets - ip net exec $netns netperf -$NF -t TCP_STREAM -l 1 -H $serip -- -m 262144 2>&1 >/dev/null } do_test() { reverted: --- linux-6.5.0/tools/testing/selftests/net/cmsg_ipv6.sh +++ linux-6.5.0.orig/tools/testing/selftests/net/cmsg_ipv6.sh @@ -91,7 +91,7 @@ check_result $? 0 "TCLASS $prot $ovr - pass" while [ -d /proc/$BG ]; do + $NSEXE ./cmsg_sender -6 -p u $TGT6 1234 - $NSEXE ./cmsg_sender -6 -p $p $m $((TOS2)) $TGT6 1234 done tcpdump -r $TMPF -v 2>&1 | grep "class $TOS2" >> /dev/null @@ -128,7 +128,7 @@ check_result $? 0 "HOPLIMIT $prot $ovr - pass" while [ -d /proc/$BG ]; do + $NSEXE ./cmsg_sender -6 -p u $TGT6 1234 - $NSEXE ./cmsg_sender -6 -p $p $m $LIM $TGT6 1234 done tcpdump -r $TMPF -v 2>&1 | grep "hlim $LIM[^0-9]" >> /dev/null reverted: --- linux-6.5.0/tools/testing/selftests/net/forwarding/bridge_mdb.sh +++ linux-6.5.0.orig/tools/testing/selftests/net/forwarding/bridge_mdb.sh @@ -145,14 +145,14 @@ # Check basic add, replace and delete behavior. bridge mdb add dev br0 port br0 grp $grp $state vid 10 + bridge mdb show dev br0 vid 10 | grep -q "$grp" - bridge mdb get dev br0 grp $grp vid 10 &> /dev/null check_err $? "Failed to add $name host entry" bridge mdb replace dev br0 port br0 grp $grp $state vid 10 &> /dev/null check_fail $? "Managed to replace $name host entry" bridge mdb del dev br0 port br0 grp $grp $state vid 10 + bridge mdb show dev br0 vid 10 | grep -q "$grp" - bridge mdb get dev br0 grp $grp vid 10 &> /dev/null check_fail $? "Failed to delete $name host entry" # Check error cases. @@ -200,7 +200,7 @@ # Check basic add, replace and delete behavior. bridge mdb add dev br0 port $swp1 $grp_key permanent vid 10 + bridge mdb show dev br0 vid 10 | grep -q "$grp_key" - bridge mdb get dev br0 $grp_key vid 10 &> /dev/null check_err $? "Failed to add $name entry" bridge mdb replace dev br0 port $swp1 $grp_key permanent vid 10 \ @@ -208,31 +208,31 @@ check_err $? "Failed to replace $name entry" bridge mdb del dev br0 port $swp1 $grp_key permanent vid 10 + bridge mdb show dev br0 vid 10 | grep -q "$grp_key" - bridge mdb get dev br0 $grp_key vid 10 &> /dev/null check_fail $? "Failed to delete $name entry" # Check default protocol and replacement. bridge mdb add dev br0 port $swp1 $grp_key permanent vid 10 + bridge -d mdb show dev br0 vid 10 | grep "$grp_key" | grep -q "static" - bridge -d mdb get dev br0 $grp_key vid 10 | grep -q "static" check_err $? "$name entry not added with default \"static\" protocol" bridge mdb replace dev br0 port $swp1 $grp_key permanent vid 10 \ proto 123 + bridge -d mdb show dev br0 vid 10 | grep "$grp_key" | grep -q "123" - bridge -d mdb get dev br0 $grp_key vid 10 | grep -q "123" check_err $? "Failed to replace protocol of $name entry" bridge mdb del dev br0 port $swp1 $grp_key permanent vid 10 # Check behavior when VLAN is not specified. bridge mdb add dev br0 port $swp1 $grp_key permanent + bridge mdb show dev br0 vid 10 | grep -q "$grp_key" - bridge mdb get dev br0 $grp_key vid 10 &> /dev/null check_err $? "$name entry with VLAN 10 not added when VLAN was not specified" + bridge mdb show dev br0 vid 20 | grep -q "$grp_key" - bridge mdb get dev br0 $grp_key vid 20 &> /dev/null check_err $? "$name entry with VLAN 20 not added when VLAN was not specified" bridge mdb del dev br0 port $swp1 $grp_key permanent + bridge mdb show dev br0 vid 10 | grep -q "$grp_key" - bridge mdb get dev br0 $grp_key vid 10 &> /dev/null check_fail $? "$name entry with VLAN 10 not deleted when VLAN was not specified" + bridge mdb show dev br0 vid 20 | grep -q "$grp_key" - bridge mdb get dev br0 $grp_key vid 20 &> /dev/null check_fail $? "$name entry with VLAN 20 not deleted when VLAN was not specified" # Check behavior when bridge port is down. @@ -298,21 +298,21 @@ RET=0 bridge mdb add dev br0 port $swp1 grp $grp vid 10 + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep -q "exclude" - bridge -d mdb get dev br0 grp $grp vid 10 | grep -q "exclude" check_err $? "Default filter mode is not \"exclude\"" bridge mdb del dev br0 port $swp1 grp $grp vid 10 # Check basic add and delete behavior. bridge mdb add dev br0 port $swp1 grp $grp vid 10 filter_mode exclude \ source_list $src1 + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep -q -v "src" - bridge -d mdb get dev br0 grp $grp vid 10 &> /dev/null check_err $? "(*, G) entry not created" + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep -q "src $src1" - bridge -d mdb get dev br0 grp $grp src $src1 vid 10 &> /dev/null check_err $? "(S, G) entry not created" bridge mdb del dev br0 port $swp1 grp $grp vid 10 + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep -q -v "src" - bridge -d mdb get dev br0 grp $grp vid 10 &> /dev/null check_fail $? "(*, G) entry not deleted" + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep -q "src $src1" - bridge -d mdb get dev br0 grp $grp src $src1 vid 10 &> /dev/null check_fail $? "(S, G) entry not deleted" ## State (permanent / temp) tests. @@ -321,15 +321,18 @@ bridge mdb add dev br0 port $swp1 grp $grp permanent vid 10 \ filter_mode exclude source_list $src1 + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep -v "src" | \ + grep -q "permanent" - bridge -d mdb get dev br0 grp $grp vid 10 | grep -q "permanent" check_err $? "(*, G) entry not added as \"permanent\" when should" + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep "src" | \ - bridge -d mdb get dev br0 grp $grp src $src1 vid 10 | \ grep -q "permanent" check_err $? "(S, G) entry not added as \"permanent\" when should" + bridge -d -s mdb show dev br0 vid 10 | grep "$grp" | grep -v "src" | \ + grep -q " 0.00" - bridge -d -s mdb get dev br0 grp $grp vid 10 | grep -q " 0.00" check_err $? "(*, G) \"permanent\" entry has a pending group timer" + bridge -d -s mdb show dev br0 vid 10 | grep "$grp" | grep -v "src" | \ + grep -q "\/0.00" - bridge -d -s mdb get dev br0 grp $grp vid 10 | grep -q "/0.00" check_err $? "\"permanent\" source entry has a pending source timer" bridge mdb del dev br0 port $swp1 grp $grp vid 10 @@ -339,14 +342,18 @@ bridge mdb add dev br0 port $swp1 grp $grp temp vid 10 \ filter_mode exclude source_list $src1 + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep -v "src" | \ + grep -q "temp" - bridge -d mdb get dev br0 grp $grp vid 10 | grep -q "temp" check_err $? "(*, G) EXCLUDE entry not added as \"temp\" when should" + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep "src" | \ + grep -q "temp" - bridge -d mdb get dev br0 grp $grp src $src1 vid 10 | grep -q "temp" check_err $? "(S, G) \"blocked\" entry not added as \"temp\" when should" + bridge -d -s mdb show dev br0 vid 10 | grep "$grp" | grep -v "src" | \ + grep -q " 0.00" - bridge -d -s mdb get dev br0 grp $grp vid 10 | grep -q " 0.00" check_fail $? "(*, G) EXCLUDE entry does not have a pending group timer" + bridge -d -s mdb show dev br0 vid 10 | grep "$grp" | grep -v "src" | \ + grep -q "\/0.00" - bridge -d -s mdb get dev br0 grp $grp vid 10 | grep -q "/0.00" check_err $? "\"blocked\" source entry has a pending source timer" bridge mdb del dev br0 port $swp1 grp $grp vid 10 @@ -356,14 +363,18 @@ bridge mdb add dev br0 port $swp1 grp $grp temp vid 10 \ filter_mode include source_list $src1 + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep -v "src" | \ + grep -q "temp" - bridge -d mdb get dev br0 grp $grp vid 10 | grep -q "temp" check_err $? "(*, G) INCLUDE entry not added as \"temp\" when should" + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep "src" | \ + grep -q "temp" - bridge -d mdb get dev br0 grp $grp src $src1 vid 10 | grep -q "temp" check_err $? "(S, G) entry not added as \"temp\" when should" + bridge -d -s mdb show dev br0 vid 10 | grep "$grp" | grep -v "src" | \ + grep -q " 0.00" - bridge -d -s mdb get dev br0 grp $grp vid 10 | grep -q " 0.00" check_err $? "(*, G) INCLUDE entry has a pending group timer" + bridge -d -s mdb show dev br0 vid 10 | grep "$grp" | grep -v "src" | \ + grep -q "\/0.00" - bridge -d -s mdb get dev br0 grp $grp vid 10 | grep -q "/0.00" check_fail $? "Source entry does not have a pending source timer" bridge mdb del dev br0 port $swp1 grp $grp vid 10 @@ -372,7 +383,8 @@ bridge mdb add dev br0 port $swp1 grp $grp temp vid 10 \ filter_mode include source_list $src1 + bridge -d -s mdb show dev br0 vid 10 | grep "$grp" | grep "src" | \ + grep -q " 0.00" - bridge -d -s mdb get dev br0 grp $grp src $src1 vid 10 | grep -q " 0.00" check_err $? "(S, G) entry has a pending group timer" bridge mdb del dev br0 port $swp1 grp $grp vid 10 @@ -384,9 +396,11 @@ bridge mdb add dev br0 port $swp1 grp $grp vid 10 \ filter_mode include source_list $src1 + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep -v "src" | \ + grep -q "include" - bridge -d mdb get dev br0 grp $grp vid 10 | grep -q "include" check_err $? "(*, G) INCLUDE not added with \"include\" filter mode" + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep "src" | \ + grep -q "blocked" - bridge -d mdb get dev br0 grp $grp src $src1 vid 10 | grep -q "blocked" check_fail $? "(S, G) entry marked as \"blocked\" when should not" bridge mdb del dev br0 port $swp1 grp $grp vid 10 @@ -396,9 +410,11 @@ bridge mdb add dev br0 port $swp1 grp $grp vid 10 \ filter_mode exclude source_list $src1 + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep -v "src" | \ + grep -q "exclude" - bridge -d mdb get dev br0 grp $grp vid 10 | grep -q "exclude" check_err $? "(*, G) EXCLUDE not added with \"exclude\" filter mode" + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep "src" | \ + grep -q "blocked" - bridge -d mdb get dev br0 grp $grp src $src1 vid 10 | grep -q "blocked" check_err $? "(S, G) entry not marked as \"blocked\" when should" bridge mdb del dev br0 port $swp1 grp $grp vid 10 @@ -410,9 +426,11 @@ bridge mdb add dev br0 port $swp1 grp $grp vid 10 \ filter_mode exclude source_list $src1 proto zebra + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep -v "src" | \ + grep -q "zebra" - bridge -d mdb get dev br0 grp $grp vid 10 | grep -q "zebra" check_err $? "(*, G) entry not added with \"zebra\" protocol" + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep "src" | \ + grep -q "zebra" - bridge -d mdb get dev br0 grp $grp src $src1 vid 10 | grep -q "zebra" check_err $? "(S, G) entry not marked added with \"zebra\" protocol" bridge mdb del dev br0 port $swp1 grp $grp vid 10 @@ -425,16 +443,20 @@ bridge mdb replace dev br0 port $swp1 grp $grp permanent vid 10 \ filter_mode exclude source_list $src1 + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep -v "src" | \ + grep -q "permanent" - bridge -d mdb get dev br0 grp $grp vid 10 | grep -q "permanent" check_err $? "(*, G) entry not marked as \"permanent\" after replace" + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep "src" | \ + grep -q "permanent" - bridge -d mdb get dev br0 grp $grp src $src1 vid 10 | grep -q "permanent" check_err $? "(S, G) entry not marked as \"permanent\" after replace" bridge mdb replace dev br0 port $swp1 grp $grp temp vid 10 \ filter_mode exclude source_list $src1 + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep -v "src" | \ + grep -q "temp" - bridge -d mdb get dev br0 grp $grp vid 10 | grep -q "temp" check_err $? "(*, G) entry not marked as \"temp\" after replace" + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep "src" | \ + grep -q "temp" - bridge -d mdb get dev br0 grp $grp src $src1 vid 10 | grep -q "temp" check_err $? "(S, G) entry not marked as \"temp\" after replace" bridge mdb del dev br0 port $swp1 grp $grp vid 10 @@ -445,16 +467,20 @@ bridge mdb replace dev br0 port $swp1 grp $grp temp vid 10 \ filter_mode include source_list $src1 + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep -v "src" | \ + grep -q "include" - bridge -d mdb get dev br0 grp $grp vid 10 | grep -q "include" check_err $? "(*, G) not marked with \"include\" filter mode after replace" + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep "src" | \ + grep -q "blocked" - bridge -d mdb get dev br0 grp $grp src $src1 vid 10 | grep -q "blocked" check_fail $? "(S, G) marked as \"blocked\" after replace" bridge mdb replace dev br0 port $swp1 grp $grp temp vid 10 \ filter_mode exclude source_list $src1 + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep -v "src" | \ + grep -q "exclude" - bridge -d mdb get dev br0 grp $grp vid 10 | grep -q "exclude" check_err $? "(*, G) not marked with \"exclude\" filter mode after replace" + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep "src" | \ + grep -q "blocked" - bridge -d mdb get dev br0 grp $grp src $src1 vid 10 | grep -q "blocked" check_err $? "(S, G) not marked as \"blocked\" after replace" bridge mdb del dev br0 port $swp1 grp $grp vid 10 @@ -465,20 +491,20 @@ bridge mdb replace dev br0 port $swp1 grp $grp temp vid 10 \ filter_mode exclude source_list $src1,$src2,$src3 + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep -q "src $src1" - bridge -d mdb get dev br0 grp $grp src $src1 vid 10 &> /dev/null check_err $? "(S, G) entry for source $src1 not created after replace" + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep -q "src $src2" - bridge -d mdb get dev br0 grp $grp src $src2 vid 10 &> /dev/null check_err $? "(S, G) entry for source $src2 not created after replace" + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep -q "src $src3" - bridge -d mdb get dev br0 grp $grp src $src3 vid 10 &> /dev/null check_err $? "(S, G) entry for source $src3 not created after replace" bridge mdb replace dev br0 port $swp1 grp $grp temp vid 10 \ filter_mode exclude source_list $src1,$src3 + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep -q "src $src1" - bridge -d mdb get dev br0 grp $grp src $src1 vid 10 &> /dev/null check_err $? "(S, G) entry for source $src1 not created after second replace" + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep -q "src $src2" - bridge -d mdb get dev br0 grp $grp src $src2 vid 10 &> /dev/null check_fail $? "(S, G) entry for source $src2 created after second replace" + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep -q "src $src3" - bridge -d mdb get dev br0 grp $grp src $src3 vid 10 &> /dev/null check_err $? "(S, G) entry for source $src3 not created after second replace" bridge mdb del dev br0 port $swp1 grp $grp vid 10 @@ -489,9 +515,11 @@ bridge mdb replace dev br0 port $swp1 grp $grp temp vid 10 \ filter_mode exclude source_list $src1 proto bgp + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep -v "src" | \ + grep -q "bgp" - bridge -d mdb get dev br0 grp $grp vid 10 | grep -q "bgp" check_err $? "(*, G) protocol not changed to \"bgp\" after replace" + bridge -d mdb show dev br0 vid 10 | grep "$grp" | grep "src" | \ + grep -q "bgp" - bridge -d mdb get dev br0 grp $grp src $src1 vid 10 | grep -q "bgp" check_err $? "(S, G) protocol not changed to \"bgp\" after replace" bridge mdb del dev br0 port $swp1 grp $grp vid 10 @@ -504,8 +532,8 @@ bridge mdb add dev br0 port $swp2 grp $grp vid 10 \ filter_mode include source_list $src1 bridge mdb add dev br0 port $swp1 grp $grp vid 10 + bridge -d mdb show dev br0 vid 10 | grep "$swp1" | grep "$grp" | \ + grep "$src1" | grep -q "added_by_star_ex" - bridge -d mdb get dev br0 grp $grp src $src1 vid 10 | grep "$swp1" | \ - grep -q "added_by_star_ex" check_err $? "\"added_by_star_ex\" entry not created after adding (*, G) entry" bridge mdb del dev br0 port $swp1 grp $grp vid 10 bridge mdb del dev br0 port $swp2 grp $grp src $src1 vid 10 @@ -578,23 +606,27 @@ RET=0 bridge mdb add dev br0 port $swp1 $grp_key vid 10 + bridge -d mdb show dev br0 vid 10 | grep "$grp_key" | grep -q "include" - bridge -d mdb get dev br0 $grp_key vid 10 | grep -q "include" check_err $? "Default filter mode is not \"include\"" bridge mdb del dev br0 port $swp1 $grp_key vid 10 # Check that entries can be added as both permanent and temp and that # group timer is set correctly. bridge mdb add dev br0 port $swp1 $grp_key permanent vid 10 + bridge -d mdb show dev br0 vid 10 | grep "$grp_key" | \ + grep -q "permanent" - bridge -d mdb get dev br0 $grp_key vid 10 | grep -q "permanent" check_err $? "Entry not added as \"permanent\" when should" + bridge -d -s mdb show dev br0 vid 10 | grep "$grp_key" | \ + grep -q " 0.00" - bridge -d -s mdb get dev br0 $grp_key vid 10 | grep -q " 0.00" check_err $? "\"permanent\" entry has a pending group timer" bridge mdb del dev br0 port $swp1 $grp_key vid 10 bridge mdb add dev br0 port $swp1 $grp_key temp vid 10 + bridge -d mdb show dev br0 vid 10 | grep "$grp_key" | \ + grep -q "temp" - bridge -d mdb get dev br0 $grp_key vid 10 | grep -q "temp" check_err $? "Entry not added as \"temp\" when should" + bridge -d -s mdb show dev br0 vid 10 | grep "$grp_key" | \ + grep -q " 0.00" - bridge -d -s mdb get dev br0 $grp_key vid 10 | grep -q " 0.00" check_fail $? "\"temp\" entry has an unpending group timer" bridge mdb del dev br0 port $swp1 $grp_key vid 10 @@ -618,19 +650,24 @@ # Check that we can replace available attributes. bridge mdb add dev br0 port $swp1 $grp_key vid 10 proto 123 bridge mdb replace dev br0 port $swp1 $grp_key vid 10 proto 111 + bridge -d mdb show dev br0 vid 10 | grep "$grp_key" | \ + grep -q "111" - bridge -d mdb get dev br0 $grp_key vid 10 | grep -q "111" check_err $? "Failed to replace protocol" bridge mdb replace dev br0 port $swp1 $grp_key vid 10 permanent + bridge -d mdb show dev br0 vid 10 | grep "$grp_key" | \ + grep -q "permanent" - bridge -d mdb get dev br0 $grp_key vid 10 | grep -q "permanent" check_err $? "Entry not marked as \"permanent\" after replace" + bridge -d -s mdb show dev br0 vid 10 | grep "$grp_key" | \ + grep -q " 0.00" - bridge -d -s mdb get dev br0 $grp_key vid 10 | grep -q " 0.00" check_err $? "Entry has a pending group timer after replace" bridge mdb replace dev br0 port $swp1 $grp_key vid 10 temp + bridge -d mdb show dev br0 vid 10 | grep "$grp_key" | \ + grep -q "temp" - bridge -d mdb get dev br0 $grp_key vid 10 | grep -q "temp" check_err $? "Entry not marked as \"temp\" after replace" + bridge -d -s mdb show dev br0 vid 10 | grep "$grp_key" | \ + grep -q " 0.00" - bridge -d -s mdb get dev br0 $grp_key vid 10 | grep -q " 0.00" check_fail $? "Entry has an unpending group timer after replace" bridge mdb del dev br0 port $swp1 $grp_key vid 10 @@ -638,7 +675,7 @@ # (*, G) ports need to be added to it. bridge mdb add dev br0 port $swp2 grp $grp vid 10 bridge mdb add dev br0 port $swp1 $grp_key vid 10 + bridge mdb show dev br0 vid 10 | grep "$grp_key" | grep $swp2 | \ - bridge mdb get dev br0 $grp_key vid 10 | grep $swp2 | \ grep -q "added_by_star_ex" check_err $? "\"added_by_star_ex\" entry not created after adding (S, G) entry" bridge mdb del dev br0 port $swp1 $grp_key vid 10 @@ -1065,17 +1102,14 @@ echo log_info "# Forwarding tests" - # Set the Max Response Delay to 100 centiseconds (1 second) so that the - # bridge will start forwarding according to its MDB soon after a - # multicast querier is enabled. - ip link set dev br0 type bridge mcast_query_response_interval 100 - # Forwarding according to MDB entries only takes place when the bridge # detects that there is a valid querier in the network. Set the bridge # as the querier and assign it a valid IPv6 link-local address to be # used as the source address for MLD queries. ip -6 address add fe80::1/64 nodad dev br0 ip link set dev br0 type bridge mcast_querier 1 + # Wait the default Query Response Interval (10 seconds) for the bridge + # to determine that there are no other queriers in the network. sleep 10 fwd_test_host @@ -1083,7 +1117,6 @@ ip link set dev br0 type bridge mcast_querier 0 ip -6 address del fe80::1/64 dev br0 - ip link set dev br0 type bridge mcast_query_response_interval 1000 } ctrl_igmpv3_is_in_test() @@ -1099,7 +1132,7 @@ $MZ $h1.10 -c 1 -a own -b 01:00:5e:01:01:01 -A 192.0.2.1 -B 239.1.1.1 \ -t ip proto=2,p=$(igmpv3_is_in_get 239.1.1.1 192.0.2.2) -q + bridge -d mdb show dev br0 vid 10 | grep 239.1.1.1 | grep -q 192.0.2.2 - bridge mdb get dev br0 grp 239.1.1.1 src 192.0.2.2 vid 10 &> /dev/null check_fail $? "Permanent entry affected by IGMP packet" # Replace the permanent entry with a temporary one and check that after @@ -1112,10 +1145,12 @@ $MZ $h1.10 -a own -b 01:00:5e:01:01:01 -c 1 -A 192.0.2.1 -B 239.1.1.1 \ -t ip proto=2,p=$(igmpv3_is_in_get 239.1.1.1 192.0.2.2) -q + bridge -d mdb show dev br0 vid 10 | grep 239.1.1.1 | grep -v "src" | \ + grep -q 192.0.2.2 - bridge -d mdb get dev br0 grp 239.1.1.1 vid 10 | grep -q 192.0.2.2 check_err $? "Source not add to source list" + bridge -d mdb show dev br0 vid 10 | grep 239.1.1.1 | \ + grep -q "src 192.0.2.2" - bridge mdb get dev br0 grp 239.1.1.1 src 192.0.2.2 vid 10 &> /dev/null check_err $? "(S, G) entry not created for new source" bridge mdb del dev br0 port $swp1 grp 239.1.1.1 vid 10 @@ -1137,7 +1172,8 @@ $MZ -6 $h1.10 -a own -b 33:33:00:00:00:01 -c 1 -A fe80::1 -B ff0e::1 \ -t ip hop=1,next=0,p="$p" -q + bridge -d mdb show dev br0 vid 10 | grep ff0e::1 | \ + grep -q 2001:db8:1::2 - bridge mdb get dev br0 grp ff0e::1 src 2001:db8:1::2 vid 10 &> /dev/null check_fail $? "Permanent entry affected by MLD packet" # Replace the permanent entry with a temporary one and check that after @@ -1150,10 +1186,12 @@ $MZ -6 $h1.10 -a own -b 33:33:00:00:00:01 -c 1 -A fe80::1 -B ff0e::1 \ -t ip hop=1,next=0,p="$p" -q + bridge -d mdb show dev br0 vid 10 | grep ff0e::1 | grep -v "src" | \ + grep -q 2001:db8:1::2 - bridge -d mdb get dev br0 grp ff0e::1 vid 10 | grep -q 2001:db8:1::2 check_err $? "Source not add to source list" + bridge -d mdb show dev br0 vid 10 | grep ff0e::1 | \ + grep -q "src 2001:db8:1::2" - bridge mdb get dev br0 grp ff0e::1 src 2001:db8:1::2 vid 10 &> /dev/null check_err $? "(S, G) entry not created for new source" bridge mdb del dev br0 port $swp1 grp ff0e::1 vid 10 @@ -1170,8 +1208,8 @@ ctrl_mldv2_is_in_test } +if ! bridge mdb help 2>&1 | grep -q "replace"; then + echo "SKIP: iproute2 too old, missing bridge mdb replace support" -if ! bridge mdb help 2>&1 | grep -q "get"; then - echo "SKIP: iproute2 too old, missing bridge mdb get support" exit $ksft_skip fi reverted: --- linux-6.5.0/tools/testing/selftests/net/forwarding/tc_flower_l2_miss.sh +++ linux-6.5.0.orig/tools/testing/selftests/net/forwarding/tc_flower_l2_miss.sh @@ -209,17 +209,14 @@ # both registered and unregistered multicast traffic. bridge link set dev $swp2 mcast_router 2 - # Set the Max Response Delay to 100 centiseconds (1 second) so that the - # bridge will start forwarding according to its MDB soon after a - # multicast querier is enabled. - ip link set dev br1 type bridge mcast_query_response_interval 100 - # Forwarding according to MDB entries only takes place when the bridge # detects that there is a valid querier in the network. Set the bridge # as the querier and assign it a valid IPv6 link-local address to be # used as the source address for MLD queries. ip link set dev br1 type bridge mcast_querier 1 ip -6 address add fe80::1/64 nodad dev br1 + # Wait the default Query Response Interval (10 seconds) for the bridge + # to determine that there are no other queriers in the network. sleep 10 test_l2_miss_multicast_ipv4 @@ -227,7 +224,6 @@ ip -6 address del fe80::1/64 dev br1 ip link set dev br1 type bridge mcast_querier 0 - ip link set dev br1 type bridge mcast_query_response_interval 1000 bridge link set dev $swp2 mcast_router 1 } reverted: --- linux-6.5.0/tools/testing/selftests/net/mptcp/config +++ linux-6.5.0.orig/tools/testing/selftests/net/mptcp/config @@ -22,11 +22,8 @@ CONFIG_NFT_SOCKET=m CONFIG_IP_ADVANCED_ROUTER=y CONFIG_IP_MULTIPLE_TABLES=y -CONFIG_IP_NF_FILTER=m -CONFIG_IP_NF_MANGLE=m CONFIG_IP_NF_TARGET_REJECT=m CONFIG_IPV6_MULTIPLE_TABLES=y -CONFIG_IP6_NF_FILTER=m CONFIG_NET_ACT_CSUM=m CONFIG_NET_ACT_PEDIT=m CONFIG_NET_CLS_ACT=y diff -u linux-6.5.0/tools/testing/selftests/net/mptcp/mptcp_join.sh linux-6.5.0/tools/testing/selftests/net/mptcp/mptcp_join.sh --- linux-6.5.0/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ linux-6.5.0/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -626,10 +626,16 @@ done } +kill_wait() +{ + kill $1 > /dev/null 2>&1 + wait $1 2>/dev/null +} + kill_events_pids() { - mptcp_lib_kill_wait $evts_ns1_pid - mptcp_lib_kill_wait $evts_ns2_pid + kill_wait $evts_ns1_pid + kill_wait $evts_ns2_pid } kill_tests_wait() reverted: --- linux-6.5.0/tools/testing/selftests/net/mptcp/mptcp_lib.sh +++ linux-6.5.0.orig/tools/testing/selftests/net/mptcp/mptcp_lib.sh @@ -102,12 +102,3 @@ mptcp_lib_fail_if_expected_feature "kernel version ${1} lower than ${v}" } - -# $1: PID -mptcp_lib_kill_wait() { - [ "${1}" -eq 0 ] && return 0 - - kill -SIGUSR1 "${1}" > /dev/null 2>&1 - kill "${1}" > /dev/null 2>&1 - wait "${1}" 2>/dev/null -} reverted: --- linux-6.5.0/tools/testing/selftests/net/mptcp/settings +++ linux-6.5.0.orig/tools/testing/selftests/net/mptcp/settings @@ -1 +1 @@ +timeout=1200 -timeout=1800 reverted: --- linux-6.5.0/tools/testing/selftests/net/mptcp/userspace_pm.sh +++ linux-6.5.0.orig/tools/testing/selftests/net/mptcp/userspace_pm.sh @@ -58,8 +58,15 @@ stdbuf -o0 -e0 printf "INFO: %s\n" "${1}" } +kill_wait() +{ + [ $1 -eq 0 ] && return 0 + + kill -SIGUSR1 $1 > /dev/null 2>&1 + kill $1 > /dev/null 2>&1 + wait $1 2>/dev/null +} + -# This function is used in the cleanup trap -#shellcheck disable=SC2317 cleanup() { print_title "Cleanup" @@ -69,7 +76,7 @@ for pid in $client4_pid $server4_pid $client6_pid $server6_pid\ $server_evts_pid $client_evts_pid do + kill_wait $pid - mptcp_lib_kill_wait $pid done local netns @@ -150,7 +157,7 @@ fi :>"$client_evts" if [ $client_evts_pid -ne 0 ]; then + kill_wait $client_evts_pid - mptcp_lib_kill_wait $client_evts_pid fi ip netns exec "$ns2" ./pm_nl_ctl events >> "$client_evts" 2>&1 & client_evts_pid=$! @@ -159,7 +166,7 @@ fi :>"$server_evts" if [ $server_evts_pid -ne 0 ]; then + kill_wait $server_evts_pid - mptcp_lib_kill_wait $server_evts_pid fi ip netns exec "$ns1" ./pm_nl_ctl events >> "$server_evts" 2>&1 & server_evts_pid=$! @@ -579,7 +586,7 @@ "10.0.2.2" "$client4_port" "23" "$client_addr_id" "ns1" "ns2" # Delete the listener from the client ns, if one was created + kill_wait $listener_pid - mptcp_lib_kill_wait $listener_pid local sport sport=$(sed --unbuffered -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q' "$server_evts") @@ -618,7 +625,7 @@ "$client_addr_id" "ns1" "ns2" # Delete the listener from the client ns, if one was created + kill_wait $listener_pid - mptcp_lib_kill_wait $listener_pid sport=$(sed --unbuffered -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q' "$server_evts") @@ -657,7 +664,7 @@ "$client_addr_id" "ns1" "ns2" # Delete the listener from the client ns, if one was created + kill_wait $listener_pid - mptcp_lib_kill_wait $listener_pid sport=$(sed --unbuffered -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q' "$server_evts") @@ -695,7 +702,7 @@ "10.0.2.1" "$app4_port" "23" "$server_addr_id" "ns2" "ns1" # Delete the listener from the server ns, if one was created + kill_wait $listener_pid - mptcp_lib_kill_wait $listener_pid sport=$(sed --unbuffered -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q' "$client_evts") @@ -734,7 +741,7 @@ "$server_addr_id" "ns2" "ns1" # Delete the listener from the server ns, if one was created + kill_wait $listener_pid - mptcp_lib_kill_wait $listener_pid sport=$(sed --unbuffered -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q' "$client_evts") @@ -771,7 +778,7 @@ "10.0.2.2" "10.0.2.1" "$new4_port" "23" "$server_addr_id" "ns2" "ns1" # Delete the listener from the server ns, if one was created + kill_wait $listener_pid - mptcp_lib_kill_wait $listener_pid sport=$(sed --unbuffered -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q' "$client_evts") @@ -817,7 +824,7 @@ "$server_addr_id" "ns2" "ns1" # Delete the listener from the server ns, if one was created + kill_wait $listener_pid - mptcp_lib_kill_wait $listener_pid sport=$(sed --unbuffered -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q' "$client_evts") @@ -937,7 +944,7 @@ sleep 0.5 # Delete the listener from the client ns, if one was created + kill_wait $listener_pid - mptcp_lib_kill_wait $listener_pid sleep 0.5 verify_listener_events $client_evts $LISTENER_CLOSED $AF_INET 10.0.2.2 $client4_port diff -u linux-6.5.0/tools/testing/selftests/net/pmtu.sh linux-6.5.0/tools/testing/selftests/net/pmtu.sh --- linux-6.5.0/tools/testing/selftests/net/pmtu.sh +++ linux-6.5.0/tools/testing/selftests/net/pmtu.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # SPDX-License-Identifier: GPL-2.0 # # Check that route PMTU values match expectations, and that initial device MTU @@ -198,8 +198,8 @@ # - pmtu_ipv6_route_change # Same as above but with IPv6 -source lib.sh -source net_helper.sh +# Kselftest framework requirement - SKIP code is 4. +ksft_skip=4 PAUSE_ON_FAIL=no VERBOSE=0 @@ -268,6 +268,16 @@ pmtu_ipv4_route_change ipv4: PMTU exception w/route replace 1 pmtu_ipv6_route_change ipv6: PMTU exception w/route replace 1" +NS_A="ns-A" +NS_B="ns-B" +NS_C="ns-C" +NS_R1="ns-R1" +NS_R2="ns-R2" +ns_a="ip netns exec ${NS_A}" +ns_b="ip netns exec ${NS_B}" +ns_c="ip netns exec ${NS_C}" +ns_r1="ip netns exec ${NS_R1}" +ns_r2="ip netns exec ${NS_R2}" # Addressing and routing for tests with routers: four network segments, with # index SEGMENT between 1 and 4, a common prefix (PREFIX4 or PREFIX6) and an # identifier ID, which is 1 for hosts (A and B), 2 for routers (R1 and R2). @@ -533,17 +543,13 @@ } setup_namespaces() { - setup_ns NS_A NS_B NS_C NS_R1 NS_R2 for n in ${NS_A} ${NS_B} ${NS_C} ${NS_R1} ${NS_R2}; do + ip netns add ${n} || return 1 + # Disable DAD, so that we don't have to wait to use the # configured IPv6 addresses ip netns exec ${n} sysctl -q net/ipv6/conf/default/accept_dad=0 done - ns_a="ip netns exec ${NS_A}" - ns_b="ip netns exec ${NS_B}" - ns_c="ip netns exec ${NS_C}" - ns_r1="ip netns exec ${NS_R1}" - ns_r2="ip netns exec ${NS_R2}" } setup_veth() { @@ -833,7 +839,7 @@ run_cmd ${ns_a} ip link set br0 up run_cmd ${ns_c} ip link add veth_C-A type veth peer name veth_A-C - run_cmd ${ns_c} ip link set veth_A-C netns ${NS_A} + run_cmd ${ns_c} ip link set veth_A-C netns ns-A run_cmd ${ns_a} ip link set veth_A-C up run_cmd ${ns_c} ip link set veth_C-A up @@ -938,7 +944,9 @@ done socat_pids= - cleanup_all_ns + for n in ${NS_A} ${NS_B} ${NS_C} ${NS_R1} ${NS_R2}; do + ip netns del ${n} 2> /dev/null + done ip link del veth_A-C 2>/dev/null ip link del veth_A-R1 2>/dev/null @@ -1337,15 +1345,13 @@ TCPDST="TCP:[${dst}]:50000" fi ${ns_b} socat -T 3 -u -6 TCP-LISTEN:50000 STDOUT > $tmpoutfile & - local socat_pid=$! - wait_local_port_listen ${NS_B} 50000 tcp + sleep 1 dd if=/dev/zero status=none bs=1M count=1 | ${target} socat -T 3 -u STDIN $TCPDST,connect-timeout=3 size=$(du -sb $tmpoutfile) size=${size%%/tmp/*} - wait ${socat_pid} [ $size -ne 1048576 ] && err "File size $size mismatches exepcted value in locally bridged vxlan test" && return 1 done @@ -1957,13 +1963,6 @@ return 0 } -check_running() { - pid=${1} - cmd=${2} - - [ "$(cat /proc/${pid}/cmdline 2>/dev/null | tr -d '\0')" = "{cmd}" ] -} - test_cleanup_vxlanX_exception() { outer="${1}" encap="vxlan" @@ -1994,12 +1993,11 @@ ${ns_a} ip link del dev veth_A-R1 & iplink_pid=$! - for i in $(seq 1 20); do - check_running ${iplink_pid} "iplinkdeldevveth_A-R1" || return 0 - sleep 0.1 - done - err " can't delete veth device in a timely manner, PMTU dst likely leaked" - return 1 + sleep 1 + if [ "$(cat /proc/${iplink_pid}/cmdline 2>/dev/null | tr -d '\0')" = "iplinkdeldevveth_A-R1" ]; then + err " can't delete veth device in a timely manner, PMTU dst likely leaked" + return 1 + fi } test_cleanup_ipv6_exception() { diff -u linux-6.5.0/tools/testing/selftests/net/udpgro_fwd.sh linux-6.5.0/tools/testing/selftests/net/udpgro_fwd.sh --- linux-6.5.0/tools/testing/selftests/net/udpgro_fwd.sh +++ linux-6.5.0/tools/testing/selftests/net/udpgro_fwd.sh @@ -39,10 +39,6 @@ for ns in $NS_SRC $NS_DST; do ip netns add $ns ip -n $ns link set dev lo up - - # disable route solicitations to decrease 'noise' traffic - ip netns exec $ns sysctl -qw net.ipv6.conf.default.router_solicitations=0 - ip netns exec $ns sysctl -qw net.ipv6.conf.all.router_solicitations=0 done ip link add name veth$SRC type veth peer name veth$DST @@ -84,12 +80,6 @@ create_vxlan_endpoint $BASE$ns veth$ns $BM_NET_V6$((3 - $ns)) vxlan6$ns 6 ip -n $BASE$ns addr add dev vxlan6$ns $OL_NET_V6$ns/24 nodad done - - # preload neighbur cache, do avoid some noisy traffic - local addr_dst=$(ip -j -n $BASE$DST link show dev vxlan6$DST |jq -r '.[]["address"]') - local addr_src=$(ip -j -n $BASE$SRC link show dev vxlan6$SRC |jq -r '.[]["address"]') - ip -n $BASE$DST neigh add dev vxlan6$DST lladdr $addr_src $OL_NET_V6$SRC - ip -n $BASE$SRC neigh add dev vxlan6$SRC lladdr $addr_dst $OL_NET_V6$DST } is_ipv6() { @@ -129,7 +119,7 @@ # not enable GRO ip netns exec $NS_DST $ipt -A INPUT -p udp --dport 4789 ip netns exec $NS_DST $ipt -A INPUT -p udp --dport 8000 - ip netns exec $NS_DST ./udpgso_bench_rx -C 2000 -R 100 -n 10 -l 1300 $rx_args & + ip netns exec $NS_DST ./udpgso_bench_rx -C 1000 -R 10 -n 10 -l 1300 $rx_args & local spid=$! wait_local_port_listen "$NS_DST" 8000 udp ip netns exec $NS_SRC ./udpgso_bench_tx $family -M 1 -s 13000 -S 1300 -D $dst @@ -178,7 +168,7 @@ # bind the sender and the receiver to different CPUs to try # get reproducible results ip netns exec $NS_DST bash -c "echo 2 > /sys/class/net/veth$DST/queues/rx-0/rps_cpus" - ip netns exec $NS_DST taskset 0x2 ./udpgso_bench_rx -C 2000 -R 100 & + ip netns exec $NS_DST taskset 0x2 ./udpgso_bench_rx -C 1000 -R 10 & local spid=$! wait_local_port_listen "$NS_DST" 8000 udp ip netns exec $NS_SRC taskset 0x1 ./udpgso_bench_tx $family -l 3 -S 1300 -D $dst reverted: --- linux-6.5.0/tools/testing/selftests/net/udpgso_bench_rx.c +++ linux-6.5.0.orig/tools/testing/selftests/net/udpgso_bench_rx.c @@ -375,7 +375,7 @@ do_flush_udp(fd); tnow = gettimeofday_ms(); + if (tnow > treport) { - if (!cfg_expected_pkt_nr && tnow > treport) { if (packets) fprintf(stderr, "%s rx: %6lu MB/s %8lu calls/s\n", reverted: --- linux-6.5.0/tools/testing/selftests/net/unicast_extensions.sh +++ linux-6.5.0.orig/tools/testing/selftests/net/unicast_extensions.sh @@ -1,4 +1,4 @@ +#!/bin/sh -#!/bin/bash # SPDX-License-Identifier: GPL-2.0 # # By Seth Schoen (c) 2021, for the IPv4 Unicast Extensions Project @@ -28,7 +28,8 @@ # These tests provide an easy way to flip the expected result of any # of these behaviors for testing kernel patches that change them. +# Kselftest framework requirement - SKIP code is 4. +ksft_skip=4 -source lib.sh # nettest can be run from PATH or from same directory as this selftest if ! which nettest >/dev/null; then @@ -60,20 +61,20 @@ # foo --- bar # Arguments: ip_a ip_b prefix_length test_description # + # Caller must set up foo-ns and bar-ns namespaces - # Caller must set up $foo_ns and $bar_ns namespaces # containing linked veth devices foo and bar, # respectively. + ip -n foo-ns address add $1/$3 dev foo || return 1 + ip -n foo-ns link set foo up || return 1 + ip -n bar-ns address add $2/$3 dev bar || return 1 + ip -n bar-ns link set bar up || return 1 - ip -n $foo_ns address add $1/$3 dev foo || return 1 - ip -n $foo_ns link set foo up || return 1 - ip -n $bar_ns address add $2/$3 dev bar || return 1 - ip -n $bar_ns link set bar up || return 1 + ip netns exec foo-ns timeout 2 ping -c 1 $2 || return 1 + ip netns exec bar-ns timeout 2 ping -c 1 $1 || return 1 - ip netns exec $foo_ns timeout 2 ping -c 1 $2 || return 1 - ip netns exec $bar_ns timeout 2 ping -c 1 $1 || return 1 + nettest -B -N bar-ns -O foo-ns -r $1 || return 1 + nettest -B -N foo-ns -O bar-ns -r $2 || return 1 - nettest -B -N $bar_ns -O $foo_ns -r $1 || return 1 - nettest -B -N $foo_ns -O $bar_ns -r $2 || return 1 return 0 } @@ -87,31 +88,31 @@ # Arguments: foo_ip foo1_ip bar1_ip bar_ip prefix_len test_description # Displays test result and returns success or failure. + # Caller must set up foo-ns, bar-ns, and router-ns - # Caller must set up $foo_ns, $bar_ns, and $router_ns # containing linked veth devices foo-foo1, bar1-bar + # (foo in foo-ns, foo1 and bar1 in router-ns, and + # bar in bar-ns). - # (foo in $foo_ns, foo1 and bar1 in $router_ns, and - # bar in $bar_ns). + ip -n foo-ns address add $1/$5 dev foo || return 1 + ip -n foo-ns link set foo up || return 1 + ip -n foo-ns route add default via $2 || return 1 + ip -n bar-ns address add $4/$5 dev bar || return 1 + ip -n bar-ns link set bar up || return 1 + ip -n bar-ns route add default via $3 || return 1 + ip -n router-ns address add $2/$5 dev foo1 || return 1 + ip -n router-ns link set foo1 up || return 1 + ip -n router-ns address add $3/$5 dev bar1 || return 1 + ip -n router-ns link set bar1 up || return 1 + + echo 1 | ip netns exec router-ns tee /proc/sys/net/ipv4/ip_forward + + ip netns exec foo-ns timeout 2 ping -c 1 $2 || return 1 + ip netns exec foo-ns timeout 2 ping -c 1 $4 || return 1 + ip netns exec bar-ns timeout 2 ping -c 1 $3 || return 1 + ip netns exec bar-ns timeout 2 ping -c 1 $1 || return 1 - ip -n $foo_ns address add $1/$5 dev foo || return 1 - ip -n $foo_ns link set foo up || return 1 - ip -n $foo_ns route add default via $2 || return 1 - ip -n $bar_ns address add $4/$5 dev bar || return 1 - ip -n $bar_ns link set bar up || return 1 - ip -n $bar_ns route add default via $3 || return 1 - ip -n $router_ns address add $2/$5 dev foo1 || return 1 - ip -n $router_ns link set foo1 up || return 1 - ip -n $router_ns address add $3/$5 dev bar1 || return 1 - ip -n $router_ns link set bar1 up || return 1 - - echo 1 | ip netns exec $router_ns tee /proc/sys/net/ipv4/ip_forward - - ip netns exec $foo_ns timeout 2 ping -c 1 $2 || return 1 - ip netns exec $foo_ns timeout 2 ping -c 1 $4 || return 1 - ip netns exec $bar_ns timeout 2 ping -c 1 $3 || return 1 - ip netns exec $bar_ns timeout 2 ping -c 1 $1 || return 1 + nettest -B -N bar-ns -O foo-ns -r $1 || return 1 + nettest -B -N foo-ns -O bar-ns -r $4 || return 1 - nettest -B -N $bar_ns -O $foo_ns -r $1 || return 1 - nettest -B -N $foo_ns -O $bar_ns -r $4 || return 1 return 0 } @@ -120,15 +121,17 @@ # Sets up veth link and tries to connect over it. # Arguments: ip_a ip_b prefix_len test_description hide_output + ip netns add foo-ns + ip netns add bar-ns + ip link add foo netns foo-ns type veth peer name bar netns bar-ns - setup_ns foo_ns bar_ns - ip link add foo netns $foo_ns type veth peer name bar netns $bar_ns test_result=0 _do_segmenttest "$@" || test_result=1 + ip netns pids foo-ns | xargs -r kill -9 + ip netns pids bar-ns | xargs -r kill -9 + ip netns del foo-ns + ip netns del bar-ns - ip netns pids $foo_ns | xargs -r kill -9 - ip netns pids $bar_ns | xargs -r kill -9 - cleanup_ns $foo_ns $bar_ns show_output # inverted tests will expect failure instead of success @@ -144,17 +147,21 @@ # Returns success or failure. hide_output + ip netns add foo-ns + ip netns add bar-ns + ip netns add router-ns + ip link add foo netns foo-ns type veth peer name foo1 netns router-ns + ip link add bar netns bar-ns type veth peer name bar1 netns router-ns - setup_ns foo_ns bar_ns router_ns - ip link add foo netns $foo_ns type veth peer name foo1 netns $router_ns - ip link add bar netns $bar_ns type veth peer name bar1 netns $router_ns test_result=0 _do_route_test "$@" || test_result=1 + ip netns pids foo-ns | xargs -r kill -9 + ip netns pids bar-ns | xargs -r kill -9 + ip netns pids router-ns | xargs -r kill -9 + ip netns del foo-ns + ip netns del bar-ns + ip netns del router-ns - ip netns pids $foo_ns | xargs -r kill -9 - ip netns pids $bar_ns | xargs -r kill -9 - ip netns pids $router_ns | xargs -r kill -9 - cleanup_ns $foo_ns $bar_ns $router_ns show_output reverted: --- linux-6.5.0/tools/tracing/rtla/Makefile +++ linux-6.5.0.orig/tools/tracing/rtla/Makefile @@ -28,15 +28,10 @@ -fasynchronous-unwind-tables -fstack-clash-protection WOPTS := -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -Wno-maybe-uninitialized -ifeq ($(CC),clang) - FOPTS := $(filter-out -ffat-lto-objects, $(FOPTS)) - WOPTS := $(filter-out -Wno-maybe-uninitialized, $(WOPTS)) -endif - TRACEFS_HEADERS := $$($(PKG_CONFIG) --cflags libtracefs) CFLAGS := -O -g -DVERSION=\"$(VERSION)\" $(FOPTS) $(MOPTS) $(WOPTS) $(TRACEFS_HEADERS) $(EXTRA_CFLAGS) +LDFLAGS := -ggdb $(EXTRA_LDFLAGS) -LDFLAGS := -flto=auto -ggdb $(EXTRA_LDFLAGS) LIBS := $$($(PKG_CONFIG) --libs libtracefs) SRC := $(wildcard src/*.c) reverted: --- linux-6.5.0/tools/tracing/rtla/src/osnoise_hist.c +++ linux-6.5.0.orig/tools/tracing/rtla/src/osnoise_hist.c @@ -135,7 +135,8 @@ if (params->output_divisor) duration = duration / params->output_divisor; + if (data->bucket_size) + bucket = duration / data->bucket_size; - bucket = duration / data->bucket_size; total_duration = duration * count; @@ -479,11 +480,7 @@ for (i = 0; msg[i]; i++) fprintf(stderr, "%s\n", msg[i]); + exit(1); - - if (usage) - exit(EXIT_FAILURE); - - exit(EXIT_SUCCESS); } /* reverted: --- linux-6.5.0/tools/tracing/rtla/src/osnoise_top.c +++ linux-6.5.0.orig/tools/tracing/rtla/src/osnoise_top.c @@ -331,11 +331,7 @@ for (i = 0; msg[i]; i++) fprintf(stderr, "%s\n", msg[i]); + exit(1); - - if (usage) - exit(EXIT_FAILURE); - - exit(EXIT_SUCCESS); } /* reverted: --- linux-6.5.0/tools/tracing/rtla/src/timerlat_hist.c +++ linux-6.5.0.orig/tools/tracing/rtla/src/timerlat_hist.c @@ -178,7 +178,8 @@ if (params->output_divisor) latency = latency / params->output_divisor; + if (data->bucket_size) + bucket = latency / data->bucket_size; - bucket = latency / data->bucket_size; if (!context) { hist = data->hist[cpu].irq; @@ -545,11 +546,7 @@ for (i = 0; msg[i]; i++) fprintf(stderr, "%s\n", msg[i]); + exit(1); - - if (usage) - exit(EXIT_FAILURE); - - exit(EXIT_SUCCESS); } /* reverted: --- linux-6.5.0/tools/tracing/rtla/src/timerlat_top.c +++ linux-6.5.0.orig/tools/tracing/rtla/src/timerlat_top.c @@ -375,11 +375,7 @@ for (i = 0; msg[i]; i++) fprintf(stderr, "%s\n", msg[i]); + exit(1); - - if (usage) - exit(EXIT_FAILURE); - - exit(EXIT_SUCCESS); } /* diff -u linux-6.5.0/tools/tracing/rtla/src/utils.c linux-6.5.0/tools/tracing/rtla/src/utils.c --- linux-6.5.0/tools/tracing/rtla/src/utils.c +++ linux-6.5.0/tools/tracing/rtla/src/utils.c @@ -238,6 +238,12 @@ return syscall(__NR_sched_setattr, pid, attr, flags); } +static inline int sched_getattr(pid_t pid, struct sched_attr *attr, + unsigned int size, unsigned int flags) +{ + return syscall(__NR_sched_getattr, pid, attr, size, flags); +} + int __set_sched_attr(int pid, struct sched_attr *attr) { int flags = 0; @@ -473,13 +479,13 @@ if (prio == INVALID_VAL) return -1; - if (prio < MIN_NICE) + if (prio < sched_get_priority_min(SCHED_OTHER)) return -1; - if (prio > MAX_NICE) + if (prio > sched_get_priority_max(SCHED_OTHER)) return -1; sched_param->sched_policy = SCHED_OTHER; - sched_param->sched_nice = prio; + sched_param->sched_priority = prio; break; default: return -1; @@ -530,7 +536,7 @@ */ static const int find_mount(const char *fs, char *mp, int sizeof_mp) { - char mount_point[MAX_PATH+1]; + char mount_point[MAX_PATH]; char type[100]; int found = 0; FILE *fp; reverted: --- linux-6.5.0/tools/tracing/rtla/src/utils.h +++ linux-6.5.0.orig/tools/tracing/rtla/src/utils.h @@ -9,8 +9,6 @@ */ #define BUFF_U64_STR_SIZE 24 #define MAX_PATH 1024 -#define MAX_NICE 20 -#define MIN_NICE -19 #define container_of(ptr, type, member)({ \ const typeof(((type *)0)->member) *__mptr = (ptr); \ reverted: --- linux-6.5.0/tools/verification/rv/Makefile +++ linux-6.5.0.orig/tools/verification/rv/Makefile @@ -28,15 +28,10 @@ -fasynchronous-unwind-tables -fstack-clash-protection WOPTS := -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -Wno-maybe-uninitialized -ifeq ($(CC),clang) - FOPTS := $(filter-out -ffat-lto-objects, $(FOPTS)) - WOPTS := $(filter-out -Wno-maybe-uninitialized, $(WOPTS)) -endif - TRACEFS_HEADERS := $$($(PKG_CONFIG) --cflags libtracefs) CFLAGS := -O -g -DVERSION=\"$(VERSION)\" $(FOPTS) $(MOPTS) $(WOPTS) $(TRACEFS_HEADERS) $(EXTRA_CFLAGS) -I include +LDFLAGS := -ggdb $(EXTRA_LDFLAGS) -LDFLAGS := -flto=auto -ggdb $(EXTRA_LDFLAGS) LIBS := $$($(PKG_CONFIG) --libs libtracefs) SRC := $(wildcard src/*.c) reverted: --- linux-6.5.0/tools/verification/rv/src/in_kernel.c +++ linux-6.5.0.orig/tools/verification/rv/src/in_kernel.c @@ -210,9 +210,9 @@ static char *ikm_get_current_reactor(char *monitor_name) { char *reactors = ikm_read_reactor(monitor_name); - char *curr_reactor = NULL; char *start; char *end; + char *curr_reactor; if (!reactors) return NULL; only in patch2: unchanged: --- linux-6.5.0.orig/drivers/scsi/fcoe/fcoe_ctlr.c +++ linux-6.5.0/drivers/scsi/fcoe/fcoe_ctlr.c @@ -319,16 +319,17 @@ { struct fcoe_fcf *sel; struct fcoe_fcf *fcf; + unsigned long flags; mutex_lock(&fip->ctlr_mutex); - spin_lock_bh(&fip->ctlr_lock); + spin_lock_irqsave(&fip->ctlr_lock, flags); kfree_skb(fip->flogi_req); fip->flogi_req = NULL; list_for_each_entry(fcf, &fip->fcfs, list) fcf->flogi_sent = 0; - spin_unlock_bh(&fip->ctlr_lock); + spin_unlock_irqrestore(&fip->ctlr_lock, flags); sel = fip->sel_fcf; if (sel && ether_addr_equal(sel->fcf_mac, fip->dest_addr)) @@ -699,6 +700,7 @@ { struct fc_frame *fp; struct fc_frame_header *fh; + unsigned long flags; u16 old_xid; u8 op; u8 mac[ETH_ALEN]; @@ -732,11 +734,11 @@ op = FIP_DT_FLOGI; if (fip->mode == FIP_MODE_VN2VN) break; - spin_lock_bh(&fip->ctlr_lock); + spin_lock_irqsave(&fip->ctlr_lock, flags); kfree_skb(fip->flogi_req); fip->flogi_req = skb; fip->flogi_req_send = 1; - spin_unlock_bh(&fip->ctlr_lock); + spin_unlock_irqrestore(&fip->ctlr_lock, flags); schedule_work(&fip->timer_work); return -EINPROGRESS; case ELS_FDISC: @@ -1705,10 +1707,11 @@ static int fcoe_ctlr_flogi_retry(struct fcoe_ctlr *fip) { struct fcoe_fcf *fcf; + unsigned long flags; int error; mutex_lock(&fip->ctlr_mutex); - spin_lock_bh(&fip->ctlr_lock); + spin_lock_irqsave(&fip->ctlr_lock, flags); LIBFCOE_FIP_DBG(fip, "re-sending FLOGI - reselect\n"); fcf = fcoe_ctlr_select(fip); if (!fcf || fcf->flogi_sent) { @@ -1719,7 +1722,7 @@ fcoe_ctlr_solicit(fip, NULL); error = fcoe_ctlr_flogi_send_locked(fip); } - spin_unlock_bh(&fip->ctlr_lock); + spin_unlock_irqrestore(&fip->ctlr_lock, flags); mutex_unlock(&fip->ctlr_mutex); return error; } @@ -1736,8 +1739,9 @@ static void fcoe_ctlr_flogi_send(struct fcoe_ctlr *fip) { struct fcoe_fcf *fcf; + unsigned long flags; - spin_lock_bh(&fip->ctlr_lock); + spin_lock_irqsave(&fip->ctlr_lock, flags); fcf = fip->sel_fcf; if (!fcf || !fip->flogi_req_send) goto unlock; @@ -1764,7 +1768,7 @@ } else /* XXX */ LIBFCOE_FIP_DBG(fip, "No FCF selected - defer send\n"); unlock: - spin_unlock_bh(&fip->ctlr_lock); + spin_unlock_irqrestore(&fip->ctlr_lock, flags); } /**