Skip to contentSkip to conversation

2.4.20-pa27 64bits smp problem!

parisc-linux Joel Soete 5 participants 24 messages Feb 26, 2003 – Feb 28, 2003

lore
Share & tools
lore

Joel Soete

author
#0 lore raw

Hi Dave,

Quoted 17 lines

-- Original Message --
Subject: Re: [parisc-linux] 2.4.20-pa27 64bits smp problem!
To: [email protected] (Joel Soete)
From: "John David Anglin" <[email protected]>
Cc: [email protected], [email protected]
Date: Tue, 25 Feb 2003 13:50:04 -0500 (EST)

Quoted 4 lines

int main(int argc, char * * argv, char * * env) {

    spinlock_t MySpinLock __attribute__((__aligned__(64))) =SPIN_LOCK_UNLOCKED;
    rwlock_t MyRWLock __attribute__((__aligned__(64))) = RW_LOCK_UNLOCKED;

This does not work. The aligned attribute doesn't work for automatic variables and never has. Structures allocated on the stack are allocated with alignment BIGGEST_ALIGNMENT. This should be a FAQ.

Quoted 8 lines

BIGGEST_ALIGNMENT is 128 bits on the 64-bit ports. It is 64 on the 32-bit port. It is 128 in debian gcc 3.0.4 but this broke the hpux ABI regarding the placement of long doubles in structures. Thus, this change was reverted the GCC CVS source.

Spinlocks on PA 2.0 machines don't need special alignment, although you may want to keep them in separate cache lines.

Sorry in advance if I missunderstood.

Ok, ow the test case which actually reproduce the problem is:
#include <stdio.h>

typedef struct {
        volatile unsigned int lock;
        volatile unsigned long owner_pc;
        volatile unsigned long owner_cpu;
} spinlock_t;

#define SPIN_LOCK_UNLOCKED (spinlock_t) { 1 }

typedef struct {
        spinlock_t lock;
        volatile int counter;
} rwlock_t;

#define RW_LOCK_UNLOCKED (rwlock_t) { SPIN_LOCK_UNLOCKED, 0 }

spinlock_t MySpinLock __attribute__((__aligned__(64))) =SPIN_LOCK_UNLOCKED; rwlock_t MyRWLock __attribute__((__aligned__(64))) = RW_LOCK_UNLOCKED;

int main(int argc, char * * argv, char * * env) {

    printf("MySpinLock->lock: %d\n", MySpinLock.lock);

    printf("MySpinLock->owner_pc: %d\n", MySpinLock.owner_pc);

    printf("MySpinLock->owner_cpu: %d\n", MySpinLock.owner_cpu);

    printf("MyRWLock->lock->lock: %d\n", MyRWLock.lock.lock);

    printf("MyRWLock->lock->owner_pc: %d\n", MyRWLock.lock.owner_pc);

    printf("MyRWLock->lock->owner_cpu: %d\n", MyRWLock.lock.owner_cpu);

    printf("MyRWLock->counter: %d\n", MyRWLock.counter);

    return 0;
}

Would I have to open a bug report near gcc with this one?

Quoted 5 lines

Dave
--
J. David Anglin [email protected]
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
_______________________________________________

Thanks again,
Joel

---------------------------------
Vous surfez avec une ligne classique ?
Faites des economies avec Tiscali Complete
... Plus d'info sur http://complete.tiscali.be

#1 lore raw
Quoted 1 line

Would I have to open a bug report near gcc with this one?

You mean for the errors:

joel.c:19: error: initializer element is not constant joel.c:19: error: (near initialization for `MyRWLock') joel.c:19: error: initializer element is not constant

No, fix the code. I don't believe you will win this one. This feature (extension) was deliberately removed from GCC.

Dave

Signature · 2 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)
#2 lore raw
Quoted 10 lines · John David Anglin
Quoted 1 line

Would I have to open a bug report near gcc with this one?

You mean for the errors:

joel.c:19: error: initializer element is not constant joel.c:19: error: (near initialization for `MyRWLock') joel.c:19: error: initializer element is not constant

No, fix the code. I don't believe you will win this one. This feature (extension) was deliberately removed from GCC.

I think it was an error to do so. I do not see how

	(spinlock_t) { 1 }

is any more or less constant than

	{ 1 }

Removing this extension is a bad idea because it removes the ability to do typechecking. For example,

	rwlock_t lock = SPIN_LOCK_INIT;

would throw an error with a cast and not without.

Signature · 3 lines
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk
#3 lore raw
In reply to John David Anglin
Quoted 10 lines · John David Anglin
Quoted 1 line

Would I have to open a bug report near gcc with this one?

You mean for the errors:

joel.c:19: error: initializer element is not constant joel.c:19: error: (near initialization for `MyRWLock') joel.c:19: error: initializer element is not constant

No, fix the code. I don't believe you will win this one. This feature (extension) was deliberately removed from GCC.

I think it was an error to do so. I do not see how

	(spinlock_t) { 1 }

is any more or less constant than

	{ 1 }

Removing this extension is a bad idea because it removes the ability to do typechecking. For example,

	rwlock_t lock = SPIN_LOCK_INIT;

would throw an error with a cast and not without.

Signature · 3 lines
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk
#4 lore raw

Matthew Wilcox <[email protected]> writes:

|> On Wed, Feb 26, 2003 at 01:58:57PM -0500, John David Anglin wrote:
|> > > Would I have to open a bug report near gcc with this one?
|> > 
|> > You mean for the errors:
|> > 
|> > joel.c:19: error: initializer element is not constant
|> > joel.c:19: error: (near initialization for `MyRWLock')
|> > joel.c:19: error: initializer element is not constant
|> > 
|> > No, fix the code.  I don't believe you will win this one.  This
|> > feature (extension) was deliberately removed from GCC.
|> 
|> I think it was an error to do so.  I do not see how
|> 
|> 	(spinlock_t) { 1 }
|> 
|> is any more or less constant than
|> 
|> 	{ 1 }

A compound literal is not a constant, but an unnamed object.

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#5 lore raw
In reply to Matthew Wilcox

Matthew Wilcox <[email protected]> writes:

|> On Wed, Feb 26, 2003 at 01:58:57PM -0500, John David Anglin wrote:
|> > > Would I have to open a bug report near gcc with this one?
|> > 
|> > You mean for the errors:
|> > 
|> > joel.c:19: error: initializer element is not constant
|> > joel.c:19: error: (near initialization for `MyRWLock')
|> > joel.c:19: error: initializer element is not constant
|> > 
|> > No, fix the code.  I don't believe you will win this one.  This
|> > feature (extension) was deliberately removed from GCC.
|> 
|> I think it was an error to do so.  I do not see how
|> 
|> 	(spinlock_t) { 1 }
|> 
|> is any more or less constant than
|> 
|> 	{ 1 }

A compound literal is not a constant, but an unnamed object.

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#6 lore raw
In reply to Matthew Wilcox
Quoted 18 lines · John David Anglin
Quoted 10 lines
Quoted 1 line

Would I have to open a bug report near gcc with this one?

You mean for the errors:

joel.c:19: error: initializer element is not constant joel.c:19: error: (near initialization for `MyRWLock') joel.c:19: error: initializer element is not constant

No, fix the code. I don't believe you will win this one. This feature (extension) was deliberately removed from GCC.

I think it was an error to do so. I do not see how

	(spinlock_t) { 1 }

is any more or less constant than

Quoted 8 lines
	{ 1 }

Removing this extension is a bad idea because it removes the ability to do typechecking. For example,

	rwlock_t lock = SPIN_LOCK_INIT;

would throw an error with a cast and not without.

GCC allows the above cast. What is not ok is a non-arithmentic cast operator within an arithmetic constant expression (initializer). In ISO C, cast operators in an arithmetic constant expression shall only convert arithmetic types to arithmetic types, except as part of an operand to the sizeof operator. See section 6.6 in the ISO C standard.

Joel's example contained a non-arithmetic cast within an arithmetic expression. Possibly, GCC could have continued to allow casts to aggregate types, but a decision was made not to. I know glibc has had to adapt similar code.

Dave

Signature · 2 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)
#7 lore raw
In reply to Matthew Wilcox
Quoted 18 lines · John David Anglin
Quoted 10 lines
Quoted 1 line

Would I have to open a bug report near gcc with this one?

You mean for the errors:

joel.c:19: error: initializer element is not constant joel.c:19: error: (near initialization for `MyRWLock') joel.c:19: error: initializer element is not constant

No, fix the code. I don't believe you will win this one. This feature (extension) was deliberately removed from GCC.

I think it was an error to do so. I do not see how

	(spinlock_t) { 1 }

is any more or less constant than

Quoted 8 lines
	{ 1 }

Removing this extension is a bad idea because it removes the ability to do typechecking. For example,

	rwlock_t lock = SPIN_LOCK_INIT;

would throw an error with a cast and not without.

GCC allows the above cast. What is not ok is a non-arithmentic cast operator within an arithmetic constant expression (initializer). In ISO C, cast operators in an arithmetic constant expression shall only convert arithmetic types to arithmetic types, except as part of an operand to the sizeof operator. See section 6.6 in the ISO C standard.

Joel's example contained a non-arithmetic cast within an arithmetic expression. Possibly, GCC could have continued to allow casts to aggregate types, but a decision was made not to. I know glibc has had to adapt similar code.

Dave

Signature · 2 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)
#8 lore raw

"John David Anglin" <[email protected]> writes:

|> > I think it was an error to do so.  I do not see how
|> > 
|> > 	(spinlock_t) { 1 }
|> > 
|> > is any more or less constant than
|> > 
|> > 	{ 1 }
|> > 
|> > Removing this extension is a bad idea because it removes the ability to
|> > do typechecking.  For example,
|> > 
|> > 	rwlock_t lock = SPIN_LOCK_INIT;
|> > 
|> > would throw an error with a cast and not without.
|> 
|> GCC allows the above cast.

This is not a cast, it's a compound literal.

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#9 lore raw
In reply to John David Anglin

"John David Anglin" <[email protected]> writes:

|> > I think it was an error to do so.  I do not see how
|> > 
|> > 	(spinlock_t) { 1 }
|> > 
|> > is any more or less constant than
|> > 
|> > 	{ 1 }
|> > 
|> > Removing this extension is a bad idea because it removes the ability to
|> > do typechecking.  For example,
|> > 
|> > 	rwlock_t lock = SPIN_LOCK_INIT;
|> > 
|> > would throw an error with a cast and not without.
|> 
|> GCC allows the above cast.

This is not a cast, it's a compound literal.

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
#10 lore raw
Quoted 1 line

This is not a cast, it's a compound literal.

You of course are correct. However, the GCC documentation says:

ISO C99 supports compound literals. A compound literal looks like a cast containing an initializer. Its value is an object of the type specified in the cast, containing the elements specified in the initializer; it is an lvalue. As an extension, GCC supports compound literals in C89 mode and in C++.

Compound literals for scalar types and union types are is also allowed, but then the compound literal is equivalent to a cast.

As a GNU extension, GCC allows initialization of objects with static storage duration by compound literals (which is not possible in ISO C99, because the initializer is not a constant).
It is handled as if the object was initialized only with the bracket enclosed list if compound literal's and object types match.
The initializer list of the compound literal must be constant.

So, the basic point is that the nesting of compound literals isn't allowed because they are not a constant. Cast operators in the initializer portion of a compound literal can only convert arithmetic types to arithmentic types, except as noted for the sizeof operator.

Unless you use the capability of compound literals to coerce to a pointer to its first element, it doesn't appear that there is much benefit in using compound literals for non-automatic data.

In Joel's case, the initializer only needs to contain constant expressions and doesn't require a construction, even when the define for RW_LOCK_UNLOCKED is done as a compound literal.

Dave

Signature · 2 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)
#11 lore raw
In reply to Andreas Schwab
Quoted 1 line

This is not a cast, it's a compound literal.

You of course are correct. However, the GCC documentation says:

ISO C99 supports compound literals. A compound literal looks like a cast containing an initializer. Its value is an object of the type specified in the cast, containing the elements specified in the initializer; it is an lvalue. As an extension, GCC supports compound literals in C89 mode and in C++.

Compound literals for scalar types and union types are is also allowed, but then the compound literal is equivalent to a cast.

As a GNU extension, GCC allows initialization of objects with static storage duration by compound literals (which is not possible in ISO C99, because the initializer is not a constant).
It is handled as if the object was initialized only with the bracket enclosed list if compound literal's and object types match.
The initializer list of the compound literal must be constant.

So, the basic point is that the nesting of compound literals isn't allowed because they are not a constant. Cast operators in the initializer portion of a compound literal can only convert arithmetic types to arithmentic types, except as noted for the sizeof operator.

Unless you use the capability of compound literals to coerce to a pointer to its first element, it doesn't appear that there is much benefit in using compound literals for non-automatic data.

In Joel's case, the initializer only needs to contain constant expressions and doesn't require a construction, even when the define for RW_LOCK_UNLOCKED is done as a compound literal.

Dave

Signature · 2 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)
author
#12 lore raw
In reply to Andreas Schwab

Hi all,

Quoted 29 lines

-- Original Message --
To: "John David Anglin" <[email protected]>
Cc: [email protected] (Matthew Wilcox), [email protected],
[email protected]
Subject: Re: [parisc-linux] 2.4.20-pa27 64bits smp problem!
From: Andreas Schwab <[email protected]>
Date: Wed, 26 Feb 2003 22:48:20 +0100

"John David Anglin" <[email protected]> writes:

|> > I think it was an error to do so.  I do not see how
|> > 
|> > 	(spinlock_t) { 1 }
|> > 
|> > is any more or less constant than
|> > 
|> > 	{ 1 }
|> > 
|> > Removing this extension is a bad idea because it removes the ability
to
|> > do typechecking.  For example,
|> > 
|> > 	rwlock_t lock = SPIN_LOCK_INIT;
|> > 
|> > would throw an error with a cast and not without.
|> 
|> GCC allows the above cast.
Quoted 13 lines

This is not a cast, it's a compound literal.

Andreas.

Signature · 8 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

Thanks to all for this clarification.

Never the less, I would like to put an additional question:

the mentionned error occurs when this variable is a global one
but when it became local (e.g. when I define it into main() ) the error doesn't occur anynore (I do not presume of the resulting code).
So what is the conceptual difference?

Thanks in advance for additional help,
Joel

---------------------------------
Vous surfez avec une ligne classique ?
Faites des economies avec Tiscali Complete
... Plus d'info sur http://complete.tiscali.be

#13 lore raw

[parisc-linux] Heaps of HP Ram from 64 mb to 512 mb sticks

Heaps of serious ram for HP systems, I am not altogether sure if the ram works for other systems however I have thousands of sticks from 64megs through to 512meg sticks

Offers welcome

Chris Christie

[email protected]

#14 lore raw
In reply to Joel Soete
Quoted 5 lines

Never the less, I would like to put an additional question:
the mentionned error occurs when this variable is a global one
but when it became local (e.g. when I define it into main() ) the error doesn't occur anynore (I do not presume of the resulting code).
So what is the conceptual difference?

If you look at the assembly code, you will see that the initialization is done entirely in code when RW_LOCK_UNLOCKED is used to initialize a local. You can handle more complex initializers when you use code to initialize an object. When global or static storage is initialized, the initialized values are placed directly into a data section. C++ has constructors to do more complex initializations but this isn't present in standard C.

The reason as to why GCC can't handle your example when it could before has to do with the alignment of GCC to ISO C. Constraint "3" in the standard states that "If the compound literal occurs outside the body of a function, the initializer list shall consist of constant expressions." Also, as Andreas said, "the value of a compound literal is that of an unnamed object initialized by the initializer list". You would get the same error trying to do an initialization using a named object:

  struct a { int i; } a = { 1 };
  struct b { struct a x; } b = { a };

I think you want to avoid using compound literals for you particular initialization. You don't need the capability of compound literals to initialize an object type or an array of unknown size, or that each compound literal creates only a single object in a given scope (this is useful if the initializer values aren't constant).

Dave

Signature · 2 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)
#15 lore raw
In reply to Joel Soete
Quoted 5 lines

Never the less, I would like to put an additional question:
the mentionned error occurs when this variable is a global one
but when it became local (e.g. when I define it into main() ) the error doesn't occur anynore (I do not presume of the resulting code).
So what is the conceptual difference?

If you look at the assembly code, you will see that the initialization is done entirely in code when RW_LOCK_UNLOCKED is used to initialize a local. You can handle more complex initializers when you use code to initialize an object. When global or static storage is initialized, the initialized values are placed directly into a data section. C++ has constructors to do more complex initializations but this isn't present in standard C.

The reason as to why GCC can't handle your example when it could before has to do with the alignment of GCC to ISO C. Constraint "3" in the standard states that "If the compound literal occurs outside the body of a function, the initializer list shall consist of constant expressions." Also, as Andreas said, "the value of a compound literal is that of an unnamed object initialized by the initializer list". You would get the same error trying to do an initialization using a named object:

  struct a { int i; } a = { 1 };
  struct b { struct a x; } b = { a };

I think you want to avoid using compound literals for you particular initialization. You don't need the capability of compound literals to initialize an object type or an array of unknown size, or that each compound literal creates only a single object in a given scope (this is useful if the initializer values aren't constant).

Dave

Signature · 2 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)
author
#16 lore raw
In reply to John David Anglin
Quoted 10 lines

-- Original Message --
Subject: Re: [parisc-linux] 2.4.20-pa27 64bits smp problem!
To: [email protected] (Joel Soete)
From: "John David Anglin" <[email protected]>
Cc: [email protected], [email protected]
Date: Wed, 26 Feb 2003 13:58:57 -0500 (EST)

Quoted 1 line

Would I have to open a bug report near gcc with this one?

Quoted 9 lines

You mean for the errors:

joel.c:19: error: initializer element is not constant joel.c:19: error: (near initialization for `MyRWLock') joel.c:19: error: initializer element is not constant

No, fix the code. I don't believe you will win this one. This feature (extension) was deliberately removed from GCC.

Well I first choose the facility:

I remove the cast so that in asm-parisc/spinclok_t.h
...
#ifndef CONFIG_DEBUG_SPINLOCK
#define SPIN_LOCK_UNLOCKED { 1 }
...
#else

#define SPIN_LOCK_UNLOCKED { 1, 0L, 0L }
...

but it breacks many code else where fork.c, raid1.c, raid5.c,... where it is easy to recast.

Any better idea?

Joel

---------------------------------
Vous surfez avec une ligne classique ?
Faites des economies avec Tiscali Complete
... Plus d'info sur http://complete.tiscali.be

#17 lore raw
Quoted 8 lines

I remove the cast so that in asm-parisc/spinclok_t.h
...
#ifndef CONFIG_DEBUG_SPINLOCK
#define SPIN_LOCK_UNLOCKED { 1 }
...
#else

#define SPIN_LOCK_UNLOCKED { 1, 0L, 0L }

You probably don't need the 0's. When there a fewer initializers in a brace enclosed list than there are elements or members of an aggregate, they are implicitly initialized the same as objects that have static storage duration.

Quoted 2 lines

but it breacks many code else where fork.c, raid1.c, raid5.c,... where it is easy to recast.

Glibc linuxthreads defines two initializers in the pthread code, one using compound literals and the other using standard initializer lists.

Dave

Signature · 2 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)
author
#18 lore raw
Quoted 21 lines

-- Original Message --
Subject: Re: [parisc-linux] 2.4.20-pa27 64bits smp problem!
To: [email protected] (Joel Soete)
From: "John David Anglin" <[email protected]>
Cc: [email protected], [email protected]
Date: Thu, 27 Feb 2003 12:17:18 -0500 (EST)

Quoted 8 lines

I remove the cast so that in asm-parisc/spinclok_t.h
...
#ifndef CONFIG_DEBUG_SPINLOCK
#define SPIN_LOCK_UNLOCKED { 1 }
...
#else

#define SPIN_LOCK_UNLOCKED { 1, 0L, 0L }

You probably don't need the 0's. When there a fewer initializers in a brace enclosed list than there are elements or members of an aggregate, they are implicitly initialized the same as objects that have static storage duration.

Quoted 6 lines
Quoted 2 lines

but it breacks many code else where fork.c, raid1.c, raid5.c,... where it is easy to recast.

Glibc linuxthreads defines two initializers in the pthread code, one using compound literals and the other using standard initializer lists.

I will have a look (it will just have to wait two weeks because of Sun course about 6800)

Thanks a lot,
Joel

Quoted 8 lines

Dave

Signature · 6 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)
_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

---------------------------------
Vous surfez avec une ligne classique ?
Faites des economies avec Tiscali Complete
... Plus d'info sur http://complete.tiscali.be

author
#19 lore raw
In reply to John David Anglin

Hi all,

Quoted 21 lines

-- Original Message --
Subject: Re: [parisc-linux] 2.4.20-pa27 64bits smp problem!
To: [email protected] (Joel Soete)
From: "John David Anglin" <[email protected]>
Cc: [email protected], [email protected]
Date: Thu, 27 Feb 2003 12:17:18 -0500 (EST)

Quoted 8 lines

I remove the cast so that in asm-parisc/spinclok_t.h
...
#ifndef CONFIG_DEBUG_SPINLOCK
#define SPIN_LOCK_UNLOCKED { 1 }
...
#else

#define SPIN_LOCK_UNLOCKED { 1, 0L, 0L }

You probably don't need the 0's. When there a fewer initializers in a brace enclosed list than there are elements or members of an aggregate, they are implicitly initialized the same as objects that have static storage duration.

Quoted 6 lines
Quoted 2 lines

but it breacks many code else where fork.c, raid1.c, raid5.c,... where it is easy to recast.

Glibc linuxthreads defines two initializers in the pthread code, one using compound literals and the other using standard initializer lists.

Sorry Dave I do not find this stuff.

Any way after some sleep, I find this kind patches:

asm-parisc/spinlock_t.h renamed from asm-parisc/spinlock_t.h.orig +8 -4
@@ -47,7 +47,9 @@
 } spinlock_t;
 
 #ifndef CONFIG_DEBUG_SPINLOCK
-#define SPIN_LOCK_UNLOCKED (spinlock_t) { 1 }
+/* This following change because of gcc-3.2 limits for C99 compliance */
+#define C_SPIN_LOCK_UNLOCKED { 1 }
+#define SPIN_LOCK_UNLOCKED (spinlock_t) C_SPIN_LOCK_UNLOCKED
 
 /* Define 6 spinlock primitives that don't depend on anything else. */
 
@@ -79,7 +81,9 @@
 
 #else
 
-#define SPIN_LOCK_UNLOCKED (spinlock_t) { 1, 0, 0 }
+/* This following change because of gcc-3.2 limits for C99 compliance */
+#define C_SPIN_LOCK_UNLOCKED { 1, 0L, 0L }
+#define SPIN_LOCK_UNLOCKED (spinlock_t) C_SPIN_LOCK_UNLOCKED
 
 /* Define 6 spinlock primitives that don't depend on anything else. */
--- include/asm-parisc/spinlock.h.orig	2003-02-19 18:05:55.000000000 +0100
+++ include/asm-parisc/spinlock.h	2003-02-28 09:45:10.000000000 +0100
@@ -14,7 +14,7 @@
 	volatile int counter;
 } rwlock_t;
 
