]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
KVM: arm/arm64: Handle CPU_PM_ENTER_FAILED
authorJames Morse <james.morse@arm.com>
Mon, 22 Jan 2018 18:19:06 +0000 (18:19 +0000)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 22 Feb 2018 14:15:54 +0000 (08:15 -0600)
commit056e3bc60678d313477bed7c7f9dd38296a4ee50
tree027ff246848310aae3cdd81dd23746e060d07772
parentd3e4c9643f99944f2c6ed6d0e444f75d149e14d9
KVM: arm/arm64: Handle CPU_PM_ENTER_FAILED

BugLink: http://bugs.launchpad.net/bugs/1751064
commit 58d6b15e9da5042a99c9c30ad725792e4569150e upstream.

cpu_pm_enter() calls the pm notifier chain with CPU_PM_ENTER, then if
there is a failure: CPU_PM_ENTER_FAILED.

When KVM receives CPU_PM_ENTER it calls cpu_hyp_reset() which will
return us to the hyp-stub. If we subsequently get a CPU_PM_ENTER_FAILED,
KVM does nothing, leaving the CPU running with the hyp-stub, at odds
with kvm_arm_hardware_enabled.

Add CPU_PM_ENTER_FAILED as a fallthrough for CPU_PM_EXIT, this reloads
KVM based on kvm_arm_hardware_enabled. This is safe even if CPU_PM_ENTER
never gets as far as KVM, as cpu_hyp_reinit() calls cpu_hyp_reset()
to make sure the hyp-stub is loaded before reloading KVM.

Fixes: 67f691976662 ("arm64: kvm: allows kvm cpu hotplug")
CC: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
virt/kvm/arm/arm.c