KVM: arm64: Parametrize exception entry with a target EL
authorMarc Zyngier <maz@kernel.org>
Tue, 21 Apr 2020 17:32:02 +0000 (18:32 +0100)
committerMarc Zyngier <maz@kernel.org>
Thu, 28 May 2020 12:16:55 +0000 (13:16 +0100)
commitd9d7d84d9906e1bc886c5e0fc66aaad26008264b
treec3d9d33afecb36ab5f9ab94c50d66b1103fd3774
parent349c330ced9764667678f4d2804fd4ebc16110c9
KVM: arm64: Parametrize exception entry with a target EL

We currently assume that an exception is delivered to EL1, always.
Once we emulate EL2, this no longer will be the case. To prepare
for this, add a target_mode parameter.

While we're at it, merge the computing of the target PC and PSTATE in
a single function that updates both PC and CPSR after saving their
previous values in the corresponding ELR/SPSR. This ensures that they
are updated in the correct order (a pretty common source of bugs...).

Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/include/asm/ptrace.h
arch/arm64/kvm/inject_fault.c