diff mbox series

[RFC,1/8] arm64/fpsimd: Update documentation of do_sve_acc

Message ID 20190118164610.8123-2-julien.grall@arm.com (mailing list archive)
State RFC
Headers show
Series arm64/sve: First steps towards optimizing syscalls | expand

Commit Message

Julien Grall Jan. 18, 2019, 4:46 p.m. UTC
TIF_SVE is cleared by fpsimd_restore_current_state() not
task_fpsimd_load(). Update the documentatio of do_sve_acc to reflect
this behavior.

Signed-off-by: Julien Grall <julien.grall@arm.com>
---
 arch/arm64/kernel/fpsimd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mark Rutland Jan. 21, 2019, 12:13 p.m. UTC | #1
On Fri, Jan 18, 2019 at 04:46:03PM +0000, Julien Grall wrote:
> TIF_SVE is cleared by fpsimd_restore_current_state() not
> task_fpsimd_load(). Update the documentatio of do_sve_acc to reflect
> this behavior.

AFAICT (in v5.0-rc2), fpsimd_restore_current_state() clears
TIF_FOREIGN_FPSTATE, not TIF_SVE. 

I think you mean that fpsimd_restore_current_state() enabled/disables
the trap (via fpsimd_bind_task_to_cpu()), based on TIF_SVE. Is that
right?

Thanks,
Mark.

> 
> Signed-off-by: Julien Grall <julien.grall@arm.com>
> ---
>  arch/arm64/kernel/fpsimd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
> index 5ebe73b69961..b3870905a492 100644
> --- a/arch/arm64/kernel/fpsimd.c
> +++ b/arch/arm64/kernel/fpsimd.c
> @@ -799,7 +799,7 @@ void fpsimd_release_task(struct task_struct *dead_task)
>   * the SVE access trap will be disabled the next time this task
>   * reaches ret_to_user.
>   *
> - * TIF_SVE should be clear on entry: otherwise, task_fpsimd_load()
> + * TIF_SVE should be clear on entry: otherwise, fpsimd_restore_current_state()
>   * would have disabled the SVE access trap for userspace during
>   * ret_to_user, making an SVE access trap impossible in that case.
>   */
> -- 
> 2.11.0
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Julien Grall Jan. 22, 2019, 4:03 p.m. UTC | #2
Hi Mark,

On 1/21/19 12:13 PM, Mark Rutland wrote:
> On Fri, Jan 18, 2019 at 04:46:03PM +0000, Julien Grall wrote:
>> TIF_SVE is cleared by fpsimd_restore_current_state() not
>> task_fpsimd_load(). Update the documentatio of do_sve_acc to reflect
>> this behavior.
> 
> AFAICT (in v5.0-rc2), fpsimd_restore_current_state() clears
> TIF_FOREIGN_FPSTATE, not TIF_SVE.
> 
> I think you mean that fpsimd_restore_current_state() enabled/disables
> the trap (via fpsimd_bind_task_to_cpu()), based on TIF_SVE. Is that
> right?

That's correct. I will reword the commit message and the documentation 
below.

Cheers,
diff mbox series

Patch

diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
index 5ebe73b69961..b3870905a492 100644
--- a/arch/arm64/kernel/fpsimd.c
+++ b/arch/arm64/kernel/fpsimd.c
@@ -799,7 +799,7 @@  void fpsimd_release_task(struct task_struct *dead_task)
  * the SVE access trap will be disabled the next time this task
  * reaches ret_to_user.
  *
- * TIF_SVE should be clear on entry: otherwise, task_fpsimd_load()
+ * TIF_SVE should be clear on entry: otherwise, fpsimd_restore_current_state()
  * would have disabled the SVE access trap for userspace during
  * ret_to_user, making an SVE access trap impossible in that case.
  */