mbox series

[v3,0/3] arm64/sve: Document our actual SVE syscall ABI

Message ID 20220829162502.886816-1-broonie@kernel.org (mailing list archive)
Headers show
Series arm64/sve: Document our actual SVE syscall ABI | expand

Message

Mark Brown Aug. 29, 2022, 4:24 p.m. UTC
Currently our SVE syscall ABI documentation does not reflect the actual
implemented ABI, it says that register state not shared with FPSIMD
becomes undefined on syscall when in reality we always clear it. Since
changing this would cause a change in the observed kernel behaviour
there is a substantial desire to avoid taking advantage of the
documented ABI so instead let's document what we actually do so it's
clear that it is in reality an ABI.

There has been some pushback on tightening the documentation in the past
but it is hard to see who that helps, it makes the implementation
decisions less clear and makes it harder for people to discover and make
use of the actual ABI. The main practical concern is that qemu's user
mode does not currently flush the registers.

v3:
 - Rebase onto v6.0-rc3.
v2:
 - Rebase onto v6.0-rc1.

Mark Brown (3):
  kselftest/arm64: Correct buffer allocation for SVE Z registers
  arm64/sve: Document our actual ABI for clearing registers on syscall
  kselftest/arm64: Enforce actual ABI for SVE syscalls

 Documentation/arm64/sve.rst                   |  2 +-
 .../testing/selftests/arm64/abi/syscall-abi.c | 61 ++++++++++++-------
 2 files changed, 41 insertions(+), 22 deletions(-)


base-commit: b90cb1053190353cc30f0fef0ef1f378ccc063c5

Comments

Catalin Marinas Sept. 2, 2022, 6:22 p.m. UTC | #1
On Mon, Aug 29, 2022 at 05:24:59PM +0100, Mark Brown wrote:
> v3:
>  - Rebase onto v6.0-rc3.
> v2:
>  - Rebase onto v6.0-rc1.

Please don't rebase beyond -rc1 unless it no longer applies cleanly. I
came back from holiday and I have two or three versions of all of your
patches in my inbox. It just adds to the clutter.

Thanks.
Mark Brown Sept. 2, 2022, 6:57 p.m. UTC | #2
On Fri, Sep 02, 2022 at 07:22:20PM +0100, Catalin Marinas wrote:
> On Mon, Aug 29, 2022 at 05:24:59PM +0100, Mark Brown wrote:

> > v3:
> >  - Rebase onto v6.0-rc3.
> > v2:
> >  - Rebase onto v6.0-rc1.

> Please don't rebase beyond -rc1 unless it no longer applies cleanly. I
> came back from holiday and I have two or three versions of all of your
> patches in my inbox. It just adds to the clutter.

OK, sure.  It might help to advertise what you're looking for here - the
whole thing with wanting everything based off -rc3 has never been clear
to me, IIRC I figured it out from some off hand comment rather than
actually knowing what you and Will want.  It's neither base off latest
nor base off -rc1 which seem to be the more common policies.
Catalin Marinas Sept. 2, 2022, 7:41 p.m. UTC | #3
On Fri, Sep 02, 2022 at 07:57:15PM +0100, Mark Brown wrote:
> On Fri, Sep 02, 2022 at 07:22:20PM +0100, Catalin Marinas wrote:
> > On Mon, Aug 29, 2022 at 05:24:59PM +0100, Mark Brown wrote:
> > > v3:
> > >  - Rebase onto v6.0-rc3.
> > > v2:
> > >  - Rebase onto v6.0-rc1.
> 
> > Please don't rebase beyond -rc1 unless it no longer applies cleanly. I
> > came back from holiday and I have two or three versions of all of your
> > patches in my inbox. It just adds to the clutter.
> 
> OK, sure.  It might help to advertise what you're looking for here - the
> whole thing with wanting everything based off -rc3 has never been clear
> to me, IIRC I figured it out from some off hand comment rather than
> actually knowing what you and Will want.  It's neither base off latest
> nor base off -rc1 which seem to be the more common policies.

Usually basing off -rc1 is sufficient unless the patches conflict with
something newer and we occasionally push for-next/core to even higher
-rcX. Of course, fixes for something in a late -rc should be based off
that version.

Both Will and I start queuing patches around -rc3 with the two weeks
before pretty much reviewing or waiting to see if there are any more
comments. I don't mind you basing your patches off -rc3 though in
general it's better for series aimed at the upcoming merging window to
be posted shortly after -rc1 to give them some more time on the list.
However, once posted, if there are no changes please don't repost them
for subsequent -rcX, it won't make any difference as we can just apply
the original series to whatever we base for-next/core off.

Thanks.
Catalin Marinas Sept. 6, 2022, 5:45 p.m. UTC | #4
On Mon, 29 Aug 2022 17:24:59 +0100, Mark Brown wrote:
> Currently our SVE syscall ABI documentation does not reflect the actual
> implemented ABI, it says that register state not shared with FPSIMD
> becomes undefined on syscall when in reality we always clear it. Since
> changing this would cause a change in the observed kernel behaviour
> there is a substantial desire to avoid taking advantage of the
> documented ABI so instead let's document what we actually do so it's
> clear that it is in reality an ABI.
> 
> [...]

Applied to arm64 (for-next/kselftest), thanks!

[1/3] kselftest/arm64: Correct buffer allocation for SVE Z registers
      https://git.kernel.org/arm64/c/27f3d9e70fd8
[3/3] kselftest/arm64: Enforce actual ABI for SVE syscalls
      https://git.kernel.org/arm64/c/9ccff5080758
Catalin Marinas Sept. 6, 2022, 5:47 p.m. UTC | #5
On Mon, 29 Aug 2022 17:24:59 +0100, Mark Brown wrote:
> Currently our SVE syscall ABI documentation does not reflect the actual
> implemented ABI, it says that register state not shared with FPSIMD
> becomes undefined on syscall when in reality we always clear it. Since
> changing this would cause a change in the observed kernel behaviour
> there is a substantial desire to avoid taking advantage of the
> documented ABI so instead let's document what we actually do so it's
> clear that it is in reality an ABI.
> 
> [...]

Applied to arm64 (for-next/doc), thanks!

[2/3] arm64/sve: Document our actual ABI for clearing registers on syscall
      https://git.kernel.org/arm64/c/d09ee410a3c3