From: Greg Kroah-Hartman Date: Tue, 18 Apr 2023 09:54:14 +0000 (+0200) Subject: 4.19-stable patches X-Git-Tag: v4.14.313~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e45c4cd029c1fcc5d68ee0aac63d597c353a1aa;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: cgroup-cpuset-wake-up-cpuset_attach_wq-tasks-in-cpuset_cancel_attach.patch coresight-etm4-fix-for-loop-drvdata-nr_addr_cmp-range-bug.patch kvm-nvmx-add-missing-consistency-checks-for-cr0-and-cr4.patch watchdog-sbsa_wdog-make-sure-the-timeout-programming-is-within-the-limits.patch --- diff --git a/queue-4.19/cgroup-cpuset-wake-up-cpuset_attach_wq-tasks-in-cpuset_cancel_attach.patch b/queue-4.19/cgroup-cpuset-wake-up-cpuset_attach_wq-tasks-in-cpuset_cancel_attach.patch new file mode 100644 index 00000000000..294e994f6f9 --- /dev/null +++ b/queue-4.19/cgroup-cpuset-wake-up-cpuset_attach_wq-tasks-in-cpuset_cancel_attach.patch @@ -0,0 +1,43 @@ +From ba9182a89626d5f83c2ee4594f55cb9c1e60f0e2 Mon Sep 17 00:00:00 2001 +From: Waiman Long +Date: Tue, 11 Apr 2023 09:35:57 -0400 +Subject: cgroup/cpuset: Wake up cpuset_attach_wq tasks in cpuset_cancel_attach() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Waiman Long + +commit ba9182a89626d5f83c2ee4594f55cb9c1e60f0e2 upstream. + +After a successful cpuset_can_attach() call which increments the +attach_in_progress flag, either cpuset_cancel_attach() or cpuset_attach() +will be called later. In cpuset_attach(), tasks in cpuset_attach_wq, +if present, will be woken up at the end. That is not the case in +cpuset_cancel_attach(). So missed wakeup is possible if the attach +operation is somehow cancelled. Fix that by doing the wakeup in +cpuset_cancel_attach() as well. + +Fixes: e44193d39e8d ("cpuset: let hotplug propagation work wait for task attaching") +Signed-off-by: Waiman Long +Reviewed-by: Michal Koutný +Cc: stable@vger.kernel.org # v3.11+ +Signed-off-by: Tejun Heo +Signed-off-by: Greg Kroah-Hartman +--- + kernel/cgroup/cpuset.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/kernel/cgroup/cpuset.c ++++ b/kernel/cgroup/cpuset.c +@@ -1504,7 +1504,9 @@ static void cpuset_cancel_attach(struct + cs = css_cs(css); + + mutex_lock(&cpuset_mutex); +- css_cs(css)->attach_in_progress--; ++ cs->attach_in_progress--; ++ if (!cs->attach_in_progress) ++ wake_up(&cpuset_attach_wq); + mutex_unlock(&cpuset_mutex); + } + diff --git a/queue-4.19/coresight-etm4-fix-for-loop-drvdata-nr_addr_cmp-range-bug.patch b/queue-4.19/coresight-etm4-fix-for-loop-drvdata-nr_addr_cmp-range-bug.patch new file mode 100644 index 00000000000..36c6b679266 --- /dev/null +++ b/queue-4.19/coresight-etm4-fix-for-loop-drvdata-nr_addr_cmp-range-bug.patch @@ -0,0 +1,33 @@ +From bf84937e882009075f57fd213836256fc65d96bc Mon Sep 17 00:00:00 2001 +From: Steve Clevenger +Date: Mon, 27 Feb 2023 16:54:32 -0700 +Subject: coresight-etm4: Fix for() loop drvdata->nr_addr_cmp range bug + +From: Steve Clevenger + +commit bf84937e882009075f57fd213836256fc65d96bc upstream. + +In etm4_enable_hw, fix for() loop range to represent address comparator pairs. + +Fixes: 2e1cdfe184b5 ("coresight-etm4x: Adding CoreSight ETM4x driver") +Cc: stable@vger.kernel.org +Signed-off-by: Steve Clevenger +Reviewed-by: James Clark +Signed-off-by: Suzuki K Poulose +Link: https://lore.kernel.org/r/4a4ee61ce8ef402615a4528b21a051de3444fb7b.1677540079.git.scclevenger@os.amperecomputing.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/hwtracing/coresight/coresight-etm4x.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/hwtracing/coresight/coresight-etm4x.c ++++ b/drivers/hwtracing/coresight/coresight-etm4x.c +@@ -143,7 +143,7 @@ static void etm4_enable_hw(void *info) + writel_relaxed(config->ss_pe_cmp[i], + drvdata->base + TRCSSPCICRn(i)); + } +- for (i = 0; i < drvdata->nr_addr_cmp; i++) { ++ for (i = 0; i < drvdata->nr_addr_cmp * 2; i++) { + writeq_relaxed(config->addr_val[i], + drvdata->base + TRCACVRn(i)); + writeq_relaxed(config->addr_acc[i], diff --git a/queue-4.19/kvm-nvmx-add-missing-consistency-checks-for-cr0-and-cr4.patch b/queue-4.19/kvm-nvmx-add-missing-consistency-checks-for-cr0-and-cr4.patch new file mode 100644 index 00000000000..ea02244a65e --- /dev/null +++ b/queue-4.19/kvm-nvmx-add-missing-consistency-checks-for-cr0-and-cr4.patch @@ -0,0 +1,60 @@ +From 112e66017bff7f2837030f34c2bc19501e9212d5 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 10 Mar 2023 11:10:56 -0500 +Subject: KVM: nVMX: add missing consistency checks for CR0 and CR4 + +From: Paolo Bonzini + +commit 112e66017bff7f2837030f34c2bc19501e9212d5 upstream. + +The effective values of the guest CR0 and CR4 registers may differ from +those included in the VMCS12. In particular, disabling EPT forces +CR4.PAE=1 and disabling unrestricted guest mode forces CR0.PG=CR0.PE=1. + +Therefore, checks on these bits cannot be delegated to the processor +and must be performed by KVM. + +Reported-by: Reima ISHII +Cc: stable@vger.kernel.org +Signed-off-by: Paolo Bonzini +[OP: drop CC() macro calls, as tracing is not implemented in 4.19] +[OP: adjust "return -EINVAL" -> "return 1" to match current return logic] +Signed-off-by: Ovidiu Panait +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/kvm/vmx/vmx.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +--- a/arch/x86/kvm/vmx/vmx.c ++++ b/arch/x86/kvm/vmx/vmx.c +@@ -12752,7 +12752,7 @@ static int nested_vmx_check_vmcs_link_pt + static int check_vmentry_postreqs(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12, + u32 *exit_qual) + { +- bool ia32e; ++ bool ia32e = !!(vmcs12->vm_entry_controls & VM_ENTRY_IA32E_MODE); + + *exit_qual = ENTRY_FAIL_DEFAULT; + +@@ -12765,6 +12765,13 @@ static int check_vmentry_postreqs(struct + return 1; + } + ++ if ((vmcs12->guest_cr0 & (X86_CR0_PG | X86_CR0_PE)) == X86_CR0_PG) ++ return 1; ++ ++ if ((ia32e && !(vmcs12->guest_cr4 & X86_CR4_PAE)) || ++ (ia32e && !(vmcs12->guest_cr0 & X86_CR0_PG))) ++ return 1; ++ + /* + * If the load IA32_EFER VM-entry control is 1, the following checks + * are performed on the field for the IA32_EFER MSR: +@@ -12776,7 +12783,6 @@ static int check_vmentry_postreqs(struct + */ + if (to_vmx(vcpu)->nested.nested_run_pending && + (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_IA32_EFER)) { +- ia32e = (vmcs12->vm_entry_controls & VM_ENTRY_IA32E_MODE) != 0; + if (!kvm_valid_efer(vcpu, vmcs12->guest_ia32_efer) || + ia32e != !!(vmcs12->guest_ia32_efer & EFER_LMA) || + ((vmcs12->guest_cr0 & X86_CR0_PG) && diff --git a/queue-4.19/series b/queue-4.19/series index f558376efca..7bb31646f18 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -48,3 +48,7 @@ x86-pci-add-quirk-for-amd-xhci-controller-that-loses-msi-x-state-in-d3hot.patch ubi-fix-failure-attaching-when-vid_hdr-offset-equals-to-sub-page-size.patch mtd-ubi-wl-fix-a-couple-of-kernel-doc-issues.patch ubi-fix-deadlock-caused-by-recursively-holding-work_.patch +cgroup-cpuset-wake-up-cpuset_attach_wq-tasks-in-cpuset_cancel_attach.patch +watchdog-sbsa_wdog-make-sure-the-timeout-programming-is-within-the-limits.patch +coresight-etm4-fix-for-loop-drvdata-nr_addr_cmp-range-bug.patch +kvm-nvmx-add-missing-consistency-checks-for-cr0-and-cr4.patch diff --git a/queue-4.19/watchdog-sbsa_wdog-make-sure-the-timeout-programming-is-within-the-limits.patch b/queue-4.19/watchdog-sbsa_wdog-make-sure-the-timeout-programming-is-within-the-limits.patch new file mode 100644 index 00000000000..f70bed4eb49 --- /dev/null +++ b/queue-4.19/watchdog-sbsa_wdog-make-sure-the-timeout-programming-is-within-the-limits.patch @@ -0,0 +1,36 @@ +From 000987a38b53c172f435142a4026dd71378ca464 Mon Sep 17 00:00:00 2001 +From: George Cherian +Date: Thu, 9 Feb 2023 02:11:17 +0000 +Subject: watchdog: sbsa_wdog: Make sure the timeout programming is within the limits + +From: George Cherian + +commit 000987a38b53c172f435142a4026dd71378ca464 upstream. + +Make sure to honour the max_hw_heartbeat_ms while programming the timeout +value to WOR. Clamp the timeout passed to sbsa_gwdt_set_timeout() to +make sure the programmed value is within the permissible range. + +Fixes: abd3ac7902fb ("watchdog: sbsa: Support architecture version 1") + +Signed-off-by: George Cherian +Reviewed-by: Guenter Roeck +Link: https://lore.kernel.org/r/20230209021117.1512097-1-george.cherian@marvell.com +Signed-off-by: Guenter Roeck +Signed-off-by: Wim Van Sebroeck +Signed-off-by: Tyler Hicks (Microsoft) +Signed-off-by: Greg Kroah-Hartman +--- + drivers/watchdog/sbsa_gwdt.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/watchdog/sbsa_gwdt.c ++++ b/drivers/watchdog/sbsa_gwdt.c +@@ -130,6 +130,7 @@ static int sbsa_gwdt_set_timeout(struct + struct sbsa_gwdt *gwdt = watchdog_get_drvdata(wdd); + + wdd->timeout = timeout; ++ timeout = clamp_t(unsigned int, timeout, 1, wdd->max_hw_heartbeat_ms / 1000); + + if (action) + writel(gwdt->clk * timeout,