From: Greg Kroah-Hartman Date: Tue, 8 Oct 2024 11:13:40 +0000 (+0200) Subject: 6.1-stable patches X-Git-Tag: v6.6.55~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=25128193eeea390426d88285651e37e49c8cebd9;p=thirdparty%2Fkernel%2Fstable-queue.git 6.1-stable patches added patches: clk-imx6ul-fix-failed-to-get-parent-error.patch fsdax-dax_unshare_iter-should-return-a-valid-length.patch fsdax-unshare-zero-destination-if-srcmap-is-hole-or-unwritten.patch perf-report-fix-segfault-when-sym-sort-key-is-not-used.patch --- diff --git a/queue-6.1/clk-imx6ul-fix-failed-to-get-parent-error.patch b/queue-6.1/clk-imx6ul-fix-failed-to-get-parent-error.patch new file mode 100644 index 00000000000..f6be7ee0001 --- /dev/null +++ b/queue-6.1/clk-imx6ul-fix-failed-to-get-parent-error.patch @@ -0,0 +1,50 @@ +From f420f47e56c67587d9bc8f94267327b6fb214c1d Mon Sep 17 00:00:00 2001 +From: Oleksij Rempel +Date: Fri, 10 Mar 2023 17:45:23 +0100 +Subject: clk: imx6ul: fix "failed to get parent" error + +From: Oleksij Rempel + +commit f420f47e56c67587d9bc8f94267327b6fb214c1d upstream. + +On some configuration we may get following error: +[ 0.000000] imx:clk-gpr-mux: failed to get parent (-EINVAL) + +This happens if selector is configured to not supported value. To avoid +this warnings add dummy parents for not supported values. + +Fixes: 4e197ee880c2 ("clk: imx6ul: add ethernet refclock mux support") +Signed-off-by: Oleksij Rempel +Link: https://lore.kernel.org/r/20230310164523.534571-1-o.rempel@pengutronix.de +Tested-by: Stefan Wahren +Reported-by: Stefan Wahren +Reviewed-by: Peng Fan +Signed-off-by: Stephen Boyd +Signed-off-by: Greg Kroah-Hartman +--- + drivers/clk/imx/clk-imx6ul.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +--- a/drivers/clk/imx/clk-imx6ul.c ++++ b/drivers/clk/imx/clk-imx6ul.c +@@ -95,14 +95,16 @@ static const struct clk_div_table video_ + { } + }; + +-static const char * enet1_ref_sels[] = { "enet1_ref_125m", "enet1_ref_pad", }; ++static const char * enet1_ref_sels[] = { "enet1_ref_125m", "enet1_ref_pad", "dummy", "dummy"}; + static const u32 enet1_ref_sels_table[] = { IMX6UL_GPR1_ENET1_TX_CLK_DIR, +- IMX6UL_GPR1_ENET1_CLK_SEL }; ++ IMX6UL_GPR1_ENET1_CLK_SEL, 0, ++ IMX6UL_GPR1_ENET1_TX_CLK_DIR | IMX6UL_GPR1_ENET1_CLK_SEL }; + static const u32 enet1_ref_sels_table_mask = IMX6UL_GPR1_ENET1_TX_CLK_DIR | + IMX6UL_GPR1_ENET1_CLK_SEL; +-static const char * enet2_ref_sels[] = { "enet2_ref_125m", "enet2_ref_pad", }; ++static const char * enet2_ref_sels[] = { "enet2_ref_125m", "enet2_ref_pad", "dummy", "dummy"}; + static const u32 enet2_ref_sels_table[] = { IMX6UL_GPR1_ENET2_TX_CLK_DIR, +- IMX6UL_GPR1_ENET2_CLK_SEL }; ++ IMX6UL_GPR1_ENET2_CLK_SEL, 0, ++ IMX6UL_GPR1_ENET2_TX_CLK_DIR | IMX6UL_GPR1_ENET2_CLK_SEL }; + static const u32 enet2_ref_sels_table_mask = IMX6UL_GPR1_ENET2_TX_CLK_DIR | + IMX6UL_GPR1_ENET2_CLK_SEL; + diff --git a/queue-6.1/fsdax-dax_unshare_iter-should-return-a-valid-length.patch b/queue-6.1/fsdax-dax_unshare_iter-should-return-a-valid-length.patch new file mode 100644 index 00000000000..4885746a0f2 --- /dev/null +++ b/queue-6.1/fsdax-dax_unshare_iter-should-return-a-valid-length.patch @@ -0,0 +1,43 @@ +From 388bc034d91d480efa88abc5c8d6e6c8a878b1ab Mon Sep 17 00:00:00 2001 +From: Shiyang Ruan +Date: Thu, 2 Feb 2023 12:33:47 +0000 +Subject: fsdax: dax_unshare_iter() should return a valid length + +From: Shiyang Ruan + +commit 388bc034d91d480efa88abc5c8d6e6c8a878b1ab upstream. + +The copy_mc_to_kernel() will return 0 if it executed successfully. Then +the return value should be set to the length it copied. + +[akpm@linux-foundation.org: don't mess up `ret', per Matthew] +Link: https://lkml.kernel.org/r/1675341227-14-1-git-send-email-ruansy.fnst@fujitsu.com +Fixes: d984648e428b ("fsdax,xfs: port unshare to fsdax") +Signed-off-by: Shiyang Ruan +Cc: Darrick J. Wong +Cc: Alistair Popple +Cc: Dan Williams +Cc: Dave Chinner +Cc: Jason Gunthorpe +Cc: John Hubbard +Cc: Matthew Wilcox +Signed-off-by: Andrew Morton +Signed-off-by: Greg Kroah-Hartman +--- + fs/dax.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/fs/dax.c ++++ b/fs/dax.c +@@ -1247,8 +1247,9 @@ static s64 dax_unshare_iter(struct iomap + if (ret < 0) + goto out_unlock; + +- ret = copy_mc_to_kernel(daddr, saddr, length); +- if (ret) ++ if (copy_mc_to_kernel(daddr, saddr, length) == 0) ++ ret = length; ++ else + ret = -EIO; + + out_unlock: diff --git a/queue-6.1/fsdax-unshare-zero-destination-if-srcmap-is-hole-or-unwritten.patch b/queue-6.1/fsdax-unshare-zero-destination-if-srcmap-is-hole-or-unwritten.patch new file mode 100644 index 00000000000..65323225962 --- /dev/null +++ b/queue-6.1/fsdax-unshare-zero-destination-if-srcmap-is-hole-or-unwritten.patch @@ -0,0 +1,59 @@ +From 13dd4e04625f600e5affb1b3f0b6c35268ab839b Mon Sep 17 00:00:00 2001 +From: Shiyang Ruan +Date: Wed, 22 Mar 2023 11:11:09 +0000 +Subject: fsdax: unshare: zero destination if srcmap is HOLE or UNWRITTEN + +From: Shiyang Ruan + +commit 13dd4e04625f600e5affb1b3f0b6c35268ab839b upstream. + +unshare copies data from source to destination. But if the source is +HOLE or UNWRITTEN extents, we should zero the destination, otherwise +the HOLE or UNWRITTEN part will be user-visible old data of the new +allocated extent. + +Found by running generic/649 while mounting with -o dax=always on pmem. + +Link: https://lkml.kernel.org/r/1679483469-2-1-git-send-email-ruansy.fnst@fujitsu.com +Fixes: d984648e428b ("fsdax,xfs: port unshare to fsdax") +Signed-off-by: Shiyang Ruan +Cc: Dan Williams +Cc: Darrick J. Wong +Cc: Jan Kara +Cc: Matthew Wilcox (Oracle) +Cc: Alistair Popple +Cc: Jason Gunthorpe +Cc: John Hubbard +Cc: +Signed-off-by: Andrew Morton +Signed-off-by: Greg Kroah-Hartman +--- + fs/dax.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +--- a/fs/dax.c ++++ b/fs/dax.c +@@ -1234,15 +1234,20 @@ static s64 dax_unshare_iter(struct iomap + /* don't bother with blocks that are not shared to start with */ + if (!(iomap->flags & IOMAP_F_SHARED)) + return length; +- /* don't bother with holes or unwritten extents */ +- if (srcmap->type == IOMAP_HOLE || srcmap->type == IOMAP_UNWRITTEN) +- return length; + + id = dax_read_lock(); + ret = dax_iomap_direct_access(iomap, pos, length, &daddr, NULL); + if (ret < 0) + goto out_unlock; + ++ /* zero the distance if srcmap is HOLE or UNWRITTEN */ ++ if (srcmap->flags & IOMAP_F_SHARED || srcmap->type == IOMAP_UNWRITTEN) { ++ memset(daddr, 0, length); ++ dax_flush(iomap->dax_dev, daddr, length); ++ ret = length; ++ goto out_unlock; ++ } ++ + ret = dax_iomap_direct_access(srcmap, pos, length, &saddr, NULL); + if (ret < 0) + goto out_unlock; diff --git a/queue-6.1/perf-report-fix-segfault-when-sym-sort-key-is-not-used.patch b/queue-6.1/perf-report-fix-segfault-when-sym-sort-key-is-not-used.patch new file mode 100644 index 00000000000..fda4b3afb32 --- /dev/null +++ b/queue-6.1/perf-report-fix-segfault-when-sym-sort-key-is-not-used.patch @@ -0,0 +1,88 @@ +From 9af2efee41b27a0f386fb5aa95d8d0b4b5d9fede Mon Sep 17 00:00:00 2001 +From: Namhyung Kim +Date: Mon, 26 Aug 2024 15:10:42 -0700 +Subject: perf report: Fix segfault when 'sym' sort key is not used + +From: Namhyung Kim + +commit 9af2efee41b27a0f386fb5aa95d8d0b4b5d9fede upstream. + +The fields in the hist_entry are filled on-demand which means they only +have meaningful values when relevant sort keys are used. + +So if neither of 'dso' nor 'sym' sort keys are used, the map/symbols in +the hist entry can be garbage. So it shouldn't access it +unconditionally. + +I got a segfault, when I wanted to see cgroup profiles. + + $ sudo perf record -a --all-cgroups --synth=cgroup true + + $ sudo perf report -s cgroup + + Program received signal SIGSEGV, Segmentation fault. + 0x00005555557a8d90 in map__dso (map=0x0) at util/map.h:48 + 48 return RC_CHK_ACCESS(map)->dso; + (gdb) bt + #0 0x00005555557a8d90 in map__dso (map=0x0) at util/map.h:48 + #1 0x00005555557aa39b in map__load (map=0x0) at util/map.c:344 + #2 0x00005555557aa592 in map__find_symbol (map=0x0, addr=140736115941088) at util/map.c:385 + #3 0x00005555557ef000 in hists__findnew_entry (hists=0x555556039d60, entry=0x7fffffffa4c0, al=0x7fffffffa8c0, sample_self=true) + at util/hist.c:644 + #4 0x00005555557ef61c in __hists__add_entry (hists=0x555556039d60, al=0x7fffffffa8c0, sym_parent=0x0, bi=0x0, mi=0x0, ki=0x0, + block_info=0x0, sample=0x7fffffffaa90, sample_self=true, ops=0x0) at util/hist.c:761 + #5 0x00005555557ef71f in hists__add_entry (hists=0x555556039d60, al=0x7fffffffa8c0, sym_parent=0x0, bi=0x0, mi=0x0, ki=0x0, + sample=0x7fffffffaa90, sample_self=true) at util/hist.c:779 + #6 0x00005555557f00fb in iter_add_single_normal_entry (iter=0x7fffffffa900, al=0x7fffffffa8c0) at util/hist.c:1015 + #7 0x00005555557f09a7 in hist_entry_iter__add (iter=0x7fffffffa900, al=0x7fffffffa8c0, max_stack_depth=127, arg=0x7fffffffbce0) + at util/hist.c:1260 + #8 0x00005555555ba7ce in process_sample_event (tool=0x7fffffffbce0, event=0x7ffff7c14128, sample=0x7fffffffaa90, evsel=0x555556039ad0, + machine=0x5555560388e8) at builtin-report.c:334 + #9 0x00005555557b30c8 in evlist__deliver_sample (evlist=0x555556039010, tool=0x7fffffffbce0, event=0x7ffff7c14128, + sample=0x7fffffffaa90, evsel=0x555556039ad0, machine=0x5555560388e8) at util/session.c:1232 + #10 0x00005555557b32bc in machines__deliver_event (machines=0x5555560388e8, evlist=0x555556039010, event=0x7ffff7c14128, + sample=0x7fffffffaa90, tool=0x7fffffffbce0, file_offset=110888, file_path=0x555556038ff0 "perf.data") at util/session.c:1271 + #11 0x00005555557b3848 in perf_session__deliver_event (session=0x5555560386d0, event=0x7ffff7c14128, tool=0x7fffffffbce0, + file_offset=110888, file_path=0x555556038ff0 "perf.data") at util/session.c:1354 + #12 0x00005555557affaf in ordered_events__deliver_event (oe=0x555556038e60, event=0x555556135aa0) at util/session.c:132 + #13 0x00005555557bb605 in do_flush (oe=0x555556038e60, show_progress=false) at util/ordered-events.c:245 + #14 0x00005555557bb95c in __ordered_events__flush (oe=0x555556038e60, how=OE_FLUSH__ROUND, timestamp=0) at util/ordered-events.c:324 + #15 0x00005555557bba46 in ordered_events__flush (oe=0x555556038e60, how=OE_FLUSH__ROUND) at util/ordered-events.c:342 + #16 0x00005555557b1b3b in perf_event__process_finished_round (tool=0x7fffffffbce0, event=0x7ffff7c15bb8, oe=0x555556038e60) + at util/session.c:780 + #17 0x00005555557b3b27 in perf_session__process_user_event (session=0x5555560386d0, event=0x7ffff7c15bb8, file_offset=117688, + file_path=0x555556038ff0 "perf.data") at util/session.c:1406 + +As you can see the entry->ms.map was NULL even if he->ms.map has a +value. This is because 'sym' sort key is not given, so it cannot assume +whether he->ms.sym and entry->ms.sym is the same. I only checked the +'sym' sort key here as it implies 'dso' behavior (so maps are the same). + +Fixes: ac01c8c4246546fd ("perf hist: Update hist symbol when updating maps") +Signed-off-by: Namhyung Kim +Cc: Adrian Hunter +Cc: Ian Rogers +Cc: Ingo Molnar +Cc: Jiri Olsa +Cc: Kan Liang +Cc: Matt Fleming +Cc: Peter Zijlstra +Cc: Stephane Eranian +Link: https://lore.kernel.org/r/20240826221045.1202305-2-namhyung@kernel.org +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman +--- + tools/perf/util/hist.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/tools/perf/util/hist.c ++++ b/tools/perf/util/hist.c +@@ -633,7 +633,7 @@ static struct hist_entry *hists__findnew + * mis-adjust symbol addresses when computing + * the history counter to increment. + */ +- if (he->ms.map != entry->ms.map) { ++ if (hists__has(hists, sym) && he->ms.map != entry->ms.map) { + if (he->ms.sym) { + u64 addr = he->ms.sym->start; + he->ms.sym = map__find_symbol(entry->ms.map, addr); diff --git a/queue-6.1/series b/queue-6.1/series index 1d59e821ec6..4ee17603dee 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -661,3 +661,7 @@ erofs-avoid-hardcoded-blocksize-for-subpage-block-support.patch erofs-set-block-size-to-the-on-disk-block-size.patch erofs-fix-incorrect-symlink-detection-in-fast-symlink.patch vhost-scsi-null-ptr-dereference-in-vhost_scsi_get_req.patch +perf-report-fix-segfault-when-sym-sort-key-is-not-used.patch +fsdax-dax_unshare_iter-should-return-a-valid-length.patch +clk-imx6ul-fix-failed-to-get-parent-error.patch +fsdax-unshare-zero-destination-if-srcmap-is-hole-or-unwritten.patch