linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Dave Martin <Dave.Martin@arm.com>
To: linux-arm-kernel@lists.infradead.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	gdb@sourceware.org, "Alan Hayward" <alan.hayward@arm.com>,
	"Will Deacon" <will.deacon@arm.com>,
	"Zhang Lei" <zhang.lei@jp.fujitsu.com>,
	"Julien Grall" <julien.grall@arm.com>,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	"Alex Bennée" <alex.bennee@linaro.org>
Subject: [PATCH v2 0/3] arm64/sve: Fix mutating register endianness on big-endian
Date: Wed, 12 Jun 2019 17:00:31 +0100	[thread overview]
Message-ID: <1560355234-25516-1-git-send-email-Dave.Martin@arm.com> (raw)

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

-- 
2.1.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2019-06-12 16:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-12 16:00 Dave Martin [this message]
2019-06-12 16:00 ` [PATCH v2 1/3] arm64/sve: Fix missing SVE/FPSIMD endianness conversions Dave Martin
2019-06-12 17:28   ` Will Deacon
2019-06-27 13:51     ` Catalin Marinas
2019-06-27 15:18       ` Dave Martin
2019-06-12 17:46   ` Julien Grall
2019-06-13  9:22     ` Will Deacon
2019-06-13 10:00     ` Dave Martin
2019-06-13 10:17       ` Will Deacon
2019-06-13 10:20         ` Dave Martin
2019-06-12 16:00 ` [PATCH v2 2/3] arm64/sve: Factor out FPSIMD to SVE state conversion Dave Martin
2019-06-20 13:45   ` Julien Grall
2019-07-22 10:31   ` Catalin Marinas
2019-06-12 16:00 ` [PATCH v2 3/3] arm64/sve: Fix a couple of magic numbers for the Z-reg count Dave Martin
2019-06-20 13:43   ` Julien Grall
2019-07-22 10:32   ` Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1560355234-25516-1-git-send-email-Dave.Martin@arm.com \
    --to=dave.martin@arm.com \
    --cc=alan.hayward@arm.com \
    --cc=alex.bennee@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=gdb@sourceware.org \
    --cc=julien.grall@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=peter.maydell@linaro.org \
    --cc=will.deacon@arm.com \
    --cc=zhang.lei@jp.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).