NetBSD Problem Report #49717

From www@NetBSD.org  Wed Mar  4 14:25:17 2015
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id E82A5A654B
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  4 Mar 2015 14:25:17 +0000 (UTC)
Message-Id: <20150304142513.862F4A65B8@mollari.NetBSD.org>
Date: Wed,  4 Mar 2015 14:25:13 +0000 (UTC)
From: scole_mail@gmx.com
Reply-To: scole_mail@gmx.com
To: gnats-bugs@NetBSD.org
Subject: add ia64 nfs netboot support
X-Send-Pr-Version: www-1.0

>Number:         49717
>Category:       port-ia64
>Synopsis:       add ia64 nfs netboot support
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    scole
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 04 14:30:00 +0000 2015
>Closed-Date:    Wed Aug 10 11:54:09 +0000 2016
>Last-Modified:  Wed Aug 10 11:54:09 +0000 2016
>Originator:     scole_mail
>Release:        current
>Organization:
>Environment:
NetBSD 7.99.5 (GENERIC) #1: Wed Mar  4 08:30:46 EST 2015
>Description:
I made some code changes to allow nfs/netbooting of my dual itanium
hp3410/rx2600.  Basically, the code tries to boot of disk, and if that
doesn't work, it tries nfs.

I used dhcp for the loader file "loader.efi", then typed "boot" to
load the kernel over nfs.  I had to enable rarpd also.  Not all of the
other boot commands work, e.g., ls is still crashing.

ski didn't work for me before or after these changes.

I thought about importing the latest freebsd efi code for ia64, but
saw someone is already working on a efi loader
http://mail-index.netbsd.org/current-users/2014/04/19/msg024713.html

The GENERIC kernel crashes with a "Page Not Present" error.  When I
added some debug printf's, it crashed at a later place with the same
error.  The boot messages are below.  My machine has 2G of memory but
only 1G is detected, maybe that is related to the crashes...

Feel free to change/fix this code in any way.

********************************
Files changed:
sys/arch/ia64/stand/common/Makefile.inc
sys/arch/ia64/stand/common/dev_net.c
sys/arch/ia64/stand/common/dev_net.h
sys/arch/ia64/stand/efi/libefi/Makefile
sys/arch/ia64/stand/efi/libefi/efiboot.h
sys/arch/ia64/stand/efi/libefi/efinet.c
sys/arch/ia64/stand/ia64/Makefile.booters
sys/arch/ia64/stand/ia64/efi/conf.c
sys/arch/ia64/stand/ia64/efi/main.c
sys/arch/ia64/stand/ia64/ski/conf.c
sys/arch/ia64/stand/ia64/ski/time.c

********************************
Here is the console output, I added "<-------" to highlight what I
selected or entered

EFI version 1.10 [14.61]
EFI64 Running on Intel(R) Itanium Processor Family 
EFI 1.10 IPF zx6000/rx2600/zx2000 1.22 [Thu Mar 11 14:22:35 2004] - HP

Copyright (c) 2000-2002 Broadcom Corporation
Broadcom NetXtreme Gigabit Ethernet EFI driver v3.0.7

Loading 'FPSWA'...
Loading 'lsi1030'...
Loading 'gigundi'...
2 0 0x00020B 0x0000000000000006 EFI Launching Boot Manager
Scsi(Pun0,Lun0) HP 36.4GMAS3367NC       HPC3 (320 MBytes/sec)                 
Scsi(Pun1,Lun0) HP 36.4GMAS3367NC       HPC3 (320 MBytes/sec)                 
Searching for device at Scsi(PunF,Lun0)  

EFI Boot Manager ver 1.10 [14.61]  Firmware ver 2.31 [4411]

Please select a boot option

    EFI Shell [Built-in]                                            
    Internal Bootable DVD                                           
    Boot Option Maintenance Menu <-------                                   
    System Configuration Menu                                       


    Use ^ and v to change option(s). Use Enter to select an option

EFI Boot Maintenance Manager ver 1.10 [14.61]

Main Menu. Select an Operation


        Boot from a File         <-------                                   
        Add a Boot Option                                           
        Delete Boot Option(s)                                       
        Change Boot Order                                           

        Manage BootNext setting                                     
        Set Auto Boot TimeOut                                       

        Select Active Console Output Devices                        
        Select Active Console Input Devices                         
        Select Active Standard Error Devices                        

        Cold Reset                                                  
        Exit                                                        


    Timeout-->[7] sec SystemGuid-->[C38370CE-02AD-11D9-A179-89962AC2F5B0]

EFI Boot Maintenance Manager ver 1.10 [14.61]

