Skip to content

Commit 4c181e3

Browse files
broonieMarc Zyngier
authored andcommitted
KVM: arm64: Document check for TIF_FOREIGN_FPSTATE
In kvm_arch_vcpu_load_fp() we unconditionally set the current FP state to FP_STATE_HOST_OWNED, this will be overridden to FP_STATE_NONE if TIF_FOREIGN_FPSTATE is set but the check is deferred until kvm_arch_vcpu_ctxflush_fp() where we are no longer preemptable. Add a comment to this effect to help avoid people being concerned about the lack of a check and discover where the check is done. Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20221214-kvm-arm64-sme-context-switch-v2-1-57ba0082e9ff@kernel.org
1 parent 3d17935 commit 4c181e3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

arch/arm64/kvm/fpsimd.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ void kvm_arch_vcpu_load_fp(struct kvm_vcpu *vcpu)
8181

8282
fpsimd_kvm_prepare();
8383

84+
/*
85+
* We will check TIF_FOREIGN_FPSTATE just before entering the
86+
* guest in kvm_arch_vcpu_ctxflush_fp() and override this to
87+
* FP_STATE_FREE if the flag set.
88+
*/
8489
vcpu->arch.fp_state = FP_STATE_HOST_OWNED;
8590

8691
vcpu_clear_flag(vcpu, HOST_SVE_ENABLED);

0 commit comments

Comments
 (0)