Linux MIPS Architecture development
 help / color / mirror / Atom feed
* Newbie R5K questions -- -mips2 vs -mips4; is n32 ABI supported by Linux?
@ 2003-11-17 22:04 Jeffrey Baitis
  2003-11-17 22:29 ` Daniel Jacobowitz
  2003-11-17 22:52 ` Ralf Baechle
  0 siblings, 2 replies; 3+ messages in thread
From: Jeffrey Baitis @ 2003-11-17 22:04 UTC (permalink / raw)
  To: linux-mips; +Cc: Adam_Kiepul, Mr. Brian R. Gunnison, Francis Yu, Johnny Lam

Hi all:

I'm currently trying to increase performance on our PMC-Sierra RM5231
system by taking advantage of the MIPS IV ISA. This processor has a
32-bit address bus interface with 64-bit GPRs, so I guess that the
choice of -mabi=n32 is ideal for this processor.

Why is it that the Linux kernel defaults to -mcpu=r5000 -mips2 for the
52XX? Wouldn't there be good reasons to use the enhancements present in
the MIPS IV instruction set?

I've tried modifying the mips Makefile so that the Nevada adds the
cflags -mabi=n32 -mcpu=r5000 -mips4. I also modified asm/unistd.h so
that __NR_sigreturn is defined for the case where _MIPS_SIM ==
_MIPS_SIM_NABI32. Unfortunately, I get link errors: (gcc 3.2.3)

        arch/mips/kernel/kernel.o(.data+0x4240): undefined reference to
        `sys_stat64'
        arch/mips/kernel/kernel.o(.data+0x4244): undefined reference to
        `sys_lstat64'
        arch/mips/kernel/kernel.o(.data+0x4248): undefined reference to
        `sys_fstat64'
        drivers/ide/idedriver.o(.data.init+0x8): undefined reference to
        `init_setup_it8172'
        

The goal is that I want to be able to execute MIPS IV or MIPS III
instructions in user mode, since the profiling program that I'm using is
based in userspace and does not measure kernel performance. I already
have measured performance using MIPS I binaries. Under a -mips1-compiled
uClibc/busybox root filesystem, I tried executing -mips2, -mips3, and
-mips4 binaries -- but it seemed that the ELF interpreter was unable to
recognize them as valid ELF files (resulting in a shell 'Syntax Error').

After doing some digging, I found some documentation on SGI's website
about different ABI levels:

http://www.parallab.uib.no/SGI_bookshelves/SGI_Developer/books/MproCplrDbx_TG/sgi_html/ch06.html#Z70233

Here, I read that the OS, my libraries, and, of course, the application
must support the ABI of my choice. So, this takes me to my second
question: does Linux support the n32 ABI? How do I enable this support,
so that it is possible to take advantage of MIPS IV instructions?

Is there a book or FAQ that can answer questions such as these?

Thank you very much for any help.

Regards,

Jeff


-- 
Jeffrey Baitis <baitisj@evolution.com>

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

* Re: Newbie R5K questions -- -mips2 vs -mips4; is n32 ABI supported by Linux?
  2003-11-17 22:04 Newbie R5K questions -- -mips2 vs -mips4; is n32 ABI supported by Linux? Jeffrey Baitis
@ 2003-11-17 22:29 ` Daniel Jacobowitz
  2003-11-17 22:52 ` Ralf Baechle
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Jacobowitz @ 2003-11-17 22:29 UTC (permalink / raw)
  To: Jeffrey Baitis
  Cc: linux-mips, Adam_Kiepul, Mr. Brian R. Gunnison, Francis Yu,
	Johnny Lam

