Re: [PATCH v5 02/26] arm64: fpsimd: Always set TIF_FOREIGN_FPSTATE on task state flush
From: Julien Grall <hidden>
Date: 2019-02-26 12:35:56
Also in:
kvmarm
On 26/02/2019 12:06, Dave Martin wrote:
On Thu, Feb 21, 2019 at 12:39:39PM +0000, Julien Grall wrote:quoted
Hi Dave, On 18/02/2019 19:52, Dave Martin wrote:quoted
This patch updates fpsimd_flush_task_state() to mirror the new semantics of fpsimd_flush_cpu_state() introduced by commit d8ad71fa38a9 ("arm64: fpsimd: Fix TIF_FOREIGN_FPSTATE after invalidating cpu regs"). Both functions now implicitly setNIT: Double-space before "Both"quoted
TIF_FOREIGN_FPSTATE to indicate that the task's FPSIMD state is not loaded into the cpu. As a side-effect, fpsimd_flush_task_state() now sets TIF_FOREIGN_FPSTATE even for non-running tasks. In the case ofNIT: Double sppace before "In".quoted
non-running tasks this is not useful but also harmless, because the flag is live only while the corresponding task is running. This function is not called from fast paths, so special-casing this for the task == current case is not really worth it. Compiler barriers previously present in restore_sve_fpsimd_context() are pulled into fpsimd_flush_task_state() so that it can be safely called with preemption enabled if necessary. Explicit calls to set TIF_FOREIGN_FPSTATE that accompany fpsimd_flush_task_state() calls and are now redundant are removed as appropriate. fpsimd_flush_task_state() is used to get exclusive access to the representation of the task's state via task_struct, for the purpose of replacing the state. Thus, the call to this function shouldNIT: Double-space before "Thus".quoted
happen before manipulating fpsimd_state or sve_state etc. in task_struct. Anomalous cases are reordered appropriately in orderNIT: Double-space before "Anomalous".A habit rather than a mistake [1], and I don't propose to change it ;)
I wasn't aware of this. Thank you for the pointer! Please ignore the comments on it :). Cheers, -- Julien Grall _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel