Linux MIPS Architecture development
 help / color / mirror / Atom feed
* CONFIG_MIPS32 implies CONFIG_CPU_HAS_PREFETCH
@ 2002-08-07 15:04 Stewart Brodie
  2002-08-07 15:25 ` Ralf Baechle
  2002-08-07 15:41 ` Maciej W. Rozycki
  0 siblings, 2 replies; 3+ messages in thread
From: Stewart Brodie @ 2002-08-07 15:04 UTC (permalink / raw)
  To: linux-mips

linux_2_4 branch question: In config-shared.in, and previously in config.in,
whether or not the CPU has prefetch instructions seems to be dependent only
on whether CONFIG_MIPS32 is y.  However, this causes our kernel builds to die
when compiling memcpy.S because the compiler is objecting to the pref/prefx
instructions.  The gcc 2.96 compiler options we are using are -mtune=r4600
and -mips2.

Is it simply the case that the processors on all the boards supported in the
MIPS builds all support prefetch?  At the moment, I've just put a specific
check in for our particular processor to stop CONFIG_CPU_HAS_PREFETCH from
being set to y and that stops the problem.  In earlier (2.4.17 pre-release)
kernels, whether or not to define PREF/PREFX as pref/prefx or the empty
string was determined on a stricter set of criteria based around actual CPU
types rather than a blanket check on being a 32-bit MIPS.

-- 
Stewart Brodie, Senior Software Engineer
Pace Micro Technology PLC
645 Newmarket Road
Cambridge, CB5 8PB, United Kingdom         WWW: http://www.pacemicro.com/

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

* Re: CONFIG_MIPS32 implies CONFIG_CPU_HAS_PREFETCH
  2002-08-07 15:04 CONFIG_MIPS32 implies CONFIG_CPU_HAS_PREFETCH Stewart Brodie
@ 2002-08-07 15:25 ` Ralf Baechle
  2002-08-07 15:41 ` Maciej W. Rozycki
  1 sibling, 0 replies; 3+ messages in thread
From: Ralf Baechle @ 2002-08-07 15:25 UTC (permalink / raw)
  To: Stewart Brodie; +Cc: linux-mips

On Wed, Aug 07, 2002 at 04:04:16PM +0100, Stewart Brodie wrote:

> linux_2_4 branch question: In config-shared.in, and previously in config.in,
> whether or not the CPU has prefetch instructions seems to be dependent only
> on whether CONFIG_MIPS32 is y.  However, this causes our kernel builds to die
> when compiling memcpy.S because the compiler is objecting to the pref/prefx
> instructions.  The gcc 2.96 compiler options we are using are -mtune=r4600
> and -mips2.
> 
> Is it simply the case that the processors on all the boards supported in the
> MIPS builds all support prefetch?  At the moment, I've just put a specific
> check in for our particular processor to stop CONFIG_CPU_HAS_PREFETCH from
> being set to y and that stops the problem.  In earlier (2.4.17 pre-release)
> kernels, whether or not to define PREF/PREFX as pref/prefx or the empty
> string was determined on a stricter set of criteria based around actual CPU
> types rather than a blanket check on being a 32-bit MIPS.

The MIPS32 architecture specifies a prefetch instruction.  So it's correct
(though not necessarily alway the most efficient thing) to assume your
system has this instruction available.  The compiler option -mips2 which
you're specifying however tells the tools that you do not have that
instruction, so is wrong.

  Ralf

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

* Re: CONFIG_MIPS32 implies CONFIG_CPU_HAS_PREFETCH
  2002-08-07 15:04 CONFIG_MIPS32 implies CONFIG_CPU_HAS_PREFETCH Stewart Brodie
  2002-08-07 15:25 ` Ralf Baechle
@ 2002-08-07 15:41 ` Maciej W. Rozycki
  1 sibling, 0 replies; 3+ messages in thread
From: Maciej W. Rozycki @ 2002-08-07 15:41 UTC (permalink / raw)
  To: Stewart Brodie; +Cc: linux-mips

On Wed, 7 Aug 2002, Stewart Brodie wrote:

> linux_2_4 branch question: In config-shared.in, and previously in config.in,
> whether or not the CPU has prefetch instructions seems to be dependent only
> on whether CONFIG_MIPS32 is y.  However, this causes our kernel builds to die

 Well, what I see is CONFIG_CPU_HAS_PREFETCH is set for the following CPU
selection options:

- CONFIG_CPU_MIPS32,

- CONFIG_CPU_MIPS64,

- CONFIG_CPU_RM7000,

- CONFIG_CPU_SB1,

presumably because they support prefetching instructions.

> when compiling memcpy.S because the compiler is objecting to the pref/prefx
> instructions.  The gcc 2.96 compiler options we are using are -mtune=r4600
> and -mips2.

 Check you have a sufficiently new version of binutils -- the instructions
are guarded by ".set mips4", so they should be assembled just fine
regardless of the options passed to as.  What is the exact error message
printed (the usual first question, sigh...)?

> Is it simply the case that the processors on all the boards supported in the
> MIPS builds all support prefetch?  At the moment, I've just put a specific
> check in for our particular processor to stop CONFIG_CPU_HAS_PREFETCH from
> being set to y and that stops the problem.  In earlier (2.4.17 pre-release)
> kernels, whether or not to define PREF/PREFX as pref/prefx or the empty
> string was determined on a stricter set of criteria based around actual CPU
> types rather than a blanket check on being a 32-bit MIPS.

 Please make sure you have a clean checkout of the CVS tree -- here is an
extract of the relevant part of current config-shared.in from the 2.4
branch:

if [ "$CONFIG_CPU_MIPS32" = "y" ]; then
   define_bool CONFIG_CPU_HAS_PREFETCH y
   bool '  Support for Virtual Tagged I-cache' CONFIG_VTAG_ICACHE
fi

if [ "$CONFIG_CPU_MIPS64" = "y" ]; then
   define_bool CONFIG_CPU_HAS_PREFETCH y
   bool '  Support for Virtual Tagged I-cache' CONFIG_VTAG_ICACHE
fi

if [ "$CONFIG_CPU_RM7000" = "y" ]; then
   define_bool CONFIG_CPU_HAS_PREFETCH y
fi

if [ "$CONFIG_CPU_SB1" = "y" ]; then
   bool '  Workarounds for pass 1 sb1 bugs' CONFIG_SB1_PASS_1_WORKAROUNDS
   bool '  Support for SB1 Cache Error handler' CONFIG_SB1_CACHE_ERROR
   define_bool CONFIG_VTAG_ICACHE y
   define_bool CONFIG_CPU_HAS_PREFETCH y
fi

as you might see there is no CONFIG_MIPS32 dependency anywhere (also the
kernel works for the R3k, which definitely lacks prefetching intructions).

  Maciej

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

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

end of thread, other threads:[~2002-08-07 15:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-07 15:04 CONFIG_MIPS32 implies CONFIG_CPU_HAS_PREFETCH Stewart Brodie
2002-08-07 15:25 ` Ralf Baechle
2002-08-07 15:41 ` Maciej W. Rozycki

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