On Mon, Nov 17, 2003 at 02:04:26PM -0800, Jeffrey Baitis wrote:
> Hi all:
> 
> I'm currently trying to increase performance on our PMC-Sierra RM5231
> system by taking advantage of the MIPS IV ISA. This processor has a
> 32-bit address bus interface with 64-bit GPRs, so I guess that the
> choice of -mabi=n32 is ideal for this processor.
> 
> Why is it that the Linux kernel defaults to -mcpu=r5000 -mips2 for the
> 52XX? Wouldn't there be good reasons to use the enhancements present in
> the MIPS IV instruction set?
> 
> I've tried modifying the mips Makefile so that the Nevada adds the
> cflags -mabi=n32 -mcpu=r5000 -mips4. I also modified asm/unistd.h so
> that __NR_sigreturn is defined for the case where _MIPS_SIM ==
> _MIPS_SIM_NABI32. Unfortunately, I get link errors: (gcc 3.2.3)
> 
>         arch/mips/kernel/kernel.o(.data+0x4240): undefined reference to
>         `sys_stat64'
>         arch/mips/kernel/kernel.o(.data+0x4244): undefined reference to
>         `sys_lstat64'
>         arch/mips/kernel/kernel.o(.data+0x4248): undefined reference to
>         `sys_fstat64'
>         drivers/ide/idedriver.o(.data.init+0x8): undefined reference to
>         `init_setup_it8172'

Do not even attempt to run an n32 kernel.  Use a 64-bit kernel (you
can't just say -mabi=n64, of course!  See ARCH=mips64 in 2.4 or
CONFIG_MIPS64 in 2.6).

> The goal is that I want to be able to execute MIPS IV or MIPS III
> instructions in user mode, since the profiling program that I'm using is
> based in userspace and does not measure kernel performance. I already
> have measured performance using MIPS I binaries. Under a -mips1-compiled
> uClibc/busybox root filesystem, I tried executing -mips2, -mips3, and
> -mips4 binaries -- but it seemed that the ELF interpreter was unable to
> recognize them as valid ELF files (resulting in a shell 'Syntax Error').
> 
> After doing some digging, I found some documentation on SGI's website
> about different ABI levels:
> 
> http://www.parallab.uib.no/SGI_bookshelves/SGI_Developer/books/MproCplrDbx_TG/sgi_html/ch06.html#Z70233
> 
> Here, I read that the OS, my libraries, and, of course, the application
> must support the ABI of my choice. So, this takes me to my second
> question: does Linux support the n32 ABI? How do I enable this support,
> so that it is possible to take advantage of MIPS IV instructions?

Currently, the tools are just beginning to support n32 and n64 user
programs.  No released version of binutils, gcc, or glibc contains the
support.  Current CVS versions may or may not.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

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

* Re: Newbie R5K questions -- -mips2 vs -mips4; is n32 ABI supported by Linux?
  2003-11-17 22:04 Newbie R5K questions -- -mips2 vs -mips4; is n32 ABI supported by Linux? Jeffrey Baitis
  2003-11-17 22:29 ` Daniel Jacobowitz
@ 2003-11-17 22:52 ` Ralf Baechle
  1 sibling, 0 replies; 3+ messages in thread
From: Ralf Baechle @ 2003-11-17 22:52 UTC (permalink / raw)
  To: Jeffrey Baitis
  Cc: linux-mips, Adam_Kiepul, Mr. Brian R. Gunnison, Francis Yu,
	Johnny Lam

On Mon, Nov 17, 2003 at 02:04:26PM -0800, Jeffrey Baitis wrote:

> I'm currently trying to increase performance on our PMC-Sierra RM5231
> system by taking advantage of the MIPS IV ISA. This processor has a
> 32-bit address bus interface with 64-bit GPRs, so I guess that the
> choice of -mabi=n32 is ideal for this processor.

In addition to what Daniel just said ...

N32 requires a 64-bit kernel to run on which is significantly larger
thereby causing more cache misses so a 64-bit kernel is often slower.
On the kernel side a 64-bit kernel is drastically better at handling
large amounts of memory, so once a 32-bit kernel needs highmem the
64-bit kernel will win the race.  Often these effects influence
performance more than what you might gain from exploiting a new ISA.

  Ralf

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

end of thread, other threads:[~2003-11-17 22:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-17 22:04 Newbie R5K questions -- -mips2 vs -mips4; is n32 ABI supported by Linux? Jeffrey Baitis
2003-11-17 22:29 ` Daniel Jacobowitz
2003-11-17 22:52 ` Ralf Baechle

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