linux-stable/arch
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
..
alpha alpha: fix R_ALPHA_LITERAL reloc for large modules 2023-03-17 08:58:02 +01:00
arc
arm ARM: dts: imx6sl: tolino-shine2hd: fix usbotg1 pinctrl 2023-03-30 12:50:51 +02:00
arm64 KVM: arm64: PMU: Restore the guest's EL0 event counting after migration 2023-04-20 12:36:52 +02:00
csky arch/csky patches for 6.2-rc1 2022-12-19 07:51:30 -06:00
hexagon
ia64 ia64: fix build error due to switch case label appearing next to declaration 2023-01-31 16:44:08 -08:00
loongarch LoongArch: Only call get_timer_irq() once in constant_clockevent_init() 2023-03-22 13:37:56 +01:00
m68k m68k: Only force 030 bus error if PC not in exception table 2023-03-30 12:51:28 +02:00
microblaze
mips mips: bmips: BCM6358: disable RAC flush for TP1 2023-04-06 12:12:31 +02:00
nios2
openrisc
parisc parisc: Wire up PTRACE_GETREGS/PTRACE_SETREGS for compat case 2023-02-01 21:42:37 +01:00
powerpc powerpc/64s: Fix __pte_needs_flush() false positive warning 2023-04-06 12:12:44 +02:00
riscv riscv/kvm: Fix VM hang in case of timer delta being zero. 2023-04-06 12:12:31 +02:00
s390 KVM: s390: pv: fix external interruption loop not always detected 2023-04-13 17:02:36 +02:00
sh sh: sanitize the flags on sigreturn 2023-03-30 12:51:31 +02:00
sparc sparc: allow PM configs for sparc32 COMPILE_TEST 2023-03-10 09:28:44 +01:00
um UML: define RUNTIME_DISCARD_EXIT 2023-03-17 08:58:03 +01:00
x86 KVM: SVM: Flush Hyper-V TLB when required 2023-04-13 17:02:48 +02:00
xtensa xtensa: fix KASAN report for show_stack 2023-04-06 12:12:45 +02:00
.gitignore
Kconfig