NetBSD Problem Report #56089

From martin@aprisoft.de  Fri Apr  2 08:59:21 2021
Return-Path: <martin@aprisoft.de>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 2B6331A9217
	for <gnats-bugs@gnats.NetBSD.org>; Fri,  2 Apr 2021 08:59:21 +0000 (UTC)
Message-Id: <20210402085911.011CB5CC7A0@emmas.aprisoft.de>
Date: Fri,  2 Apr 2021 10:59:10 +0200 (CEST)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: ofwboot fails to load G5 kernel
X-Send-Pr-Version: 3.95

>Number:         56089
>Category:       port-macppc
>Synopsis:       ofwboot fails to load G5 kernel
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    thorpej
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 02 09:00:00 +0000 2021
>Closed-Date:    Fri Sep 15 18:35:14 +0000 2023
>Last-Modified:  Fri Sep 15 18:35:14 +0000 2023
>Originator:     Martin Husemann
>Release:        NetBSD 9.99.81
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD big-apple.aprisoft.de 9.99.81 NetBSD 9.99.81 (POWERMAC_G5.MP) #12: Fri Apr 2 08:55:57 CEST 2021 martin@seven-days-to-the-wolves.aprisoft.de:/work/src/sys/arch/macppc/compile/POWERMAC_G5.MP macppc
Architecture: powerpc
Machine: macppc
>Description:

Trying to load my kernel via ofwboot fails:

Apple PowerMac7,3 5.1.8f7 BootROM built on 10/26/04 at 16:30:32
Copyright 1994-2004 Apple Computer, Inc.
All Rights Reserved.

Welcome to Open Firmware, the system time and date is: 07:01:48 04/02/2021

To continue booting, type "mac-boot" and press return.
To shut down, type "shut-down" and press return.

 ok
0 > boot sd1:1,ofwboot.xcf sd1:/netbsd load-size=7936f adler32=3cd24efd 

loading XCOFF

tsize=10070 dsize=268 bsize=28f0 entry=e00000 
SECTIONS:
.text    00e00000 00e00000 00010070 00001000
.pad     00e10064 00e10064 00000f90 00011070
.data    00e11000 00e11000 00000268 00012000
.bss     00e11268 00e11268 000028f0 00000000
.debug_l 00000000 00000000 00012008 00012268
.debug_s 00000000 00000000 000050ab 00024270
.gnu.att 00000000 00000000 00000010 0002931b
.ident   00000000 00000000 00000076 0002932b
.debug_i 00000000 00000000 0002c558 000293a1
.debug_a 00000000 00000000 00008537 000558f9
.debug_l 00000000 00000000 00013f1c 0005de30
.debug_a 00000000 00000000 000008e8 00071d4c
.debug_r 00000000 00000000 00000ee8 00072634
.debug_f 00000000 00000000 0000277c 0007351c
loading .text, done..
loading .data, done..
clearing .bss, done..

>> NetBSD/macppc OpenFirmware Boot, Revision 1.14 (Tue Mar 30 19:45:04 UTC 2021)
>> Open Firmware version 4.x
>> Open Firmware running in virtual-mode.
@@@@@@@@@5206364!!! CLAIM PHYS 0x100000 RETURNED 0x0
!!! FAILED TO CLAIM PHYS 0x100000 size 0x4f8000
read section
 start=0x0

Invalid memory access at   %SRR0: 00000000.00e0e128   %SRR1: 10000000.00003030 
 ok


Booting the kernel directly works (but then it misses symbols).


>How-To-Repeat:
s/a

>Fix:
n/a

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: port-macppc-maintainer->thorpej
Responsible-Changed-By: thorpej@NetBSD.org
Responsible-Changed-When: Fri, 02 Apr 2021 13:13:14 +0000
Responsible-Changed-Why:
Take.