Boot From a File.  Select a Volume


    Removable Media Boot [Acpi(HWP0002,0)/Pci(2|0)/Ata(Primary,Maste
    Load File [EFI Shell [Built-in]]                                
    Load File [Acpi(HWP0002,0)/Pci(3|0)/Mac(00306EF3EB46)]    <-------      
    Load File [Acpi(HWP0002,100)/Pci(2|0)/Mac(00306EF35B59)]        
    Exit                                                            


Running LoadFile()

CLIENT MAC ADDR: 00 30 6E F3 EB 46 
CLIENT IP: 10.0.0.21  MASK: 255.255.255.0  DHCP IP: 10.0.0.1

TSize.Running LoadFile()

TFTP.Console: EFI console
Image base: 0x407efcb000

NetBSD/ia64 EFI boot, Revision 0.1 (Tue Mar  3 14:09:56 EST 2015)


Type '?' for a list of commands, 'help' for more detailed help.
OK boot                   <-------
4648168+109328+120360 [201504+135134]=0x4dc250
netbsd entry at 0xe000000004008000
Entering netbsd at 0xe000000004008000...
PAL Proc at 0xe00000003fac8010
SAL Proc at 0xe00000003fa42970, GP at 0xe00000003f930000
SAL: AP wake-up vector: 0xff
Platform clock frequency 200000000 Hz
Processor ratio 14/2, Bus ratio 1/1, ITC ratio 14/2
MD 0xe00000407ef4a0b0: type 4 pa 0x0 cnt 0x1
MD 0xe00000407ef4a0e0: type 7 pa 0x1000 cnt 0x9f
Loading descriptor 0xe00000407ef4a0e0: 0x1 / 0x28
MD 0xe00000407ef4a110: type 11 pa 0xa0000 cnt 0x20
MD 0xe00000407ef4a140: type 5 pa 0xc0000 cnt 0x40
MD 0xe00000407ef4a170: type 7 pa 0x100000 cnt 0x3f4e4
Descriptor 0xe00000407ef4a170 contains kernel
Loading chunk before kernel: 0x40 / 0x1000
Loading chunk after kernel: 0x1139 / 0xfd79
MD 0xe00000407ef4a1a0: type 5 pa 0x3f5e4000 cnt 0x4dc
MD 0xe00000407ef4a1d0: type 13 pa 0x3fac0000 cnt 0x40
MD 0xe00000407ef4a200: type 7 pa 0x3fb00000 cnt 0x7
Loading descriptor 0xe00000407ef4a200: 0xfec0 / 0xfec1
MD 0xe00000407ef4a230: type 4 pa 0x3fb07000 cnt 0x25
MD 0xe00000407ef4a260: type 9 pa 0x3fb2c000 cnt 0xc
MD 0xe00000407ef4a290: type 6 pa 0x3fb38000 cnt 0x4c8
MD 0xe00000407ef4a2c0: type 11 pa 0x80000000 cnt 0x7e000
MD 0xe00000407ef4a2f0: type 11 pa 0xfed00000 cnt 0x1300
MD 0xe00000407ef4a320: type 7 pa 0x4040000000 cnt 0x3ef4a
Skipping memory chunk start 0x4040000000
MD 0xe00000407ef4a350: type 2 pa 0x407ef4a000 cnt 0x81
MD 0xe00000407ef4a380: type 1 pa 0x407efcb000 cnt 0x33
MD 0xe00000407ef4a3b0: type 7 pa 0x407effe000 cnt 0x2f4
Skipping memory chunk start 0x407effe000
MD 0xe00000407ef4a3e0: type 4 pa 0x407f2f2000 cnt 0x50f
MD 0xe00000407ef4a410: type 7 pa 0x407f801000 cnt 0x5
MD 0xe00000407ef4a440: type 4 pa 0x407f806000 cnt 0x1f4
MD 0xe00000407ef4a470: type 7 pa 0x407f9fa000 cnt 0x1
MD 0xe00000407ef4a4a0: type 4 pa 0x407f9fb000 cnt 0x3
MD 0xe00000407ef4a4d0: type 7 pa 0x407f9fe000 cnt 0x36a
Skipping memory chunk start 0x407f9fe000
MD 0xe00000407ef4a500: type 5 pa 0x407fd68000 cnt 0x3c
MD 0xe00000407ef4a530: type 3 pa 0x407fda4000 cnt 0x5a
MD 0xe00000407ef4a560: type 7 pa 0x407fdfe000 cnt 0x12
Skipping memory chunk start 0x407fdfe000
MD 0xe00000407ef4a590: type 5 pa 0x407fe10000 cnt 0x6e
MD 0xe00000407ef4a5c0: type 7 pa 0x407fe7e000 cnt 0x142
Skipping memory chunk start 0x407fe7e000
MD 0xe00000407ef4a5f0: type 6 pa 0x407ffc0000 cnt 0x40
MD 0xe00000407ef4a620: type 11 pa 0x80000000000 cnt 0x80000000
MD 0xe00000407ef4a650: type 12 pa 0x3fffffc000000 cnt 0x4000
ptc.e base=0x0, count1=1, count2=1, stride1=0x0, stride2=0x0
Processor supports 24 Region ID bits
Trying VHPT size 0x10000
Putting VHPT at 0xe000000000020000
vhpt base = e000000000020000 
vhpt size = 10000 
Loaded initial symtab at 0xe000000004489f50, strtab at 0xe0000000044bb270, # entries 8372
pmap_reference(0xe00000000447c178)
Detected memory  = 1062748160 (1013 MB)
Physical memory chunk(s):
0x0000000000018000 - 0x000000000001ffff, 32768 bytes (2 pages)
0x0000000000050000 - 0x000000000009ffff, 327680 bytes (20 pages)
0x0000000000af4000 - 0x0000000003ffffff, 55623680 bytes (3395 pages)
0x00000000044e4000 - 0x000000003f5e3fff, 990904320 bytes (60480 pages)
0x000000003fb00000 - 0x000000003fb03fff, 16384 bytes (1 pages)
Total number of segments: vm_nphysseg = 5 
pmap_reference(0xe00000000447c178)
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 7.99.5 (GENERIC) #0: Wed Mar  4 08:21:48 EST 2015
        scole@dstar:/home/scole/nbsd/src/sys/arch/ia64/compile/obj/GENERIC
total memory = 1013 MB
avail memory = 998 MB
Warning: no FPSWA package supplied
Table 'FACP' at 0xe00000003fb369e0
Table 'SPCR' at 0xe00000003fb36b18
Table 'DBGP' at 0xe00000003fb36b68
Table 'APIC' at 0xe00000003fb36c28
        Local APIC address=0xfee00000
        Local APIC override entry
                Local APIC address=0xfee00000
        Local SAPIC entry
                ProcessorId=0x0, Id=0x0, Eid=0x0
        Local SAPIC entry
                ProcessorId=0x1, Id=0x1, Eid=0x0
        I/O SAPIC entry
                Id=0x0, InterruptBase=0x10, Address=0xfed20800
        I/O SAPIC entry
                Id=0x1, InterruptBase=0x1b, Address=0xfed22800
        I/O SAPIC entry
                Id=0x2, InterruptBase=0x26, Address=0xfed24800
        I/O SAPIC entry
                Id=0x3, InterruptBase=0x31, Address=0xfed26800
        I/O SAPIC entry
                Id=0x4, InterruptBase=0x3c, Address=0xfed28800
        I/O SAPIC entry
                Id=0x6, InterruptBase=0x47, Address=0xfed2c800
        I/O SAPIC entry
                Id=0x7, InterruptBase=0x52, Address=0xfed2e800
Table 'SPMI' at 0xe00000003fb36ba0
Table 'CPEP' at 0xe00000003fb36bf0
Table 'SSDT' at 0xe00000003fb33870
Table 'SSDT' at 0xe00000003fb33a50
Table 'SSDT' at 0xe00000003fb33da0
Table 'SSDT' at 0xe00000003fb347c0
Table 'SSDT' at 0xe00000003fb351e0
Table 'SSDT' at 0xe00000003fb35c00
Table 'SSDT' at 0xe00000003fb36620
Table 'SSDT' at 0xe00000003fb36800
Table 'SSDT' at 0xe00000003fb368f0
pmap_reference(0xe00000000447c178)
pmap_reference(0xe00000000447c178)

fatal kernel trap (cpu 0):

    trap vector = 0x14 (Page Not Present)
    cr.iip      = 0xe000000004361dc0
    cr.ipsr     = 0x1010080a2010 (mfl,ic,dt,dfh,rt,cpl=0,it,ri=0,bn)
    cr.isr      = 0x400000000 (code=0,vector=0,r,ei=0)
    cr.ifa      = 0x68
    curlwp   = 0xe000000004456d00
        pid = 0, comm = system

Stopped in pid 0.1 (system) at  netbsd:cpu_lwp_fork+0x340:      [M0]    ld8 r15=r15
db> t
--Kernel Call Trace--

fatal kernel trap (cpu 0):

    trap vector = 0x14 (Page Not Present)
    cr.iip      = 0xe0000000041d5a70
    cr.ipsr     = 0x1210080a2010 (mfl,ic,dt,dfh,rt,cpl=0,it,ri=1,bn)
    cr.isr      = 0x20400000000 (code=0,vector=0,r,ei=1)
    cr.ifa      = 0x8
    curlwp   = 0xe000000004456d00
        pid = 0, comm = system

Stopped in pid 0.1 (system) at  netbsd:patchunwindframe+0x31:   [M1]    ld8 r14=
r14

**********************************

It gets a little farther but crashes with same "Page Not Present"
error if some print statements are added to vm_machdep.c, cpu_lwp_fork:

NetBSD/ia64 EFI boot, Revision 0.1 (Tue Mar  3 14:09:56 EST 2015)


Type '?' for a list of commands, 'help' for more detailed help.
OK boot
4648208+109352+120360 [201504+135134]=0x4dc290
netbsd entry at 0xe000000004008000
Entering netbsd at 0xe000000004008000...
PAL Proc at 0xe00000003fac8010
SAL Proc at 0xe00000003fa42970, GP at 0xe00000003f930000
SAL: AP wake-up vector: 0xff
Platform clock frequency 200000000 Hz
Processor ratio 14/2, Bus ratio 1/1, ITC ratio 14/2
MD 0xe00000407ef4a0b0: type 4 pa 0x0 cnt 0x1
MD 0xe00000407ef4a0e0: type 7 pa 0x1000 cnt 0x9f
Loading descriptor 0xe00000407ef4a0e0: 0x1 / 0x28
MD 0xe00000407ef4a110: type 11 pa 0xa0000 cnt 0x20
MD 0xe00000407ef4a140: type 5 pa 0xc0000 cnt 0x40
MD 0xe00000407ef4a170: type 7 pa 0x100000 cnt 0x3f4e4
Descriptor 0xe00000407ef4a170 contains kernel
Loading chunk before kernel: 0x40 / 0x1000
Loading chunk after kernel: 0x1139 / 0xfd79
MD 0xe00000407ef4a1a0: type 5 pa 0x3f5e4000 cnt 0x4dc
MD 0xe00000407ef4a1d0: type 13 pa 0x3fac0000 cnt 0x40
MD 0xe00000407ef4a200: type 7 pa 0x3fb00000 cnt 0x7
Loading descriptor 0xe00000407ef4a200: 0xfec0 / 0xfec1
MD 0xe00000407ef4a230: type 4 pa 0x3fb07000 cnt 0x25
MD 0xe00000407ef4a260: type 9 pa 0x3fb2c000 cnt 0xc
MD 0xe00000407ef4a290: type 6 pa 0x3fb38000 cnt 0x4c8
MD 0xe00000407ef4a2c0: type 11 pa 0x80000000 cnt 0x7e000
MD 0xe00000407ef4a2f0: type 11 pa 0xfed00000 cnt 0x1300
MD 0xe00000407ef4a320: type 7 pa 0x4040000000 cnt 0x3ef4a
Skipping memory chunk start 0x4040000000
MD 0xe00000407ef4a350: type 2 pa 0x407ef4a000 cnt 0x81
MD 0xe00000407ef4a380: type 1 pa 0x407efcb000 cnt 0x33
MD 0xe00000407ef4a3b0: type 7 pa 0x407effe000 cnt 0x2f4
Skipping memory chunk start 0x407effe000
MD 0xe00000407ef4a3e0: type 4 pa 0x407f2f2000 cnt 0x50f
MD 0xe00000407ef4a410: type 7 pa 0x407f801000 cnt 0x13
Skipping memory chunk start 0x407f801000
MD 0xe00000407ef4a440: type 4 pa 0x407f814000 cnt 0x2
MD 0xe00000407ef4a470: type 7 pa 0x407f816000 cnt 0x8
Skipping memory chunk start 0x407f816000
MD 0xe00000407ef4a4a0: type 4 pa 0x407f81e000 cnt 0x1dc
MD 0xe00000407ef4a4d0: type 7 pa 0x407f9fa000 cnt 0x1
MD 0xe00000407ef4a500: type 4 pa 0x407f9fb000 cnt 0x3
MD 0xe00000407ef4a530: type 7 pa 0x407f9fe000 cnt 0x36a
Skipping memory chunk start 0x407f9fe000
MD 0xe00000407ef4a560: type 5 pa 0x407fd68000 cnt 0x3c
MD 0xe00000407ef4a590: type 3 pa 0x407fda4000 cnt 0x5a
MD 0xe00000407ef4a5c0: type 7 pa 0x407fdfe000 cnt 0x12
Skipping memory chunk start 0x407fdfe000
MD 0xe00000407ef4a5f0: type 5 pa 0x407fe10000 cnt 0x6e
MD 0xe00000407ef4a620: type 7 pa 0x407fe7e000 cnt 0x142
Skipping memory chunk start 0x407fe7e000
MD 0xe00000407ef4a650: type 6 pa 0x407ffc0000 cnt 0x40
MD 0xe00000407ef4a680: type 11 pa 0x80000000000 cnt 0x80000000
MD 0xe00000407ef4a6b0: type 12 pa 0x3fffffc000000 cnt 0x4000
ptc.e base=0x0, count1=1, count2=1, stride1=0x0, stride2=0x0
Processor supports 24 Region ID bits
Trying VHPT size 0x10000
Putting VHPT at 0xe000000000020000
vhpt base = e000000000020000 
vhpt size = 10000 
Loaded initial symtab at 0xe000000004489f90, strtab at 0xe0000000044bb2b0, # entries 8372
pmap_reference(0xe00000000447c1b8)
Detected memory  = 1062748160 (1013 MB)
Physical memory chunk(s):
0x0000000000018000 - 0x000000000001ffff, 32768 bytes (2 pages)
0x0000000000050000 - 0x000000000009ffff, 327680 bytes (20 pages)
0x0000000000af4000 - 0x0000000003ffffff, 55623680 bytes (3395 pages)
0x00000000044e4000 - 0x000000003f5e3fff, 990904320 bytes (60480 pages)
0x000000003fb00000 - 0x000000003fb03fff, 16384 bytes (1 pages)
Total number of segments: vm_nphysseg = 5 
pmap_reference(0xe00000000447c1b8)
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 7.99.5 (GENERIC) #1: Wed Mar  4 08:30:46 EST 2015
        scole@dstar:/home/scole/nbsd/src/sys/arch/ia64/compile/obj/GENERIC
total memory = 1013 MB
avail memory = 998 MB
Warning: no FPSWA package supplied
Table 'FACP' at 0xe00000003fb369e0
Table 'SPCR' at 0xe00000003fb36b18
Table 'DBGP' at 0xe00000003fb36b68
Table 'APIC' at 0xe00000003fb36c28
        Local APIC address=0xfee00000
        Local APIC override entry
                Local APIC address=0xfee00000
        Local SAPIC entry
                ProcessorId=0x0, Id=0x0, Eid=0x0
        Local SAPIC entry
                ProcessorId=0x1, Id=0x1, Eid=0x0
        I/O SAPIC entry
                Id=0x0, InterruptBase=0x10, Address=0xfed20800
        I/O SAPIC entry
                Id=0x1, InterruptBase=0x1b, Address=0xfed22800
        I/O SAPIC entry
                Id=0x2, InterruptBase=0x26, Address=0xfed24800
        I/O SAPIC entry
                Id=0x3, InterruptBase=0x31, Address=0xfed26800
        I/O SAPIC entry
                Id=0x4, InterruptBase=0x3c, Address=0xfed28800
        I/O SAPIC entry
                Id=0x6, InterruptBase=0x47, Address=0xfed2c800
        I/O SAPIC entry
                Id=0x7, InterruptBase=0x52, Address=0xfed2e800
Table 'SPMI' at 0xe00000003fb36ba0
Table 'CPEP' at 0xe00000003fb36bf0
Table 'SSDT' at 0xe00000003fb33870
Table 'SSDT' at 0xe00000003fb33a50
Table 'SSDT' at 0xe00000003fb33da0
Table 'SSDT' at 0xe00000003fb347c0
Table 'SSDT' at 0xe00000003fb351e0
Table 'SSDT' at 0xe00000003fb35c00
Table 'SSDT' at 0xe00000003fb36620
Table 'SSDT' at 0xe00000003fb36800
Table 'SSDT' at 0xe00000003fb368f0
pmap_reference(0xe00000000447c1b8)
pmap_reference(0xe00000000447c1b8)
a1                                  (printf debug statements)
a2
a3
a4
a5
a1
a2
a3
a4
a5
a1
a2
a3
a4
a5
a1
a2
a3
a4
a5
a1
a2
a3
a4
a5
a1
a2
a3
a4
a5
a1
a2
a3
a4
a5
a1
a2
a3
a4
a5
a1
a2
a3
a4
a5
a1
a2
a3
a4
a5
timecounter: Timecounters tick every 10.000 msec
a1
a2
a3
a4
a5
a1
a2
a3
a4
a5
a1
a2
a3
a4
a5
mainbus0 (root)
cpu0 at mainbus0: ProcessorID 0, Id 0, Eid 0
cpu0: Madison (1400.00-MHz Itanium 2)
cpu0: Origin "GenuineIntel",  Revision 5
cpu0: Features 0x1<LB>
cpu1 at mainbus0: ProcessorID 1, Id 1, Eid 0
cpu1: Madison (1400.00-MHz Itanium 2)
cpu1: Origin "GenuineIntel",  Revision 5
cpu1: Features 0x1<LB>
a1
a2
a3
a4
a5
ACPI: RSDP 0x000000003FB2E000 000028 (v02 HP    )
ACPI: XSDT 0x000000003FB2E02C 00009C (v01 HP     rx2600   00000000 HP   00000000)
ACPI: FACP 0x000000003FB369E0 0000F4 (v03 HP     rx2600   00000000 HP   00000000)
ACPI BIOS Warning (bug): 32/64X length mismatch in FADT/Gpe0Block: 32/16 (20140926/tbfadt-648)
ACPI BIOS Warning (bug): 32/64X length mismatch in FADT/Gpe1Block: 32/16 (20140926/tbfadt-648)
ACPI: DSDT 0x000000003FB2E0E0 005781 (v01 HP     rx2600   00000007 INTL 02012044)
ACPI: FACS 0x000000003FB36AD8 000040
ACPI: SPCR 0x000000003FB36B18 000050 (v01 HP     rx2600   00000000 HP   00000000)
ACPI: DBGP 0x000000003FB36B68 000034 (v01 HP     rx2600   00000000 HP   00000000)
ACPI: APIC 0x000000003FB36C28 0000C0 (v01 HP     rx2600   00000000 HP   00000000)
ACPI: SPMI 0x000000003FB36BA0 000050 (v04 HP     rx2600   00000000 HP   00000000)
ACPI: CPEP 0x000000003FB36BF0 000034 (v01 HP     rx2600   00000000 HP   00000000)
ACPI: SSDT 0x000000003FB33870 0001D6 (v01 HP     rx2600   00000006 INTL 02012044)
ACPI: SSDT 0x000000003FB33A50 000342 (v01 HP     rx2600   00000006 INTL 02012044)
ACPI: SSDT 0x000000003FB33DA0 000A16 (v01 HP     rx2600   00000006 INTL 02012044)
ACPI: SSDT 0x000000003FB347C0 000A16 (v01 HP     rx2600   00000006 INTL 02012044)
ACPI: SSDT 0x000000003FB351E0 000A16 (v01 HP     rx2600   00000006 INTL 02012044)
ACPI: SSDT 0x000000003FB35C00 000A16 (v01 HP     rx2600   00000006 INTL 02012044)
ACPI: SSDT 0x000000003FB36620 0001D8 (v01 HP     rx2600   00000006 INTL 02012044)
ACPI: SSDT 0x000000003FB36800 0000EB (v01 HP     rx2600   00000006 INTL 02012044)
ACPI: SSDT 0x000000003FB368F0 0000EF (v01 HP     rx2600   00000006 INTL 02012044)
ACPI: All ACPI Tables successfully acquired
acpi0 at mainbus0: Intel ACPICA 20140926
acpi0: X/RSDT: OemId <    HP,  rx2600,00000000>, AslId <  HP,00000000>

fatal kernel trap (cpu 0):

    trap vector = 0x14 (Page Not Present)
    cr.iip      = 0xe00000000421d630
    cr.ipsr     = 0x1210080a2010 (mfl,ic,dt,dfh,rt,cpl=0,it,ri=1,bn)
    cr.isr      = 0x20200000000 (code=0,vector=0,w,ei=1)
    cr.ifa      = 0x1
    curlwp   = 0xe000000004456d00
        pid = 0, comm = system

Stopped in pid 0.1 (system) at  netbsd:bcopy+0x61:      [M1]    st1 r33=r14,0x1
**********************************

Index: sys/arch/ia64/stand/common/Makefile.inc
===================================================================
RCS file: /cvsroot/src/sys/arch/ia64/stand/common/Makefile.inc,v
retrieving revision 1.2
diff -b -u -r1.2 Makefile.inc
--- sys/arch/ia64/stand/common/Makefile.inc	2 Jul 2006 17:28:11 -0000	1.2
+++ sys/arch/ia64/stand/common/Makefile.inc	4 Mar 2015 14:10:19 -0000
@@ -3,13 +3,8 @@
 SRCS+=	commands.c console.c devopen.c interp.c boot.c #XXX: Remove bcache.c 
 SRCS+=	interp_backslash.c interp_parse.c ls.c misc.c 
 SRCS+=	panic.c calloc.c readdir.c pager.c environment.c fileload.c 
-SRCS+=  getopt.c gets.c strdup.c strtol.c strspn.c
+SRCS+=  getopt.c gets.c strdup.c strtol.c strspn.c dev_net.c

 .if ${MACHINE_ARCH} == "ia64" 
 SRCS+=	load_elf64.c 
 .endif
-
-.if defined(LOADER_NET_SUPPORT)
-#SRCS+=	dev_net.c
-.endif
-
Index: sys/arch/ia64/stand/common/dev_net.c
===================================================================
RCS file: /cvsroot/src/sys/arch/ia64/stand/common/dev_net.c,v
retrieving revision 1.9
diff -b -u -r1.9 dev_net.c
--- sys/arch/ia64/stand/common/dev_net.c	25 Mar 2014 18:35:32 -0000	1.9
+++ sys/arch/ia64/stand/common/dev_net.c	4 Mar 2015 14:10:22 -0000
@@ -53,17 +53,15 @@
  */

 #include <sys/param.h>
-#include <sys/socket.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-
-#include <stand.h>
-#include <string.h>
-#include <net.h>
-#include <netif.h>
-#include <bootp.h>
-#include <bootparam.h>
+
+#include <lib/libsa/stand.h>
+#include <lib/libsa/net.h>
+#include <lib/libsa/bootparam.h>
+#include <lib/libsa/loadfile.h>
+#include <lib/libsa/netif.h>
+#include <lib/libsa/nfs.h>
+#include <lib/libsa/bootp.h>
+#include <lib/libkern/libkern.h>

 #include "dev_net.h"
 #include "bootstrap.h"
@@ -73,31 +71,8 @@
 static int netdev_sock = -1;
 static int netdev_opens;

-static int	net_init(void);
-static int	net_open(struct open_file *, ...);
-static int	net_close(struct open_file *);
-static int	net_strategy();
-static void	net_print(int);
-
 static int net_getparams(int sock);

-struct devsw netdev = {
-    "net", 
-    DEVT_NET, 
-    net_init,
-    net_strategy, 
-    net_open, 
-    net_close, 
-    noioctl,
-    net_print
-};
-
-int
-net_init(void)
-{
-    return 0;
-}
-
 /*
  * Called by devopen after it sets f->f_dev to our devsw entry.
  * This opens the low-level device and sets f->f_devdata.
@@ -136,6 +111,23 @@
 		return (error);
 	    }
 	}
+	if (debug)
+	    printf("net_open: got rootip %s\n", inet_ntoa(rootip));
+
+	/*
+	 * Get the NFS file handle (mount).
+	 */
+	error = nfs_mount(netdev_sock, rootip, rootpath);
+	if (error) {
+	    netif_close(netdev_sock);
+	    netdev_sock = -1;
+	    printf("net_open: error with nfs mount 0x%x\n", error);
+	    return error;
+	}
+
+	if (debug)
+	    printf("root addr=%s path=%s\n", inet_ntoa(rootip), rootpath);
+
 	netdev_opens++;
     }
     netdev_opens++;
@@ -172,7 +164,13 @@
 }
  int
