diff options
author | Marc Zyngier <maz@kernel.org> | 2020-06-03 19:24:01 +0200 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2020-06-09 11:44:40 +0200 |
commit | ef3e40a7ea8dbe2abd0a345032cd7d5023b9684f (patch) | |
tree | 7e63f5fc23024885fc6f7eb1662f27f1b2ac8e44 /arch/arm64/include | |
parent | KVM: arm64: Flush the instruction cache if not unmapping the VM on reboot (diff) | |
download | linux-ef3e40a7ea8dbe2abd0a345032cd7d5023b9684f.tar.xz linux-ef3e40a7ea8dbe2abd0a345032cd7d5023b9684f.zip |
KVM: arm64: Save the host's PtrAuth keys in non-preemptible context
When using the PtrAuth feature in a guest, we need to save the host's
keys before allowing the guest to program them. For that, we dump
them in a per-CPU data structure (the so called host context).
But both call sites that do this are in preemptible context,
which may end up in disaster should the vcpu thread get preempted
before reentering the guest.
Instead, save the keys eagerly on each vcpu_load(). This has an
increased overhead, but is at least safe.
Cc: stable@vger.kernel.org
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'arch/arm64/include')
-rw-r--r-- | arch/arm64/include/asm/kvm_emulate.h | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h index a30b4eec7cb4..977843e4d5fb 100644 --- a/arch/arm64/include/asm/kvm_emulate.h +++ b/arch/arm64/include/asm/kvm_emulate.h @@ -112,12 +112,6 @@ static inline void vcpu_ptrauth_disable(struct kvm_vcpu *vcpu) vcpu->arch.hcr_el2 &= ~(HCR_API | HCR_APK); } -static inline void vcpu_ptrauth_setup_lazy(struct kvm_vcpu *vcpu) -{ - if (vcpu_has_ptrauth(vcpu)) - vcpu_ptrauth_disable(vcpu); -} - static inline unsigned long vcpu_get_vsesr(struct kvm_vcpu *vcpu) { return vcpu->arch.vsesr_el2; |