diff options
author | Andrew Scull <ascull@google.com> | 2020-09-15 13:46:36 +0300 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2020-09-15 20:39:03 +0300 |
commit | 4e3393a969a0bdaae83263918b6824b2d08c3996 (patch) | |
tree | 327744162b7e9be685044a5ca25fb24914380c0c /arch/arm64/kvm/hyp/include | |
parent | 603d2bdaa57e48a33d57eeb88971b88fbe5875d6 (diff) | |
download | linux-4e3393a969a0bdaae83263918b6824b2d08c3996.tar.xz |
KVM: arm64: nVHE: Switch to hyp context for EL2
Save and restore the host context when switching to and from hyp. This
gives hyp its own context that the host will not see as a step towards a
full trust boundary between the two.
SP_EL0 and pointer authentication keys are currently shared between the
host and hyp so don't need to be switched yet.
Signed-off-by: Andrew Scull <ascull@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20200915104643.2543892-13-ascull@google.com
Diffstat (limited to 'arch/arm64/kvm/hyp/include')
-rw-r--r-- | arch/arm64/kvm/hyp/include/hyp/switch.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm64/kvm/hyp/include/hyp/switch.h b/arch/arm64/kvm/hyp/include/hyp/switch.h index 821721b78ad9..4536b50ddc06 100644 --- a/arch/arm64/kvm/hyp/include/hyp/switch.h +++ b/arch/arm64/kvm/hyp/include/hyp/switch.h @@ -372,6 +372,8 @@ static inline bool esr_is_ptrauth_trap(u32 esr) ctxt_sys_reg(ctxt, key ## KEYHI_EL1) = __val; \ } while(0) +DECLARE_PER_CPU(struct kvm_cpu_context, kvm_hyp_ctxt); + static inline bool __hyp_handle_ptrauth(struct kvm_vcpu *vcpu) { struct kvm_cpu_context *ctxt; |