-net_strategy(void)
+net_strategy(void *devdata, int rw, daddr_t blk, size_t size, void *buf, size_t *rsize)
+{
+	return EIO;
+}
+
+int
+net_ioctl(struct open_file *f, u_long cmd, void *data)
 {
     return EIO;
 }
@@ -194,13 +192,13 @@
 int try_bootp = 1;
 #endif

-extern n_long ip_convertaddr(char *p);
-
 static int
 net_getparams(int sock)
 {
     char buf[MAXHOSTNAMELEN];
     char temp[FNAME_SIZE];
+    char num[8];
+
     struct iodesc *d;
     int i;
     n_long smask;
@@ -213,7 +211,7 @@
      * use RARP and RPC/bootparam (the Sun way) to get them.
      */
     if (try_bootp)
-	bootp(sock, BOOTP_NONE);
+	bootp(sock);
     if (myip.s_addr != 0)
 	goto exit;
     if (debug)
@@ -245,13 +243,15 @@
     gateip.s_addr = 0;
     if (bp_getfile(sock, "gateway", &gateip, buf) == 0) {
 	/* Got it!  Parse the netmask. */
-	smask = ip_convertaddr(buf);
+	smask = inet_addr(buf);
     }
     if (smask) {
 	netmask = smask;
+	if (debug)
 	printf("net_open: subnet mask: %s\n", intoa(netmask));
     }
     if (gateip.s_addr)
+	if (debug)
 	printf("net_open: net gateway: %s\n", inet_ntoa(gateip));

     /* Get the root server and pathname. */
@@ -275,11 +275,30 @@
 	    memcpy(&temp[0], &rootpath[i], strlen(&rootpath[i])+1);
 	    memcpy(&rootpath[0], &temp[0], strlen(&rootpath[i])+1);	    
     }
+
+    if (debug) {
     printf("net_open: server addr: %s\n", inet_ntoa(rootip));
     printf("net_open: server path: %s\n", rootpath);	    
+    }

+    /* do equivalent of
+     *   snprintf(temp, sizeof(temp), "%6D", d->myea, ":");
+     * in lame way since snprintf seems to understand "%x", but not "%x:%x"
+     */
     d = socktodesc(sock);
-    snprintf(temp, sizeof(temp), "%6D", d->myea, ":");
+    memset(temp, '\0', sizeof(temp));
+
+    for (i = 0; i < ETHER_ADDR_LEN; i++) {
+	if (d->myea[i] < 0x10)
+	    strncat(temp, "0", 1);
+
+	snprintf(num, sizeof(num), "%x", d->myea[i]);
+	strncat(temp, num, 2);
+
+	if (i < ETHER_ADDR_LEN-1)
+	    strncat(temp, ":", 1);
+    }
+
     setenv("boot.netif.ip", inet_ntoa(myip), 1);
     setenv("boot.netif.netmask", intoa(netmask), 1);
     setenv("boot.netif.gateway", inet_ntoa(gateip), 1);
@@ -289,9 +308,3 @@

     return (0);
 }
-
-static void
-net_print(int verbose)
-{
-    return;
-}
Index: sys/arch/ia64/stand/common/dev_net.h
===================================================================
RCS file: /cvsroot/src/sys/arch/ia64/stand/common/dev_net.h,v
retrieving revision 1.2
diff -b -u -r1.2 dev_net.h
--- sys/arch/ia64/stand/common/dev_net.h	22 Apr 2006 07:58:53 -0000	1.2
+++ sys/arch/ia64/stand/common/dev_net.h	4 Mar 2015 14:10:26 -0000
@@ -28,5 +28,7 @@
  * $FreeBSD: src/sys/boot/common/dev_net.h,v 1.2 1999/08/28 00:39:46 peter Exp $
  */

-extern struct devsw netdev;
-
+int	net_open(struct open_file *, ...);
+int	net_close(struct open_file *);
+int	net_ioctl(struct open_file *, u_long, void *);
+int	net_strategy(void *, int , daddr_t , size_t, void *, size_t *);
Index: sys/arch/ia64/stand/efi/libefi/Makefile
===================================================================
RCS file: /cvsroot/src/sys/arch/ia64/stand/efi/libefi/Makefile,v
retrieving revision 1.2
diff -b -u -r1.2 Makefile
--- sys/arch/ia64/stand/efi/libefi/Makefile	20 Jul 2009 04:59:03 -0000	1.2
+++ sys/arch/ia64/stand/efi/libefi/Makefile	4 Mar 2015 14:10:32 -0000
@@ -8,8 +8,6 @@
 NOPROFILE=# defined
 INTERNALLIB=#	defined

-EFI_INCLUDE_NET?= no
-
 CPPFLAGS= -I${EFICPPFLAGS} ${EFIMISCCPPFLAGS}
 CPPFLAGS+= -I${.CURDIR}/../include
 CPPFLAGS+= -I${.CURDIR}/../include/${MACHINE_ARCH}
@@ -18,16 +16,12 @@
 CPPFLAGS+= -I${.CURDIR}/../../common

 SRCS=  copy.c delay.c efi.c efi_console.c devicename.c bootinfo.c
-SRCS+= time.c efifs.c efi_console.c module.c exec.c #efinet.c
+SRCS+= time.c efifs.c efi_console.c module.c exec.c efinet.c

 .if ${MACHINE_ARCH} == "ia64"
 SRCS+=	efifpswa.c pal.S
 .endif

-.if (${EFI_INCLUDE_NET} == "yes")
-SRCS+= efinet.c #etc.
-.endif
-
 .include <bsd.own.mk>
 .undef DESTDIR
 .include <bsd.lib.mk>
Index: sys/arch/ia64/stand/efi/libefi/efiboot.h
===================================================================
RCS file: /cvsroot/src/sys/arch/ia64/stand/efi/libefi/efiboot.h,v
retrieving revision 1.2
diff -b -u -r1.2 efiboot.h
--- sys/arch/ia64/stand/efi/libefi/efiboot.h	22 Apr 2006 07:58:53 -0000	1.2
+++ sys/arch/ia64/stand/efi/libefi/efiboot.h	4 Mar 2015 14:10:35 -0000
@@ -68,7 +68,7 @@
 extern struct netif_driver efi_net; 

 /* Find EFI network resources */
-/*extern void efinet_init_driver(void); XXX should get this running once we're off the mark */
+extern void efinet_init_driver(void);

 /* Map handles to units */
 int efifs_get_unit(EFI_HANDLE);