-#define RW_LOCK_UNLOCKED (rwlock_t) { SPIN_LOCK_UNLOCKED, 0 }
+#define RW_LOCK_UNLOCKED (rwlock_t) { C_SPIN_LOCK_UNLOCKED, 0 }
 
 #define rwlock_init(lp)	do { *(lp) = RW_LOCK_UNLOCKED; } while (0)
 

Well I prefer to save "{ 1, 0L, 0L }" because I am never sure about what is (how) and what is not initialised in C.

I test it on gcc-3.2 64bits and I obtain a a kernel (I will try to boot it latter).

Any better idea?

Joel

---------------------------------
Vous surfez avec une ligne classique ?
Faites des economies avec Tiscali Complete
... Plus d'info sur http://complete.tiscali.be

author
#20 lore raw
Quoted 4 lines

Hi all,

I test it on gcc-3.2 64bits and I obtain a a kernel (I will try to boot

it

Quoted 2 lines

latter).

And as announce it failled to boot :(

Here is the boot log:

Firmware Version 41.28

Duplex Console IO Dependent Code (IODC) revision 1

------------------------------------------------------------------------------
(c) Copyright 1995-2000, Hewlett-Packard Company, All rights reserved
------------------------------------------------------------------------------

  Processor   Speed            State           CoProcessor State  Cache Size
  Number                                       State              Inst  
 Data
  ---------  --------   ---------------------  -----------------  ------------
      1      550  MHz   Active                 Functional         512 KB

1 MB
3 550 MHz Idle Functional 512 KB
1 MB

  Central Bus Speed (in MHz)  :        133  
  Available Memory            :    4194304  KB
  Good Memory Required        :      15364  KB
   Primary boot path:    0/0/2/1.6           
   Alternate boot path:  0/0/2/1.6           
   Console path:         0/0/4/1.0           
   Keyboard path:        0/0/4/0.0           

---- Main Menu ---------------------------------------------------------------

----
Main Menu: Enter command or menu > bo extscsi.8
Interact with IPL (Y, N, or Cancel)?> y

Booting...
Boot IO Dependent Code (IODC) revision 1

HARD Booted.
palo ipl 1.2 root@b2000 Tue Jan 14 13:13:07 MST 2003
Information: Boot device can't seek past 2Gb (ignore next error).byteio_read:
seekread() returned -1 expected 2048

Partition Start(MB) End(MB) Id Type

1               1      63   f0 Palo
2              64     188   83 ext2
3             189     313   82 swap
5             314    2000   83 ext2
6            2001    2250   83 ext2

PALO(F0) partition contains:

    0/vmlinux32 3687647 bytes @ 0x44000

Information: No console specified on kernel command line. This is normal. PALO will choose the console currently used by firmware (serial).Current command line:
2/vmlinux root=/dev/sda5 HOME=/ console=ttyS0 TERM=vt102
0: 2/vmlinux
1: root=/dev/sda5
2: HOME=/
3: console=ttyS0
4: TERM=vt102

Edit which field?
(or 'b' to boot with this command line)? 0 2/vmlinux-2.4.20-pa27-smp64
Current command line:
2/vmlinux-2.4.20-pa27-smp64 root=/dev/sda5 HOME=/ console=ttyS0 TERM=vt102
0: 2/vmlinux-2.4.20-pa27-smp64
1: root=/dev/sda5
2: HOME=/
3: console=ttyS0
4: TERM=vt102

Edit which field?
(or 'b' to boot with this command line)? b

Command line for kernel: 'root=/dev/sda5 HOME=/ console=ttyS0 TERM=vt102 palo_kernel=2/vmlinux-2.4.20-pa27-smp64'
Selected kernel: /vmlinux-2.4.20-pa27-smp64 from partition 2 ELF64 executable
Entry 00100000 first 00100000 n 4
Segment 0 load 00100000 size 2907552 mediaptr 0x1000
Segment 1 load 003c6000 size 1407360 mediaptr 0x2c7000 Segment 2 load 00520000 size 344064 mediaptr 0x41f000 Segment 3 load 00578000 size 32768 mediaptr 0x473000 Branching to kernel entry point 0x00100000. If this is the last message you see, you may need to switch your console. This is a common symptom -- search the FAQ and mailing list at parisc-linux.org

********** VIRTUAL FRONT PANEL **********
System Boot detected
*****************************************

LEDs:  RUN      ATTENTION     FAULT     REMOTE     POWER
       ON       OFF           OFF       ON         ON

LED State: System running normally.

processor system initialization 1C00

*****************************************

************ EARLY BOOT VFP *************
End of early boot detected
*****************************************
sym53c875-0: ID 7, Fast-20, Parity Checking
sym53c875-1: rev 0x37 on pci bus 0 device 2 function 1 irq 131
sym53c875-1: ID 7, Fast-20, Parity Checking
sym53c895-2: rev 0x1 on pci bus 0 device 1 function 0 irq 129
sym53c895-2: ID 7, Fast-20, Parity Checking
sym53c895-2: SCSI bus mode change from 80 to 80.
scsi0 : sym53c8xx-1.7.3c-20010512
scsi1 : sym53c8xx-1.7.3c-20010512
scsi2 : sym53c8xx-1.7.3c-20010512
blk: queue 000000008fa50e40, I/O limit 4095Mb (mask 0xffffffff)
Vendor: SEAGATE Model: ST39140WS Rev: HP03
Type: Direct-Access ANSI SCSI revision: 02
blk: queue 000000008fa50c40, I/O limit 4095Mb (mask 0xffffffff) Attached scsi disk sda at scsi2, channel 0, id 8, lun 0 sym53c895-2-<8,*>: FAST-20 WIDE SCSI 40.0 MB/s (50.0 ns, offset 15) SCSI device sda: 17773524 512-byte hdwr sectors (9100 MB) Partition check:
sda: sda1 sda2 sda3 sda4 < sda5 sda6 sda7 sda8 sda9 sda10 sda11 >
STI GSC/PCI graphics driver version 0.9

BUG: Skipping previously registered driver: sti (native)

md: linear personality registered as nr 1
md: raid0 personality registered as nr 2
md: raid1 personality registered as nr 3
md: raid5 personality registered as nr 4
raid5: measuring checksumming speed
8regs : 2504.400 MB/sec
8regs_prefetch: 1856.000 MB/sec
32regs : 2067.600 MB/sec
32regs_prefetch: 1946.000 MB/sec
raid5: using function: 8regs (2504.400 MB/sec)
md: md driver 0.90.0 MAX_MD_DEVS=256, MD_SB_DISKS=27
md: Autodetecting RAID arrays.
md: autorun ...
md: ... autorun DONE.
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 2048 buckets, 80Kbytes
TCP: Hash tables configured (established 32768 bind 65536)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0. kjournald starting. Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) readonly. Freeing unused kernel memory: 318k freed ********** VIRTUAL FRONT PANEL **********
System Boot detected
*****************************************

LEDs:  RUN      ATTENTION     FAULT     REMOTE     POWER
       ON       OFF           OFF       ON         ON

LED State: System running normally.

processor system initialization 1C00

*****************************************

************ EARLY BOOT VFP *************
End of early boot detected
*****************************************

************* SYSTEM ALERT **************
SYSTEM NAME: ap8002
DATE: 02/28/2003 TIME: 15:19:37
ALERT LEVEL: 7 = reserved

REASON FOR ALERT
SOURCE: 0 = unknown, no source stated
SOURCE DETAIL: 0 = unknown, no source stated SOURCE ID: FF
PROBLEM DETAIL: 0 = no problem detail

LEDs:  RUN      ATTENTION     FAULT     REMOTE     POWER
       ON       FLASH         OFF       ON         ON

LED State: There was a system interruption that did not take the system down. Check Chassis and Console Logs for error messages.

0x0000107000FF6292 000000FF FF800000 - type 0 = Data Field Unused 0x5800187000FF6292 00006701 1C0F1325 - type 11 = Timestamp 02/28/2003 15:19:37
A: ack read of this entry - X: Disable all future alert messages Anything else skip redisplay the log entry
->Choice:
*****************************************

...

and the pim info

Service Menu: Enter command > pim

PROCESSOR PIM INFORMATION

Original Product Number:  A3639C
Current Product Number:   A3639C

------- Processor 1 HPMC Information - PDC Version: 41.28 ------

Timestamp = Fri Feb 28 15:19:35 GMT 2003 (20:03:02:28:15:19:35)

HPMC Chassis Codes

       Chassis Code        Extension 
       ------------        --------- 
       0x0000082000ff6242  0x0000000000000000
       0x1800082011016312  0xcb81000000000000
       0x0000087000ff6292  0x000000ffff800000
       0x6000082013016062  0x2002000000080000
       0x6000082013016072  0x0000000000080000
       0x7000082013016082  0x0000000000192200
       0x6000082013036062  0x2001000000082004
       0x6000082013036072  0x0000000000082000
       0x7000082013036082  0x0000000000992600
       0x6000082070006062  0x0000000000080000
       0x6000082070006072  0x0000000000080000
       0x7000082070006082  0x0000000000192200
       0x6000082070016062  0x0000000000000800
       0x6000082070016072  0x0000000000000800
       0x7000082070016082  0x00000000001a4400
       0x0000080080006310  0x0000000000000001
       0x7000082082006333  0x0000000000b92200
       0x7000082082016333  0x0000000000b92200
       0x000008008000631f  0x0000000000000000
       0x0000082000ff6452  0x0000000000000000
       0x0000082000ff6402  0x0000000000000000
       0x0000080080006300  0x0000000000000001
       0x7000082082006333  0x0000000000b92200
       0x7000082382006343  0x0000000000070200
       0x7000082382016343  0x0000000000070200
       0x7000082382026343  0x0000000000070200
       0x7000082382046343  0x0000000000070200
       0x7000082382056343  0x0000000000070200
       0x7000082382086343  0x0000000000070200
       0x70000823820a6343  0x0000000000070200
       0x70000823820c6343  0x0000000000070200
       0x7000082082016333  0x0000000000b92200
       0x7000082382106343  0x0000000000070200
       0x7000082382126343  0x0000000000070200
       0x7000082382146343  0x0000000000070200
       0x7000082382186343  0x0000000000070200
       0x70000823821a6343  0x0000000000070200
       0x70000823821c6343  0x0000000000070200
       0x0000080089006200  0x0000000000000000
       0x0000082389006200  0x0000000000000000
       0x0000080086006200  0x0000000000000000
       0x000008008000630f  0x0000000000000000

General Registers 0 - 31

00-03  0000000000000000  0000000010516300  000000001014d6ec  0000000010507b00
04-07  000000008f0c8000  0000000010431788  000000008f093000  0000000010000000
08-11  000000001349c2b0  000000001349d4e8  000000007f093b25  0000000010565d00
12-15  00000000faf00b2c  0000000010565d60  000000008f677ec0  000000008f675800
16-19  000000001349d4e8  0000000000005000  00000000faf005e0  0000000000000180
20-23  0000000010565d00  00000000002f7465  00000000003f45a2  000fe18fffc079c0
24-27  000000007f0c8b27  000fe18fffc079c0  0000000000575898  0000000010507b00
28-31  000000000007f0c8  003f86400007f0c8  000000008f67cf40  0000000000008ba3

Control Registers 0 - 31

00-03  0000000000000000  0000000000000000  0000000000000000  0000000000000000
04-07  0000000000000000  0000000000000000  0000000000000000  0000000000000000
08-11  0000000000000006  0000000000000000  00000000000000c0  000000000000003f
12-15  0000000000000000  0000000000000000  0000000000107000  ffe0000000000000
16-19  0000001dcdcb88a5  0000000000000000  000000001014d718  0000000005804200
20-23  0000000000000180  00000000faf00b2c  000000ff0804cf0f  c000000000000000
24-27  0000000000435000  000000007f680000  0000000000041020  5555555555555555
28-31  000000ffff95c810  5555555555555555  000000008f67c000  0000000010578000

Space Registers 0 - 7

00-03  00000180          00000180          00000000          00000180
04-07  00000000          00000000          00000000          00000000
IIA Space (back entry)       = 0x0000000000000000
IIA Offset (back entry)      = 0x000000001014d71c
Check Type                   = 0x20000000
CPU State                    = 0x9e000004
Cache Check                  = 0x00000000
TLB Check                    = 0x00000000
Bus Check                    = 0x0010c03b
Assists Check                = 0x00000000
Assist State                 = 0x00000000
Path Info                    = 0x00000000
System Responder Address     = 0x0000000000000000
System Requestor Address     = 0xfffffffffed25000

Floating Point Registers 0 - 31

00-03  0000000000000000  0000000000000000  0000000000000000  0000000000000000
04-07  000000008f777ec0  0000000010507b00  0000000000000002  00000000104ab298
08-11  0000000010507b00  0000000000000802  00000000104cc768  000000008fab0000
12-15  0000000000000000  0000000000000000  000000001016db38  00000000103b1d10
16-19  00000000000009c8  000000008fa5e000  000000000800000f  00000000104ab2a0
20-23  000000008f777ec0  0000000010507b00  00000000003f45a2  000000000000ba2e
24-27  0000000400000000  000099997fab0b70  000000007fab0b78  000000000bebc200
28-31  0000000000000001  00000000ff915e20  000000001016880c  0000000010507b00
Check Summary                = 0xcb81000000000000
Available Memory             = 0x0000000100000000
CPU Diagnose Register 2      = 0x0301010800802004
CPU Status Register 0        = 0x2640c24000000000
CPU Status Register 1        = 0x8000200000000000
SADD LOG                     = 0xf8f0bd000040b800
Read Short LOG               = 0xc18200ff80000002

----------------- DEW 1 HPMC Information - ------

Timestamp = Fri Feb 28 15:19:35 GMT 2003 (20:03:02:28:15:19:35)

Runway Control Log Reg            = 0x00927b0000000000
Runway Address Data Log Reg Odd   = 0xc0aa1010c4a61010
Runway Address Data Log Reg Even  = 0xc8a61010cca61010
Runway Address Log Reg            = 0x00000000000000f4
Runway Broad Error Log Reg        = 0x000000000000005c
  OV  RQ  RS      ESTAT      A  C  D  corr  unc  fe  cw  pf
  --  --  --      -----      -  -  -  ----  ---  --  --  --
                ERR_ERROR       X                X       
Merced Bus Requestor Address      = 0x0000000000000000
Merced Bus Target Address         = 0x0000000000000000
Merced Bus Responder Address      = 0x0000000000000000
Merced Error Status Reg           = 0x2002000000080000
Merced Error Overflow Reg         = 0x0000000000080000
Merced AERR Addr1 Log Reg         = 0x00006000ff86fdc0
Merced AERR Addr2 Log Reg         = 0x00008000078fff08
Merced DERR  Log Reg              = 0x0001000000000000
Merced Error Syndrome Reg         = 0x00000000000000c0

------- Processor 1 LPMC Information ------------------

Check Type                   = 0x00000000
IC Parity Info               = 0x00000000
Cache Check                  = 0x00000000
TLB Check                    = 0x00000000
Bus Check                    = 0x00000000
Assists Check                = 0x00000000
Assist State                 = 0x00000000
Path Info                    = 0x00000000
System Responder Address     = 0x0000000000000000
System Requestor Address     = 0x0000000000000000

------- Processor 1 TOC Information -------------------

General Registers 0 - 31

00-03  0000000000000000  0000000000000000  0000000000000000  0000000000000000
04-07  0000000000000000  0000000000000000  0000000000000000  0000000000000000
08-11  0000000000000000  0000000000000000  0000000000000000  0000000000000000
12-15  0000000000000000  0000000000000000  0000000000000000  0000000000000000
16-19  0000000000000000  0000000000000000  0000000000000000  0000000000000000
20-23  0000000000000000  0000000000000000  0000000000000000  0000000000000000
24-27  0000000000000000  0000000000000000  0000000000000000  0000000000000000
28-31  0000000000000000  0000000000000000  0000000000000000  0000000000000000

Control Registers 0 - 31

00-03  0000000000000000  0000000000000000  0000000000000000  0000000000000000
04-07  0000000000000000  0000000000000000  0000000000000000  0000000000000000
08-11  0000000000000000  0000000000000000  0000000000000000  0000000000000000
12-15  0000000000000000  0000000000000000  0000000000000000  0000000000000000
16-19  0000000000000000  0000000000000000  0000000000000000  0000000000000000
20-23  0000000000000000  0000000000000000  0000000000000000  0000000000000000
24-27  0000000000000000  0000000000000000  0000000000000000  0000000000000000
28-31  0000000000000000  0000000000000000  0000000000000000  0000000000000000

Space Registers 0 - 7

00-03  00000000          00000000          00000000          00000000
04-07  00000000          00000000          00000000          00000000
IIA Space (back entry)       = 0x0000000000000000
IIA Offset (back entry)      = 0x0000000000000000
CPU State                    = 0x00000000

------- Processor 3 HPMC Information - PDC Version: 41.28 ------

Timestamp = Fri Feb 28 15:19:35 GMT 2003 (20:03:02:28:15:19:35)

HPMC Chassis Codes

       Chassis Code        Extension 
       ------------        --------- 
       0x0000082000ff6242  0x0000000000000000
       0x1800082011036322  0xcb81800000000000
       0x0000082000ff6452  0x0000000000000000
       0x0000082000ff6402  0x0000000000000000

General Registers 0 - 31

00-03  0000000000000000  0000000010516b00  0000000010115eec  00000000103fd0f8
04-07  000000000800000f  0000000000000002  0000000000000000  0000000010507b00
08-11  00000000103fd0f8  00000000103fd0f8  00000000103903c0  000000001038eec0
12-15  0000000000000001  0000000000000001  000000008fabdec8  00000000000dec68
16-19  0000000000000000  0000000000000000  00000000faf005e0  0000000000000001
20-23  0000000000005c10  0000000010431078  0000000010507b00  0000000000000001
24-27  0000000000000116  00000000103903c0  00000000103fd130  0000000010507b00
28-31  0000000000000800  000000008f0e0fb0  000000008f0e0fc0  0000000000008ba3

Control Registers 0 - 31

00-03  0000000000000000  0000000000000000  0000000000000000  0000000000000000
04-07  0000000000000000  0000000000000000  0000000000000000  0000000000000000
08-11  000000000000001e  0000000000000000  00000000000000c0  000000000000002f
12-15  0000000000000000  0000000000000000  0000000000107000  ffe0000000000000
16-19  0000001dcda30375  0000000000000000  0000000010115ff8  000000000ea010d3
20-23  0000000000000000  0000000000000000  000000000804030f  0000000000000000
24-27  0000000000435000  000000007f064000  0000000000041020  5555555555555555
28-31  000000ffff95c810  5555555555555555  000000008f0e0000  0000000000008020

Space Registers 0 - 7

