Skip to content

Commit 45f4ea9

Browse files
Fuad TabbaMarc Zyngier
authored andcommitted
KVM: arm64: Fix prototype for __sve_save_state/__sve_restore_state
Since the prototypes for __sve_save_state/__sve_restore_state at hyp were added, the underlying macro has acquired a third parameter for saving/restoring ffr. Fix the prototypes to account for the third parameter, and restore the ffr for the guest since it is saved. Suggested-by: Mark Brown <[email protected]> Signed-off-by: Fuad Tabba <[email protected]> Reviewed-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Zyngier <[email protected]>
1 parent 87bb39e commit 45f4ea9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

arch/arm64/include/asm/kvm_hyp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ void __debug_restore_host_buffers_nvhe(struct kvm_vcpu *vcpu);
111111

112112
void __fpsimd_save_state(struct user_fpsimd_state *fp_regs);
113113
void __fpsimd_restore_state(struct user_fpsimd_state *fp_regs);
114-
void __sve_save_state(void *sve_pffr, u32 *fpsr);
115-
void __sve_restore_state(void *sve_pffr, u32 *fpsr);
114+
void __sve_save_state(void *sve_pffr, u32 *fpsr, int save_ffr);
115+
void __sve_restore_state(void *sve_pffr, u32 *fpsr, int restore_ffr);
116116

117117
u64 __guest_enter(struct kvm_vcpu *vcpu);
118118

arch/arm64/kvm/hyp/include/hyp/switch.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,8 @@ static inline void __hyp_sve_restore_guest(struct kvm_vcpu *vcpu)
316316
{
317317
sve_cond_update_zcr_vq(vcpu_sve_max_vq(vcpu) - 1, SYS_ZCR_EL2);
318318
__sve_restore_state(vcpu_sve_pffr(vcpu),
319-
&vcpu->arch.ctxt.fp_regs.fpsr);
319+
&vcpu->arch.ctxt.fp_regs.fpsr,
320+
true);
320321
write_sysreg_el1(__vcpu_sys_reg(vcpu, ZCR_EL1), SYS_ZCR);
321322
}
322323

0 commit comments

Comments
 (0)