OpenCloudOS-Kernel/arch/arm/kvm
Marc Zyngier b20c9f29c5 arm/arm64: KVM: detect CPU reset on CPU_PM_EXIT
Commit 1fcf7ce0c6 (arm: kvm: implement CPU PM notifier) added
support for CPU power-management, using a cpu_notifier to re-init
KVM on a CPU that entered CPU idle.

The code assumed that a CPU entering idle would actually be powered
off, loosing its state entierely, and would then need to be
reinitialized. It turns out that this is not always the case, and
some HW performs CPU PM without actually killing the core. In this
case, we try to reinitialize KVM while it is still live. It ends up
badly, as reported by Andre Przywara (using a Calxeda Midway):

[    3.663897] Kernel panic - not syncing: unexpected prefetch abort in Hyp mode at: 0x685760
[    3.663897] unexpected data abort in Hyp mode at: 0xc067d150
[    3.663897] unexpected HVC/SVC trap in Hyp mode at: 0xc0901dd0

The trick here is to detect if we've been through a full re-init or
not by looking at HVBAR (VBAR_EL2 on arm64). This involves
implementing the backend for __hyp_get_vectors in the main KVM HYP
code (rather small), and checking the return value against the
default one when the CPU notifier is called on CPU_PM_EXIT.

Reported-by: Andre Przywara <osp@andrep.de>
Tested-by: Andre Przywara <osp@andrep.de>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Rob Herring <rob.herring@linaro.org>
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-02-27 19:27:10 +01:00
..
Kconfig ARM: KVM: Yield CPU when vcpu executes a WFE 2013-10-17 15:26:50 -07:00
Makefile KVM: ARM: Add support for Cortex-A7 2013-10-12 17:45:30 -07:00
arm.c arm/arm64: KVM: detect CPU reset on CPU_PM_EXIT 2014-02-27 19:27:10 +01:00
coproc.c ARM: KVM: fix L2CTLR to be per-cluster 2013-10-22 08:00:06 -07:00
coproc.h ARM: KVM: Fix 64-bit coprocessor handling 2013-08-06 11:32:30 -07:00
coproc_a7.c KVM: ARM: Add support for Cortex-A7 2013-10-12 17:45:30 -07:00
coproc_a15.c KVM: ARM: Add support for Cortex-A7 2013-10-12 17:45:30 -07:00
emulate.c KVM: ARM: Fix typo in comments of inject_abt() 2013-10-02 17:29:19 +01:00
guest.c ARM/KVM: save and restore generic timer registers 2013-12-21 10:00:15 -08:00
handle_exit.c KVM: ARM: Remove duplicate include 2014-01-08 13:54:00 -08:00
init.S ARM: kvm: use inner-shareable barriers after TLB flushing 2013-08-12 12:25:45 +01:00
interrupts.S arm/arm64: KVM: detect CPU reset on CPU_PM_EXIT 2014-02-27 19:27:10 +01:00
interrupts_head.S KVM fixes for 3.11 2013-07-03 13:21:40 -07:00
mmio.c arm/arm64: KVM: MMIO support for BE guest 2013-11-07 19:09:04 +00:00
mmu.c arm/arm64: KVM: relax the requirements of VMA alignment for THP 2014-01-08 13:49:03 -08:00
perf.c ARM: KVM: add support for minimal host vs guest profiling 2013-04-28 21:44:01 -07:00
psci.c arm: KVM: Don't return PSCI_INVAL if waitqueue is inactive 2013-12-21 09:55:17 -08:00
reset.c Updates for KVM/ARM, take 3 supporting more than 4 CPUs. 2013-11-11 12:02:27 +01:00
trace.h ARM: KVM: Simplify tracepoint text 2013-08-30 15:47:53 -07:00