FROMGIT: KVM: arm64: Let vcpu_sve_pffr() handle HYP VAs
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> (cherry picked from commit 985d3a1beab543875e0c857ce263cad8233923bb git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git next) Signed-off-by: Will Deacon <willdeacon@google.com> Bug: 178098380 Test: atest VirtualizationHostTestCases on an EL2-enabled device Change-Id: I01203df5e118b35c62f502652da6e6db7f521f7b
This commit is contained in:

committed by
Quentin Perret

parent
c2469fa4b4
commit
f9bab75599
@@ -375,8 +375,8 @@ struct kvm_vcpu_arch {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Pointer to the vcpu's SVE FFR for sve_{save,load}_state() */
|
/* Pointer to the vcpu's SVE FFR for sve_{save,load}_state() */
|
||||||
#define vcpu_sve_pffr(vcpu) ((void *)((char *)((vcpu)->arch.sve_state) + \
|
#define vcpu_sve_pffr(vcpu) (kern_hyp_va((vcpu)->arch.sve_state) + \
|
||||||
sve_ffr_offset((vcpu)->arch.sve_max_vl)))
|
sve_ffr_offset((vcpu)->arch.sve_max_vl))
|
||||||
|
|
||||||
#define vcpu_sve_state_size(vcpu) ({ \
|
#define vcpu_sve_state_size(vcpu) ({ \
|
||||||
size_t __size_ret; \
|
size_t __size_ret; \
|
||||||
|
Reference in New Issue
Block a user