From: Paul Burton <paul.burton@imgtec.com>
To: <linux-mips@linux-mips.org>
Cc: Ralf Baechle <ralf@linux-mips.org>, Paul Burton <paul.burton@imgtec.com>
Subject: [PATCH 5/7] MIPS: memcpy: Use ta* instead of manually defining t4-t7
Date: Mon, 7 Nov 2016 11:18:00 +0000 [thread overview]
Message-ID: <20161107111802.12071-6-paul.burton@imgtec.com> (raw)
In-Reply-To: <20161107111802.12071-1-paul.burton@imgtec.com>
Manually defining registers t4-t7 to match the o32 ABI in 64 bit kernels
is at best a dirty hack. Use the generic ta* definitions instead, which
further prepares us for using a standard calling convention.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
---
arch/mips/cavium-octeon/octeon-memcpy.S | 12 ++++--------
arch/mips/lib/memcpy.S | 26 +++++++++++---------------
2 files changed, 15 insertions(+), 23 deletions(-)
diff --git a/arch/mips/cavium-octeon/octeon-memcpy.S b/arch/mips/cavium-octeon/octeon-memcpy.S
index 6f312a2..db49fca 100644
--- a/arch/mips/cavium-octeon/octeon-memcpy.S
+++ b/arch/mips/cavium-octeon/octeon-memcpy.S
@@ -112,10 +112,6 @@
#define t1 $9
#define t2 $10
#define t3 $11
-#define t4 $12
-#define t5 $13
-#define t6 $14
-#define t7 $15
#ifdef CONFIG_CPU_LITTLE_ENDIAN
#define LDFIRST LOADR
@@ -391,7 +387,7 @@ l_exc:
LOAD t0, TI_TASK($28)
LOAD t0, THREAD_BUADDR(t0) # t0 is just past last good address
SUB len, AT, t0 # len number of uncopied bytes
- bnez t7, 2f /* Skip the zeroing out part if inatomic */
+ bnez ta0, 2f /* Skip the zeroing out part if inatomic */
/*
* Here's where we rely on src and dst being incremented in tandem,
* See (3) above.
@@ -473,16 +469,16 @@ EXPORT_SYMBOL(memcpy)
*/
LEAF(__copy_user)
EXPORT_SYMBOL(__copy_user)
- li t7, 0 /* not inatomic */
+ li ta0, 0 /* not inatomic */
__copy_user_common:
__BUILD_COPY_USER COPY_USER_MODE v0
END(__copy_user)
/*
- * t7 is used as a flag to note inatomic mode.
+ * ta0 is used as a flag to note inatomic mode.
*/
LEAF(__copy_user_inatomic)
EXPORT_SYMBOL(__copy_user_inatomic)
b __copy_user_common
- li t7, 1
+ li ta0, 1
END(__copy_user_inatomic)
diff --git a/arch/mips/lib/memcpy.S b/arch/mips/lib/memcpy.S
index 052f7a1..48684c4 100644
--- a/arch/mips/lib/memcpy.S
+++ b/arch/mips/lib/memcpy.S
@@ -172,10 +172,6 @@
#define t1 $9
#define t2 $10
#define t3 $11
-#define t4 $12
-#define t5 $13
-#define t6 $14
-#define t7 $15
#else
@@ -314,8 +310,8 @@
LOAD(t2, UNIT(2)(src), .Ll_exc_copy\@)
LOAD(t3, UNIT(3)(src), .Ll_exc_copy\@)
SUB len, len, 8*NBYTES
- LOAD(t4, UNIT(4)(src), .Ll_exc_copy\@)
- LOAD(t7, UNIT(5)(src), .Ll_exc_copy\@)
+ LOAD(ta0, UNIT(4)(src), .Ll_exc_copy\@)
+ LOAD(ta1, UNIT(5)(src), .Ll_exc_copy\@)
STORE(t0, UNIT(0)(dst), .Ls_exc_p8u\@)
STORE(t1, UNIT(1)(dst), .Ls_exc_p7u\@)
LOAD(t0, UNIT(6)(src), .Ll_exc_copy\@)
@@ -324,8 +320,8 @@
ADD dst, dst, 8*NBYTES
STORE(t2, UNIT(-6)(dst), .Ls_exc_p6u\@)
STORE(t3, UNIT(-5)(dst), .Ls_exc_p5u\@)
- STORE(t4, UNIT(-4)(dst), .Ls_exc_p4u\@)
- STORE(t7, UNIT(-3)(dst), .Ls_exc_p3u\@)
+ STORE(ta0, UNIT(-4)(dst), .Ls_exc_p4u\@)
+ STORE(ta1, UNIT(-3)(dst), .Ls_exc_p3u\@)
STORE(t0, UNIT(-2)(dst), .Ls_exc_p2u\@)
STORE(t1, UNIT(-1)(dst), .Ls_exc_p1u\@)
PREFS( 0, 8*32(src) )
@@ -554,7 +550,7 @@
LOADK t0, THREAD_BUADDR(t0) # t0 is just past last good address
nop
SUB len, AT, t0 # len number of uncopied bytes
- bnez t6, .Ldone\@ /* Skip the zeroing part if inatomic */
+ bnez ta2, .Ldone\@ /* Skip the zeroing part if inatomic */
/*
* Here's where we rely on src and dst being incremented in tandem,
* See (3) above.
@@ -630,7 +626,7 @@ LEAF(memcpy) /* a0=dst a1=src a2=len */
EXPORT_SYMBOL(memcpy)
move v0, dst /* return value */
.L__memcpy:
- li t6, 0 /* not inatomic */
+ li ta2, 0 /* not inatomic */
/* Legacy Mode, user <-> user */
__BUILD_COPY_USER MEMCPY_MODE USEROP USEROP len
END(memcpy)
@@ -648,19 +644,19 @@ EXPORT_SYMBOL(memcpy)
.align 5
LEAF(__copy_user)
EXPORT_SYMBOL(__copy_user)
- li t6, 0 /* not inatomic */
+ li ta2, 0 /* not inatomic */
__copy_user_common:
/* Legacy Mode, user <-> user */
__BUILD_COPY_USER LEGACY_MODE USEROP USEROP v0
END(__copy_user)
/*
- * t6 is used as a flag to note inatomic mode.
+ * ta2 is used as a flag to note inatomic mode.
*/
LEAF(__copy_user_inatomic)
EXPORT_SYMBOL(__copy_user_inatomic)
b __copy_user_common
- li t6, 1
+ li ta2, 1
END(__copy_user_inatomic)
#ifdef CONFIG_EVA
@@ -675,7 +671,7 @@ EXPORT_SYMBOL(__copy_user_inatomic)
LEAF(__copy_user_inatomic_eva)
EXPORT_SYMBOL(__copy_user_inatomic_eva)
b __copy_from_user_common
- li t6, 1
+ li ta2, 1
END(__copy_user_inatomic_eva)
/*
@@ -684,7 +680,7 @@ EXPORT_SYMBOL(__copy_user_inatomic_eva)
LEAF(__copy_from_user_eva)
EXPORT_SYMBOL(__copy_from_user_eva)
- li t6, 0 /* not inatomic */
+ li ta2, 0 /* not inatomic */
__copy_from_user_common:
__BUILD_COPY_USER EVA_MODE USEROP KERNELOP v0
END(__copy_from_user_eva)
--
2.10.2
WARNING: multiple messages have this Message-ID (diff)
From: Paul Burton <paul.burton@imgtec.com>
To: linux-mips@linux-mips.org
Cc: Ralf Baechle <ralf@linux-mips.org>, Paul Burton <paul.burton@imgtec.com>
Subject: [PATCH 5/7] MIPS: memcpy: Use ta* instead of manually defining t4-t7
Date: Mon, 7 Nov 2016 11:18:00 +0000 [thread overview]
Message-ID: <20161107111802.12071-6-paul.burton@imgtec.com> (raw)
Message-ID: <20161107111800.Zmn_z0d_kv12f2m_FxEBZF-5368kDelFWixnRasUeVA@z> (raw)
In-Reply-To: <20161107111802.12071-1-paul.burton@imgtec.com>
Manually defining registers t4-t7 to match the o32 ABI in 64 bit kernels
is at best a dirty hack. Use the generic ta* definitions instead, which
further prepares us for using a standard calling convention.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
---
arch/mips/cavium-octeon/octeon-memcpy.S | 12 ++++--------
arch/mips/lib/memcpy.S | 26 +++++++++++---------------
2 files changed, 15 insertions(+), 23 deletions(-)
diff --git a/arch/mips/cavium-octeon/octeon-memcpy.S b/arch/mips/cavium-octeon/octeon-memcpy.S
index 6f312a2..db49fca 100644
--- a/arch/mips/cavium-octeon/octeon-memcpy.S
+++ b/arch/mips/cavium-octeon/octeon-memcpy.S
@@ -112,10 +112,6 @@
#define t1 $9
#define t2 $10
#define t3 $11
-#define t4 $12
-#define t5 $13
-#define t6 $14
-#define t7 $15
#ifdef CONFIG_CPU_LITTLE_ENDIAN
#define LDFIRST LOADR
@@ -391,7 +387,7 @@ l_exc:
LOAD t0, TI_TASK($28)
LOAD t0, THREAD_BUADDR(t0) # t0 is just past last good address
SUB len, AT, t0 # len number of uncopied bytes
- bnez t7, 2f /* Skip the zeroing out part if inatomic */
+ bnez ta0, 2f /* Skip the zeroing out part if inatomic */
/*
* Here's where we rely on src and dst being incremented in tandem,
* See (3) above.
@@ -473,16 +469,16 @@ EXPORT_SYMBOL(memcpy)
*/
LEAF(__copy_user)
EXPORT_SYMBOL(__copy_user)
- li t7, 0 /* not inatomic */
+ li ta0, 0 /* not inatomic */
__copy_user_common:
__BUILD_COPY_USER COPY_USER_MODE v0
END(__copy_user)
/*
- * t7 is used as a flag to note inatomic mode.
+ * ta0 is used as a flag to note inatomic mode.
*/
LEAF(__copy_user_inatomic)
EXPORT_SYMBOL(__copy_user_inatomic)
b __copy_user_common
- li t7, 1
+ li ta0, 1
END(__copy_user_inatomic)
diff --git a/arch/mips/lib/memcpy.S b/arch/mips/lib/memcpy.S
index 052f7a1..48684c4 100644
--- a/arch/mips/lib/memcpy.S
+++ b/arch/mips/lib/memcpy.S
@@ -172,10 +172,6 @@
#define t1 $9
#define t2 $10
#define t3 $11
-#define t4 $12
-#define t5 $13
-#define t6 $14
-#define t7 $15
#else
@@ -314,8 +310,8 @@
LOAD(t2, UNIT(2)(src), .Ll_exc_copy\@)
LOAD(t3, UNIT(3)(src), .Ll_exc_copy\@)
SUB len, len, 8*NBYTES
- LOAD(t4, UNIT(4)(src), .Ll_exc_copy\@)
- LOAD(t7, UNIT(5)(src), .Ll_exc_copy\@)
+ LOAD(ta0, UNIT(4)(src), .Ll_exc_copy\@)
+ LOAD(ta1, UNIT(5)(src), .Ll_exc_copy\@)
STORE(t0, UNIT(0)(dst), .Ls_exc_p8u\@)
STORE(t1, UNIT(1)(dst), .Ls_exc_p7u\@)
LOAD(t0, UNIT(6)(src), .Ll_exc_copy\@)
@@ -324,8 +320,8 @@
ADD dst, dst, 8*NBYTES
STORE(t2, UNIT(-6)(dst), .Ls_exc_p6u\@)
STORE(t3, UNIT(-5)(dst), .Ls_exc_p5u\@)
- STORE(t4, UNIT(-4)(dst), .Ls_exc_p4u\@)
- STORE(t7, UNIT(-3)(dst), .Ls_exc_p3u\@)
+ STORE(ta0, UNIT(-4)(dst), .Ls_exc_p4u\@)
+ STORE(ta1, UNIT(-3)(dst), .Ls_exc_p3u\@)
STORE(t0, UNIT(-2)(dst), .Ls_exc_p2u\@)
STORE(t1, UNIT(-1)(dst), .Ls_exc_p1u\@)
PREFS( 0, 8*32(src) )
@@ -554,7 +550,7 @@
LOADK t0, THREAD_BUADDR(t0) # t0 is just past last good address
nop
SUB len, AT, t0 # len number of uncopied bytes
- bnez t6, .Ldone\@ /* Skip the zeroing part if inatomic */
+ bnez ta2, .Ldone\@ /* Skip the zeroing part if inatomic */
/*
* Here's where we rely on src and dst being incremented in tandem,
* See (3) above.
@@ -630,7 +626,7 @@ LEAF(memcpy) /* a0=dst a1=src a2=len */
EXPORT_SYMBOL(memcpy)
move v0, dst /* return value */
.L__memcpy:
- li t6, 0 /* not inatomic */
+ li ta2, 0 /* not inatomic */
/* Legacy Mode, user <-> user */
__BUILD_COPY_USER MEMCPY_MODE USEROP USEROP len
END(memcpy)
@@ -648,19 +644,19 @@ EXPORT_SYMBOL(memcpy)
.align 5
LEAF(__copy_user)
EXPORT_SYMBOL(__copy_user)
- li t6, 0 /* not inatomic */
+ li ta2, 0 /* not inatomic */
__copy_user_common:
/* Legacy Mode, user <-> user */
__BUILD_COPY_USER LEGACY_MODE USEROP USEROP v0
END(__copy_user)
/*
- * t6 is used as a flag to note inatomic mode.
+ * ta2 is used as a flag to note inatomic mode.
*/
LEAF(__copy_user_inatomic)
EXPORT_SYMBOL(__copy_user_inatomic)
b __copy_user_common
- li t6, 1
+ li ta2, 1
END(__copy_user_inatomic)
#ifdef CONFIG_EVA
@@ -675,7 +671,7 @@ EXPORT_SYMBOL(__copy_user_inatomic)
LEAF(__copy_user_inatomic_eva)
EXPORT_SYMBOL(__copy_user_inatomic_eva)
b __copy_from_user_common
- li t6, 1
+ li ta2, 1
END(__copy_user_inatomic_eva)
/*
@@ -684,7 +680,7 @@ EXPORT_SYMBOL(__copy_user_inatomic_eva)
LEAF(__copy_from_user_eva)
EXPORT_SYMBOL(__copy_from_user_eva)
- li t6, 0 /* not inatomic */
+ li ta2, 0 /* not inatomic */
__copy_from_user_common:
__BUILD_COPY_USER EVA_MODE USEROP KERNELOP v0
END(__copy_from_user_eva)
--
2.10.2
next prev parent reply other threads:[~2016-11-07 11:20 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-07 11:17 [PATCH 0/7] MIPS: Standard calling convention usercopy & memcpy Paul Burton
2016-11-07 11:17 ` Paul Burton
2016-11-07 11:17 ` [PATCH 1/7] MIPS: lib: Split lib-y to a line per file Paul Burton
2016-11-07 11:17 ` Paul Burton
2016-11-07 11:17 ` [PATCH 2/7] MIPS: lib: Implement memmove in C Paul Burton
2016-11-07 11:17 ` Paul Burton
2016-11-07 11:17 ` [PATCH 3/7] MIPS: memcpy: Split __copy_user & memcpy Paul Burton
2016-11-07 11:17 ` Paul Burton
2016-11-07 11:17 ` [PATCH 4/7] MIPS: memcpy: Return uncopied bytes from __copy_user*() in v0 Paul Burton
2016-11-07 11:17 ` Paul Burton
2016-11-07 11:18 ` Paul Burton [this message]
2016-11-07 11:18 ` [PATCH 5/7] MIPS: memcpy: Use ta* instead of manually defining t4-t7 Paul Burton
2016-11-07 11:18 ` [PATCH 6/7] MIPS: memcpy: Use a3/$7 for source end address Paul Burton
2016-11-07 11:18 ` Paul Burton
2016-11-14 14:47 ` Maciej W. Rozycki
2016-11-14 14:47 ` Maciej W. Rozycki
2016-11-07 11:18 ` [PATCH 7/7] MIPS: uaccess: Use standard __user_copy* function calls Paul Burton
2016-11-07 11:18 ` Paul Burton
2017-06-27 22:33 ` James Hogan
2017-06-27 22:33 ` James Hogan
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=20161107111802.12071-6-paul.burton@imgtec.com \
--to=paul.burton@imgtec.com \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.