]> xenbits.xensource.com Git - people/pauldu/linux.git/commitdiff
KVM: arm64: Let vcpu_sve_pffr() handle HYP VAs
authorMarc Zyngier <maz@kernel.org>
Thu, 11 Mar 2021 19:18:42 +0000 (19:18 +0000)
committerMarc Zyngier <maz@kernel.org>
Thu, 18 Mar 2021 11:24:00 +0000 (11:24 +0000)
The vcpu_sve_pffr() returns a pointer, which can be an interesting
thing to do on nVHE. Wrap the pointer with kern_hyp_va(), and
take this opportunity to remove the unnecessary casts (sve_state
being a void *).

Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/include/asm/kvm_host.h

index 3d10e6527f7de73bfe4be18987367f06557008d8..fb1d78299ba024d77d4e36fcf826cd6e47de1e69 100644 (file)
@@ -372,8 +372,8 @@ struct kvm_vcpu_arch {
 };
 
 /* Pointer to the vcpu's SVE FFR for sve_{save,load}_state() */
-#define vcpu_sve_pffr(vcpu) ((void *)((char *)((vcpu)->arch.sve_state) + \
-                                     sve_ffr_offset((vcpu)->arch.sve_max_vl)))
+#define vcpu_sve_pffr(vcpu) (kern_hyp_va((vcpu)->arch.sve_state) +     \
+                            sve_ffr_offset((vcpu)->arch.sve_max_vl))
 
 #define vcpu_sve_state_size(vcpu) ({                                   \
        size_t __size_ret;                                              \