From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: macallan@NetBSD.org
Subject: Re: port-macppc/56089: ofwboot fails to load G5 kernel
Date: Tue, 22 Feb 2022 18:24:43 +0100

 I compiled a ofwboot version with a bit more debug output and got the
 output below.

 Martin


 Apple PowerMac7,3 5.1.8f7 BootROM built on 10/26/04 at 16:30:32
 Copyright 1994-2004 Apple Computer, Inc.
 All Rights Reserved.

 Welcome to Open Firmware, the system time and date is: 17:08:49 02/22/2022

 To continue booting, type "mac-boot" and press return.
 To shut down, type "shut-down" and press return.

  ok
 0 > boot sd1:1,ofwboot.xcf load-size=6e893 adler32=24743c7d 

 loading XCOFF

 tsize=10980 dsize=23c bsize=2909 entry=e00000 
 SECTIONS:
 .text    00e00000 00e00000 00010980 00001000
 .pad     00e10974 00e10974 00000680 00011980
 .data    00e11000 00e11000 0000023c 00012000
 .bss     00e11240 00e11240 00002909 00000000
 .debug_l 00000000 00000000 00011cce 0001223c
 .debug_s 00000000 00000000 00004dff 00023f0a
 .gnu.att 00000000 00000000 00000010 00028d09
 .ident   00000000 00000000 000000ad 00028d19
 .debug_i 00000000 00000000 000226ec 00028dc6
 .debug_a 00000000 00000000 000076af 0004b4b2
 .debug_l 00000000 00000000 00014578 00052b61
 .debug_a 00000000 00000000 00000908 000670d9
 .debug_r 00000000 00000000 00000f93 000679e1
 .debug_f 00000000 00000000 00002854 00068974
 loading .text, done..
 loading .data, done..
 clearing .bss, done..

 >> NetBSD/macppc OpenFirmware Boot, Revision 1.14 (Tue Feb 22 17:05:09 UTC 2022)
 >> Open Firmware version 4.x
 >> Open Firmware running in virtual-mode.
 bootline=
 parsefilepath: path = /netbsd
 parsefilepath: Checking /netbsd: dhandle = -1
 parsefilepath: filename = /netbsd
 Trying /netbsd
 parsefilepath: path = /netbsd
 parsefilepath: Checking /netbsd: dhandle = -1
 parsefilepath: filename = /netbsd
 devopen: devname =  /ht/pci@7/k2-sata-root/k2-sata@1/disk@0:0, filename = /netbsd
 devopen: opened_name =  /ht/pci@7/k2-sata-root/k2-sata@1/disk@0:0/netbsd
 OF_open(/ht/pci@7/k2-sata-root/k2-sata@1/disk@0:0) -> -5083648
 OF_seek(-5083648, 0, 0) -> 0
 OF_read(-5083648, 0xe12868, 200) -> 200
 OF_seek(-5083648, 0, 0) -> 0
 OF_read(-5083648, 0xe12868, 200) -> 200
 OF_seek(-5083648, 0, 7d84200) -> 0
 OF_read(-5083648, 0xe12868, 200) -> 200
 OF_claim(0x0, 1000, 1000) -> 0x3000
 OF_claim(0x0, 3000, 1000) -> 0x4000
 OF_seek(-5083648, 0, 7d86000) -> 0
 OF_read(-5083648, 0x4010, 2000) -> 2000
 OF_seek(-5083648, 0, 7d94000) -> 0
 OF_read(-5083648, 0x4010, 2000) -> 2000
 OF_claim(0x0, 5000, 1000) -> 0x7000
 OF_seek(-5083648, 0, 7da0000) -> 0
 OF_read(-5083648, 0x7010, 4000) -> 4000
 OF_seek(-5083648, 0, 8340000) -> 0
 OF_read(-5083648, 0x7010, 800) -> 800
 OF_seek(-5083648, 0, 7d86000) -> 0
 OF_read(-5083648, 0x4010, 2000) -> 2000
 OF_seek(-5083648, 0, 7d86000) -> 0
 OF_read(-5083648, 0x4010, 2000) -> 2000
 OF_seek(-5083648, 0, 7d86000) -> 0
 OF_read(-5083648, 0x9118, 2800) -> 2800
 OF_seek(-5083648, 0, 7d8c000) -> 0
 OF_read(-5083648, 0x3010, 800) -> 800
 OF_open(/ht/pci@7/k2-sata-root/k2-sata@1/disk@0:1,netbsd) -> -5084928
 OF_read(-5084928, 0x7010, 1000) -> 1000
 OF_seek(-5084928, 0, 0) -> 0
 OF_read(-5084928, 0xe12e78, 34) -> 34
 OF_claim(0x0, 1000, 1000) -> 0xc000
 OF_seek(-5084928, 0, 34) -> 0
 OF_read(-5084928, 0xc010, 20) -> 20
 5214076OF_seek(-5084928, 0, 80) -> 0
 !!! CLAIM PHYS 0x100000 RETURNED 0x20
 !!! FAILED TO CLAIM PHYS 0x100000 size 0x4f9000
 read section
  start=0x0

 Invalid memory access at   %SRR0: 00000000.00e0e714   %SRR1: 10000000.00003030 
  ok

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: macallan@NetBSD.org
Subject: Re: port-macppc/56089: ofwboot fails to load G5 kernel
Date: Wed, 23 Feb 2022 17:21:59 +0100

 So the first call to the new OFW_claimphys fails.
 I added some debug output:

 !!! CLAIM PHYS 0x100000 RETURNED 0x20 - ofw_address_cells 2 ofw_memory_ihandle 4290234752 res 20 / e12d58
 !!! FAILED TO CLAIM PHYS 0x100000 size 0x4f9000


 and verified the cell numbers:

 #address-cells          00000002 
 #size-cells             00000001 

 and the memory nodes:

 memory                  ffb7c980 
 mmu                     ffb7ca00 


 I don't understand the verification that method does and how it tries to
 fit two 32bit cells (that OF should have returned) into a single 32bit
 paddr_t.

 Why do we need to force a physical address here anyway? The old (working)
 ofwboot code did not do that and the commit log mentions nothing about
 this change.

 Martin

State-Changed-From-To: open->closed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Fri, 15 Sep 2023 18:35:14 +0000
State-Changed-Why:
This has been fixed quite some time ago


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.