Index: sys/arch/ia64/stand/efi/libefi/efinet.c
===================================================================
RCS file: /cvsroot/src/sys/arch/ia64/stand/efi/libefi/efinet.c,v
retrieving revision 1.6
diff -b -u -r1.6 efinet.c
--- sys/arch/ia64/stand/efi/libefi/efinet.c	26 Oct 2009 19:16:56 -0000	1.6
+++ sys/arch/ia64/stand/efi/libefi/efinet.c	4 Mar 2015 14:10:40 -0000
@@ -30,18 +30,40 @@
 /* __FBSDID("$FreeBSD: src/sys/boot/efi/libefi/efinet.c,v 1.6 2004/01/04 23:28:16 obrien Exp $"); */

 #include <sys/param.h>
-#include <netinet/in.h>
-#include <netinet/in_systm.h>

 #include <lib/libsa/stand.h>
-#include <net.h>
-#include <netif.h>
+#include <lib/libsa/loadfile.h>
+#include <lib/libsa/net.h>
+#include <lib/libsa/netif.h>
+
+#ifdef EFINET_DEBUG
+#include <lib/libsa/ether_sprintf.c>
+#endif

 #include <efi.h>
 #include <efilib.h>

 extern struct netif_driver efi_net;

+int  efinet_match(struct netif *, void *);
+int  efinet_probe(struct netif *, void *);
+void efinet_init(struct iodesc *, void *);
+int  efinet_get(struct iodesc *, void *, size_t, saseconds_t);
+int  efinet_put(struct iodesc *, void *, size_t);
+void efinet_end(struct netif *);
+
+struct netif_driver efi_net = {
+	"net",			/* netif_bname */
+	efinet_match,		/* netif_match */
+	efinet_probe,		/* netif_probe */
+	efinet_init,		/* netif_init */
+	efinet_get,		/* netif_get */
+	efinet_put,		/* netif_put */
+	efinet_end,		/* netif_end */
+	0,			/* netif_ifs */
+	0			/* netif_nifs */
+};
+
 #ifdef EFINET_DEBUG
 static void
 dump_mode(EFI_SIMPLE_NETWORK_MODE *mode)
@@ -120,7 +142,7 @@


 int
-efinet_get(struct iodesc *desc, void *pkt, size_t len, time_t timeout)
+efinet_get(struct iodesc *desc, void *pkt, size_t len, saseconds_t timeout)
 {
 	struct netif *nif = desc->io_netif;
 	EFI_SIMPLE_NETWORK *net;
@@ -223,7 +245,7 @@
 	handles = (EFI_HANDLE *) alloc(sz);
 	status = BS->LocateHandle(ByProtocol, &netid, 0, &sz, handles);
 	if (EFI_ERROR(status)) {
-		free(handles, sz);
+                free(handles);
 		return;
 	}

@@ -256,15 +278,3 @@
 	net->Shutdown(net);
 }

-struct netif_driver efi_net = {
-	"net",			/* netif_bname */
-	efinet_match,		/* netif_match */
-	efinet_probe,		/* netif_probe */
-	efinet_init,		/* netif_init */
-	efinet_get,		/* netif_get */
-	efinet_put,		/* netif_put */
-	efinet_end,		/* netif_end */
-	0,			/* netif_ifs */
-	0			/* netif_nifs */
-};
-
Index: sys/arch/ia64/stand/ia64/Makefile.booters
===================================================================
RCS file: /cvsroot/src/sys/arch/ia64/stand/ia64/Makefile.booters,v
retrieving revision 1.6
diff -b -u -r1.6 Makefile.booters
--- sys/arch/ia64/stand/ia64/Makefile.booters	12 Jan 2014 15:26:29 -0000	1.6
+++ sys/arch/ia64/stand/ia64/Makefile.booters	4 Mar 2015 14:10:44 -0000
@@ -37,7 +37,7 @@

 ### find out what to use for libsa
 SA_AS=		library
-SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes" "SA_INCLUDE_NET=no"
+SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes" "SA_INCLUDE_NET=yes"
 .include "${S}/lib/libsa/Makefile.inc"
 LIBSA=		${SALIB}

Index: sys/arch/ia64/stand/ia64/efi/conf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/ia64/stand/ia64/efi/conf.c,v
retrieving revision 1.3
diff -b -u -r1.3 conf.c
--- sys/arch/ia64/stand/ia64/efi/conf.c	20 Jul 2009 04:59:04 -0000	1.3
+++ sys/arch/ia64/stand/ia64/efi/conf.c	4 Mar 2015 14:10:49 -0000
@@ -31,9 +31,9 @@
 #include <sys/types.h>

 #include <lib/libsa/stand.h>
+#include <lib/libsa/net.h>
 #include <lib/libsa/loadfile.h>
-
-#include <bootstrap.h>
+#include <lib/libsa/nfs.h>

 #include <efi.h>
 #include <efilib.h>
