From: David Daney <david.daney@cavium.com>
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Cc: linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [PATCH] MIPS: SMTC: Correct saving of CP0_STATUS
Date: Mon, 29 Aug 2011 16:45:20 -0700 [thread overview]
Message-ID: <4E5C2490.6040203@cavium.com> (raw)
In-Reply-To: <20110829232029.GA15763@zapo>
[-- Attachment #1: Type: text/plain, Size: 481 bytes --]
On 08/29/2011 04:20 PM, Edgar E. Iglesias wrote:
> Hi,
>
> Commit 362e696428590f7d0a5d0971a2d04b0372a761b8
> reorders a bunch of insns to improve the flow of the pipeline but
> for MT_SMTC kernels, AFAICT, the saving of CP0_STATUS seems wrong.
Indeed.
>
> Am I missing something?
>
It does look like in the MIPS_MT_SMTC case we are clobbering the value
in v1.
> If not here is a patch, tested with qemu.
>
How about the attached completely untested one instead?
David Daney
[-- Attachment #2: 0001-MIPS-Don-t-clobber-CP0_STATUS-vaue-for-CONFIG_MIPS_M.patch --]
[-- Type: text/plain, Size: 967 bytes --]
>From d0035295ae34bcf84d601b1e25e2642fe0802752 Mon Sep 17 00:00:00 2001
From: David Daney <david.daney@cavium.com>
Date: Mon, 29 Aug 2011 16:42:12 -0700
Subject: [PATCH] MIPS: Don't clobber CP0_STATUS vaue for CONFIG_MIPS_MT_SMTC
Untested, but it looks nice.
Reported-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: David Daney <david.daney@cavium.com>
---
arch/mips/include/asm/stackframe.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/mips/include/asm/stackframe.h b/arch/mips/include/asm/stackframe.h
index 569681e..51a3a0c 100644
--- a/arch/mips/include/asm/stackframe.h
+++ b/arch/mips/include/asm/stackframe.h
@@ -195,9 +195,9 @@
* to cover the pipeline delay.
*/
.set mips32
- mfc0 v1, CP0_TCSTATUS
+ mfc0 k0, CP0_TCSTATUS
.set mips0
- LONG_S v1, PT_TCSTATUS(sp)
+ LONG_S k0, PT_TCSTATUS(sp)
#endif /* CONFIG_MIPS_MT_SMTC */
LONG_S $4, PT_R4(sp)
LONG_S $5, PT_R5(sp)
--
1.7.2.3
WARNING: multiple messages have this Message-ID (diff)
From: David Daney <david.daney@cavium.com>
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Cc: linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [PATCH] MIPS: SMTC: Correct saving of CP0_STATUS
Date: Mon, 29 Aug 2011 16:45:20 -0700 [thread overview]
Message-ID: <4E5C2490.6040203@cavium.com> (raw)
Message-ID: <20110829234520.A521dnOMOl2aQ7pdMe0MNfbOBZwWKxceIShIcs8f2xM@z> (raw)
In-Reply-To: <20110829232029.GA15763@zapo>
[-- Attachment #1: Type: text/plain, Size: 481 bytes --]
On 08/29/2011 04:20 PM, Edgar E. Iglesias wrote:
> Hi,
>
> Commit 362e696428590f7d0a5d0971a2d04b0372a761b8
> reorders a bunch of insns to improve the flow of the pipeline but
> for MT_SMTC kernels, AFAICT, the saving of CP0_STATUS seems wrong.
Indeed.
>
> Am I missing something?
>
It does look like in the MIPS_MT_SMTC case we are clobbering the value
in v1.
> If not here is a patch, tested with qemu.
>
How about the attached completely untested one instead?
David Daney
[-- Attachment #2: 0001-MIPS-Don-t-clobber-CP0_STATUS-vaue-for-CONFIG_MIPS_M.patch --]
[-- Type: text/plain, Size: 966 bytes --]
From d0035295ae34bcf84d601b1e25e2642fe0802752 Mon Sep 17 00:00:00 2001
From: David Daney <david.daney@cavium.com>
Date: Mon, 29 Aug 2011 16:42:12 -0700
Subject: [PATCH] MIPS: Don't clobber CP0_STATUS vaue for CONFIG_MIPS_MT_SMTC
Untested, but it looks nice.
Reported-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: David Daney <david.daney@cavium.com>
---
arch/mips/include/asm/stackframe.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/mips/include/asm/stackframe.h b/arch/mips/include/asm/stackframe.h
index 569681e..51a3a0c 100644
--- a/arch/mips/include/asm/stackframe.h
+++ b/arch/mips/include/asm/stackframe.h
@@ -195,9 +195,9 @@
* to cover the pipeline delay.
*/
.set mips32
- mfc0 v1, CP0_TCSTATUS
+ mfc0 k0, CP0_TCSTATUS
.set mips0
- LONG_S v1, PT_TCSTATUS(sp)
+ LONG_S k0, PT_TCSTATUS(sp)
#endif /* CONFIG_MIPS_MT_SMTC */
LONG_S $4, PT_R4(sp)
LONG_S $5, PT_R5(sp)
--
1.7.2.3
next prev parent reply other threads:[~2011-08-29 23:45 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-29 23:20 [PATCH] MIPS: SMTC: Correct saving of CP0_STATUS Edgar E. Iglesias
2011-08-29 23:45 ` David Daney [this message]
2011-08-29 23:45 ` David Daney
2011-08-29 23:53 ` David Daney
2011-08-29 23:55 ` Kevin D. Kissell
2011-08-30 0:14 ` David Daney
2011-08-30 0:35 ` Kevin D. Kissell
2011-08-30 11:16 ` Edgar E. Iglesias
2011-08-30 16:54 ` Kevin D. Kissell
2011-09-14 15:12 ` Ralf Baechle
2011-09-14 18:20 ` Kevin D. Kissell
2011-08-30 5:57 ` Edgar E. Iglesias
2011-09-15 16:00 ` Ralf Baechle
2011-09-17 1:23 ` Edgar E. Iglesias
2011-09-17 2:00 ` Ralf Baechle
2011-09-17 2:08 ` Edgar E. Iglesias
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=4E5C2490.6040203@cavium.com \
--to=david.daney@cavium.com \
--cc=edgar.iglesias@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox