Skip to content

Commit 31aa126

Browse files
author
Marc Zyngier
committed
arm64/fpsimd: Document the use of TIF_FOREIGN_FPSTATE by KVM
The bit of documentation that talks about TIF_FOREIGN_FPSTATE does not mention the ungodly tricks that KVM plays with this flag. Try and document this for the posterity. Reviewed-by: Mark Brown <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
1 parent bee14bc commit 31aa126

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

arch/arm64/kernel/fpsimd.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@
7878
* indicate whether or not the userland FPSIMD state of the current task is
7979
* present in the registers. The flag is set unless the FPSIMD registers of this
8080
* CPU currently contain the most recent userland FPSIMD state of the current
81-
* task.
81+
* task. If the task is behaving as a VMM, then this is will be managed by
82+
* KVM which will clear it to indicate that the vcpu FPSIMD state is currently
83+
* loaded on the CPU, allowing the state to be saved if a FPSIMD-aware
84+
* softirq kicks in. Upon vcpu_put(), KVM will save the vcpu FP state and
85+
* flag the register state as invalid.
8286
*
8387
* In order to allow softirq handlers to use FPSIMD, kernel_neon_begin() may
8488
* save the task's FPSIMD context back to task_struct from softirq context.

0 commit comments

Comments
 (0)