00-03  00000780          00000780          00000000          00000780
04-07  00000000          00000000          00000000          00000000
IIA Space (back entry)       = 0x0000000000000000
IIA Offset (back entry)      = 0x0000000010115ffc
Check Type                   = 0x20000000
CPU State                    = 0x9e000004
Cache Check                  = 0x00000000
TLB Check                    = 0x00000000
Bus Check                    = 0x0030000d
Assists Check                = 0x00000000
Assist State                 = 0x00000000
Path Info                    = 0x00000000
System Responder Address     = 0xfffffffffed2d000
System Requestor Address     = 0x000000fffed2c000

Floating Point Registers 0 - 31

00-03  0000000000000000  0000000000000000  0000000000000000  0000000000000000
04-07  000000008f777ec0  0000000010507b00  0000000000000002  00000000104ab298
08-11  0000000010507b00  0000000000000802  00000000104cc768  000000008fab0000
12-15  0000000000000000  0000000000000000  000000001016db38  00000000103b1d10
16-19  00000000000009c8  000000008fa5e000  000000000800000f  00000000104ab2a0
20-23  000000008f777ec0  0000000010507b00  00000000003f45a2  000000000000ba2e
24-27  0000999900000000  000099997fab0b70  000000007fab0b78  000000000bebc200
28-31  0000000000000001  00000000ff915e20  000000001016880c  0000000010507b00
Check Summary                = 0xcb81800000000000
Available Memory             = 0x0000000100000000
CPU Diagnose Register 2      = 0x0301030800802004
CPU Status Register 0        = 0x3640c24000000000
CPU Status Register 1        = 0x8000000000000000
SADD LOG                     = 0x48e0000000000002
Read Short LOG               = 0xc18080ff80080014

----------------- DEW 3 HPMC Information - ------

Timestamp = Fri Feb 28 15:19:35 GMT 2003 (20:03:02:28:15:19:35)

Runway Control Log Reg            = 0x0006720000000000
Runway Address Data Log Reg Odd   = 0xfffffffffffc3f00
Runway Address Data Log Reg Even  = 0xfffffffffffc3f00
Runway Address Log Reg            = 0x0000000000000048
Runway Broad Error Log Reg        = 0x00000000000000dc
  OV  RQ  RS      ESTAT      A  C  D  corr  unc  fe  cw  pf
  --  --  --      -----      -  -  -  ----  ---  --  --  --
  X             ERR_ERROR       X            X   X       
Merced Bus Requestor Address      = 0x0000000000000000
Merced Bus Target Address         = 0x0000000000000000
Merced Bus Responder Address      = 0x0000000000000000
Merced Error Status Reg           = 0x2001000000082004
Merced Error Overflow Reg         = 0x0000000000082000
Merced AERR Addr1 Log Reg         = 0x00c0000000300000
Merced AERR Addr2 Log Reg         = 0x0000000000f00000
Merced DERR  Log Reg              = 0x0001000000000000
Merced Error Syndrome Reg         = 0x0000000000260000

------- Processor 3 LPMC Information ------------------

Check Type                   = 0x00000000
IC Parity Info               = 0x00000000
Cache Check                  = 0x00000000
TLB Check                    = 0x00000000
Bus Check                    = 0x00000000
Assists Check                = 0x00000000
Assist State                 = 0x00000000
Path Info                    = 0x00000000
System Responder Address     = 0x0000000000000000
System Requestor Address     = 0x0000000000000000

------- Processor 3 TOC Information -------------------

General Registers 0 - 31

00-03  0000000000000000  0000000000000000  0000000000000000  0000000000000000
04-07  0000000000000000  0000000000000000  0000000000000000  0000000000000000
08-11  0000000000000000  0000000000000000  0000000000000000  0000000000000000
12-15  0000000000000000  0000000000000000  0000000000000000  0000000000000000
16-19  0000000000000000  0000000000000000  0000000000000000  0000000000000000
20-23  0000000000000000  0000000000000000  0000000000000000  0000000000000000
24-27  0000000000000000  0000000000000000  0000000000000000  0000000000000000
28-31  0000000000000000  0000000000000000  0000000000000000  0000000000000000

Control Registers 0 - 31

00-03  0000000000000000  0000000000000000  0000000000000000  0000000000000000
04-07  0000000000000000  0000000000000000  0000000000000000  0000000000000000
08-11  0000000000000000  0000000000000000  0000000000000000  0000000000000000
12-15  0000000000000000  0000000000000000  0000000000000000  0000000000000000
16-19  0000000000000000  0000000000000000  0000000000000000  0000000000000000
20-23  0000000000000000  0000000000000000  0000000000000000  0000000000000000
24-27  0000000000000000  0000000000000000  0000000000000000  0000000000000000
28-31  0000000000000000  0000000000000000  0000000000000000  0000000000000000

Space Registers 0 - 7

00-03  00000000          00000000          00000000          00000000
04-07  00000000          00000000          00000000          00000000
IIA Space (back entry)       = 0x0000000000000000
IIA Offset (back entry)      = 0x0000000000000000
CPU State                    = 0x00000000

-------------- Memory Error Log Information --------------

Bus 0 Log Information

Timestamp = Fri Feb 28 15:19:35 GMT 2003 (20:03:02:28:15:19:35)

  OV  RQ  RS      ESTAT      A  C  D  corr  unc  fe  cw  pf
  --  --  --      -----      -  -  -  ----  ---  --  --  --
                ERR_ERROR       X                X       
Bus Requestor Address      = 0x0000000000000000
Bus Target Address         = 0x0000000000000000
Bus Responder Address      = 0x0000000000000000
Error Status Reg           = 0x0000000000080000
Error Overflow Reg         = 0x0000000000080000
AERR Address 1 Log Reg     = 0x0000000000000000
AERR Address 2 Log Reg     = 0xf800000000000000
FERR  Log Reg              = 0x0000000000000000
DERR  Log Reg              = 0x000112000a96c580
Error Syndrome Reg         = 0x0000000000000000

Address/Control Parity Error Registers

Address/Control Parity Error Bit (AE) Not Set

Bus 1 Log Information

Timestamp = Fri Feb 28 15:19:35 GMT 2003 (20:03:02:28:15:19:35)

  OV  RQ  RS      ESTAT      A  C  D  corr  unc  fe  cw  pf
  --  --  --      -----      -  -  -  ----  ---  --  --  --
               ERR_TIMEOUT   X               X           
Bus Requestor Address      = 0xfffffffffed2c000
Bus Target Address         = 0x00000000f000a000
Bus Responder Address      = 0x0000000000000000
Error Status Reg           = 0x0000000000000800
Error Overflow Reg         = 0x0000000000000800
AERR Address 1 Log Reg     = 0x08006000f000a000
AERR Address 2 Log Reg     = 0x6000b0002f700a10
FERR  Log Reg              = 0x0000000000000000
DERR  Log Reg              = 0x0000000000000000
Error Syndrome Reg         = 0x0000000000000000

Address/Control Parity Error Registers

Address/Control Parity Error Bit (AE) Not Set

------------ I/O Module Error Log Information ------------

Summary of IO subsystem log entries
-----------------------------------
Phys Loc Vendor Device Severity
Description (hex) Id Id CORR UNC FE
CW
----------- ----- ------ ------ ----------------

System Bus Adapter SB  0x000000ffffffff82   0x103c  0x1050              X
System Bus Adapter RP  0x000000ffff0dff83   0x103c  0x1051              X
System Bus Adapter RP  0x000000ffff0eff83   0x103c  0x1051              X
System Bus Adapter RP  0x000101ffff06ff83   0x103c  0x1051              X
System Bus Adapter RP  0x000101ffff02ff83   0x103c  0x1051              X
System Bus Adapter RP  0x000101ffff01ff83   0x103c  0x1051              X
System Bus Adapter RP  0x000101ffff04ff83   0x103c  0x1051              X
System Bus Adapter RP  0x000101ffff05ff83   0x103c  0x1051              X
System Bus Adapter RP  0x000101ffff03ff83   0x103c  0x1051              X
System Bus Adapter SB  0x000000ffffffff82   0x103c  0x1050              X
System Bus Adapter RP  0x000202ffff0cff83   0x103c  0x1051              X
System Bus Adapter RP  0x000202ffff0aff83   0x103c  0x1051              X
System Bus Adapter RP  0x000202ffff09ff83   0x103c  0x1051              X
System Bus Adapter RP  0x000202ffff0bff83   0x103c  0x1051              X
System Bus Adapter RP  0x000202ffff08ff83   0x103c  0x1051              X
System Bus Adapter RP  0x000202ffff07ff83   0x103c  0x1051              X

Detail display of IO subsystem log entries
------------------------------------------

System Bus Adapter -- System Bus Interface
------------------------------------------

Timestamp = Fri Feb 28 15:21:37 GMT 2003 (20:03:02:28:15:21:37)

  OV  RQ  RS      ESTAT      A  C  D  corr  unc  fe  cw  pf
  --  --  --      -----      -  -  -  ----  ---  --  --  --
  X       X     ERR_ERROR       X                X       
IO Requestor Address    = 0x0000000000000000
IO Target Address       = 0x0000000000000000
IO Responder Address    = 0xfffffffffed00000
IO Physical Location    = 0x000000ffffffff82
IO Hardware Path        = 0x00ffffffffffff00

Module Error Register = 0x0000000007ff0034

System Bus Adapter -- Rope Interface
------------------------------------------

Timestamp = Fri Feb 28 15:21:39 GMT 2003 (20:03:02:28:15:21:39)

  OV  RQ  RS      ESTAT      A  C  D  corr  unc  fe  cw  pf
  --  --  --      -----      -  -  -  ----  ---  --  --  --
               ERR_FUNCTION                      X       
IO Requestor Address    = 0x0000000000000000
IO Target Address       = 0x0000000000000000
IO Responder Address    = 0x0000000000000000
IO Physical Location    = 0x000000ffffffff82
IO Hardware Path        = 0x00ffffffffffff00

Module Error Register = 0x0000000000000000
Rope Physical Location = 0x000000ffff0dff83

System Bus Adapter -- Rope Interface
------------------------------------------

Timestamp = Fri Feb 28 15:21:39 GMT 2003 (20:03:02:28:15:21:39)

  OV  RQ  RS      ESTAT      A  C  D  corr  unc  fe  cw  pf
  --  --  --      -----      -  -  -  ----  ---  --  --  --
               ERR_FUNCTION                      X       
IO Requestor Address    = 0x0000000000000000
IO Target Address       = 0x0000000000000000
IO Responder Address    = 0x0000000000000000
IO Physical Location    = 0x000000ffffffff82
IO Hardware Path        = 0x00ffffffffffff00

Module Error Register = 0x0000000000000000
Rope Physical Location = 0x000000ffff0eff83

System Bus Adapter -- Rope Interface
------------------------------------------

Timestamp = Fri Feb 28 15:21:39 GMT 2003 (20:03:02:28:15:21:39)

  OV  RQ  RS      ESTAT      A  C  D  corr  unc  fe  cw  pf
  --  --  --      -----      -  -  -  ----  ---  --  --  --
               ERR_FUNCTION                      X       
IO Requestor Address    = 0x0000000000000000
IO Target Address       = 0x0000000000000000
IO Responder Address    = 0x0000000000000000
IO Physical Location    = 0x000000ffffffff82
IO Hardware Path        = 0x00ffffffffffff00

Module Error Register = 0x0000000000000000
Rope Physical Location = 0x000101ffff06ff83

System Bus Adapter -- Rope Interface
------------------------------------------

Timestamp = Fri Feb 28 15:21:39 GMT 2003 (20:03:02:28:15:21:39)

  OV  RQ  RS      ESTAT      A  C  D  corr  unc  fe  cw  pf
  --  --  --      -----      -  -  -  ----  ---  --  --  --
               ERR_FUNCTION                      X       
IO Requestor Address    = 0x0000000000000000
IO Target Address       = 0x0000000000000000
IO Responder Address    = 0x0000000000000000
IO Physical Location    = 0x000000ffffffff82
IO Hardware Path        = 0x00ffffffffffff00

Module Error Register = 0x0000000000000000
Rope Physical Location = 0x000101ffff02ff83

System Bus Adapter -- Rope Interface
------------------------------------------

Timestamp = Fri Feb 28 15:21:39 GMT 2003 (20:03:02:28:15:21:39)

  OV  RQ  RS      ESTAT      A  C  D  corr  unc  fe  cw  pf
  --  --  --      -----      -  -  -  ----  ---  --  --  --
               ERR_FUNCTION                      X       
IO Requestor Address    = 0x0000000000000000
IO Target Address       = 0x0000000000000000
IO Responder Address    = 0x0000000000000000
IO Physical Location    = 0x000000ffffffff82
IO Hardware Path        = 0x00ffffffffffff00

Module Error Register = 0x0000000000000000
Rope Physical Location = 0x000101ffff01ff83

System Bus Adapter -- Rope Interface
------------------------------------------

Timestamp = Fri Feb 28 15:21:39 GMT 2003 (20:03:02:28:15:21:39)

  OV  RQ  RS      ESTAT      A  C  D  corr  unc  fe  cw  pf
  --  --  --      -----      -  -  -  ----  ---  --  --  --
               ERR_FUNCTION                      X       
IO Requestor Address    = 0x0000000000000000
IO Target Address       = 0x0000000000000000
IO Responder Address    = 0x0000000000000000
IO Physical Location    = 0x000000ffffffff82
IO Hardware Path        = 0x00ffffffffffff00

Module Error Register = 0x0000000000000000
Rope Physical Location = 0x000101ffff04ff83

System Bus Adapter -- Rope Interface
------------------------------------------

Timestamp = Fri Feb 28 15:21:39 GMT 2003 (20:03:02:28:15:21:39)

  OV  RQ  RS      ESTAT      A  C  D  corr  unc  fe  cw  pf
  --  --  --      -----      -  -  -  ----  ---  --  --  --
               ERR_FUNCTION                      X       
IO Requestor Address    = 0x0000000000000000
IO Target Address       = 0x0000000000000000
IO Responder Address    = 0x0000000000000000
IO Physical Location    = 0x000000ffffffff82
IO Hardware Path        = 0x00ffffffffffff00

Module Error Register = 0x0000000000000000
Rope Physical Location = 0x000101ffff05ff83

System Bus Adapter -- Rope Interface
------------------------------------------

Timestamp = Fri Feb 28 15:21:39 GMT 2003 (20:03:02:28:15:21:39)

  OV  RQ  RS      ESTAT      A  C  D  corr  unc  fe  cw  pf
  --  --  --      -----      -  -  -  ----  ---  --  --  --
               ERR_FUNCTION                      X       
IO Requestor Address    = 0x0000000000000000
IO Target Address       = 0x0000000000000000
IO Responder Address    = 0x0000000000000000
IO Physical Location    = 0x000000ffffffff82
IO Hardware Path        = 0x00ffffffffffff00

Module Error Register = 0x0000000000000000
Rope Physical Location = 0x000101ffff03ff83

System Bus Adapter -- System Bus Interface
------------------------------------------

Timestamp = Fri Feb 28 15:21:40 GMT 2003 (20:03:02:28:15:21:40)

  OV  RQ  RS      ESTAT      A  C  D  corr  unc  fe  cw  pf
  --  --  --      -----      -  -  -  ----  ---  --  --  --
  X       X     ERR_ERROR       X                X       
IO Requestor Address    = 0x0000000000000000
IO Target Address       = 0x0000000000000000
IO Responder Address    = 0xfffffffffed40000
IO Physical Location    = 0x000000ffffffff82
IO Hardware Path        = 0x00ffffffffffff01

Module Error Register = 0x0000000007ff0034

System Bus Adapter -- Rope Interface
------------------------------------------

Timestamp = Fri Feb 28 15:21:42 GMT 2003 (20:03:02:28:15:21:42)

  OV  RQ  RS      ESTAT      A  C  D  corr  unc  fe  cw  pf
  --  --  --      -----      -  -  -  ----  ---  --  --  --
               ERR_FUNCTION                      X       
IO Requestor Address    = 0x0000000000000000
IO Target Address       = 0x0000000000000000
IO Responder Address    = 0x0000000000000000
IO Physical Location    = 0x000000ffffffff82
IO Hardware Path        = 0x00ffffffffffff01

Module Error Register = 0x0000000000000000
Rope Physical Location = 0x000202ffff0cff83

System Bus Adapter -- Rope Interface
------------------------------------------

Timestamp = Fri Feb 28 15:21:42 GMT 2003 (20:03:02:28:15:21:42)

  OV  RQ  RS      ESTAT      A  C  D  corr  unc  fe  cw  pf
  --  --  --      -----      -  -  -  ----  ---  --  --  --
               ERR_FUNCTION                      X       
IO Requestor Address    = 0x0000000000000000
IO Target Address       = 0x0000000000000000
IO Responder Address    = 0x0000000000000000
IO Physical Location    = 0x000000ffffffff82
IO Hardware Path        = 0x00ffffffffffff01

Module Error Register = 0x0000000000000000
Rope Physical Location = 0x000202ffff0aff83

