linux-stable/arch/arm64
James Morse c97e166e54 KVM: arm64: Change hyp_panic()s dependency on tpidr_el2
Make tpidr_el2 a cpu-offset for per-cpu variables in the same way the
host uses tpidr_el1. This lets tpidr_el{1,2} have the same value, and
on VHE they can be the same register.

KVM calls hyp_panic() when anything unexpected happens. This may occur
while a guest owns the EL1 registers. KVM stashes the vcpu pointer in
tpidr_el2, which it uses to find the host context in order to restore
the host EL1 registers before parachuting into the host's panic().

The host context is a struct kvm_cpu_context allocated in the per-cpu
area, and mapped to hyp. Given the per-cpu offset for this CPU, this is
easy to find. Change hyp_panic() to take a pointer to the
struct kvm_cpu_context. Wrap these calls with an asm function that
retrieves the struct kvm_cpu_context from the host's per-cpu area.

Copy the per-cpu offset from the hosts tpidr_el1 into tpidr_el2 during
kvm init. (Later patches will make this unnecessary for VHE hosts)

We print out the vcpu pointer as part of the panic message. Add a back
reference to the 'running vcpu' in the host cpu context to preserve this.

Signed-off-by: James Morse <james.morse@arm.com>
Reviewed-by: Christoffer Dall <cdall@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2018-01-13 10:44:22 +00:00
..
boot Amlogic fixes for v4.15-rc 2017-12-09 20:23:29 -08:00
configs arm64: defconfig: enable CONFIG_GPIO_UNIPHIER 2017-10-30 14:41:54 +01:00
crypto License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
include KVM: arm64: Change hyp_panic()s dependency on tpidr_el2 2018-01-13 10:44:22 +00:00
kernel Merge branch 'for-next/perf' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux 2018-01-12 14:33:56 +00:00
kvm KVM: arm64: Change hyp_panic()s dependency on tpidr_el2 2018-01-13 10:44:22 +00:00
lib arm64: make label allocation style consistent in tishift 2018-01-02 14:22:18 +00:00
mm arm64: Add skeleton to harden the branch predictor against aliasing attacks 2018-01-08 18:45:25 +00:00
net bpf, arm64: implement jiting of BPF_J{LT, LE, SLT, SLE} 2017-08-09 16:53:56 -07:00
xen arm64: mm: Fix and re-enable ARM64_SW_TTBR0_PAN 2017-12-11 13:40:35 +00:00
Kconfig arm64: Add skeleton to harden the branch predictor against aliasing attacks 2018-01-08 18:45:25 +00:00
Kconfig.debug arm64: relocation testing module 2017-04-04 17:03:32 +01:00
Kconfig.platforms ARM: SoC driver updates for v4.15 2017-11-16 16:05:01 -08:00
Makefile arm64: ftrace: emit ftrace-mod.o contents through code 2017-12-01 13:04:59 +00:00