Subject: Changes to head.S

From: Rani Assaf <[email-masked]>
Date: Sun, 3 Mar 2002 18:50:49 +0100

Hi,

I'm  working  on  support  for  IDT  RC32355  CPU  on  a  board  we're
developping and  when trying to port  my code to a  recent snapshot of
the cvs  tree (up  to now,  I was using  a snapshot  dated of  dec 15,
2001),  the kernel  crashed at  boot  while starting  the init  thread
(unaligned access).

Looking at the diffs, I noticed  that putting back the following lines
at  the end  of head.S  (they've  been removed  in revision  1.29.2.4)
resolves the problem:

/*
 * Align to 8kb boundary for init_task_union which follows in the
 * .text segment.
 */
		.text
                .align  13

Any idea why they have been removed?

BTW,  print_memory_map()  (in  kernel.c)  now uses  long  long  format
without casting (which obviously gives wrong numbers on 32bits archs).

Regards,
Rani

---

From: Ralf Baechle <[email-masked]>
Date: Sun, 3 Mar 2002 22:56:31 +0100

> Any idea why they have been removed?

init_task_union lives in it's own section which has 8kB alignment.  So if
you're observing an alignment problem I suspect you're using a too old
egcs 1.1.2 variant.

> without casting (which obviously gives wrong numbers on 32bits archs).

Yes and we preferably want to get rid of long long anyway.

  Ralf

---

From: Rani Assaf <[email-masked]>
Date: Sun, 3 Mar 2002 23:04:49 +0100

> you're observing an alignment problem I suspect you're using a too old

Hmm.. It's the redhat one on ftp://oss.sgi.com/pub/linux/mips/:

Reading specs from
/opt/Mipsel/bin/../lib/gcc-lib/mipsel-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-99.1)

Is there anything newer/better (I thought  that this is the place were
H.J. Lu binutils/gcc is stored)?

BTW, is there any interest in integrating the RC32355 support into the
main tree? (I can provide the code that runs on IDT eval boards though
we're not using them anymore).

Regards,
Rani

---

From: Ralf Baechle <[email-masked]>
Date: Sun, 3 Mar 2002 23:19:06 +0100

> gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-99.1)

Just doublechecked it.  The way the alignment guarantee works is through
these two lines in the linker script arch/mips/ld.script.in:

  . = ALIGN(8192);
  .data.init_task : { *(.data.init_task) }

> main tree?

Sure, send patches to me.

> (I can provide the code that runs on IDT eval boards though

I certainly would appreciate somebody to take care of maintaining support
for such eval boards.  By now the number of supported platforms means
that the code for platforms otherwise soon would start to bitrot.

  Ralf

---

From: Rani Assaf <[email-masked]>
Date: Sun, 3 Mar 2002 23:54:16 +0100

>   .data.init_task : { *(.data.init_task) }

Yep, I was just  looking at it. So the problem  is in init_task.c. The
following line should be changed from:

        __attribute__((__section__(".text"))) =

to:
	__attribute__((__section__(".data.init_task"))) =

Right?

Regards,
Rani

---

From: Ralf Baechle <[email-masked]>
Date: Mon, 4 Mar 2002 00:32:28 +0100

> 	__attribute__((__section__(".data.init_task"))) =

Yes, just as it already is in CVS for kernel 2.4.

  Ralf