* [PATCH] make prepare_frametrace() not clobber v0
@ 2006-08-29 3:10 Atsushi Nemoto
2006-08-29 7:31 ` Franck Bui-Huu
0 siblings, 1 reply; 2+ messages in thread
From: Atsushi Nemoto @ 2006-08-29 3:10 UTC (permalink / raw)
To: linux-mips; +Cc: ralf, vagabon.xyz
Since lmo commit 323a380bf9e1a1679a774a2b053e3c1f2aa3f179 ("Simplify
dump_stack()") made prepare_frametrace() always inlined, using $2 (v0)
in __asm__ is not safe anymore. We can use $1 (at) instead. Also we
should use "dla" instead of "la" for 64-bit kernel.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
traps.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index ab77034..e51d8fd 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -161,16 +161,20 @@ static void show_stacktrace(struct task_
static __always_inline void prepare_frametrace(struct pt_regs *regs)
{
__asm__ __volatile__(
- "1: la $2, 1b\n\t"
+ ".set push\n\t"
+ ".set noat\n\t"
#ifdef CONFIG_64BIT
- "sd $2, %0\n\t"
+ "1: dla $1, 1b\n\t"
+ "sd $1, %0\n\t"
"sd $29, %1\n\t"
"sd $31, %2\n\t"
#else
- "sw $2, %0\n\t"
+ "1: la $1, 1b\n\t"
+ "sw $1, %0\n\t"
"sw $29, %1\n\t"
"sw $31, %2\n\t"
#endif
+ ".set pop\n\t"
: "=m" (regs->cp0_epc),
"=m" (regs->regs[29]), "=m" (regs->regs[31])
: : "memory");
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] make prepare_frametrace() not clobber v0
2006-08-29 3:10 [PATCH] make prepare_frametrace() not clobber v0 Atsushi Nemoto
@ 2006-08-29 7:31 ` Franck Bui-Huu
0 siblings, 0 replies; 2+ messages in thread
From: Franck Bui-Huu @ 2006-08-29 7:31 UTC (permalink / raw)
To: Atsushi Nemoto; +Cc: linux-mips, ralf, vagabon.xyz
Atsushi Nemoto wrote:
> Since lmo commit 323a380bf9e1a1679a774a2b053e3c1f2aa3f179 ("Simplify
> dump_stack()") made prepare_frametrace() always inlined, using $2 (v0)
> in __asm__ is not safe anymore. We can use $1 (at) instead. Also we
Thanks, good catch !
Franck
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-08-29 7:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-29 3:10 [PATCH] make prepare_frametrace() not clobber v0 Atsushi Nemoto
2006-08-29 7:31 ` Franck Bui-Huu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox