NetBSD Problem Report #14497

Received: (qmail 25560 invoked from network); 7 Nov 2001 21:03:13 -0000
Message-Id: <20011107210255.AC90911112@www.netbsd.org>
Date: Wed,  7 Nov 2001 13:02:55 -0800 (PST)
From: cagney@mac.com
Sender: nobody@netbsd.org
Reply-To: cagney@mac.com
To: gnats-bugs@gnats.netbsd.org
Subject: OF_buf isn't in OF address space
X-Send-Pr-Version: www-1.0

>Number:         14497
>Category:       port-ofppc
>Synopsis:       OF_buf isn't in OF address space
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-ofppc-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Nov 07 21:04:00 +0000 2001
>Closed-Date:    Sun Jul 14 20:57:00 +0000 2002
>Last-Modified:  Sun Jul 14 20:57:00 +0000 2002
>Originator:     Andrew Cagney
>Release:        1.5.2 userland, current kernel
>Organization:
>Environment:
NetBSD localhost 1.5Y NetBSD 1.5Y (NETLUX) #1: Thu Nov  1 05:53:32 EST 2001     boor@localhost:/usr/src/sys/arch/macppc/compile/NETLUX macppc

>Description:
The OFPPC locore.s files both allocate space for OF_buf by extending
the .bss section by one page.

This only works if the OpenFirmware has 1:1 mapped all of memory.
PSIM doesn't do this so that 4k page of memory isn't in the VM
shared by the kernel and OF.

The code could instead:
  - claim() the memory using an OF call
  - shove the page into the .bss so it is part of the kernel and
  is already mapped in.

I suspect NetBSD/MacPPC has a similar problem.



>How-To-Repeat:
bash-2.04# gdb netbsd.gdb 
GNU gdb 2001-11-06-cvs
....
This GDB was configured as "powerpc-apple-netbsd1.5X"...
(gdb) target sim -r 0x400000 -t os-emul
Connected to the simulator.
(gdb) load
chirp: note descriptor missing load-base
(gdb) run
Starting program: /usr/src/sys/arch/ofppc/compile/GENERIC/netbsd.gdb 
emul_chirp.c:1982: finddevice called from 0x287898 with args 0x2bad0c
emul_chirp.c:718: finddevice - in - device_specifier=`/chosen'
emul_chirp.c:729: finddevice - out - phandle=0x4(0x1c0c380`chosen')
emul_chirp.c:1982: getprop called from 0x287898 with args 0x2bacd0
emul_chirp.c:518: getprop - in - phandle=0x4(0x1c0c380`chosen') name=`stdin' buf=0x2ef000 buflen=4
cpu 1, cia 0x80004000: double interrupt - MSR[RI] bit clear when attempting to deliver interrupt, cia=0x80004000, msr=0x30; srr0=0x0(cia), srr1=0x0(msr); trap-vector=0x300, trap-msr=0x0

Program terminated with signal ?, Unknown signal.
The program no longer exists.
[Switching to process 0]
(gdb) 

>Fix:
The hack below works.

bash-2.04# diff -c locore.S fixed-locore.S 
*** locore.S    Wed Nov  7 15:43:45 2001
--- fixed-locore.S      Fri Oct 26 21:25:01 2001
***************
*** 77,82 ****
--- 77,86 ----
  openfirmware_entry:
        .long   0                       /* openfirmware entry point */

+       .section .bss
+ OF_buffer:    
+       .space 0x1000
+ 
  /*
   * This symbol is here for the benefit of kvm_mkdb, and is supposed to
   * mark the start of kernel text.
***************
*** 146,151 ****
--- 150,158 ----
        li      9,PGOFSET
        add     8,8,9
        andc    8,8,9
+ /*   having worked all this out just ignore it.  */
+       lis     8,OF_buffer@ha
+       addi    8,8,OF_buffer@l
        lis     9,_C_LABEL(OF_buf)@ha
        stw     8,_C_LABEL(OF_buf)@l(9)
        addi    8,8,NBPG


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: chs 
State-Changed-When: Sun Jul 14 13:56:25 PDT 2002 
State-Changed-Why:  
fixed both ofppc and macppc copies of this.  thanks! 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.