Skip to contentSkip to conversation

Changes to head.S

DISCUSSION Rani Assaf 2 participants 6 messages Mar 3, 2002 – Mar 4, 2002 MIPS

lore
Share & tools
lore

Rani Assaf

author
#0 lore raw

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

#1 lore raw
Quoted 8 lines · Rani Assaf

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

		.text
                .align  13

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.

Quoted 2 lines

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

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

Ralf

author
#2 lore raw
Quoted 2 lines · Ralf Baechle

you're observing an alignment problem I suspect you're using a too old egcs 1.1.2 variant.

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

#3 lore raw
Quoted 9 lines · Rani Assaf
Quoted 2 lines · Ralf Baechle

you're observing an alignment problem I suspect you're using a too old egcs 1.1.2 variant.

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)

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) }
Quoted 5 lines

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?

Sure, send patches to me.

Quoted 2 lines

(I can provide the code that runs on IDT eval boards though we're not using them anymore).

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

author
#4 lore raw
Quoted 4 lines · Ralf Baechle

these two lines in the linker script arch/mips/ld.script.in:

  . = ALIGN(8192);
  .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

#5 lore raw
Quoted 9 lines · Rani Assaf
Quoted 4 lines · Ralf Baechle

these two lines in the linker script arch/mips/ld.script.in:

  . = ALIGN(8192);
  .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:

Quoted 6 lines
        __attribute__((__section__(".text"))) =

to:

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

Right?

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

Ralf