Skip to contentSkip to conversation

arm64: sve: Fix some compile errors about sve_cond_update_zcr_vq

RFC PATCH Applied Xiaofei Tan 2 participants 2 messages Mar 31, 2021 arm64

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 arm64: sve: Fix some compile errors about sve_cond_update_zcr_vq

There are some compile errors of ARM64 KVM when ARM64_SVE is not selected, in the locations of sve_cond_update_zcr_vq used. One error log is as following:

CC arch/arm64/kvm/sys_regs.o
In file included from arch/arm64/kvm/hyp/vhe/switch.c:8:0:
./arch/arm64/kvm/hyp/include/hyp/switch.h: In function ‘__hyp_sve_restore_guest’:
./arch/arm64/kvm/hyp/include/hyp/switch.h:220:2: error: implicit declaration of function ‘sve_cond_update_zcr_vq’; did you mean ‘kvm_pmu_update_run’? [-Werror=implicit-function-declaration]
sve_cond_update_zcr_vq(vcpu_sve_max_vq(vcpu) - 1, SYS_ZCR_EL2); ^~~~~~~~~~~~~~~~~~~~~~
kvm_pmu_update_run

The root cause is that sve_cond_update_zcr_vq is not defined when ARM64_SVE is not selected. Fix it by adding an empty definition when CONFIG_ARM64_SVE=n.

---
 arch/arm64/include/asm/fpsimd.h | 2 ++
 1 file changed, 2 insertions(+)
arch/arm64/include/asm/fpsimd.h +2 -0
index 05c9c55..3f93b63 100644
@@ -168,6 +168,8 @@ static inline int sve_get_current_vl(void)
 static inline void sve_user_disable(void) { BUILD_BUG(); }
 static inline void sve_user_enable(void) { BUILD_BUG(); }
 
+#define sve_cond_update_zcr_vq(val, reg)
+
 static inline void sve_init_vq_map(void) { }
 static inline void sve_update_vq_map(void) { }
 static inline int sve_verify_vq_map(void) { return 0; }
Signature · 1 line
2.8.1
Applied
#1 lore raw
Quoted 14 lines · Xiaofei Tan

There are some compile errors of ARM64 KVM when ARM64_SVE is not selected, in the locations of sve_cond_update_zcr_vq used. One error log is as following:

CC arch/arm64/kvm/sys_regs.o
In file included from arch/arm64/kvm/hyp/vhe/switch.c:8:0:
./arch/arm64/kvm/hyp/include/hyp/switch.h: In function ‘__hyp_sve_restore_guest’:
./arch/arm64/kvm/hyp/include/hyp/switch.h:220:2: error: implicit declaration of function ‘sve_cond_update_zcr_vq’; did you mean ‘kvm_pmu_update_run’? [-Werror=implicit-function-declaration]
sve_cond_update_zcr_vq(vcpu_sve_max_vq(vcpu) - 1, SYS_ZCR_EL2); ^~~~~~~~~~~~~~~~~~~~~~
kvm_pmu_update_run

Quoted 1 line

[...]

Applied to kvm-arm64/nvhe-sve, thanks!

[1/1] arm64: sve: Fix some compile errors about sve_cond_update_zcr_vq

      commit: a9f8696d4be5228de9d1d4f0e9f027b64d77dab6

Cheers,

	M.
Signature · 1 line
Without deviation from the norm, progress is not possible.