Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Jun Sun <jsun@mvista.com>
To: Alexandr Andreev <andreev@niisi.msk.ru>
Cc: linux-mips@oss.sgi.com
Subject: Re: 3 questions about linux-2.4.18 and R3000
Date: Fri, 24 May 2002 14:10:55 -0700	[thread overview]
Message-ID: <3CEEAC5F.6010802@mvista.com> (raw)
In-Reply-To: 3CEEBBA9.5070809@niisi.msk.ru

Alexandr Andreev wrote:

> Hi, list.
> I have three little questions with linux-2.4.18 on my machine.
> 
> My configuration is:
> MIPS R3000, linux-2.4.18 kernel from CVS,
> egcs-mips-linux-1.1.2-4 (egcs-2.91.66) and binutils-mips-linux-2.8.1-2
> 
> 1. When i use MIPS specific arch_get_unmapped_area() function, my kernel
>  hangs. It looks like this:
>  ...
>  Freeing unused kernel memory: 108k freed
>  do_page_fault() #2: sending SIGSEGV to init for illegal read access 
> from        0fb65330 (epc == 0fb65330, ra == 0fb851dc)
>  ... and so on. Last message is printed infinitely.
> 
>  So, i have to give up HAVE_ARCH_UNMAPPED_AREA feature, and to use
>  common arch_get_unmapped_area() routine.
> 


I took a look of the arch_get_unmapped_area(),  and it looks fine to me.

Can you try the following changes and let me know what happens?

1) change COLOUR_ALIGN
#define COLOUR_ALIGN(addr,pgoff) 	addr

2) I don't understand why we need color alignment if file is not NULL.  (Can 
someone explain?).  So you can try to remove that condition:

diff -Nru ./arch/mips/kernel/syscall.c.orig ./arch/mips/kernel/syscall.c
--- ./arch/mips/kernel/syscall.c.orig   Sat May 11 00:05:34 2002
+++ ./arch/mips/kernel/syscall.c        Fri May 24 13:54:47 2002
@@ -77,7 +77,7 @@
         if (len > TASK_SIZE)
                 return -ENOMEM;
         do_color_align = 0;
-       if (filp || (flags & MAP_SHARED))
+       if (flags & MAP_SHARED)
                 do_color_align = 1;
         if (addr) {
                 if (do_color_align)



> 2. There is a strange code in the local_flush_tlb_page() function
>  (tlb-r3k.c and tlb-r4k.c):
>     ...
>         if (!vma || vma->vm_mm->context != 0) {
>               unsigned long flags;
>               int oldpid, newpid, idx;
>  #ifdef DEBUG_TLB
>               printk("[tlbpage<%lu,0x%08lx>]", vma->vm_mm->context, page);
>  #endif
>               newpid = (vma->vm_mm->context & 0xfc0);
>                         ^^^^^
>  Hmm... the kernel will crash if vma ==0. I guess that this code must look
>  like this:
> 
>         if (vma && vma->vm_mm->context !=0) {
> 
>  Is any patches required?
> 


I think you just found a bug.  The fix looks good to me.


> 3. I have some problems, when i try to compile latest kernels with my egcs
>  and binutils, such as problems with "__INIT" and "__FINI" assembler 
> macroses:
> 
>  # mips-linux-gcc -D__ASSEMBLY__ -D__KERNEL__ -I include -G 0
>   -mno-abicalls -fno-pic -mcpu=r3000 -mips1 -pipe -c entry.S -o entry.o
>  entry.S: Assembler messages:
>  entry.S:179: Error: .previous without corresponding .section; ignored
> 
>  ... and ".macro" assembler command usage:
> 
>  # mips-linux-gcc -D__ASSEMBLY__ -D__KERNEL__ -I include -G 0   
> -mno-abicalls -fno-pic -mcpu=r3000 -mips1 -pipe -c head.S -o head.o
>  head.S: Assembler messages:
>  head.S:224: Error: .size expression too complicated to fix up
>  head.S:224: Error: .size expression too complicated to fix up
>  head.S:224: Error: .size expression too complicated to fix up
>  head.S:224: Error: .size expression too complicated to fix up
>  make[1]: *** [head.o] Error 1
> 
>  I know that my binutils are obsolete and so, I tried to use some newer
>   binutils (2.9.5-1, 2.9.5-3), but my kernel crashed :(. Please, can you 
> answer
>   me, what egcs & binutils are suitable for linux-2.4.18 and MIPS R3000
>   compliant?
>


We have been using gcc 2.9.5 and binutils 2.10.x for R3000 CPUs for quite a 
while with no problems.  It seems newer gcc and binutiles are fine too.

Jun

  reply	other threads:[~2002-05-24 21:29 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-24 22:16 3 questions about linux-2.4.18 and R3000 Alexandr Andreev
2002-05-24 21:10 ` Jun Sun [this message]
2002-05-27 21:13   ` Alexandr Andreev
2002-05-28 17:15     ` Jun Sun
2002-05-30  0:18       ` Alexandr Andreev
2002-05-31  9:43       ` Gleb O. Raiko
2002-06-03  8:55         ` Ralf Baechle
2002-06-03 18:30           ` Maciej W. Rozycki
2002-06-03 22:40             ` Ralf Baechle
2002-06-03 23:01               ` Thiemo Seufer
2002-06-03 23:04                 ` Ralf Baechle
2002-06-03 23:11                   ` Thiemo Seufer
2002-06-03 23:15                     ` Ralf Baechle
2002-06-03 23:53                       ` Thiemo Seufer
2002-06-04 17:41                         ` nick
2002-06-05 22:37                           ` Thiemo Seufer
2002-06-05 23:50                             ` Ilya Volynets
2002-06-06 23:54                               ` Thiemo Seufer
2002-06-04 14:39                   ` Maciej W. Rozycki
2002-06-04 14:37                 ` Maciej W. Rozycki
2002-06-05 22:38                   ` Thiemo Seufer
2002-06-04 14:34               ` Maciej W. Rozycki
2002-06-04 11:31           ` Gleb O. Raiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3CEEAC5F.6010802@mvista.com \
    --to=jsun@mvista.com \
    --cc=andreev@niisi.msk.ru \
    --cc=linux-mips@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox