From: Greg Kroah-Hartman Date: Mon, 1 Feb 2021 12:52:08 +0000 (+0100) Subject: 4.19-stable patches X-Git-Tag: v4.4.255~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=430f9b5280be3564dabe59e681d9f8a7e736fb5b;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: drivers-soc-atmel-add-null-entry-at-the-end-of-at91_soc_allowed_list.patch drivers-soc-atmel-avoid-calling-at91_soc_init-on-non-at91-socs.patch kvm-x86-get-smi-pending-status-correctly.patch kvm-x86-pmu-fix-hw_ref_cpu_cycles-event-pseudo-encoding-in-intel_arch_events.patch --- diff --git a/queue-4.19/drivers-soc-atmel-add-null-entry-at-the-end-of-at91_soc_allowed_list.patch b/queue-4.19/drivers-soc-atmel-add-null-entry-at-the-end-of-at91_soc_allowed_list.patch new file mode 100644 index 00000000000..9f6676f1968 --- /dev/null +++ b/queue-4.19/drivers-soc-atmel-add-null-entry-at-the-end-of-at91_soc_allowed_list.patch @@ -0,0 +1,37 @@ +From 680896556805d3ad3fa47f6002b87b3041a45ac2 Mon Sep 17 00:00:00 2001 +From: Claudiu Beznea +Date: Fri, 22 Jan 2021 14:21:34 +0200 +Subject: drivers: soc: atmel: add null entry at the end of at91_soc_allowed_list[] + +From: Claudiu Beznea + +commit 680896556805d3ad3fa47f6002b87b3041a45ac2 upstream. + +of_match_node() calls __of_match_node() which loops though the entries of +matches array. It stops when condition: +(matches->name[0] || matches->type[0] || matches->compatible[0]) is +false. Thus, add a null entry at the end of at91_soc_allowed_list[] +array. + +Fixes: caab13b49604 ("drivers: soc: atmel: Avoid calling at91_soc_init on non AT91 SoCs") +Cc: stable@vger.kernel.org #4.12+ +Signed-off-by: Claudiu Beznea +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/soc/atmel/soc.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/soc/atmel/soc.c ++++ b/drivers/soc/atmel/soc.c +@@ -258,7 +258,8 @@ static const struct of_device_id at91_so + { .compatible = "atmel,at91rm9200", }, + { .compatible = "atmel,at91sam9", }, + { .compatible = "atmel,sama5", }, +- { .compatible = "atmel,samv7", } ++ { .compatible = "atmel,samv7", }, ++ { } + }; + + static int __init atmel_soc_device_init(void) diff --git a/queue-4.19/drivers-soc-atmel-avoid-calling-at91_soc_init-on-non-at91-socs.patch b/queue-4.19/drivers-soc-atmel-avoid-calling-at91_soc_init-on-non-at91-socs.patch new file mode 100644 index 00000000000..79804a561fa --- /dev/null +++ b/queue-4.19/drivers-soc-atmel-avoid-calling-at91_soc_init-on-non-at91-socs.patch @@ -0,0 +1,52 @@ +From caab13b4960416b9fee83169a758eb0f31e65109 Mon Sep 17 00:00:00 2001 +From: Sudeep Holla +Date: Fri, 11 Dec 2020 13:58:46 +0000 +Subject: drivers: soc: atmel: Avoid calling at91_soc_init on non AT91 SoCs + +From: Sudeep Holla + +commit caab13b4960416b9fee83169a758eb0f31e65109 upstream. + +Since at91_soc_init is called unconditionally from atmel_soc_device_init, +we get the following warning on all non AT91 SoCs: + " AT91: Could not find identification node" + +Fix the same by filtering with allowed AT91 SoC list. + +Cc: Nicolas Ferre +Cc: Alexandre Belloni +Cc: Ludovic Desroches +Cc: stable@vger.kernel.org #4.12+ +Signed-off-by: Sudeep Holla +Signed-off-by: Alexandre Belloni +Link: https://lore.kernel.org/r/20201211135846.1334322-1-sudeep.holla@arm.com +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/soc/atmel/soc.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +--- a/drivers/soc/atmel/soc.c ++++ b/drivers/soc/atmel/soc.c +@@ -254,8 +254,20 @@ struct soc_device * __init at91_soc_init + return soc_dev; + } + ++static const struct of_device_id at91_soc_allowed_list[] __initconst = { ++ { .compatible = "atmel,at91rm9200", }, ++ { .compatible = "atmel,at91sam9", }, ++ { .compatible = "atmel,sama5", }, ++ { .compatible = "atmel,samv7", } ++}; ++ + static int __init atmel_soc_device_init(void) + { ++ struct device_node *np = of_find_node_by_path("/"); ++ ++ if (!of_match_node(at91_soc_allowed_list, np)) ++ return 0; ++ + at91_soc_init(socs); + + return 0; diff --git a/queue-4.19/kvm-x86-get-smi-pending-status-correctly.patch b/queue-4.19/kvm-x86-get-smi-pending-status-correctly.patch new file mode 100644 index 00000000000..bbcc4263f60 --- /dev/null +++ b/queue-4.19/kvm-x86-get-smi-pending-status-correctly.patch @@ -0,0 +1,67 @@ +From 1f7becf1b7e21794fc9d460765fe09679bc9b9e0 Mon Sep 17 00:00:00 2001 +From: Jay Zhou +Date: Mon, 18 Jan 2021 16:47:20 +0800 +Subject: KVM: x86: get smi pending status correctly + +From: Jay Zhou + +commit 1f7becf1b7e21794fc9d460765fe09679bc9b9e0 upstream. + +The injection process of smi has two steps: + + Qemu KVM +Step1: + cpu->interrupt_request &= \ + ~CPU_INTERRUPT_SMI; + kvm_vcpu_ioctl(cpu, KVM_SMI) + + call kvm_vcpu_ioctl_smi() and + kvm_make_request(KVM_REQ_SMI, vcpu); + +Step2: + kvm_vcpu_ioctl(cpu, KVM_RUN, 0) + + call process_smi() if + kvm_check_request(KVM_REQ_SMI, vcpu) is + true, mark vcpu->arch.smi_pending = true; + +The vcpu->arch.smi_pending will be set true in step2, unfortunately if +vcpu paused between step1 and step2, the kvm_run->immediate_exit will be +set and vcpu has to exit to Qemu immediately during step2 before mark +vcpu->arch.smi_pending true. +During VM migration, Qemu will get the smi pending status from KVM using +KVM_GET_VCPU_EVENTS ioctl at the downtime, then the smi pending status +will be lost. + +Signed-off-by: Jay Zhou +Signed-off-by: Shengen Zhuang +Message-Id: <20210118084720.1585-1-jianjay.zhou@huawei.com> +Cc: stable@vger.kernel.org +Signed-off-by: Paolo Bonzini +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kvm/x86.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/arch/x86/kvm/x86.c ++++ b/arch/x86/kvm/x86.c +@@ -102,6 +102,7 @@ static u64 __read_mostly cr4_reserved_bi + + static void update_cr8_intercept(struct kvm_vcpu *vcpu); + static void process_nmi(struct kvm_vcpu *vcpu); ++static void process_smi(struct kvm_vcpu *vcpu); + static void enter_smm(struct kvm_vcpu *vcpu); + static void __kvm_set_rflags(struct kvm_vcpu *vcpu, unsigned long rflags); + static void store_regs(struct kvm_vcpu *vcpu); +@@ -3499,6 +3500,10 @@ static void kvm_vcpu_ioctl_x86_get_vcpu_ + struct kvm_vcpu_events *events) + { + process_nmi(vcpu); ++ ++ if (kvm_check_request(KVM_REQ_SMI, vcpu)) ++ process_smi(vcpu); ++ + /* + * FIXME: pass injected and pending separately. This is only + * needed for nested virtualization, whose state cannot be diff --git a/queue-4.19/kvm-x86-pmu-fix-hw_ref_cpu_cycles-event-pseudo-encoding-in-intel_arch_events.patch b/queue-4.19/kvm-x86-pmu-fix-hw_ref_cpu_cycles-event-pseudo-encoding-in-intel_arch_events.patch new file mode 100644 index 00000000000..6f5ddfe7ba3 --- /dev/null +++ b/queue-4.19/kvm-x86-pmu-fix-hw_ref_cpu_cycles-event-pseudo-encoding-in-intel_arch_events.patch @@ -0,0 +1,35 @@ +From 98dd2f108e448988d91e296173e773b06fb978b8 Mon Sep 17 00:00:00 2001 +From: Like Xu +Date: Wed, 30 Dec 2020 16:19:16 +0800 +Subject: KVM: x86/pmu: Fix HW_REF_CPU_CYCLES event pseudo-encoding in intel_arch_events[] + +From: Like Xu + +commit 98dd2f108e448988d91e296173e773b06fb978b8 upstream. + +The HW_REF_CPU_CYCLES event on the fixed counter 2 is pseudo-encoded as +0x0300 in the intel_perfmon_event_map[]. Correct its usage. + +Fixes: 62079d8a4312 ("KVM: PMU: add proper support for fixed counter 2") +Signed-off-by: Like Xu +Message-Id: <20201230081916.63417-1-like.xu@linux.intel.com> +Reviewed-by: Sean Christopherson +Cc: stable@vger.kernel.org +Signed-off-by: Paolo Bonzini +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kvm/pmu_intel.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/x86/kvm/pmu_intel.c ++++ b/arch/x86/kvm/pmu_intel.c +@@ -29,7 +29,7 @@ static struct kvm_event_hw_type_mapping + [4] = { 0x2e, 0x41, PERF_COUNT_HW_CACHE_MISSES }, + [5] = { 0xc4, 0x00, PERF_COUNT_HW_BRANCH_INSTRUCTIONS }, + [6] = { 0xc5, 0x00, PERF_COUNT_HW_BRANCH_MISSES }, +- [7] = { 0x00, 0x30, PERF_COUNT_HW_REF_CPU_CYCLES }, ++ [7] = { 0x00, 0x03, PERF_COUNT_HW_REF_CPU_CYCLES }, + }; + + /* mapping between fixed pmc index and intel_arch_events array */ diff --git a/queue-4.19/series b/queue-4.19/series index fa659476752..75f3add5202 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -8,3 +8,7 @@ arm-dts-imx6qdl-gw52xx-fix-duplicate-regulator-naming.patch wext-fix-null-ptr-dereference-with-cfg80211-s-lack-of-commit.patch net-usb-qmi_wwan-added-support-for-thales-cinterion-plsx3-modem-family.patch pm-hibernate-flush-swap-writer-after-marking.patch +drivers-soc-atmel-avoid-calling-at91_soc_init-on-non-at91-socs.patch +drivers-soc-atmel-add-null-entry-at-the-end-of-at91_soc_allowed_list.patch +kvm-x86-pmu-fix-hw_ref_cpu_cycles-event-pseudo-encoding-in-intel_arch_events.patch +kvm-x86-get-smi-pending-status-correctly.patch