@@ -45,12 +45,22 @@

 struct devsw devsw[] = { 
 	{"disk", efifs_dev_strategy, efifs_dev_open, efifs_dev_close, noioctl},
+    { "net",  net_strategy,  net_open,  net_close,  net_ioctl },
 }; 

 int ndevs = sizeof(devsw) / sizeof(struct devsw);

+extern struct netif_driver efi_net;
+
+struct netif_driver *netif_drivers[] = {
+    &efi_net
+};
+
+int n_netif_drivers = (sizeof(netif_drivers) / sizeof(netif_drivers[0]));
+
 struct fs_ops file_system[] = {
         FS_OPS(efifs),
+    FS_OPS(nfs),
 };

 int nfsys = sizeof(file_system) / sizeof(struct fs_ops);
Index: sys/arch/ia64/stand/ia64/efi/main.c
===================================================================
RCS file: /cvsroot/src/sys/arch/ia64/stand/ia64/efi/main.c,v
retrieving revision 1.9
diff -b -u -r1.9 main.c
--- sys/arch/ia64/stand/ia64/efi/main.c	25 Mar 2014 18:35:33 -0000	1.9
+++ sys/arch/ia64/stand/ia64/efi/main.c	4 Mar 2015 14:10:54 -0000
@@ -124,7 +124,7 @@

 	efifs_dev_init();

-        /*	efinet_init_driver(); XXX enable net boot. */
+	efinet_init_driver();

 	/* Get our loaded image protocol interface structure. */
 	BS->HandleProtocol(IH, &imgid, (VOID**)&img);
@@ -147,6 +147,8 @@
 		currdev.d_kind.netif.unit = 0;		/* XXX */
 		currdev.d_type = DEVT_NET;

+		/* XXX overwrite disk ops with nfs ops */
+		memcpy(&file_system[0], &file_system[1], sizeof(struct fs_ops));
 	}


Index: sys/arch/ia64/stand/ia64/ski/conf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/ia64/stand/ia64/ski/conf.c,v
retrieving revision 1.2
diff -b -u -r1.2 conf.c
--- sys/arch/ia64/stand/ia64/ski/conf.c	20 Jul 2009 04:59:04 -0000	1.2
+++ sys/arch/ia64/stand/ia64/ski/conf.c	4 Mar 2015 14:10:58 -0000
@@ -76,6 +76,10 @@

 int ndevs = sizeof(devsw) / sizeof(struct devsw);

+/* XXX fix netif for ski if needed */
+struct netif_drvier *netif_drivers[] = {};
+int n_netif_drivers = 0;
+
 struct fs_ops file_system[] = {
 	FS_OPS(skifs),
 };
Index: sys/arch/ia64/stand/ia64/ski/time.c
===================================================================
RCS file: /cvsroot/src/sys/arch/ia64/stand/ia64/ski/time.c,v
retrieving revision 1.3
diff -b -u -r1.3 time.c
--- sys/arch/ia64/stand/ia64/ski/time.c	20 Jul 2009 04:59:04 -0000	1.3
+++ sys/arch/ia64/stand/ia64/ski/time.c	4 Mar 2015 14:11:02 -0000
@@ -176,3 +176,10 @@

 	return *tloc = EfiTimeToUnixTime(&time);
 }
+
+time_t
+getsecs(void)
+{
+    return time(0);
+}
+


>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: port-ia64-maintainer->martin
Responsible-Changed-By: martin@NetBSD.org
Responsible-Changed-When: Wed, 04 Mar 2015 15:29:31 +0000
Responsible-Changed-Why:
Take


From: scole_mail <scole_mail@gmx.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-ia64/49717: add ia64 nfs netboot support
Date: Mon, 9 May 2016 13:03:14 -0400

 Just a note for myself that these changes will only boot from the first ethernet device in the boot menu, as I just recently found out the hard way.

 Thanks

Responsible-Changed-From-To: martin->scole
Responsible-Changed-By: scole@NetBSD.org
Responsible-Changed-When: Tue, 02 Aug 2016 09:40:23 -0400
Responsible-Changed-Why:
Take


From: "Sean Cole" <scole@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49717 CVS commit: src/sys/arch/ia64/stand
Date: Thu, 4 Aug 2016 16:22:40 +0000

 Module Name:	src
 Committed By:	scole
 Date:		Thu Aug  4 16:22:40 UTC 2016

 Modified Files:
 	src/sys/arch/ia64/stand/common: Makefile.inc dev_net.c dev_net.h
 	src/sys/arch/ia64/stand/efi/libefi: Makefile efiboot.h efinet.c
 	src/sys/arch/ia64/stand/ia64: Makefile.booters
 	src/sys/arch/ia64/stand/ia64/efi: conf.c main.c
 	src/sys/arch/ia64/stand/ia64/ski: conf.c time.c

 Log Message:
 PR port-ia64/49717

 Minimal changes needed to add nfs netboot support


 To generate a diff of this commit:
 cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ia64/stand/common/Makefile.inc \
     src/sys/arch/ia64/stand/common/dev_net.h
 cvs rdiff -u -r1.10 -r1.11 src/sys/arch/ia64/stand/common/dev_net.c
 cvs rdiff -u -r1.5 -r1.6 src/sys/arch/ia64/stand/efi/libefi/Makefile
 cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ia64/stand/efi/libefi/efiboot.h
 cvs rdiff -u -r1.6 -r1.7 src/sys/arch/ia64/stand/efi/libefi/efinet.c
 cvs rdiff -u -r1.6 -r1.7 src/sys/arch/ia64/stand/ia64/Makefile.booters
 cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ia64/stand/ia64/efi/conf.c
 cvs rdiff -u -r1.9 -r1.10 src/sys/arch/ia64/stand/ia64/efi/main.c
 cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ia64/stand/ia64/ski/conf.c
 cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ia64/stand/ia64/ski/time.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: scole@NetBSD.org
State-Changed-When: Wed, 10 Aug 2016 07:54:09 -0400
State-Changed-Why:
Checked into current about a week ago


>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-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.