public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/2] arm64/sve: Fix mutating register endianness on big-endian
@ 2019-06-06 16:45 Dave Martin
  2019-06-06 16:45 ` [PATCH 1/2] arm64/sve: Factor out FPSIMD to SVE state conversion Dave Martin
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Dave Martin @ 2019-06-06 16:45 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: gdb, Alex Bennée, Will Deacon, Julien Grall,
	Catalin Marinas, Peter Maydell, Zhang Lei

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.

Dave Martin (2):
  arm64/sve: Factor out FPSIMD to SVE state conversion
  arm64/sve: Fix missing SVE/FPSIMD endianness conversions

 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(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-06-12 13:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-06 16:45 [PATCH 0/2] arm64/sve: Fix mutating register endianness on big-endian Dave Martin
2019-06-06 16:45 ` [PATCH 1/2] arm64/sve: Factor out FPSIMD to SVE state conversion Dave Martin
2019-06-06 16:45 ` [PATCH 2/2] arm64/sve: Fix missing SVE/FPSIMD endianness conversions Dave Martin
2019-06-07  9:39 ` [PATCH 0/2] arm64/sve: Fix mutating register endianness on big-endian Will Deacon
2019-06-07 15:48   ` Dave Martin
2019-06-11 16:16     ` Alan Hayward
2019-06-11 16:25       ` Dave Martin
2019-06-12 10:40       ` Alex Bennée
2019-06-12 10:59         ` Alan Hayward
2019-06-12 12:47         ` Dave Martin
2019-06-12 13:18           ` Alex Bennée
2019-06-12 13:50             ` Dave Martin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).