System Bus Adapter -- Rope Interface
------------------------------------------

Timestamp = Fri Feb 28 15:21:42 GMT 2003 (20:03:02:28:15:21:42)

  OV  RQ  RS      ESTAT      A  C  D  corr  unc  fe  cw  pf
  --  --  --      -----      -  -  -  ----  ---  --  --  --
               ERR_FUNCTION                      X       
IO Requestor Address    = 0x0000000000000000
IO Target Address       = 0x0000000000000000
IO Responder Address    = 0x0000000000000000
IO Physical Location    = 0x000000ffffffff82
IO Hardware Path        = 0x00ffffffffffff01

Module Error Register = 0x0000000000000000
Rope Physical Location = 0x000202ffff09ff83

System Bus Adapter -- Rope Interface
------------------------------------------

Timestamp = Fri Feb 28 15:21:42 GMT 2003 (20:03:02:28:15:21:42)

  OV  RQ  RS      ESTAT      A  C  D  corr  unc  fe  cw  pf
  --  --  --      -----      -  -  -  ----  ---  --  --  --
               ERR_FUNCTION                      X       
IO Requestor Address    = 0x0000000000000000
IO Target Address       = 0x0000000000000000
IO Responder Address    = 0x0000000000000000
IO Physical Location    = 0x000000ffffffff82
IO Hardware Path        = 0x00ffffffffffff01

Module Error Register = 0x0000000000000000
Rope Physical Location = 0x000202ffff0bff83

System Bus Adapter -- Rope Interface
------------------------------------------

Timestamp = Fri Feb 28 15:21:42 GMT 2003 (20:03:02:28:15:21:42)

  OV  RQ  RS      ESTAT      A  C  D  corr  unc  fe  cw  pf
  --  --  --      -----      -  -  -  ----  ---  --  --  --
               ERR_FUNCTION                      X       
IO Requestor Address    = 0x0000000000000000
IO Target Address       = 0x0000000000000000
IO Responder Address    = 0x0000000000000000
IO Physical Location    = 0x000000ffffffff82
IO Hardware Path        = 0x00ffffffffffff01

Module Error Register = 0x0000000000000000
Rope Physical Location = 0x000202ffff08ff83

System Bus Adapter -- Rope Interface
------------------------------------------

Timestamp = Fri Feb 28 15:21:42 GMT 2003 (20:03:02:28:15:21:42)

  OV  RQ  RS      ESTAT      A  C  D  corr  unc  fe  cw  pf
  --  --  --      -----      -  -  -  ----  ---  --  --  --
               ERR_FUNCTION                      X       
IO Requestor Address    = 0x0000000000000000
IO Target Address       = 0x0000000000000000
IO Responder Address    = 0x0000000000000000
IO Physical Location    = 0x000000ffffffff82
IO Hardware Path        = 0x00ffffffffffff01

Module Error Register = 0x0000000000000000
Rope Physical Location = 0x000202ffff07ff83

What and how should I submit to dump_analyser.sh (if relevant for a 64bits kernel?)

Thanks in advance,
Joel

---------------------------------
Vous surfez avec une ligne classique ?
Faites des economies avec Tiscali Complete
... Plus d'info sur http://complete.tiscali.be

#21 lore raw
Quoted 3 lines
Quoted 1 line

I test it on gcc-3.2 64bits and I obtain a a kernel (I will try to boot

it

Quoted 1 line

latter).

I would like to strongly suggest 3.3 be used for this kind testing. The 3.2 branch is more or less at its end. There is a serious PR relating to building a cross to hppa64-linux on hppa-linux which hasn't been resolved. 3.3 has a huge number of changes (hopefully improvements) for hppa64 and we are still doing bug fixes (no new features). 3.3 isn't far from release, so the more testing the better.

Dave

Signature · 2 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)
#22 lore raw
In reply to Joel Soete
Quoted 1 line

Sorry Dave I do not find this stuff.

The place to look is

linuxthreads/sysdeps/unix/sysv/linux/hppa/bits/initspin.h.

It is rather buried. Carlos and I have had some rather lengthy discussions on how to implement pthread locking in glibc given the limitations in aligning data on the stack and also for data allocated by malloc. This might be relevant to the kernel locking code.

Quoted 1 line

#define rwlock_init(lp) do { *(lp) = RW_LOCK_UNLOCKED; } while (0)

The above macro uses a compound literal. This creates a unique object in the scope in which the macro is used. As this is a BLKmode object, the alignment of the object is set to GCC's definition for BIGGEST_ALIGNMENT. The overall alignment also won't be better than STACK_BOUNDARY. It is possible to use a "static" macro argument in which case space for the object will be allocated in the .bss section rather than on the stack. This also allows the alignment attribute to work. If you do this, then you have to worry about whether the code needs to be reentrant.

On the hppa64 port (3.3 & later), BIGGEST_ALIGNMENT, STACK_BOUNDARY and PREFERRED_STACK_BOUNDARY are now all 128 bits. Prior to 3.3, PREFERRED_STACK_BOUNDARY is 1024 bits but this is wrong. The runtime documentation specifies 128 bits (16 bytes) for the stack alignment on the 64-bit port. Using a larger boundary just wastes space. Stack alignment is also determined by what you start with.

Also note, any attempt to provide an overall alignment for the compound literal on the stack is ignored. However, as all 64-bit machines are PA 2.0, this doesn't matter. On the otherhand, the alignment does matter for the 32-bit port on PA 1.1 machines. There the ldcw insn has to operate on 16-byte aligned data. GCC from the master source has BIGGEST_ALIGNMENT set to 64-bits on the 32-bit port. So, the above macro won't create a properly aligned lock. Debian 3.0.4 has BIGGEST_ALIGNMENT set to 128, so it should be used for PA 1.1 kernel builds until this issue is resolved.

Quoted 1 line

Any better idea?

Not really. I might use a name like SPIN_LOCK_UNLOCKED_INIT rather than C_SPIN_LOCK_UNLOCKED, as I think it is slightly more descriptive.

Hope this helps,
Dave

Signature · 2 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)
author
#23 lore raw
Quoted 31 lines
Quoted 2 lines

Sorry Dave I do not find this stuff.

The place to look is

linuxthreads/sysdeps/unix/sysv/linux/hppa/bits/initspin.h.

It is rather buried. Carlos and I have had some rather lengthy discussions on how to implement pthread locking in glibc given the limitations in aligning data on the stack and also for data allocated by malloc. This might be relevant to the kernel locking code.

Quoted 1 line

#define rwlock_init(lp) do { *(lp) = RW_LOCK_UNLOCKED; } while (0)

The above macro uses a compound literal. This creates a unique object in the scope in which the macro is used. As this is a BLKmode object, the alignment of the object is set to GCC's definition for BIGGEST_ALIGNMENT. The overall alignment also won't be better than STACK_BOUNDARY. It is possible to use a "static" macro argument in which case space for the object will be allocated in the .bss section rather than on the stack. This also allows the alignment attribute to work. If you do this, then you have to worry about whether the code needs to be reentrant.

On the hppa64 port (3.3 & later), BIGGEST_ALIGNMENT, STACK_BOUNDARY and PREFERRED_STACK_BOUNDARY are now all 128 bits. Prior to 3.3, PREFERRED_STACK_BOUNDARY is 1024 bits but this is wrong. The runtime documentation specifies 128 bits (16 bytes) for the stack alignment on the 64-bit port. Using a larger boundary just wastes space. Stack alignment is also determined by what you start with.

Quoted 10 lines

Also note, any attempt to provide an overall alignment for the compound literal on the stack is ignored. However, as all 64-bit machines are PA 2.0, this doesn't matter. On the otherhand, the alignment does matter for the 32-bit port on PA 1.1 machines. There the ldcw insn has to operate on 16-byte aligned data. GCC from the master source has BIGGEST_ALIGNMENT set to 64-bits on the 32-bit port. So, the above macro won't create a properly aligned lock. Debian 3.0.4 has BIGGEST_ALIGNMENT set to 128, so it should be used for PA 1.1 kernel builds until this issue is resolved.

Thanks for all info ;)

Quoted 5 lines
Quoted 1 line

Any better idea?

Not really. I might use a name like SPIN_LOCK_UNLOCKED_INIT rather than C_SPIN_LOCK_UNLOCKED, as I think it is slightly more descriptive.

Ok for me (my C_ would stand for Constant form)

Joel

---------------------------------
Vous surfez avec une ligne classique ?
Faites des economies avec Tiscali Complete
... Plus d'info sur http://complete.tiscali.be