From: Sasha Levin Date: Mon, 22 Nov 2021 01:54:51 +0000 (-0500) Subject: Fixes for 5.10 X-Git-Tag: v5.15.5~75 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bf219b6c414320cfa1343f8278a45d2928d24c43;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.10 Signed-off-by: Sasha Levin --- diff --git a/queue-5.10/kvm-ppc-book3s-hv-use-global_toc-for-kvmppc_h_set_da.patch b/queue-5.10/kvm-ppc-book3s-hv-use-global_toc-for-kvmppc_h_set_da.patch new file mode 100644 index 00000000000..d742fbef158 --- /dev/null +++ b/queue-5.10/kvm-ppc-book3s-hv-use-global_toc-for-kvmppc_h_set_da.patch @@ -0,0 +1,64 @@ +From 851d64c795bcdbd4f6ffd86022fac1ab98d699d6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 24 Sep 2021 01:10:31 +1000 +Subject: KVM: PPC: Book3S HV: Use GLOBAL_TOC for kvmppc_h_set_dabr/xdabr() + +From: Michael Ellerman + +[ Upstream commit dae581864609d36fb58855fd59880b4941ce9d14 ] + +kvmppc_h_set_dabr(), and kvmppc_h_set_xdabr() which jumps into +it, need to use _GLOBAL_TOC to setup the kernel TOC pointer, because +kvmppc_h_set_dabr() uses LOAD_REG_ADDR() to load dawr_force_enable. + +When called from hcall_try_real_mode() we have the kernel TOC in r2, +established near the start of kvmppc_interrupt_hv(), so there is no +issue. + +But they can also be called from kvmppc_pseries_do_hcall() which is +module code, so the access ends up happening with the kvm-hv module's +r2, which will not point at dawr_force_enable and could even cause a +fault. + +With the current code layout and compilers we haven't observed a fault +in practice, the load hits somewhere in kvm-hv.ko and silently returns +some bogus value. + +Note that we we expect p8/p9 guests to use the DAWR, but SLOF uses +h_set_dabr() to test if sc1 works correctly, see SLOF's +lib/libhvcall/brokensc1.c. + +Fixes: c1fe190c0672 ("powerpc: Add force enable of DAWR on P9 option") +Signed-off-by: Michael Ellerman +Reviewed-by: Daniel Axtens +Link: https://lore.kernel.org/r/20210923151031.72408-1-mpe@ellerman.id.au +Signed-off-by: Sasha Levin +--- + arch/powerpc/kvm/book3s_hv_rmhandlers.S | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S +index db78123166a8b..b1d9afffd8419 100644 +--- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S ++++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S +@@ -2539,7 +2539,7 @@ hcall_real_table: + .globl hcall_real_table_end + hcall_real_table_end: + +-_GLOBAL(kvmppc_h_set_xdabr) ++_GLOBAL_TOC(kvmppc_h_set_xdabr) + EXPORT_SYMBOL_GPL(kvmppc_h_set_xdabr) + andi. r0, r5, DABRX_USER | DABRX_KERNEL + beq 6f +@@ -2549,7 +2549,7 @@ EXPORT_SYMBOL_GPL(kvmppc_h_set_xdabr) + 6: li r3, H_PARAMETER + blr + +-_GLOBAL(kvmppc_h_set_dabr) ++_GLOBAL_TOC(kvmppc_h_set_dabr) + EXPORT_SYMBOL_GPL(kvmppc_h_set_dabr) + li r5, DABRX_USER | DABRX_KERNEL + 3: +-- +2.33.0 + diff --git a/queue-5.10/perf-x86-intel-uncore-fix-filter_tid-mask-for-cha-ev.patch b/queue-5.10/perf-x86-intel-uncore-fix-filter_tid-mask-for-cha-ev.patch new file mode 100644 index 00000000000..7fd0cd49d96 --- /dev/null +++ b/queue-5.10/perf-x86-intel-uncore-fix-filter_tid-mask-for-cha-ev.patch @@ -0,0 +1,41 @@ +From 890bd45eff48a8e2213ab1b30d1909d49064f154 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 15 Nov 2021 12:03:32 +0300 +Subject: perf/x86/intel/uncore: Fix filter_tid mask for CHA events on Skylake + Server + +From: Alexander Antonov + +[ Upstream commit e324234e0aa881b7841c7c713306403e12b069ff ] + +According Uncore Reference Manual: any of the CHA events may be filtered +by Thread/Core-ID by using tid modifier in CHA Filter 0 Register. +Update skx_cha_hw_config() to follow Uncore Guide. + +Fixes: cd34cd97b7b4 ("perf/x86/intel/uncore: Add Skylake server uncore support") +Signed-off-by: Alexander Antonov +Signed-off-by: Peter Zijlstra (Intel) +Reviewed-by: Kan Liang +Link: https://lore.kernel.org/r/20211115090334.3789-2-alexander.antonov@linux.intel.com +Signed-off-by: Sasha Levin +--- + arch/x86/events/intel/uncore_snbep.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c +index c01b51d1cbdff..229884f4134cb 100644 +--- a/arch/x86/events/intel/uncore_snbep.c ++++ b/arch/x86/events/intel/uncore_snbep.c +@@ -3545,6 +3545,9 @@ static int skx_cha_hw_config(struct intel_uncore_box *box, struct perf_event *ev + struct hw_perf_event_extra *reg1 = &event->hw.extra_reg; + struct extra_reg *er; + int idx = 0; ++ /* Any of the CHA events may be filtered by Thread/Core-ID.*/ ++ if (event->hw.config & SNBEP_CBO_PMON_CTL_TID_EN) ++ idx = SKX_CHA_MSR_PMON_BOX_FILTER_TID; + + for (er = skx_uncore_cha_extra_regs; er->msr; er++) { + if (er->event != (event->hw.config & er->config_mask)) +-- +2.33.0 + diff --git a/queue-5.10/perf-x86-intel-uncore-fix-iio-event-constraints-for-.patch b/queue-5.10/perf-x86-intel-uncore-fix-iio-event-constraints-for-.patch new file mode 100644 index 00000000000..7d3e8d7deab --- /dev/null +++ b/queue-5.10/perf-x86-intel-uncore-fix-iio-event-constraints-for-.patch @@ -0,0 +1,38 @@ +From 3a76f918e202b193d3797d82e3141a5c1fa9a947 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 15 Nov 2021 12:03:33 +0300 +Subject: perf/x86/intel/uncore: Fix IIO event constraints for Skylake Server + +From: Alexander Antonov + +[ Upstream commit 3866ae319c846a612109c008f43cba80b8c15e86 ] + +According to the latest uncore document, COMP_BUF_OCCUPANCY (0xd5) event +can be collected on 2-3 counters. Update uncore IIO event constraints for +Skylake Server. + +Fixes: cd34cd97b7b4 ("perf/x86/intel/uncore: Add Skylake server uncore support") +Signed-off-by: Alexander Antonov +Signed-off-by: Peter Zijlstra (Intel) +Reviewed-by: Kan Liang +Link: https://lore.kernel.org/r/20211115090334.3789-3-alexander.antonov@linux.intel.com +Signed-off-by: Sasha Levin +--- + arch/x86/events/intel/uncore_snbep.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c +index 229884f4134cb..ba26792d96731 100644 +--- a/arch/x86/events/intel/uncore_snbep.c ++++ b/arch/x86/events/intel/uncore_snbep.c +@@ -3615,6 +3615,7 @@ static struct event_constraint skx_uncore_iio_constraints[] = { + UNCORE_EVENT_CONSTRAINT(0xc0, 0xc), + UNCORE_EVENT_CONSTRAINT(0xc5, 0xc), + UNCORE_EVENT_CONSTRAINT(0xd4, 0xc), ++ UNCORE_EVENT_CONSTRAINT(0xd5, 0xc), + EVENT_CONSTRAINT_END + }; + +-- +2.33.0 + diff --git a/queue-5.10/pinctrl-qcom-sdm845-enable-dual-edge-errata.patch b/queue-5.10/pinctrl-qcom-sdm845-enable-dual-edge-errata.patch new file mode 100644 index 00000000000..bef288ababd --- /dev/null +++ b/queue-5.10/pinctrl-qcom-sdm845-enable-dual-edge-errata.patch @@ -0,0 +1,48 @@ +From 7b1c887a239c2d7d471eb4648dbbae7a3f514fe7 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 1 Nov 2021 22:41:15 -0500 +Subject: pinctrl: qcom: sdm845: Enable dual edge errata + +From: Bjorn Andersson + +[ Upstream commit 3a3a100473d2f6ebf9bdfe6efedd7e18de724388 ] + +It has been observed that dual edge triggered wakeirq GPIOs on SDM845 +doesn't trigger interrupts on the falling edge. + +Enabling wakeirq_dual_edge_errata for SDM845 indicates that the PDC in +SDM845 suffers from the same problem described, and worked around, by +Doug in 'c3c0c2e18d94 ("pinctrl: qcom: Handle broken/missing PDC dual +edge IRQs on sc7180")', so enable the workaround for SDM845 as well. + +The specific problem seen without this is that gpio-keys does not detect +the falling edge of the LID gpio on the Lenovo Yoga C630 and as such +consistently reports the LID as closed. + +Fixes: e35a6ae0eb3a ("pinctrl/msm: Setup GPIO chip in hierarchy") +Signed-off-by: Bjorn Andersson +Tested-By: Steev Klimaszewski +Reviewed-by: Douglas Anderson +Reviewed-by: Stephen Boyd +Link: https://lore.kernel.org/r/20211102034115.1946036-1-bjorn.andersson@linaro.org +Signed-off-by: Linus Walleij +Signed-off-by: Sasha Levin +--- + drivers/pinctrl/qcom/pinctrl-sdm845.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/pinctrl/qcom/pinctrl-sdm845.c b/drivers/pinctrl/qcom/pinctrl-sdm845.c +index c51793f6546f1..fdfd7b8f3a76d 100644 +--- a/drivers/pinctrl/qcom/pinctrl-sdm845.c ++++ b/drivers/pinctrl/qcom/pinctrl-sdm845.c +@@ -1310,6 +1310,7 @@ static const struct msm_pinctrl_soc_data sdm845_pinctrl = { + .ngpios = 151, + .wakeirq_map = sdm845_pdc_map, + .nwakeirq_map = ARRAY_SIZE(sdm845_pdc_map), ++ .wakeirq_dual_edge_errata = true, + }; + + static const struct msm_pinctrl_soc_data sdm845_acpi_pinctrl = { +-- +2.33.0 + diff --git a/queue-5.10/s390-kexec-fix-return-code-handling.patch b/queue-5.10/s390-kexec-fix-return-code-handling.patch new file mode 100644 index 00000000000..8749f73225c --- /dev/null +++ b/queue-5.10/s390-kexec-fix-return-code-handling.patch @@ -0,0 +1,80 @@ +From e4bdc48ec8073225f96ea345df4a28888c455a1c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 16 Nov 2021 11:06:38 +0100 +Subject: s390/kexec: fix return code handling + +From: Heiko Carstens + +[ Upstream commit 20c76e242e7025bd355619ba67beb243ba1a1e95 ] + +kexec_file_add_ipl_report ignores that ipl_report_finish may fail and +can return an error pointer instead of a valid pointer. +Fix this and simplify by returning NULL in case of an error and let +the only caller handle this case. + +Fixes: 99feaa717e55 ("s390/kexec_file: Create ipl report and pass to next kernel") +Signed-off-by: Heiko Carstens +Signed-off-by: Sasha Levin +--- + arch/s390/kernel/ipl.c | 3 ++- + arch/s390/kernel/machine_kexec_file.c | 8 +++++++- + 2 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c +index 98b3aca1de8e1..6da06905ddce5 100644 +--- a/arch/s390/kernel/ipl.c ++++ b/arch/s390/kernel/ipl.c +@@ -2156,7 +2156,7 @@ void *ipl_report_finish(struct ipl_report *report) + + buf = vzalloc(report->size); + if (!buf) +- return ERR_PTR(-ENOMEM); ++ goto out; + ptr = buf; + + memcpy(ptr, report->ipib, report->ipib->hdr.len); +@@ -2195,6 +2195,7 @@ void *ipl_report_finish(struct ipl_report *report) + } + + BUG_ON(ptr > buf + report->size); ++out: + return buf; + } + +diff --git a/arch/s390/kernel/machine_kexec_file.c b/arch/s390/kernel/machine_kexec_file.c +index f9e4baa64b675..c1090f0b1f6a6 100644 +--- a/arch/s390/kernel/machine_kexec_file.c ++++ b/arch/s390/kernel/machine_kexec_file.c +@@ -170,6 +170,7 @@ static int kexec_file_add_ipl_report(struct kimage *image, + struct kexec_buf buf; + unsigned long addr; + void *ptr, *end; ++ int ret; + + buf.image = image; + +@@ -199,7 +200,10 @@ static int kexec_file_add_ipl_report(struct kimage *image, + ptr += len; + } + ++ ret = -ENOMEM; + buf.buffer = ipl_report_finish(data->report); ++ if (!buf.buffer) ++ goto out; + buf.bufsz = data->report->size; + buf.memsz = buf.bufsz; + +@@ -209,7 +213,9 @@ static int kexec_file_add_ipl_report(struct kimage *image, + data->kernel_buf + offsetof(struct lowcore, ipl_parmblock_ptr); + *lc_ipl_parmblock_ptr = (__u32)buf.mem; + +- return kexec_add_buffer(&buf); ++ ret = kexec_add_buffer(&buf); ++out: ++ return ret; + } + + void *kexec_file_add_components(struct kimage *image, +-- +2.33.0 + diff --git a/queue-5.10/series b/queue-5.10/series index 14826f795be..3a75a4ec047 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -112,3 +112,8 @@ net-nfc-nci-change-the-nci-close-sequence.patch nfc-add-nci_unreg-flag-to-eliminate-the-race.patch e100-fix-device-suspend-resume.patch perf-bench-fix-two-memory-leaks-detected-with-asan.patch +kvm-ppc-book3s-hv-use-global_toc-for-kvmppc_h_set_da.patch +pinctrl-qcom-sdm845-enable-dual-edge-errata.patch +perf-x86-intel-uncore-fix-filter_tid-mask-for-cha-ev.patch +perf-x86-intel-uncore-fix-iio-event-constraints-for-.patch +s390-kexec-fix-return-code-handling.patch