Re: Atomic breakage?

2001-01-18 Thread Bruce Evans
On Wed, 17 Jan 2001, Garrett Wollman wrote: On Tue, 16 Jan 2001 19:10:10 -0800, Alfred Perlstein [EMAIL PROTECTED] said: Just wondering, can't you use 'LOCK addl' and then use 'LOCK addc'? add longword, add longword with carry? I know it would be pretty ugly, but it should work, no?

Re: Atomic breakage?

2001-01-17 Thread Garrett Wollman
On Wed, 17 Jan 2001 14:26:54 +1100, Peter Jeremy [EMAIL PROTECTED] said: To support multiple masters, you need proper locks. On older processors, yes. On processors with the CX8 feature bit set, you can do it without any sort of locking (indeed, this is a primitive that semaphores can be

Re: Atomic breakage?

2001-01-17 Thread Garrett Wollman
On Tue, 16 Jan 2001 19:10:10 -0800, Alfred Perlstein [EMAIL PROTECTED] said: Just wondering, can't you use 'LOCK addl' and then use 'LOCK addc'? add longword, add longword with carry? I know it would be pretty ugly, but it should work, no? The two bus cycles are independent, so there is a

Re: Atomic breakage?

2001-01-17 Thread John Baldwin
On 17-Jan-01 Garrett Wollman wrote: On Wed, 17 Jan 2001 14:26:54 +1100, Peter Jeremy [EMAIL PROTECTED] said: To support multiple masters, you need proper locks. On older processors, yes. On processors with the CX8 feature bit set, you can do it without any sort of locking (indeed, this

Re: Atomic breakage?

2001-01-17 Thread Robert Drehmel
In [EMAIL PROTECTED], John Baldwin wrote: Early Pentiums (= P90) don't support CX8 or so I've heard, which make this slightly more complicated, as for a pentium we would have to use a function pointer that we setup during probe. Also, during a SMP boot we would have to panic if CX8 wasn't

Re: Atomic breakage?

2001-01-17 Thread John Baldwin
On 17-Jan-01 Poul-Henning Kamp wrote: In message [EMAIL PROTECTED], Robert Drehmel writes: In [EMAIL PROTECTED], John Baldwin wrote: Early Pentiums (= P90) don't support CX8 or so I've heard, which make this slightly more complicated, as for a pentium we would have to use a function pointer

Re: Atomic breakage?

2001-01-17 Thread Garrett Wollman
On Wed, 17 Jan 2001 10:28:03 -0800 (PST), John Baldwin [EMAIL PROTECTED] said: person was referring to: on Pentiums with stepping 0xc, a cmpxchg8b that crosses a page boundary triggers an illegel opcode fault rather than a page fault if the second page is missing. This is (part of) the

Re: Atomic breakage?

2001-01-17 Thread Peter Jeremy
On 2001-Jan-17 10:43:10 -0500, Garrett Wollman [EMAIL PROTECTED] wrote: On Wed, 17 Jan 2001 14:26:54 +1100, Peter Jeremy [EMAIL PROTECTED] said: To support multiple masters, you need proper locks. On older processors, yes. On processors with the CX8 feature bit set, you can do it without any

Re: Atomic breakage?

2001-01-17 Thread Garrett Wollman
On Thu, 18 Jan 2001 07:06:09 +1100, Peter Jeremy [EMAIL PROTECTED] said: There are SMP machines using both 386 and 486 processors. There is no support in FreeBSD for SMP on pre-Pentium processors. Yes, I well recall the Sequent. I wish for it to remain a memory. -GAWollman To

Re: Atomic breakage?

2001-01-16 Thread Bruce Evans
On Mon, 15 Jan 2001, John Baldwin wrote: On 14-Jan-01 Peter Jeremy wrote: And for BDE's benefit - atomic.h is broken for IA32's with 64-bit longs. (I believe that can be fixed for Pentiums and above using CMPXCHG8B, but I can't test the code). The i386 with 64-bit longs doesn't boot

Re: Atomic breakage?

2001-01-16 Thread Julian Elischer
Bruce Evans wrote: On Mon, 15 Jan 2001, John Baldwin wrote: On 14-Jan-01 Peter Jeremy wrote: And for BDE's benefit - atomic.h is broken for IA32's with 64-bit longs. (I believe that can be fixed for Pentiums and above using CMPXCHG8B, but I can't test the code). The i386 with

Re: Atomic breakage?

2001-01-16 Thread Bruce Evans
On Tue, 16 Jan 2001, Julian Elischer wrote: Bruce Evans wrote: I bother with 64-bit longs whether I need to or not :-). They get used on i386's mainly in old code and interfaces that don't use typedefs. Hopefully 64-bit scalars will never need to be accessed atomically. Too late.

Re: Atomic breakage?

2001-01-16 Thread Alfred Perlstein
* Bruce Evans [EMAIL PROTECTED] [010116 19:03] wrote: On Tue, 16 Jan 2001, Julian Elischer wrote: Bruce Evans wrote: I bother with 64-bit longs whether I need to or not :-). They get used on i386's mainly in old code and interfaces that don't use typedefs. Hopefully 64-bit scalars

Re: Atomic breakage?

2001-01-16 Thread Peter Jeremy
On 2001-Jan-16 19:10:10 -0800, Alfred Perlstein [EMAIL PROTECTED] wrote: * Bruce Evans [EMAIL PROTECTED] [010116 19:03] wrote: These don't use atomic operations (hint: no 64-bit atomic operations are implemented on i386's). If they need to be atomic, then they must use locks. Just wondering,

Re: Atomic breakage?

2001-01-15 Thread John Baldwin
On 14-Jan-01 Peter Jeremy wrote: On 2001-Jan-14 23:02:28 +0200, Mark Murray [EMAIL PROTECTED] wrote: Hi John There seems to be same breakage in the atomic stuff: link_elf: symbol atomic_load_acq_int undefined KLD file random.ko - could not finalize loading I back out the latest commit to

Atomic breakage?

2001-01-14 Thread Mark Murray
Hi John There seems to be same breakage in the atomic stuff: link_elf: symbol atomic_load_acq_int undefined KLD file random.ko - could not finalize loading I back out the latest commit to sys/i386/include/atomic.h, and things work a bit better (on my laptop). M -- Mark Murray Warning: this

Re: Atomic breakage?

2001-01-14 Thread Peter Jeremy
On 2001-Jan-14 23:02:28 +0200, Mark Murray [EMAIL PROTECTED] wrote: Hi John There seems to be same breakage in the atomic stuff: link_elf: symbol atomic_load_acq_int undefined KLD file random.ko - could not finalize loading I back out the latest commit to sys/i386/include/atomic.h, and things

Re: Atomic breakage?

2001-01-14 Thread David O'Brien
On Mon, Jan 15, 2001 at 09:25:45AM +1100, Peter Jeremy wrote: Due to incompatibilities between __asm in different versions of gcc, several different versions of various macros (and expansions) are necessary. Why is that?? The base, and *only* supported compiler for building kernels is GCC

Re: Atomic breakage?

2001-01-14 Thread Peter Jeremy
On 2001-Jan-14 17:05:20 -0800, David O'Brien [EMAIL PROTECTED] wrote: On Mon, Jan 15, 2001 at 09:25:45AM +1100, Peter Jeremy wrote: Due to incompatibilities between __asm in different versions of gcc, several different versions of various macros (and expansions) are necessary. Why is that??