public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: Dave Martin <Dave.Martin@arm•com>
To: Mark Brown <broonie@kernel•org>
Cc: Julien Grall <julien@xen•org>,
	Catalin Marinas <catalin.marinas@arm•com>,
	zhang.lei@jp•fujitsu.com, Julien Grall <julien.grall@arm•com>,
	Will Deacon <will@kernel•org>,
	linux-arm-kernel@lists•infradead.org,
	Daniel Kiss <Daniel.Kiss@arm•com>
Subject: Re: [PATCH v3 6/8] arm64/sve: Implement a helper to load SVE registers from FPSIMD state
Date: Wed, 15 Jul 2020 17:52:19 +0100	[thread overview]
Message-ID: <20200715165219.GE30452@arm.com> (raw)
In-Reply-To: <20200629133556.39825-7-broonie@kernel.org>

On Mon, Jun 29, 2020 at 02:35:54PM +0100, Mark Brown wrote:
> From: Julien Grall <julien.grall@arm•com>
> 
> In a follow-up patch, we may save the FPSIMD rather than the full SVE
> state when the state has to be zeroed on return to userspace (e.g
> during a syscall).
> 
> Introduce an helper to load SVE vectors from FPSIMD state and zero the rest
> of SVE registers.
> 
> Signed-off-by: Julien Grall <julien.grall@arm•com>
> Reviewed-by: Dave Martin <Dave.Martin@arm•com>
> Signed-off-by: Mark Brown <broonie@kernel•org>
> ---
>  arch/arm64/include/asm/fpsimd.h  |  2 ++
>  arch/arm64/kernel/entry-fpsimd.S | 17 +++++++++++++++++
>  2 files changed, 19 insertions(+)
> 
> diff --git a/arch/arm64/include/asm/fpsimd.h b/arch/arm64/include/asm/fpsimd.h
> index 958f642e930d..bec5f14b622a 100644
> --- a/arch/arm64/include/asm/fpsimd.h
> +++ b/arch/arm64/include/asm/fpsimd.h
> @@ -70,6 +70,8 @@ extern void sve_save_state(void *state, u32 *pfpsr);
>  extern void sve_load_state(void const *state, u32 const *pfpsr,
>  			   unsigned long vq_minus_1);
>  extern void sve_flush_live(void);
> +extern void sve_load_from_fpsimd_state(struct user_fpsimd_state const *state,
> +				       unsigned long vq_minus_1);
>  extern unsigned int sve_get_vl(void);
>  
>  struct arm64_cpu_capabilities;
> diff --git a/arch/arm64/kernel/entry-fpsimd.S b/arch/arm64/kernel/entry-fpsimd.S
> index fdf7a5a35c63..5b1a9adfb00b 100644
> --- a/arch/arm64/kernel/entry-fpsimd.S
> +++ b/arch/arm64/kernel/entry-fpsimd.S
> @@ -48,6 +48,23 @@ SYM_FUNC_START(sve_get_vl)
>  	ret
>  SYM_FUNC_END(sve_get_vl)
>  
> +/*
> + * Load SVE state from FPSIMD state.
> + *
> + * x0 = pointer to struct fpsimd_state
> + * x1 = VQ - 1
> + *
> + * Each SVE vector will be loaded with the first 128-bits taken from FPSIMD
> + * and the rest zeroed. All the other SVE registers will be zeroed.
> + */
> +SYM_FUNC_START(sve_load_from_fpsimd_state)
> +		sve_load_vq	x1, x2, x3
> +		fpsimd_restore	x0, 8
> + _for n, 0, 15, _sve_pfalse	\n
> +		_sve_wrffr 0

FWIW, trivial nit that I guess I didn't spot previously:
tab before 0 here?

Mind you, the spacing is already a bit off in this file.

Cheers
---Dave

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-07-15 16:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-29 13:35 [PATCH v3 0/8] arm64/sve: First steps towards optimizing syscalls Mark Brown
2020-06-29 13:35 ` [PATCH v3 1/8] arm64/fpsimd: Update documentation of do_sve_acc Mark Brown
2020-06-29 13:35 ` [PATCH v3 2/8] arm64/signal: Update the comment in preserve_sve_context Mark Brown
2020-06-29 13:35 ` [PATCH v3 3/8] arm64/fpsimdmacros: Allow the macro "for" to be used in more cases Mark Brown
2020-06-29 13:35 ` [PATCH v3 4/8] arm64/fpsimdmacros: Introduce a macro to update ZCR_EL1.LEN Mark Brown
2020-06-29 13:35 ` [PATCH v3 5/8] arm64/sve: Implement a helper to flush SVE registers Mark Brown
2020-07-15 16:52   ` Dave Martin
2020-06-29 13:35 ` [PATCH v3 6/8] arm64/sve: Implement a helper to load SVE registers from FPSIMD state Mark Brown
2020-07-15 16:52   ` Dave Martin [this message]
2020-06-29 13:35 ` [PATCH v3 7/8] arm64/sve: Don't disable SVE on syscalls return Mark Brown
2020-07-15 16:52   ` Dave Martin
2020-08-21 21:54     ` Mark Brown
2020-06-29 13:35 ` [PATCH v3 8/8] arm64/sve: Rework SVE trap access to use TIF_SVE_NEEDS_FLUSH Mark Brown
2020-07-15 16:52   ` Dave Martin
2020-07-15 16:49 ` [PATCH v3 0/8] arm64/sve: First steps towards optimizing syscalls Dave Martin
2020-07-15 17:11   ` Mark Brown
2020-07-20 10:44     ` Dave Martin
2020-07-21  2:43       ` zhang.lei
2020-07-21 22:34         ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200715165219.GE30452@arm.com \
    --to=dave.martin@arm$(echo .)com \
    --cc=Daniel.Kiss@arm$(echo .)com \
    --cc=broonie@kernel$(echo .)org \
    --cc=catalin.marinas@arm$(echo .)com \
    --cc=julien.grall@arm$(echo .)com \
    --cc=julien@xen$(echo .)org \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=will@kernel$(echo .)org \
    --cc=zhang.lei@jp$(echo .)fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox