mbox series

[v2,0/3] target/arm: Add sve-default-vector-length cpu property

Message ID 20210723203344.968563-1-richard.henderson@linaro.org
Headers show
Series target/arm: Add sve-default-vector-length cpu property | expand

Message

Richard Henderson July 23, 2021, 8:33 p.m. UTC
This is intended to resolve #482.

Changes for v2:
  * Split out length bounding fix to new patch.
  * Use byte units for sve-default-vector-length.
  * Support undocumented -1 "maximum".
  * Add documentation.


r~


Richard Henderson (3):
  target/arm: Correctly bound length in sve_zcr_get_valid_len
  target/arm: Export aarch64_sve_zcr_get_valid_len
  target/arm: Add sve-default-vector-length cpu property

 docs/system/arm/cpu-features.rst | 11 ++++++
 target/arm/cpu.h                 |  5 +++
 target/arm/internals.h           | 10 ++++++
 target/arm/cpu.c                 | 14 ++++++--
 target/arm/cpu64.c               | 60 ++++++++++++++++++++++++++++++++
 target/arm/helper.c              |  8 +++--
 6 files changed, 103 insertions(+), 5 deletions(-)

-- 
2.25.1

Comments

Peter Maydell July 26, 2021, 12:42 p.m. UTC | #1
On Fri, 23 Jul 2021 at 21:34, Richard Henderson
<richard.henderson@linaro.org> wrote:
>

> This is intended to resolve #482.

>

> Changes for v2:

>   * Split out length bounding fix to new patch.

>   * Use byte units for sve-default-vector-length.

>   * Support undocumented -1 "maximum".

>   * Add documentation.


I'm going to apply this to target-arm.next with the following
docs tweak squashed into patch 3:

diff --git a/docs/system/arm/cpu-features.rst b/docs/system/arm/cpu-features.rst
index 4ff36cc83f0..7b97df442aa 100644
--- a/docs/system/arm/cpu-features.rst
+++ b/docs/system/arm/cpu-features.rst
@@ -379,11 +379,14 @@ example's (1), (4), and (6) exhibit recommended
uses of the properties.
 SVE User-mode Default Vector Length Property
 --------------------------------------------

-For qemu-aarch64, the cpu property `sve-default-vector-length=N` is
+For qemu-aarch64, the cpu property ``sve-default-vector-length=N`` is
 defined to mirror the Linux kernel parameter file
-`/proc/sys/abi/sve_default_vector_length`.  The default length, `N`,
-is in units of bytes and must be between 16 and 8192.
+``/proc/sys/abi/sve_default_vector_length``.  The default length, ``N``,
+is in units of bytes and must be between 16 and 8192.
 If not specified, the default vector length is 64.

 If the default length is larger than the maximum vector length enabled
-with `sve<N>` properties, the actual vector length will be reduced.
+with ``sve<N>`` properties, the actual vector length will be reduced.
+
+If this property is set to ``-1`` then the default vector length
+is set to the maximum possible length.

thanks
-- PMM
Andrew Jones July 26, 2021, 3 p.m. UTC | #2
On Mon, Jul 26, 2021 at 01:42:45PM +0100, Peter Maydell wrote:
> On Fri, 23 Jul 2021 at 21:34, Richard Henderson

> <richard.henderson@linaro.org> wrote:

> >

> > This is intended to resolve #482.

> >

> > Changes for v2:

> >   * Split out length bounding fix to new patch.

> >   * Use byte units for sve-default-vector-length.

> >   * Support undocumented -1 "maximum".

> >   * Add documentation.

> 

> I'm going to apply this to target-arm.next with the following

> docs tweak squashed into patch 3:

> 

> diff --git a/docs/system/arm/cpu-features.rst b/docs/system/arm/cpu-features.rst

> index 4ff36cc83f0..7b97df442aa 100644

> --- a/docs/system/arm/cpu-features.rst

> +++ b/docs/system/arm/cpu-features.rst

> @@ -379,11 +379,14 @@ example's (1), (4), and (6) exhibit recommended

> uses of the properties.

>  SVE User-mode Default Vector Length Property

>  --------------------------------------------

> 

> -For qemu-aarch64, the cpu property `sve-default-vector-length=N` is

> +For qemu-aarch64, the cpu property ``sve-default-vector-length=N`` is

>  defined to mirror the Linux kernel parameter file

> -`/proc/sys/abi/sve_default_vector_length`.  The default length, `N`,

> -is in units of bytes and must be between 16 and 8192.

> +``/proc/sys/abi/sve_default_vector_length``.  The default length, ``N``,

> +is in units of bytes and must be between 16 and 8192.

>  If not specified, the default vector length is 64.

> 

>  If the default length is larger than the maximum vector length enabled

> -with `sve<N>` properties, the actual vector length will be reduced.

> +with ``sve<N>`` properties, the actual vector length will be reduced.

> +

> +If this property is set to ``-1`` then the default vector length

> +is set to the maximum possible length.


This file is full of single backtick usage. Isn't it better to stay
consistent? Or do we need a patch that converts all the rest now?

Thanks,
drew

> 

> thanks

> -- PMM

>
Peter Maydell July 26, 2021, 3:41 p.m. UTC | #3
On Mon, 26 Jul 2021 at 16:01, Andrew Jones <drjones@redhat.com> wrote:
>

> On Mon, Jul 26, 2021 at 01:42:45PM +0100, Peter Maydell wrote:

> > On Fri, 23 Jul 2021 at 21:34, Richard Henderson

> > <richard.henderson@linaro.org> wrote:

> > >

> > > This is intended to resolve #482.

> > >

> > > Changes for v2:

> > >   * Split out length bounding fix to new patch.

> > >   * Use byte units for sve-default-vector-length.

> > >   * Support undocumented -1 "maximum".

> > >   * Add documentation.

> >

> > I'm going to apply this to target-arm.next with the following

> > docs tweak squashed into patch 3:

> >

> > diff --git a/docs/system/arm/cpu-features.rst b/docs/system/arm/cpu-features.rst

> > index 4ff36cc83f0..7b97df442aa 100644

> > --- a/docs/system/arm/cpu-features.rst

> > +++ b/docs/system/arm/cpu-features.rst

> > @@ -379,11 +379,14 @@ example's (1), (4), and (6) exhibit recommended

> > uses of the properties.

> >  SVE User-mode Default Vector Length Property

> >  --------------------------------------------

> >

> > -For qemu-aarch64, the cpu property `sve-default-vector-length=N` is

> > +For qemu-aarch64, the cpu property ``sve-default-vector-length=N`` is

> >  defined to mirror the Linux kernel parameter file

> > -`/proc/sys/abi/sve_default_vector_length`.  The default length, `N`,

> > -is in units of bytes and must be between 16 and 8192.

> > +``/proc/sys/abi/sve_default_vector_length``.  The default length, ``N``,

> > +is in units of bytes and must be between 16 and 8192.

> >  If not specified, the default vector length is 64.

> >

> >  If the default length is larger than the maximum vector length enabled

> > -with `sve<N>` properties, the actual vector length will be reduced.

> > +with ``sve<N>`` properties, the actual vector length will be reduced.

> > +

> > +If this property is set to ``-1`` then the default vector length

> > +is set to the maximum possible length.

>

> This file is full of single backtick usage. Isn't it better to stay

> consistent? Or do we need a patch that converts all the rest now?


I just sent one of those:
https://patchew.org/QEMU/20210726142338.31872-1-peter.maydell@linaro.org/

-- PMM