linux-stable/arch/arm64
Reiji Watanabe 0cc6fdf79b KVM: arm64: PMU: Restore the guest's EL0 event counting after migration
commit f9ea835e99 upstream.

Currently, with VHE, KVM enables the EL0 event counting for the
guest on vcpu_load() or KVM enables it as a part of the PMU
register emulation process, when needed.  However, in the migration
case (with VHE), the same handling is lacking, as vPMU register
values that were restored by userspace haven't been propagated yet
(the PMU events haven't been created) at the vcpu load-time on the
first KVM_RUN (kvm_vcpu_pmu_restore_guest() called from vcpu_load()
on the first KVM_RUN won't do anything as events_{guest,host} of
kvm_pmu_events are still zero).

So, with VHE, enable the guest's EL0 event counting on the first
KVM_RUN (after the migration) when needed.  More specifically,
have kvm_pmu_handle_pmcr() call kvm_vcpu_pmu_restore_guest()
so that kvm_pmu_handle_pmcr() on the first KVM_RUN can take
care of it.

Fixes: d0c94c4979 ("KVM: arm64: Restore PMU configuration on first run")
Cc: stable@vger.kernel.org
Reviewed-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Reiji Watanabe <reijiw@google.com>
Link: https://lore.kernel.org/r/20230329023944.2488484-1-reijiw@google.com
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-04-20 12:36:52 +02:00
..
boot arm64: dts: qcom: sm8150: Fix the iommu mask used for PCIe controllers 2023-03-30 12:51:41 +02:00
configs arm64: defconfig: Enable Qualcomm SM6115 / SM4250 GCC and Pinctrl 2022-11-30 17:49:05 +01:00
crypto crypto: arm64/sm4-gcm - Fix possible crash in GCM cryption 2023-03-03 11:56:16 +01:00
hyperv
include arm64: efi: Make efi_rt_lock a raw_spinlock 2023-03-11 13:50:49 +01:00
kernel arm64: compat: Work around uninitialized variable warning 2023-04-13 17:02:41 +02:00
kvm KVM: arm64: PMU: Restore the guest's EL0 event counting after migration 2023-04-20 12:36:52 +02:00
lib Merge branch 'for-next/sysregs' into for-next/core 2022-12-06 11:32:25 +00:00
mm arm64: Reset KASAN tag in copy_highpage with HW tags only 2023-03-10 09:29:47 +01:00
net
tools arm64/sysreg: Fix errors in 32 bit enumeration values 2023-03-10 09:28:06 +01:00
xen
Kbuild
Kconfig arm64: mm: hugetlb: Disable HUGETLB_PAGE_OPTIMIZE_VMEMMAP 2023-03-10 09:29:47 +01:00
Kconfig.debug
Kconfig.platforms
Makefile Merge branch 'for-next/ftrace' into for-next/core 2022-12-06 11:07:39 +00:00