linux-mips
[Top] [All Lists]

Re: [PATCH 15/15] mips: save/restore MSA context around signals

To: Paul Burton <paul.burton@imgtec.com>
Subject: Re: [PATCH 15/15] mips: save/restore MSA context around signals
From: David Daney <ddaney.cavm@gmail.com>
Date: Mon, 27 Jan 2014 11:50:31 -0800
Cc: linux-mips@linux-mips.org
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=gcGLduVWO1v8BE9KSP+08zC5rSqEStLmf7RwNOE1Xaw=; b=V518OztJq3cyGnjnFEvYVzv70gFrxXZa0W6SFaUKg8m5nuh5Ei3gln9UgM9iuzTpag e6jlasuzYdiNxa9OJCe/zXh0gKGEOg5sispKT46yYBrhb0C1zqIe2cUoA+hK208y2v9k W4c9SMAnZT++WI65V0Q/bf/uQaE7YVJXgqB8mR9Q5Nt6PllEx3DwynnUSYUosYL/Q9Qb 9J0OpqjhnTVZr3stdWV2Bra6ysDAzDBfL/ombrO6zHWqbbll7iWPzSXtwPp/I3VSB0w/ UetlgxX8yYZ9lI92bTtZq8839Qpp/XCn+k+UrnVi92IE0stcSkPbRPEz7R55Q4E93YqC OJOw==
In-reply-to: <1390836194-26286-16-git-send-email-paul.burton@imgtec.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1390836194-26286-1-git-send-email-paul.burton@imgtec.com> <1390836194-26286-16-git-send-email-paul.burton@imgtec.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7
On 01/27/2014 07:23 AM, Paul Burton wrote:
This patch extends sigcontext in order to hold the most significant 64
bits of each vector register in addition to the MSA control & status
register. The least significant 64 bits are already saved as the scalar
FP context. This makes things a little awkward since the least & most
significant 64 bits of each vector register are not contiguous in
memory. Thus the copy_u & insert instructions are used to transfer the
values of the most significant 64 bits via GP registers.


Interesting.

This very much touches the userspace ABI of the kernel, so it merits very careful consideration.


Signed-off-by: Paul Burton <paul.burton@imgtec.com>
---
  arch/mips/include/asm/sigcontext.h      |   2 +
  arch/mips/include/uapi/asm/sigcontext.h |   8 ++
  arch/mips/kernel/asm-offsets.c          |   3 +
  arch/mips/kernel/r4k_fpu.S              | 213 ++++++++++++++++++++++++++++++++
  arch/mips/kernel/signal.c               |  71 +++++++++--
  arch/mips/kernel/signal32.c             |  71 +++++++++--
  6 files changed, 352 insertions(+), 16 deletions(-)

[...]
diff --git a/arch/mips/include/uapi/asm/sigcontext.h 
b/arch/mips/include/uapi/asm/sigcontext.h
index 6c9906f..681c176 100644
--- a/arch/mips/include/uapi/asm/sigcontext.h
+++ b/arch/mips/include/uapi/asm/sigcontext.h
@@ -12,6 +12,10 @@
  #include <linux/types.h>
  #include <asm/sgidefs.h>

+/* Bits which may be set in sc_used_math */
+#define USEDMATH_FP    (1 << 0)
+#define USEDMATH_MSA   (1 << 1)
+

How is this going to interact with existing userspace applications?

Is the current behavior to use / manipulate sc_used_math?

How will USEDMATH_MSA interact with existing code?




<Prev in Thread] Current Thread [Next in Thread>