
From: Zenghui Yu <yuzenghui@huawei.com> virt inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I65EGT CVE: NA ---------------------------------------------------- Currently fp_asimd_exit_stat is accumulated for *both* FP/ASIMD and SVE traps so that user can not distinguish between these two via debugfs. Fix the manipulation for both exception classes. Signed-off-by: Zenghui Yu <yuzenghui@huawei.com> Reviewed-by: Keqian Zhu <zhukeqian1@huawei.com> Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com> --- arch/arm64/kvm/hyp/include/hyp/switch.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kvm/hyp/include/hyp/switch.h b/arch/arm64/kvm/hyp/include/hyp/switch.h index 5d1973b58e3c..f4938db6c71c 100644 --- a/arch/arm64/kvm/hyp/include/hyp/switch.h +++ b/arch/arm64/kvm/hyp/include/hyp/switch.h @@ -223,7 +223,11 @@ static inline bool __hyp_handle_fpsimd(struct kvm_vcpu *vcpu) esr_ec != ESR_ELx_EC_SVE) return false; - vcpu->stat.fp_asimd_exit_stat++; + if (esr_ec == ESR_ELx_EC_FP_ASIMD) + vcpu->stat.fp_asimd_exit_stat++; + else /* SVE trap */ + vcpu->stat.sve_exit_stat++; + /* Don't handle SVE traps for non-SVE vcpus here: */ if (!sve_guest) if (esr_ec != ESR_ELx_EC_FP_ASIMD) -- 2.20.1