Skip to content

arm64/sve: Fix mutating register endianness on big-endian

Dave Martin linux-arm-kernel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 12 repliesIn review
  2. v12 patches 9 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3arm64/sve: Fix missing SVE/FPSIMD endianness conversionsDocumentation/arm64/sve.txt arch/arm64/include/uapi/asm/kvm.h arch/arm64/include/uapi/asm/ptrace.h +2 more+74 -98 replies
2/3arm64/sve: Factor out FPSIMD to SVE state conversionarch/arm64/kernel/fpsimd.c+14 -132 replies
3/3arm64/sve: Fix a couple of magic numbers for the Z-reg countarch/arm64/kernel/fpsimd.c+2 -22 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchJulien GrallCatalin Marinas
1/3
2/3R-b A-b
3/3R-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] arm64/sve: Fix mutating register endianness on big-endian

This is a respin of [1], swapping the first two patches so that (new) patch 1 can go to stable stand-alone without depending on patch 2.

I've also smuggled in a new trivial patch 3, that just replaces a couple of magic numbers for which there is now a suitable #define to use, which have been bugging me for a while.

Original blurb:

By inspection while debugging something else, I noticed that the byte order of FPSIMD V-register stores and SVE Z-register stores is not the same when running on big-endian.

This is not properly taken into account when moving between the FPSIMD and SVE register views inside the kernel, resulting in the bytes of a V-register getting spontaneously reversed in some situations, from userspace's point of view. The signal frame and ptrace interface are also affected. The KVM ABI forbids mixing the two views and so should not be affected.

See patch 2 for details.

Patch 1 does some trivial preparatory refactoring.

gdb may or may not be affected by this, depending on how it uses the NT_PRFPREG and NT_ARM_SVE regsets. I'll leave it to the developers to assess that.

[1] [PATCH 0/2] arm64/sve: Fix mutating register endianness on big-endian
http://lists.infradead.org/pipermail/linux-arm-kernel/2019-June/657824.html

Dave Martin (3):
arm64/sve: Fix missing SVE/FPSIMD endianness conversions arm64/sve: Factor out FPSIMD to SVE state conversion arm64/sve: Fix a couple of magic numbers for the Z-reg count

 Documentation/arm64/sve.txt              | 16 +++++++++++
 arch/arm64/include/uapi/asm/kvm.h        |  7 +++++
 arch/arm64/include/uapi/asm/ptrace.h     |  4 +++
 arch/arm64/include/uapi/asm/sigcontext.h | 14 +++++++++
 arch/arm64/kernel/fpsimd.c               | 49 ++++++++++++++++++++++++--------
 5 files changed, 78 insertions(+), 12 deletions(-)
Signature · 7 lines
2.1.4


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel