public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [Q] Looking for an emulation for CMOV* instructions.
@ 2002-01-12 10:48 Adam J. Richter
  2002-01-12 11:25 ` David Weinehall
                   ` (2 more replies)
  0 siblings, 3 replies; 40+ messages in thread
From: Adam J. Richter @ 2002-01-12 10:48 UTC (permalink / raw)
  To: hpa, linux-kernel; +Cc: ak

H. Peter Anvin wrote, in response to Andi Kleen:
>You don't need CMPXCHG8B to do efficient inline mutexes.  In fact, the
>pthreads code for i386 uses the same mutexes the kernel does (LOCK INC
>based, I believe), complete with section hacking to make them
>efficiently inlinable -- and then they're put inside a function call.
[...]

	Your comment prompted me to look at
linux-2.5.2-pre11/include/asm-i386/spinlock.h, and I now believe that
the "lock; decb" that it uses for grabbing spinlocks will return an
incorrect success if 255 or more processors are waiting on the same
spinlock.  I don't know if anybody has ever built a shared memory x86
multiprocessor with 257 (not a typo) or more CPU's, but it's possible
to imagine.  It's also possible to imagine this scenario happening
with even just one processor and a preemtable kernel.  I believe that
the current preemtable kernel patch limits the number of preempted
processes to something like four or six, but that's just a temporary
limitation of the current version.

	If we get the point where this scenario really could happen,
then maybe the spin lock counter type should be expanded from one byte
to four.  I think we already assume four byte alignment in
asm-i386/semaphore.h, which uses a four byte count (I think "lock" is
not guaranteed to work across page boundaries).

Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."

^ permalink raw reply	[flat|nested] 40+ messages in thread
[parent not found: <200201111845.g0BIjS2318104@saturn.cs.uml.edu>]
[parent not found: <m26669olcu.fsf@goliath.csn.tu-chemnitz.de.suse.lists.linux.kernel>]
* Re: [Q] Looking for an emulation for CMOV* instructions.
@ 2002-01-11  9:25 willy tarreau
  2002-01-11 17:55 ` Ronald Wahl
  0 siblings, 1 reply; 40+ messages in thread
From: willy tarreau @ 2002-01-11  9:25 UTC (permalink / raw)
  To: Ronald.Wahl; +Cc: linux-kernel

> is it possible to include an emulation for the CMOV*
(and
> possible other i686 instructions) for processors
that dont

I did something similar to emulate 486 instructions
for 386s
(bswap, cmpxchg...). You can reuse it if needed. It's 
available for 2.2 and 2.4 at this location :

http://www-miaif.lip6.fr/willy/linux-patches/486emulation/

Regards,
Willy


___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Courrier : http://courrier.yahoo.fr

^ permalink raw reply	[flat|nested] 40+ messages in thread
* [Q] Looking for an emulation for CMOV* instructions.
@ 2002-01-10 23:08 Ronald Wahl
  2002-01-10 23:28 ` Alan Cox
  2002-01-11 23:25 ` Alistair Riddell
  0 siblings, 2 replies; 40+ messages in thread
From: Ronald Wahl @ 2002-01-10 23:08 UTC (permalink / raw)
  To: linux-kernel

Hallo kernel hackers,

is it possible to include an emulation for the CMOV* (and possible other
i686 instructions) for processors that dont have these (k6, pentium
etc.)? I think this should work like the fpu emulation. Even if its slow
it will allow you to work even if you tried to install a libc for i686
on an older architecture or if you have apps that are statically linked
against such a libc (rpm, e2fschk, etc.).

I found some info on this here:

        http://gwenole.beauchesne.online.fr/basilisk2/

        "... * uae_jit: added CMOV "emulation" for processors that don't
         support them ..."

Maybe this can be of any use to hack it in the kernel?

thanx,
ron

-- 
/\/\  Dipl.-Inf. Ronald Wahl                /\/\        C S N         /\/\
\/\/  ronald.wahl@informatik.tu-chemnitz.de \/\/  ------------------  \/\/
/\/\  http://www.tu-chemnitz.de/~row/       /\/\  network and system  /\/\
\/\/  GnuPG/PGP key available               \/\/    administration    \/\/

^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2002-04-12 20:49 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <fa.eln67tv.a4io16@ifi.uio.no>
     [not found] ` <fa.gp0gofv.1p4se16@ifi.uio.no>
2002-01-11  8:12   ` [Q] Looking for an emulation for CMOV* instructions Giacomo Catenazzi
2002-01-12 10:48 Adam J. Richter
2002-01-12 11:25 ` David Weinehall
2002-01-12 13:18 ` Brian Gerst
2002-01-12 20:43 ` H. Peter Anvin
     [not found] <200201111845.g0BIjS2318104@saturn.cs.uml.edu>
2002-01-12  9:00 ` willy tarreau
2002-01-12 18:57   ` Alan Cox
     [not found] <m26669olcu.fsf@goliath.csn.tu-chemnitz.de.suse.lists.linux.kernel>
     [not found] ` <E16Oocq-0005tX-00@the-village.bc.nu.suse.lists.linux.kernel>
2002-01-11  9:54   ` Andi Kleen
2002-01-12  6:31     ` Pavel Machek
2002-01-12  7:52     ` H. Peter Anvin
  -- strict thread matches above, loose matches on Subject: below --
2002-01-11  9:25 willy tarreau
2002-01-11 17:55 ` Ronald Wahl
2002-01-10 23:08 Ronald Wahl
2002-01-10 23:28 ` Alan Cox
2002-01-11  0:08   ` Ronald Wahl
2002-01-11  0:26     ` Alan Cox
2002-01-11  0:39       ` Ronald Wahl
2002-01-11  0:54         ` Alan Cox
2002-01-11  1:09           ` Martin Eriksson
2002-01-11  1:42             ` Timothy Covell
2002-01-11  2:16             ` Alan Cox
2002-01-11 18:24           ` Ronald Wahl
2002-01-11 22:18           ` Richard Henderson
2002-01-11 23:07             ` Alan Cox
2002-01-11 23:26               ` Albert D. Cahalan
2002-01-11 23:40                 ` Alan Cox
2002-01-16 15:18               ` Jamie Lokier
2002-01-16 16:16                 ` Richard B. Johnson
2002-01-16 17:48                   ` Ronald Wahl
2002-01-16 17:30                 ` Dave Jones
2002-01-17 11:54                 ` Maciej W. Rozycki
2002-01-11 19:59   ` Hans-Peter Jansen
2002-01-11 20:05     ` Ronald Wahl
2002-01-11 23:19       ` Alan Cox
2002-01-12  6:27   ` Pavel Machek
2002-04-12 20:48     ` H. Peter Anvin
2002-01-12  6:34   ` Pavel Machek
2002-01-18 17:38   ` David Woodhouse
2002-01-18 22:01     ` Pavel Machek
2002-01-11 23:25 ` Alistair Riddell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox