提交 b4f1cf06 编写于 作者: M Marc Zyngier 提交者: Wang ShaoBo

KVM: arm64: Let vcpu_sve_pffr() handle HYP VAs

mainline inclusion
from mainline-v5.13-rc1~76^2
commit 985d3a1b
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5ITJT
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=985d3a1beab543875e0c857ce263cad8233923bb

-------------------------------------------------

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: NWill Deacon <will@kernel.org>
Signed-off-by: NMarc Zyngier <maz@kernel.org>
Signed-off-by: NWang ShaoBo <bobo.shaobowang@huawei.com>
上级 9896429a
...@@ -394,8 +394,8 @@ struct kvm_vcpu_arch { ...@@ -394,8 +394,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; \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册