Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Jun Sun <jsun@mvista.com>
To: "H . J . Lu" <hjl@lucon.org>
Cc: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>, linux-mips@oss.sgi.com
Subject: Re: A new mips toolchain is available
Date: Wed, 13 Jun 2001 11:48:15 -0700	[thread overview]
Message-ID: <3B27B56F.65BAE189@mvista.com> (raw)
In-Reply-To: 20010613084416.A10334@lucon.org

[-- Attachment #1: Type: text/plain, Size: 1376 bytes --]

"H . J . Lu" wrote:
> 
> On Wed, Jun 13, 2001 at 05:39:08PM +0200, Maciej W. Rozycki wrote:
> > On Wed, 13 Jun 2001, H . J . Lu wrote:
> >
> > > I don't have problem with 2.4.0-test11. It is the change in 2.4.3
> > > which breaks glibc.
> >
> >  You mean someone changed sysmips() in an incompatible way?  Aaarghh...
> 
> I don't remeber the detail, it is eithet kernel crash or glibc crash.
> I switched to mips II for glibc as the result.
> 
> H.J.

The latest CVS tree removed MIPS_ATOMIC_SET for CPUs without ll/sc.  See the
diff below.

RCS file: /cvs/linux/arch/mips/kernel/sysmips.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -r1.17 -r1.18
77a78
> #ifdef CONFIG_CPU_HAS_LLSC
120a122,124
> #else
>       printk("sys_sysmips(MIPS_ATOMIC_SET, ...) not ready for !CONFIG_CPU_HAS_LLSC\n");
> #endif

However the log says:

date: 2001/04/08 13:24:27;  author: ralf;  state: Exp;  lines: +4 -0
Fix ll/sc emulation.  Extracted from Linux-VR tree by Harald.

It seems that the checkin is a mistake because apparently it is not what
linux-vr is doing.  They used to have a piece of code for CPUs without ll/sc. 
And recently they moved to ll/sc instruction emulation.

Ralf, the following patch includes the original vr code for MIPS_ATOMIC_SET,
no ll/sc case.  Although we all know it is buggy (for small negative set
values), it is still better than nothing.

Jun

[-- Attachment #2: junk --]
[-- Type: text/plain, Size: 998 bytes --]

diff -Nru sysmips.c.orig sysmips.c
--- sysmips.c.orig	Wed Jun 13 11:32:09 2001
+++ sysmips.c	Wed Jun 13 11:46:06 2001
@@ -120,7 +120,23 @@
 			: "r" (&cmd));
 		/* Unreached */
 #else
-	printk("sys_sysmips(MIPS_ATOMIC_SET, ...) not ready for !CONFIG_CPU_HAS_LLSC\n");
+               /* this is handled in assembly now */
+               panic("Unexpected MIPS_ATOMIC_SET call in sys_sysmips()");
+#else
+               int flags;
+
+               /* without ll/sc, we have a broken code that kind of works */
+                /* This is broken in case of page faults and SMP ...
+                   Risc/OS fauls after maximum 20 tries with EAGAIN.  */
+                p = (int *) arg1;
+                retval = verify_area(VERIFY_WRITE, p, sizeof(*p));
+                if (retval)
+                        goto out;
+                save_and_cli(flags);
+                retval = *p;
+                *p = arg2;
+                restore_flags(flags);
+                goto out;
 #endif
 	}
 

  reply	other threads:[~2001-06-13 19:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-12  4:03 A new mips toolchain is available H . J . Lu
2001-06-12 11:39 ` Ralf Baechle
2001-06-12 16:40   ` H . J . Lu
2001-06-12 19:11     ` Ralf Baechle
2001-06-12 19:38       ` H . J . Lu
2001-06-13  7:57 ` Maciej W. Rozycki
2001-06-13 15:08   ` H . J . Lu
2001-06-13 15:22     ` Maciej W. Rozycki
2001-06-13 15:24       ` H . J . Lu
2001-06-13 15:39         ` Maciej W. Rozycki
2001-06-13 15:44           ` H . J . Lu
2001-06-13 18:48             ` Jun Sun [this message]
2001-06-13 20:55               ` Harald Koerfgen
2001-06-14 10:26                 ` Maciej W. Rozycki

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=3B27B56F.65BAE189@mvista.com \
    --to=jsun@mvista.com \
    --cc=hjl@lucon.org \
    --cc=linux-mips@oss.sgi.com \
    --cc=macro@ds2.pg.gda.pl \
    /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