diff mbox series

[3/4] arm64/fp: Clarify effect of setting an unsupported system VL

Message ID 20240122-arm64-sve-sme-doc-v1-3-3d492e45265b@kernel.org (mailing list archive)
State New, archived
Headers show
Series arm64/fp: Documentation cleanups and clarifications | expand

Commit Message

Mark Brown Jan. 22, 2024, 8:41 p.m. UTC
The documentation for system vector length configuration does not cover all
cases where unsupported values are written, tighten it up.

Reported-by: Edmund Grimley-Evans <edmund.grimley-evans@arm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 Documentation/arch/arm64/sme.rst | 5 ++---
 Documentation/arch/arm64/sve.rst | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

Comments

Dave Martin Jan. 23, 2024, 3:49 p.m. UTC | #1
On Mon, Jan 22, 2024 at 08:41:53PM +0000, Mark Brown wrote:
> The documentation for system vector length configuration does not cover all
> cases where unsupported values are written, tighten it up.
> 
> Reported-by: Edmund Grimley-Evans <edmund.grimley-evans@arm.com>
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
>  Documentation/arch/arm64/sme.rst | 5 ++---
>  Documentation/arch/arm64/sve.rst | 5 ++---
>  2 files changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/Documentation/arch/arm64/sme.rst b/Documentation/arch/arm64/sme.rst
> index 3133d0e91b48..ba0a5e5b2523 100644
> --- a/Documentation/arch/arm64/sme.rst
> +++ b/Documentation/arch/arm64/sme.rst
> @@ -379,9 +379,8 @@ The regset data starts with struct user_za_header, containing:
>  /proc/sys/abi/sme_default_vector_length
>  
>      Writing the text representation of an integer to this file sets the system
> -    default vector length to the specified value, unless the value is greater
> -    than the maximum vector length supported by the system in which case the
> -    default vector length is set to that maximum.
> +    default vector length to the specified value rounded to a supported value
> +    using the same rules as for setting vector length via prctl().

Do parallel changes need to be made in sve.rst?

(There seems to be so much duplication and copy-paste between these
files that I wonder whether it would make sense to merge them...  but
that's probably a separate discussion.)

Nit: is it better to name the prctl here than just to say prctl()?
That would be easier for the reader to cross-reference.

>  
>      The result can be determined by reopening the file and reading its
>      contents.
> diff --git a/Documentation/arch/arm64/sve.rst b/Documentation/arch/arm64/sve.rst
> index b45a2da19bf1..b923727ff4b9 100644
> --- a/Documentation/arch/arm64/sve.rst
> +++ b/Documentation/arch/arm64/sve.rst
> @@ -423,9 +423,8 @@ The regset data starts with struct user_sve_header, containing:
>  /proc/sys/abi/sve_default_vector_length
>  
>      Writing the text representation of an integer to this file sets the system
> -    default vector length to the specified value, unless the value is greater
> -    than the maximum vector length supported by the system in which case the
> -    default vector length is set to that maximum.
> +    default vector length to the specified value rounded to a supported value
> +    using the same rules as for setting vector length via prctl().

Ditto.

[...]

Cheers
---Dave
Mark Brown Jan. 23, 2024, 6:42 p.m. UTC | #2
On Tue, Jan 23, 2024 at 03:49:27PM +0000, Dave Martin wrote:
> On Mon, Jan 22, 2024 at 08:41:53PM +0000, Mark Brown wrote:

> >  /proc/sys/abi/sme_default_vector_length
> >  
> >      Writing the text representation of an integer to this file sets the system
> > -    default vector length to the specified value, unless the value is greater
> > -    than the maximum vector length supported by the system in which case the
> > -    default vector length is set to that maximum.
> > +    default vector length to the specified value rounded to a supported value
> > +    using the same rules as for setting vector length via prctl().

> Do parallel changes need to be made in sve.rst?

They are, in this very patch?

> (There seems to be so much duplication and copy-paste between these
> files that I wonder whether it would make sense to merge them...  but
> that's probably a separate discussion.)

Indeed, thanks for volunteering.  Note that there are differences
resulting from specification differences.

> Nit: is it better to name the prctl here than just to say prctl()?
> That would be easier for the reader to cross-reference.

I guess, though it doesn't seem entirely idiomatic.
Dave Martin Jan. 24, 2024, 2:09 p.m. UTC | #3
On Tue, Jan 23, 2024 at 06:42:03PM +0000, Mark Brown wrote:
> On Tue, Jan 23, 2024 at 03:49:27PM +0000, Dave Martin wrote:
> > On Mon, Jan 22, 2024 at 08:41:53PM +0000, Mark Brown wrote:
> 
> > >  /proc/sys/abi/sme_default_vector_length
> > >  
> > >      Writing the text representation of an integer to this file sets the system
> > > -    default vector length to the specified value, unless the value is greater
> > > -    than the maximum vector length supported by the system in which case the
> > > -    default vector length is set to that maximum.
> > > +    default vector length to the specified value rounded to a supported value
> > > +    using the same rules as for setting vector length via prctl().
> 
> > Do parallel changes need to be made in sve.rst?
> 
> They are, in this very patch?

Duh, yes.  My brain seems to have auto-ignored the second hunk, since it
was clearly a duplicate :P

> > (There seems to be so much duplication and copy-paste between these
> > files that I wonder whether it would make sense to merge them...  but
> > that's probably a separate discussion.)
> 
> Indeed, thanks for volunteering.  Note that there are differences
> resulting from specification differences.

Thanks for agreeing to an unspecfied deadline ;)

I might have a go at some point though, just to familiarise myself with
the differences...

> > Nit: is it better to name the prctl here than just to say prctl()?
> > That would be easier for the reader to cross-reference.
> 
> I guess, though it doesn't seem entirely idiomatic.

I expect counterexamples can be found, but I guess the reader can figure
it out either way.

Cheers
---Dave
diff mbox series

Patch

diff --git a/Documentation/arch/arm64/sme.rst b/Documentation/arch/arm64/sme.rst
index 3133d0e91b48..ba0a5e5b2523 100644
--- a/Documentation/arch/arm64/sme.rst
+++ b/Documentation/arch/arm64/sme.rst
@@ -379,9 +379,8 @@  The regset data starts with struct user_za_header, containing:
 /proc/sys/abi/sme_default_vector_length
 
     Writing the text representation of an integer to this file sets the system
-    default vector length to the specified value, unless the value is greater
-    than the maximum vector length supported by the system in which case the
-    default vector length is set to that maximum.
+    default vector length to the specified value rounded to a supported value
+    using the same rules as for setting vector length via prctl().
 
     The result can be determined by reopening the file and reading its
     contents.
diff --git a/Documentation/arch/arm64/sve.rst b/Documentation/arch/arm64/sve.rst
index b45a2da19bf1..b923727ff4b9 100644
--- a/Documentation/arch/arm64/sve.rst
+++ b/Documentation/arch/arm64/sve.rst
@@ -423,9 +423,8 @@  The regset data starts with struct user_sve_header, containing:
 /proc/sys/abi/sve_default_vector_length
 
     Writing the text representation of an integer to this file sets the system
-    default vector length to the specified value, unless the value is greater
-    than the maximum vector length supported by the system in which case the
-    default vector length is set to that maximum.
+    default vector length to the specified value rounded to a supported value
+    using the same rules as for setting vector length via prctl().
 
     The result can be determined by reopening the file and reading its
     contents.