From: Ralf Baechle <ralf@linux-mips.org>
To: Yoichi Yuasa <yoichi_yuasa@montavista.co.jp>
Cc: linux-mips@linux-mips.org, jsun@mvista.com
Subject: Re: [patch] simulate_ll and simulate_sc(resend)
Date: Tue, 4 Mar 2003 21:36:05 +0100 [thread overview]
Message-ID: <20030304213605.A17855@linux-mips.org> (raw)
In-Reply-To: <20030303192137.34d21352.yoichi_yuasa@montavista.co.jp>; from yoichi_yuasa@montavista.co.jp on Mon, Mar 03, 2003 at 07:21:37PM +0900
On Mon, Mar 03, 2003 at 07:21:37PM +0900, Yoichi Yuasa wrote:
> I found a bug in simulate_ll and simulate_sc.
> The board that uses ll/sc emulation is not started.
>
> When send_sig in these, in order not to operate the value of EPC correctly,
> simulate_* happens continuously.
>
> The previous patches were not perfect, I changed more.
> Please apply these patches to CVS tree.
As previously mentioned there were some problems with your fix, so I
wrote an alternative fix which is attached below. It's untested because
I don't have any ll/sc-less test platform.
Ralf
Index: arch/mips/kernel/traps.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/kernel/traps.c,v
retrieving revision 1.99.2.41
diff -u -r1.99.2.41 traps.c
--- arch/mips/kernel/traps.c 10 Feb 2003 22:50:48 -0000 1.99.2.41
+++ arch/mips/kernel/traps.c 4 Mar 2003 20:32:10 -0000
@@ -134,13 +134,14 @@
ll_bit = 0;
}
ll_task = current;
+
regs->regs[(opcode & RT) >> 16] = value;
compute_return_epc(regs);
return;
sig:
- send_sig(signal, current, 1);
+ force_sig(signal, current);
}
static inline void simulate_sc(struct pt_regs *regs, unsigned int opcode)
@@ -172,19 +173,21 @@
}
if (ll_bit == 0 || ll_task != current) {
regs->regs[reg] = 0;
- goto sig;
+ return;
}
- if (put_user(regs->regs[reg], vaddr))
+ if (put_user(regs->regs[reg], vaddr)) {
signal = SIGSEGV;
- else
- regs->regs[reg] = 1;
+ goto sig;
+ }
+
+ regs->regs[reg] = 1;
compute_return_epc(regs);
return;
sig:
- send_sig(signal, current, 1);
+ force_sig(signal, current);
}
/*
next prev parent reply other threads:[~2003-03-04 20:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-03 10:21 [patch] simulate_ll and simulate_sc(resend) Yoichi Yuasa
2003-03-04 12:07 ` Ralf Baechle
2003-03-04 20:36 ` Ralf Baechle [this message]
2003-03-06 7:53 ` Yoichi Yuasa
2003-03-10 3:41 ` Yoichi Yuasa
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=20030304213605.A17855@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=jsun@mvista.com \
--cc=linux-mips@linux-mips.org \
--cc=yoichi_yuasa@montavista.co.jp \
/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