From: Greg Kroah-Hartman Date: Mon, 17 Oct 2022 11:36:49 +0000 (+0200) Subject: 6.0-stable patches X-Git-Tag: v5.4.219~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1ee8599beae583b03fc879ce4024ea052f150608;p=thirdparty%2Fkernel%2Fstable-queue.git 6.0-stable patches added patches: drm-amd-display-fix-build-breakage-with-config_debug_fs-n.patch io_uring-fix-fdinfo-sqe-offsets-calculation.patch io_uring-rw-ensure-kiocb_end_write-is-always-called.patch powerpc-64s-interrupt-fix-lost-interrupts-when-returning-to-soft-masked-context.patch --- diff --git a/queue-6.0/drm-amd-display-fix-build-breakage-with-config_debug_fs-n.patch b/queue-6.0/drm-amd-display-fix-build-breakage-with-config_debug_fs-n.patch new file mode 100644 index 00000000000..2fb0942734e --- /dev/null +++ b/queue-6.0/drm-amd-display-fix-build-breakage-with-config_debug_fs-n.patch @@ -0,0 +1,49 @@ +From 2130b87b2273389cafe6765bf09ef564cda01407 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Fri, 14 Oct 2022 08:21:03 -0700 +Subject: drm/amd/display: Fix build breakage with CONFIG_DEBUG_FS=n +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Nathan Chancellor + +commit 2130b87b2273389cafe6765bf09ef564cda01407 upstream. + +After commit 8799c0be89eb ("drm/amd/display: Fix vblank refcount in vrr +transition"), a build with CONFIG_DEBUG_FS=n is broken due to a +misplaced brace, along the lines of: + + In file included from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_trace.h:39, + from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:41: + drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c: At top level: + ./include/drm/drm_atomic.h:864:9: error: expected identifier or ‘(’ before ‘for’ + 864 | for ((__i) = 0; \ + | ^~~ + drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8317:9: note: in expansion of macro ‘for_each_new_crtc_in_state’ + 8317 | for_each_new_crtc_in_state(state, crtc, new_crtc_state, j) + | ^~~~~~~~~~~~~~~~~~~~~~~~~~ + +Move the brace within the #ifdef so that the file can be built with or +without CONFIG_DEBUG_FS. + +Fixes: 8799c0be89eb ("drm/amd/display: Fix vblank refcount in vrr transition") +Signed-off-by: Nathan Chancellor +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c ++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +@@ -8329,8 +8329,8 @@ static void amdgpu_dm_atomic_commit_tail + crtc, dm_new_crtc_state, cur_crc_src)) + DRM_DEBUG_DRIVER("Failed to configure crc source"); + } +-#endif + } ++#endif + } + + for_each_new_crtc_in_state(state, crtc, new_crtc_state, j) diff --git a/queue-6.0/io_uring-fix-fdinfo-sqe-offsets-calculation.patch b/queue-6.0/io_uring-fix-fdinfo-sqe-offsets-calculation.patch new file mode 100644 index 00000000000..75602eda9ac --- /dev/null +++ b/queue-6.0/io_uring-fix-fdinfo-sqe-offsets-calculation.patch @@ -0,0 +1,33 @@ +From 00927931cb630bbf8edb6d7f4dadb25139fc5e16 Mon Sep 17 00:00:00 2001 +From: Pavel Begunkov +Date: Tue, 11 Oct 2022 01:59:57 +0100 +Subject: io_uring: fix fdinfo sqe offsets calculation + +From: Pavel Begunkov + +commit 00927931cb630bbf8edb6d7f4dadb25139fc5e16 upstream. + +Only with the big sqe feature they take 128 bytes per entry, but we +unconditionally advance by 128B. Fix it by using sq_shift. + +Fixes: 3b8fdd1dc35e3 ("io_uring/fdinfo: fix sqe dumping for IORING_SETUP_SQE128") +Reported-and-tested-by: syzbot+e5198737e8a2d23d958c@syzkaller.appspotmail.com +Signed-off-by: Pavel Begunkov +Link: https://lore.kernel.org/r/8b41287cb75d5efb8fcb5cccde845ddbbadd8372.1665449983.git.asml.silence@gmail.com +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + io_uring/fdinfo.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/io_uring/fdinfo.c ++++ b/io_uring/fdinfo.c +@@ -95,7 +95,7 @@ static __cold void __io_uring_show_fdinf + sq_idx = READ_ONCE(ctx->sq_array[entry & sq_mask]); + if (sq_idx > sq_mask) + continue; +- sqe = &ctx->sq_sqes[sq_idx << 1]; ++ sqe = &ctx->sq_sqes[sq_idx << sq_shift]; + seq_printf(m, "%5u: opcode:%s, fd:%d, flags:%x, off:%llu, " + "addr:0x%llx, rw_flags:0x%x, buf_index:%d " + "user_data:%llu", diff --git a/queue-6.0/io_uring-rw-ensure-kiocb_end_write-is-always-called.patch b/queue-6.0/io_uring-rw-ensure-kiocb_end_write-is-always-called.patch new file mode 100644 index 00000000000..ccb7be01f92 --- /dev/null +++ b/queue-6.0/io_uring-rw-ensure-kiocb_end_write-is-always-called.patch @@ -0,0 +1,90 @@ +From 2ec33a6c3cca9fe2465e82050c81f5ffdc508b36 Mon Sep 17 00:00:00 2001 +From: Jens Axboe +Date: Tue, 11 Oct 2022 09:06:23 -0600 +Subject: io_uring/rw: ensure kiocb_end_write() is always called + +From: Jens Axboe + +commit 2ec33a6c3cca9fe2465e82050c81f5ffdc508b36 upstream. + +A previous commit moved the notifications and end-write handling, but +it is now missing a few spots where we also want to call both of those. +Without that, we can potentially be missing file notifications, and +more importantly, have an imbalance in the super_block writers sem +accounting. + +Fixes: b000145e9907 ("io_uring/rw: defer fsnotify calls to task context") +Reported-by: Dave Chinner +Link: https://lore.kernel.org/all/20221010050319.GC2703033@dread.disaster.area/ +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + io_uring/rw.c | 38 +++++++++++++++++++++++++++++--------- + 1 file changed, 29 insertions(+), 9 deletions(-) + +--- a/io_uring/rw.c ++++ b/io_uring/rw.c +@@ -184,11 +184,34 @@ static void kiocb_end_write(struct io_ki + } + } + ++/* ++ * Trigger the notifications after having done some IO, and finish the write ++ * accounting, if any. ++ */ ++static void io_req_io_end(struct io_kiocb *req) ++{ ++ struct io_rw *rw = io_kiocb_to_cmd(req, struct io_rw); ++ ++ WARN_ON(!in_task()); ++ ++ if (rw->kiocb.ki_flags & IOCB_WRITE) { ++ kiocb_end_write(req); ++ fsnotify_modify(req->file); ++ } else { ++ fsnotify_access(req->file); ++ } ++} ++ + static bool __io_complete_rw_common(struct io_kiocb *req, long res) + { + if (unlikely(res != req->cqe.res)) { + if ((res == -EAGAIN || res == -EOPNOTSUPP) && + io_rw_should_reissue(req)) { ++ /* ++ * Reissue will start accounting again, finish the ++ * current cycle. ++ */ ++ io_req_io_end(req); + req->flags |= REQ_F_REISSUE | REQ_F_PARTIAL_IO; + return true; + } +@@ -214,15 +237,7 @@ static inline int io_fixup_rw_res(struct + + static void io_req_rw_complete(struct io_kiocb *req, bool *locked) + { +- struct io_rw *rw = io_kiocb_to_cmd(req, struct io_rw); +- +- if (rw->kiocb.ki_flags & IOCB_WRITE) { +- kiocb_end_write(req); +- fsnotify_modify(req->file); +- } else { +- fsnotify_access(req->file); +- } +- ++ io_req_io_end(req); + io_req_task_complete(req, locked); + } + +@@ -267,6 +282,11 @@ static int kiocb_done(struct io_kiocb *r + req->file->f_pos = rw->kiocb.ki_pos; + if (ret >= 0 && (rw->kiocb.ki_complete == io_complete_rw)) { + if (!__io_complete_rw_common(req, ret)) { ++ /* ++ * Safe to call io_end from here as we're inline ++ * from the submission path. ++ */ ++ io_req_io_end(req); + io_req_set_res(req, final_ret, + io_put_kbuf(req, issue_flags)); + return IOU_OK; diff --git a/queue-6.0/powerpc-64s-interrupt-fix-lost-interrupts-when-returning-to-soft-masked-context.patch b/queue-6.0/powerpc-64s-interrupt-fix-lost-interrupts-when-returning-to-soft-masked-context.patch new file mode 100644 index 00000000000..b7c990b3d36 --- /dev/null +++ b/queue-6.0/powerpc-64s-interrupt-fix-lost-interrupts-when-returning-to-soft-masked-context.patch @@ -0,0 +1,66 @@ +From a4cb3651a174366cc85a677da9e3681fbe97fdae Mon Sep 17 00:00:00 2001 +From: Nicholas Piggin +Date: Thu, 13 Oct 2022 16:44:18 +1000 +Subject: powerpc/64s/interrupt: Fix lost interrupts when returning to soft-masked context + +From: Nicholas Piggin + +commit a4cb3651a174366cc85a677da9e3681fbe97fdae upstream. + +It's possible for an interrupt returning to an irqs-disabled context to +lose a pending soft-masked irq because it branches to part of the exit +code for irqs-enabled contexts, which is meant to clear only the +PACA_IRQS_HARD_DIS flag from PACAIRQHAPPENED by zeroing the byte. This +just looks like a simple thinko from a recent commit (if there was no +hard mask pending, there would be no reason to clear it anyway). + +This also adds comment to the code that actually does need to clear the +flag. + +Fixes: e485f6c751e0a ("powerpc/64/interrupt: Fix return to masked context after hard-mask irq becomes pending") +Reported-by: Sachin Sant +Reported-by: Guenter Roeck +Signed-off-by: Nicholas Piggin +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20221013064418.1311104-1-npiggin@gmail.com +Signed-off-by: Greg Kroah-Hartman +--- + arch/powerpc/kernel/interrupt_64.S | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +--- a/arch/powerpc/kernel/interrupt_64.S ++++ b/arch/powerpc/kernel/interrupt_64.S +@@ -571,7 +571,7 @@ _ASM_NOKPROBE_SYMBOL(interrupt_return_\s + beq .Lfast_kernel_interrupt_return_\srr\() // EE already disabled + lbz r11,PACAIRQHAPPENED(r13) + andi. r10,r11,PACA_IRQ_MUST_HARD_MASK +- beq 1f // No HARD_MASK pending ++ beq .Lfast_kernel_interrupt_return_\srr\() // No HARD_MASK pending + + /* Must clear MSR_EE from _MSR */ + #ifdef CONFIG_PPC_BOOK3S +@@ -588,12 +588,23 @@ _ASM_NOKPROBE_SYMBOL(interrupt_return_\s + b .Lfast_kernel_interrupt_return_\srr\() + + .Linterrupt_return_\srr\()_soft_enabled: ++ /* ++ * In the soft-enabled case, need to double-check that we have no ++ * pending interrupts that might have come in before we reached the ++ * restart section of code, and restart the exit so those can be ++ * handled. ++ * ++ * If there are none, it is be possible that the interrupt still ++ * has PACA_IRQ_HARD_DIS set, which needs to be cleared for the ++ * interrupted context. This clear will not clobber a new pending ++ * interrupt coming in, because we're in the restart section, so ++ * such would return to the restart location. ++ */ + #ifdef CONFIG_PPC_BOOK3S + lbz r11,PACAIRQHAPPENED(r13) + andi. r11,r11,(~PACA_IRQ_HARD_DIS)@l + bne- interrupt_return_\srr\()_kernel_restart + #endif +-1: + li r11,0 + stb r11,PACAIRQHAPPENED(r13) // clear the possible HARD_DIS + diff --git a/queue-6.0/series b/queue-6.0/series index 56b749b46fc..4f760aa965e 100644 --- a/queue-6.0/series +++ b/queue-6.0/series @@ -943,3 +943,7 @@ net-ethernet-ti-davinci_mdio-fix-build-for-mdio-bitbang-uses.patch revert-drm-amd-display-correct-hostvm-flag.patch revert-net-ieee802154-reject-zero-sized-raw_sendmsg.patch net-ieee802154-don-t-warn-zero-sized-raw_sendmsg.patch +powerpc-64s-interrupt-fix-lost-interrupts-when-returning-to-soft-masked-context.patch +drm-amd-display-fix-build-breakage-with-config_debug_fs-n.patch +io_uring-fix-fdinfo-sqe-offsets-calculation.patch +io_uring-rw-ensure-kiocb_end_write-is-always-called.patch