NetBSD Problem Report #48488

From www@NetBSD.org  Wed Jan  1 13:57:42 2014
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "Postmaster NetBSD.org" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id EC5A6A61B7
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  1 Jan 2014 13:57:42 +0000 (UTC)
Message-Id: <20140101135740.9D2B8A6469@mollari.NetBSD.org>
Date: Wed,  1 Jan 2014 13:57:40 +0000 (UTC)
From: nullnilaki@gmail.com
Reply-To: nullnilaki@gmail.com
To: gnats-bugs@NetBSD.org
Subject: pmap.h modify cause Kernel Panic on NetBSD/alpha current version.
X-Send-Pr-Version: www-1.0

>Number:         48488
>Category:       port-alpha
>Synopsis:       pmap.h modify cause Kernel Panic on NetBSD/alpha current version.
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    port-alpha-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 01 14:00:00 +0000 2014
>Closed-Date:    Wed Jan 01 21:56:26 +0000 2014
>Last-Modified:  Wed Jan 01 21:56:26 +0000 2014
>Originator:     nullnilaki
>Release:        NetBSD 6.99.28 (GENERIC-$Revision: 1.356 $) #0: Wed Jan 1 21:32:40 JST 2014
>Organization:
Japan
>Environment:
NetBSD  6.99.28 NetBSD 6.99.28 (GENERIC-$Revision: 1.356 $) #0: Wed Jan  1 21:32:40 JST 2014  naruaki@NetBSD:/usr/current/obj.alpha/sys/arch/alpha/compile/GENERIC alpha

>Description:
Kernel Panic on NetBSD/alpha current version.
See below.
----------------------------------------------------------------
NetBSD/alpha 6.1.2 FFSv2 Primary Bootstrap
Jumping to entry point...

NetBSD/alpha 6.1.2 Secondary Bootstrap, Revision 1.13 (Sat Dec 7 08:20:39 JST 2013)

VMS PAL rev: 0x1000700010162
OSF PAL rev: 0x100070002015c
Switch to OSF PAL code succeeded.

Boot flags: A
10835152+265360 [596568+395053]=0xb88a90

Entering netbsd at 0xfffffc0000431220...
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014
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 6.99.28 (GENERIC-$Revision: 1.356 $) #1: Wed Jan 1 22:28:20 JST 2014
naruaki@NetBSD:/usr/current/obj.alpha/sys/arch/alpha/compile/GENERIC
AlphaStation DS15, 1000MHz, s/n AY42501857
8192 byte page size, 1 processor.
total memory = 512 MB
(2880 KB reserved for PROM, 509 MB used by NetBSD)
avail memory = 490 MB
mainbus0 (root)
cpu0 at mainbus0: ID 0 (primary), 21264C-6
cpu0: Architecture extensions: 0x1307<PAT,MVI,CIX,FIX,BWX>
tsc0 at mainbus0: 21274 Core Logic Chipset, Cchip rev 0
tsc0: 2 Dchips, 1 memory bus of 16 bytes
tsc0: arrays present: 512MB, 0MB, 0MB, 0MB, Dchip 0 rev 1
tsp0 at tsc0
pci0 at tsp0 bus 0
sio0 at pci0 dev 7 function 0: Acer Labs M1533 PCI-ISA Bridge (rev. 0xc3)
ahc0 at pci0 dev 8 function 0: Adaptec aic7899 Ultra160 SCSI adapter
ahc0: interrupting at dec 6600 irq 13
ahc0: aic7899: Ultra160 Wide Channel A, SCSI Id=7, 32/253 SCBs
scsibus0 at ahc0: 16 targets, 8 luns per target
ahc1 at pci0 dev 8 function 1: Adaptec aic7899 Ultra160 SCSI adapter
ahc1: interrupting at dec 6600 irq 12
ahc1: aic7899: Ultra160 Wide Channel B, SCSI Id=7, 32/253 SCBs
scsibus1 at ahc1: 16 targets, 8 luns per target
fxp0 at pci0 dev 9 function 0: Intel i82559ER Ethernet (rev. 0x09)
fxp0: interrupting at dec 6600 irq 28
fxp0: Ethernet address 00:0f:20:2b:e1:24
inphy0 at fxp0 phy 1: i82555 10/100 media interface, rev. 4
inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
fxp1 at pci0 dev 10 function 0: Intel i82559ER Ethernet (rev. 0x09)
fxp1: interrupting at dec 6600 irq 4
fxp1: Ethernet address 00:0f:20:2b:e1:23
inphy1 at fxp1 phy 1: i82555 10/100 media interface, rev. 4
inphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
aceride0 at pci0 dev 13 function 0: Acer Labs M5229 UDMA IDE Controller (rev. 0xc1)
aceride0: primary channel interrupting at isa irq 14
atabus0 at aceride0 channel 0
aceride0: secondary channel interrupting at isa irq 15
atabus1 at aceride0 channel 1
isa0 at sio0
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
com0: console
com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo
pckbc0 at isa0 port 0x60-0x64
attimer0 at isa0 port 0x40-0x43
pcppi0 at isa0 port 0x61
midi0 at pcppi0: PC speaker
spkr0 at pcppi0
isabeep0 at pcppi0
fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
mcclock0 at isa0 port 0x70-0x71: mc146818 compatible time-of-day clock
attimer0: attached to pcppi0
tsp1 at tsc0
pci1 at tsp1 bus 0
vga0 at pci1 dev 7 function 0: ATI Technologies Radeon 7500 QW (rev. 0x00)
wsdisplay0 at vga0 kbdmux 1
drm at vga0 not configured
tlp0 at pci1 dev 9 function 0: DECchip 21140A Ethernet, pass 2.0
tlp0: interrupting at dec 6600 irq 24
tlp0: DEC DE500-AA, Ethernet address 00:00:f8:03:dd:a1
nsphy0 at tlp0 phy 5: DP83840 10/100 media interface, rev. 0
nsphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
esiop0 at pci1 dev 10 function 0: Symbios Logic 53c895 (ultra2-wide scsi)
esiop0: using on-board RAM
esiop0: interrupting at dec 6600 irq 20
scsibus2 at esiop0: 16 targets, 8 luns per target
scsibus0: waiting 2 seconds for devices to settle...
scsibus1: waiting 2 seconds for devices to settle...
scsibus2: waiting 2 seconds for devices to settle...
atapibus0 at atabus0: 2 targets
cd0 at atapibus0 drive 0: <HL-DT-ST RW/DVD GCC-4480B, , 2.06> cdrom removable
sd0 at scsibus0 target 0 lun 0: <FUJITSU, MAU3073NP, 3502> disk fixed
sd0: 70007 MB, 49158 cyl, 4 head, 729 sec, 512 bytes/sect x 143374744 sectors
sd0: sync (12.50ns offset 127), 16-bit (160.000MB/s) transfers, tagged queueing
root on sd0a dumps on sd0b
root file system type: ffs

CPU 0: fatal kernel trap:

CPU 0 trap entry = 0x2 (memory management fault)
CPU 0 a0 = 0x0
CPU 0 a1 = 0x1
CPU 0 a2 = 0x1
CPU 0 pc = 0xfffffc00008c9f1c
CPU 0 ra = 0xfffffc00008c9ef4
CPU 0 pv = 0xfffffc00007e57b8
CPU 0 curlwp = 0xfffffc001f8975c0
CPU 0 pid = 4, comm = sh

panic: trap
Stopped in pid 4.1 (sh) at netbsd:cpu_Debugger+0x4: ret zero,(ra
)
db> tr
cpu_Debugger() at netbsd:cpu_Debugger+0x4
db_panic() at netbsd:db_panic+0x118
vpanic() at netbsd:vpanic+0x184
panic() at netbsd:panic+0x54
trap() at netbsd:trap+0x9fc
XentMM() at netbsd:XentMM+0x20
--- memory management fault (from ipl 0) ---
pmap_destroy() at netbsd:pmap_destroy+0xbc
uvmspace_free() at netbsd:uvmspace_free+0xf8
uvm_proc_exit() at netbsd:uvm_proc_exit+0x9c
exit1() at netbsd:exit1+0x230
sys_exit() at netbsd:sys_exit+0x5c
syscall() at netbsd:syscall+0x2c0
XentSys() at netbsd:XentSys+0x5c
--- syscall (1) ---
--- user mode ---
----------------------------------------------------------------
Please read the send-pr.
http://mail-index.netbsd.org/port-alpha/2013/12/23/msg000684.html
http://mail-index.netbsd.org/netbsd-bugs/2013/12/07/msg035191.html

>How-To-Repeat:

>Fix:
I think this modify is wrong.
http://cvsweb.netbsd.org/cgi-bin/cvsweb.cgi/src/sys/arch/alpha/include/pmap.h.diff?r1=1.77&r2=1.78&f=h

Please revoke this modify.

----------------------------------------------------------------
resetting all I/O buses
(boot dka0.0.0.8.0 -flags A)
block 0 of dka0.0.0.8.0 is a valid boot block
reading 13 blocks from dka0.0.0.8.0
bootstrap code read in
base = 2be000, image_start = 0, image_bytes = 1a00(6656)
initializing HWRPB at 2000
initializing page table at 1fff0000
initializing machine state
setting affinity to the primary CPU
jumping to bootstrap code

NetBSD/alpha 6.1.2 FFSv2 Primary Bootstrap
Jumping to entry point...

NetBSD/alpha 6.1.2 Secondary Bootstrap, Revision 1.13 (Sat Dec 7 08:20:39 JST 2013)

VMS PAL rev: 0x1000700010162
OSF PAL rev: 0x100070002015c
Switch to OSF PAL code succeeded.

Boot flags: A
10835152+265424 [596568+395053]=0xb88ad0

Entering netbsd at 0xfffffc0000431220...
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014
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 6.99.28 (GENERIC-$Revision: 1.356 $) #0: Wed Jan 1 21:32:40 JST 2014
naruaki@NetBSD:/usr/current/obj.alpha/sys/arch/alpha/compile/GENERIC
AlphaStation DS15, 1000MHz, s/n AY42501857
8192 byte page size, 1 processor.
total memory = 512 MB
(2880 KB reserved for PROM, 509 MB used by NetBSD)
avail memory = 490 MB
mainbus0 (root)
cpu0 at mainbus0: ID 0 (primary), 21264C-6
cpu0: Architecture extensions: 0x1307<PAT,MVI,CIX,FIX,BWX>
tsc0 at mainbus0: 21274 Core Logic Chipset, Cchip rev 0
tsc0: 2 Dchips, 1 memory bus of 16 bytes
tsc0: arrays present: 512MB, 0MB, 0MB, 0MB, Dchip 0 rev 1
tsp0 at tsc0
pci0 at tsp0 bus 0
sio0 at pci0 dev 7 function 0: Acer Labs M1533 PCI-ISA Bridge (rev. 0xc3)
ahc0 at pci0 dev 8 function 0: Adaptec aic7899 Ultra160 SCSI adapter
ahc0: interrupting at dec 6600 irq 13
ahc0: aic7899: Ultra160 Wide Channel A, SCSI Id=7, 32/253 SCBs
scsibus0 at ahc0: 16 targets, 8 luns per target
ahc1 at pci0 dev 8 function 1: Adaptec aic7899 Ultra160 SCSI adapter
ahc1: interrupting at dec 6600 irq 12
ahc1: aic7899: Ultra160 Wide Channel B, SCSI Id=7, 32/253 SCBs
scsibus1 at ahc1: 16 targets, 8 luns per target
fxp0 at pci0 dev 9 function 0: Intel i82559ER Ethernet (rev. 0x09)
fxp0: interrupting at dec 6600 irq 28
fxp0: Ethernet address 00:0f:20:2b:e1:24
inphy0 at fxp0 phy 1: i82555 10/100 media interface, rev. 4
inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
fxp1 at pci0 dev 10 function 0: Intel i82559ER Ethernet (rev. 0x09)
fxp1: interrupting at dec 6600 irq 4
fxp1: Ethernet address 00:0f:20:2b:e1:23
inphy1 at fxp1 phy 1: i82555 10/100 media interface, rev. 4
inphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
aceride0 at pci0 dev 13 function 0: Acer Labs M5229 UDMA IDE Controller (rev. 0xc1)
aceride0: primary channel interrupting at isa irq 14
atabus0 at aceride0 channel 0
aceride0: secondary channel interrupting at isa irq 15
atabus1 at aceride0 channel 1
isa0 at sio0
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
com0: console
com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo
pckbc0 at isa0 port 0x60-0x64
attimer0 at isa0 port 0x40-0x43
pcppi0 at isa0 port 0x61
midi0 at pcppi0: PC speaker
spkr0 at pcppi0
isabeep0 at pcppi0
fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
mcclock0 at isa0 port 0x70-0x71: mc146818 compatible time-of-day clock
attimer0: attached to pcppi0
tsp1 at tsc0
pci1 at tsp1 bus 0
vga0 at pci1 dev 7 function 0: ATI Technologies Radeon 7500 QW (rev. 0x00)
wsdisplay0 at vga0 kbdmux 1
drm at vga0 not configured
tlp0 at pci1 dev 9 function 0: DECchip 21140A Ethernet, pass 2.0
tlp0: interrupting at dec 6600 irq 24
tlp0: DEC DE500-AA, Ethernet address 00:00:f8:03:dd:a1
nsphy0 at tlp0 phy 5: DP83840 10/100 media interface, rev. 0
nsphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
esiop0 at pci1 dev 10 function 0: Symbios Logic 53c895 (ultra2-wide scsi)
esiop0: using on-board RAM
esiop0: interrupting at dec 6600 irq 20
scsibus2 at esiop0: 16 targets, 8 luns per target
scsibus0: waiting 2 seconds for devices to settle...
scsibus1: waiting 2 seconds for devices to settle...
scsibus2: waiting 2 seconds for devices to settle...
atapibus0 at atabus0: 2 targets
cd0 at atapibus0 drive 0: <HL-DT-ST RW/DVD GCC-4480B, , 2.06> cdrom removable
sd0 at scsibus0 target 0 lun 0: <FUJITSU, MAU3073NP, 3502> disk fixed
sd0: 70007 MB, 49158 cyl, 4 head, 729 sec, 512 bytes/sect x 143374744 sectors
sd0: sync (12.50ns offset 127), 16-bit (160.000MB/s) transfers, tagged queueing
root on sd0a dumps on sd0b
root file system type: ffs
Wed Jan 1 12:40:12 UTC 2014
Starting root file system check:
/dev/rsd0a: file system is clean; not checking
swapctl: setting dump device to /dev/sd0b
swapctl: adding /dev/sd0b as swap device at priority 0
Starting file system checks:
Setting tty flags.
Setting sysctl variables:
ddb.onpanic: 1 -> 0
Starting network.
IPv6 mode: host
Configuring network interfaces:.
Adding interface aliases:.
Starting dhclient.
Internet Systems Consortium DHCP Client V3.0.3
Copyright 2004-2005 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/products/DHCP

Listening on BPF/tlp0/00:00:f8:03:dd:a1
Sending on BPF/tlp0/00:00:f8:03:dd:a1
Listening on BPF/fxp1/00:0f:20:2b:e1:23
Sending on BPF/fxp1/00:0f:20:2b:e1:23
Listening on BPF/fxp0/00:0f:20:2b:e1:24
Sending on BPF/fxp0/00:0f:20:2b:e1:24
Sending on Socket/fallback
DHCPREQUEST on tlp0 to 255.255.255.255 port 67
DHCPACK from 192.168.1.1

bound to 192.168.1.6 -- renewal in 6266 seconds.
Building databases: dev, dev, utmp, utmpx.
Starting syslogd.
Mounting all filesystems...
Clearing temporary files.
Updating fontconfig cache: done.
Checking quotas: done.
Setting securelevel: kern.securelevel: 0 -> 1
swapctl: setting dump device to /dev/sd0b
Starting virecover.
Checking for core dump...
savecore: no core dump
Starting local daemons:.
Updating motd.
postfix: rebuilding /etc/mail/aliases (missing /etc/mail/aliases.db)
newaliases: warning: valid_hostname: empty hostname
newaliases: fatal: unable to use my own hostname
Jan 1 12:40:24 postfix/sendmail[397]: fatal: unable to use my own hostname
/etc/rc.d/postfix exited with code 1
Starting inetd.
Starting cron.
The following components reported failures:
/etc/rc.d/postfix
See /var/run/rc.log for more information.
Wed Jan 1 12:40:25 UTC 2014

NetBSD/alpha (Amnesiac) (console)

>Release-Note:

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-alpha/48488: pmap.h modify cause Kernel Panic on NetBSD/alpha current version.
Date: Wed, 1 Jan 2014 17:00:27 +0100

 On Wed, Jan 01, 2014 at 02:00:00PM +0000, nullnilaki@gmail.com wrote:
 > I think this modify is wrong.
 > http://cvsweb.netbsd.org/cgi-bin/cvsweb.cgi/src/sys/arch/alpha/include/pmap.h.diff?r1=1.77&r2=1.78&f=h

 This change looks correct (and is necessary to make alpha kernels
 compilable with modern compilers), but the question is: where is sizeof
 used incorrectly on this struct.

 Martin

From: "Matt Thomas" <matt@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/48488 CVS commit: src/sys/arch/alpha/include
Date: Wed, 1 Jan 2014 16:09:04 +0000

 Module Name:	src
 Committed By:	matt
 Date:		Wed Jan  1 16:09:04 UTC 2014

 Modified Files:
 	src/sys/arch/alpha/include: pmap.h

 Log Message:
 Fix PMAP_SIZEOF() to deal with that the pmap has 0 pmap_asn_info now.
 Addresses PR/48488.


 To generate a diff of this commit:
 cvs rdiff -u -r1.78 -r1.79 src/sys/arch/alpha/include/pmap.h

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

From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@NetBSD.org
Cc: martin@duskware.de, nullnilaki@gmail.com, tsutsui@ceres.dti.ne.jp
Subject: Re: port-alpha/48488: pmap.h modify cause Kernel Panic on NetBSD/alpha
	 current version.
Date: Thu, 2 Jan 2014 01:16:41 +0900

 martin@

 >  > I think this modify is wrong.
 >  > http://cvsweb.netbsd.org/cgi-bin/cvsweb.cgi/src/sys/arch/alpha/include/pmap.h.diff?r1=1.77&r2=1.78&f=h
 >  
 >  This change looks correct (and is necessary to make alpha kernels
 >  compilable with modern compilers),

 I don't think so.
 The definition was an (invalid) hack to have "variable sized arrays"
 so disabling out-of-range warnings is still better for now.

 >  but the question is: where is sizeof
 >  used incorrectly on this struct.

 struct pmap was defined as:
 http://nxr.netbsd.org/xref/src/sys/arch/alpha/include/pmap.h?r=1.77#136
 ---
     136 struct pmap {
     137 	TAILQ_ENTRY(pmap)	pm_list;	/* list of all pmaps */
     138 	pt_entry_t		*pm_lev1map;	/* level 1 map */
     139 	int			pm_count;	/* pmap reference count */
     140 	kmutex_t		pm_lock;	/* lock on pmap */
     141 	struct pmap_statistics	pm_stats;	/* pmap statistics */
     142 	unsigned long		pm_cpus;	/* mask of CPUs using pmap */
     143 	unsigned long		pm_needisync;	/* mask of CPUs needing isync */
     144 	struct pmap_asn_info	pm_asni[1];	/* ASN information */
     145 			/*	variable length		*/
     146 };

 and it's allocated by pool(9) and its size is deteremined at runtime
 (to adjust it per a number of CPUs):
 http://nxr.netbsd.org/xref/src/sys/arch/alpha/alpha/pmap.c?r=1.258#888
 ---
     888 	pool_cache_bootstrap(&pmap_pmap_cache, PMAP_SIZEOF(pmap_ncpuids), 0,
     889 	    0, 0, "pmap", NULL, IPL_NONE, NULL, NULL, NULL);
 ---

 http://nxr.netbsd.org/xref/src/sys/arch/alpha/alpha/pmap.c?r=1.258#1143
 ---
    1143 	pmap = pool_cache_get(&pmap_pmap_cache, PR_WAITOK);
    1144 	memset(pmap, 0, sizeof(*pmap));
    1145 
    1146 	/*
    1147 	 * Defer allocation of a new level 1 page table until
    1148 	 * the first new mapping is entered; just take a reference
    1149 	 * to the kernel kernel_lev1map.
    1150 	 */
    1151 	pmap->pm_lev1map = kernel_lev1map;
    1152 
    1153 	pmap->pm_count = 1;
    1154 	for (i = 0; i < pmap_ncpuids; i++) {
    1155 		pmap->pm_asni[i].pma_asn = PMAP_ASN_RESERVED;
    1156 		/* XXX Locking? */
    1157 		pmap->pm_asni[i].pma_asngen = pmap_asn_info[i].pma_asngen;
    1158 	}
 ---


 PMAP_SIZEOF() is defined as:
 http://nxr.netbsd.org/xref/src/sys/arch/alpha/include/pmap.h?r=1.77#148
 ---
     152 #define	PMAP_SIZEOF(x)							\
     153 	(ALIGN(sizeof(struct pmap) +					\
     154 	       (sizeof(struct pmap_asn_info) * ((x) - 1))))

 ---

 So if you really want to appease the warning, I think you have to
 define strcut pmap_asn_info array as pm_asni[ALPHA_MAXPROCS]
 and adjust all reference of sizeof(struct pmap), including
 the above memset() in pmap_create() etc.

 ---
 Izumi Tsutsui

From: Matt Thomas <matt@3am-software.com>
To: gnats-bugs@NetBSD.org
Cc: port-alpha-maintainer@netbsd.org,
 gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org,
 nullnilaki@gmail.com
Subject: Re: port-alpha/48488: pmap.h modify cause Kernel Panic on NetBSD/alpha current version.
Date: Wed, 1 Jan 2014 08:24:26 -0800

 On Jan 1, 2014, at 8:20 AM, Izumi Tsutsui <tsutsui@ceres.dti.ne.jp> wrote:

 > PMAP_SIZEOF() is defined as:
 > http://nxr.netbsd.org/xref/src/sys/arch/alpha/include/pmap.h?r=1.77#148
 > ---
 >     152 #define	PMAP_SIZEOF(x)							\
 >     153 	(ALIGN(sizeof(struct pmap) +					\
 >     154 	       (sizeof(struct pmap_asn_info) * ((x) - 1))))
 > 
 > ---

 The problem is the " - 1" was never removed from that macro.  Which
 I have since fixed.

From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: matt@3am-software.com
Cc: gnats-bugs@NetBSD.org, nullnilaki@gmail.com, tsutsui@ceres.dti.ne.jp
Subject: Re: port-alpha/48488: pmap.h modify cause Kernel Panic on NetBSD/alpha
	 current version.
Date: Thu, 2 Jan 2014 01:59:23 +0900

 matt@ wrote:

 > On Jan 1, 2014, at 8:20 AM, Izumi Tsutsui <tsutsui@ceres.dti.ne.jp> wrote:
 > 
 > > PMAP_SIZEOF() is defined as:
 > > http://nxr.netbsd.org/xref/src/sys/arch/alpha/include/pmap.h?r=1.77#148
 > > ---
 > >     152 #define	PMAP_SIZEOF(x)							\
 > >     153 	(ALIGN(sizeof(struct pmap) +					\
 > >     154 	       (sizeof(struct pmap_asn_info) * ((x) - 1))))
 > > 
 > > ---
 > 
 > The problem is the " - 1" was never removed from that macro.  Which
 > I have since fixed.

 What about this reference?
 http://nxr.netbsd.org/xref/src/sys/arch/alpha/alpha/pmap.c?r=1.258#220
     220 static struct pmap	kernel_pmap_store
     221 	[(PMAP_SIZEOF(ALPHA_MAXPROCS) + sizeof(struct pmap) - 1)
     222 		/ sizeof(struct pmap)];
 ---
 Izumi Tsutsui

From: Matt Thomas <matt@3am-software.com>
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Cc: gnats-bugs@NetBSD.org,
 nullnilaki@gmail.com
Subject: Re: port-alpha/48488: pmap.h modify cause Kernel Panic on NetBSD/alpha current version.
Date: Wed, 1 Jan 2014 09:02:25 -0800

 On Jan 1, 2014, at 8:59 AM, Izumi Tsutsui <tsutsui@ceres.dti.ne.jp> wrote:

 > What about this reference?
 > http://nxr.netbsd.org/xref/src/sys/arch/alpha/alpha/pmap.c?r=1.258#220
 >    220 static struct pmap	kernel_pmap_store
 >    221 	[(PMAP_SIZEOF(ALPHA_MAXPROCS) + sizeof(struct pmap) - 1)
 >    222 		/ sizeof(struct pmap)];

 That should be fine.  Since struct pmap is smaller than 
 PMAP_SIZEOF(ALPHA_MAXPROCS) you need more than one pmap struct to store
 that.  I thought of changing that to 
 roundup(PMAP_SIZEOF(ALPHA_MAXPROCS), sizeof(struct pmap)).

From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: matt@3am-software.com
Cc: gnats-bugs@NetBSD.org, nullnilaki@gmail.com, tsutsui@ceres.dti.ne.jp
Subject: Re: port-alpha/48488: pmap.h modify cause Kernel Panic on NetBSD/alpha
	 current version.
Date: Thu, 2 Jan 2014 02:56:27 +0900

 matt@ wrote:

 > On Jan 1, 2014, at 8:59 AM, Izumi Tsutsui <tsutsui@ceres.dti.ne.jp> wrote:
 > 
 > > What about this reference?
 > > http://nxr.netbsd.org/xref/src/sys/arch/alpha/alpha/pmap.c?r=1.258#220
 > >    220 static struct pmap	kernel_pmap_store
 > >    221 	[(PMAP_SIZEOF(ALPHA_MAXPROCS) + sizeof(struct pmap) - 1)
 > >    222 		/ sizeof(struct pmap)];
 > 
 > That should be fine.  Since struct pmap is smaller than 
 > PMAP_SIZEOF(ALPHA_MAXPROCS) you need more than one pmap struct to store
 > that.

 Ah, I see the original code intended a larger array was safe.

 > I thought of changing that to 
 > roundup(PMAP_SIZEOF(ALPHA_MAXPROCS), sizeof(struct pmap)).

 I have a feeling that using a union of struct pmap and
 full-sized PMAP_SIZEOF(ALPHA_MAXPROCS) storage for kernel_pmap_store
 would be more readable..

 ---
 Izumi Tsutsui

From: "Naruaki.Etomi" <nullnilaki@gmail.com>
To: gnats-bugs@netbsd.org
Cc: martin@duskware.de, matt@3am-software.com, tsutsui@ceres.dti.ne.jp, 
	port-alpha-maintainer@netbsd.org
Subject: Re: port-alpha/48488: pmap.h modify cause Kernel Panic on
 NetBSD/alpha current version.
Date: Thu, 2 Jan 2014 06:25:22 +0900

 Thank you for your mail!
 This works fine!!

 ----------------------------------------------------------------

 resetting all I/O buses
 (boot dka0.0.0.8.0 -flags A)
 block 0 of dka0.0.0.8.0 is a valid boot block
 reading 13 blocks from dka0.0.0.8.0
 bootstrap code read in
 base = 2be000, image_start = 0, image_bytes = 1a00(6656)
 initializing HWRPB at 2000
 initializing page table at 1fff0000
 initializing machine state
 setting affinity to the primary CPU
 jumping to bootstrap code

 NetBSD/alpha 6.1.2 FFSv2 Primary Bootstrap
 Jumping to entry point...

 NetBSD/alpha 6.1.2 Secondary Bootstrap, Revision 1.13 (Sat Dec  7
 08:20:39 JST 2013)

 VMS PAL rev: 0x1000700010162
 OSF PAL rev: 0x100070002015c
 Switch to OSF PAL code succeeded.

 Boot flags: A
 10838256+265392 [597552+395824]=0xb89da8

 Entering netbsd at 0xfffffc0000431220...
 Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
     2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014
     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 6.99.28 (GENERIC-$Revision: 1.356 $) #2: Thu Jan  2 05:34:37 JST 2014
         naruaki@NetBSD:/usr/current/obj.alpha/sys/arch/alpha/compile/GENERIC
 AlphaStation DS15, 1000MHz, s/n AY42501857
 8192 byte page size, 1 processor.
 total memory = 512 MB
 (2880 KB reserved for PROM, 509 MB used by NetBSD)
 avail memory = 490 MB
 mainbus0 (root)
 cpu0 at mainbus0: ID 0 (primary), 21264C-6
 cpu0: Architecture extensions: 0x1307<PAT,MVI,CIX,FIX,BWX>
 tsc0 at mainbus0: 21274 Core Logic Chipset, Cchip rev 0
 tsc0: 2 Dchips, 1 memory bus of 16 bytes
 tsc0: arrays present: 512MB, 0MB, 0MB, 0MB, Dchip 0 rev 1
 tsp0 at tsc0
 pci0 at tsp0 bus 0
 sio0 at pci0 dev 7 function 0: Acer Labs M1533 PCI-ISA Bridge (rev. 0xc3)
 ahc0 at pci0 dev 8 function 0: Adaptec aic7899 Ultra160 SCSI adapter
 ahc0: interrupting at dec 6600 irq 13
 ahc0: aic7899: Ultra160 Wide Channel A, SCSI Id=7, 32/253 SCBs
 scsibus0 at ahc0: 16 targets, 8 luns per target
 ahc1 at pci0 dev 8 function 1: Adaptec aic7899 Ultra160 SCSI adapter
 ahc1: interrupting at dec 6600 irq 12
 ahc1: aic7899: Ultra160 Wide Channel B, SCSI Id=7, 32/253 SCBs
 scsibus1 at ahc1: 16 targets, 8 luns per target
 fxp0 at pci0 dev 9 function 0: Intel i82559ER Ethernet (rev. 0x09)
 fxp0: interrupting at dec 6600 irq 28
 fxp0: Ethernet address 00:0f:20:2b:e1:24
 inphy0 at fxp0 phy 1: i82555 10/100 media interface, rev. 4
 inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
 fxp1 at pci0 dev 10 function 0: Intel i82559ER Ethernet (rev. 0x09)
 fxp1: interrupting at dec 6600 irq 4
 fxp1: Ethernet address 00:0f:20:2b:e1:23
 inphy1 at fxp1 phy 1: i82555 10/100 media interface, rev. 4
 inphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
 aceride0 at pci0 dev 13 function 0: Acer Labs M5229 UDMA IDE
 Controller (rev. 0xc1)
 aceride0: primary channel interrupting at isa irq 14
 atabus0 at aceride0 channel 0
 aceride0: secondary channel interrupting at isa irq 15
 atabus1 at aceride0 channel 1
 isa0 at sio0
 com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
 com0: console
 com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo
 pckbc0 at isa0 port 0x60-0x64
 attimer0 at isa0 port 0x40-0x43
 pcppi0 at isa0 port 0x61
 midi0 at pcppi0: PC speaker
 spkr0 at pcppi0
 isabeep0 at pcppi0
 fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
 mcclock0 at isa0 port 0x70-0x71: mc146818 compatible time-of-day clock
 attimer0: attached to pcppi0
 tsp1 at tsc0
 pci1 at tsp1 bus 0
 vga0 at pci1 dev 7 function 0: ATI Technologies Radeon 7500 QW (rev. 0x00)
 wsdisplay0 at vga0 kbdmux 1
 drm at vga0 not configured
 tlp0 at pci1 dev 9 function 0: DECchip 21140A Ethernet, pass 2.0
 tlp0: interrupting at dec 6600 irq 24
 tlp0: DEC DE500-AA, Ethernet address 00:00:f8:03:dd:a1
 nsphy0 at tlp0 phy 5: DP83840 10/100 media interface, rev. 0
 nsphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
 esiop0 at pci1 dev 10 function 0: Symbios Logic 53c895 (ultra2-wide scsi)
 esiop0: using on-board RAM
 esiop0: interrupting at dec 6600 irq 20
 scsibus2 at esiop0: 16 targets, 8 luns per target
 scsibus0: waiting 2 seconds for devices to settle...
 scsibus1: waiting 2 seconds for devices to settle...
 scsibus2: waiting 2 seconds for devices to settle...
 atapibus0 at atabus0: 2 targets
 cd0 at atapibus0 drive 0: <HL-DT-ST RW/DVD GCC-4480B, , 2.06> cdrom removable
 crypto: unable to register devsw
 sd0 at scsibus0 target 0 lun 0: <FUJITSU, MAU3073NP, 3502> disk fixed
 sd0: 70007 MB, 49158 cyl, 4 head, 729 sec, 512 bytes/sect x 143374744 sectors
 sd0: sync (12.50ns offset 127), 16-bit (160.000MB/s) transfers, tagged queueing
 root on sd0a dumps on sd0b
 root file system type: ffs
 Wed Jan  1 20:53:06 UTC 2014
 Starting root file system check:
 /dev/rsd0a: file system is clean; not checking
 swapctl: setting dump device to /dev/sd0b
 swapctl: adding /dev/sd0b as swap device at priority 0
 Starting file system checks:
 Setting tty flags.
 Setting sysctl variables:
 ddb.onpanic: 1 -> 0
 Starting network.
 IPv6 mode: host
 Configuring network interfaces:.
 Adding interface aliases:.
 Starting dhclient.
 Internet Systems Consortium DHCP Client V3.0.3
 Copyright 2004-2005 Internet Systems Consortium.
 All rights reserved.
 For info, please visit http://www.isc.org/products/DHCP

 Listening on BPF/tlp0/00:00:f8:03:dd:a1
 Sending on   BPF/tlp0/00:00:f8:03:dd:a1
 Listening on BPF/fxp1/00:0f:20:2b:e1:23
 Sending on   BPF/fxp1/00:0f:20:2b:e1:23
 Listening on BPF/fxp0/00:0f:20:2b:e1:24
 Sending on   BPF/fxp0/00:0f:20:2b:e1:24
 Sending on   Socket/fallback
 DHCPREQUEST on tlp0 to 255.255.255.255 port 67
 DHCPDISCOVER on fxp1 to 255.255.255.255 port 67 interval 7
 DHCPACK from 192.168.1.1

 bound to 192.168.1.6 -- renewal in 6635 seconds.
 Building databases: dev, dev, utmp, utmpx.
 Starting syslogd.
 Mounting all filesystems...
 Clearing temporary files.
 Updating fontconfig cache: done.
 Checking quotas: done.
 Setting securelevel: kern.securelevel: 0 -> 1
 swapctl: setting dump device to /dev/sd0b
 Starting virecover.
 Checking for core dump...
 savecore: no core dump
 Starting local daemons:.
 Updating motd.
 postfix: rebuilding /etc/mail/aliases (missing /etc/mail/aliases.db)
 newaliases: warning: valid_hostname: empty hostname
 newaliases: fatal: unable to use my own hostname
 Jan  1 20:53:20  postfix/sendmail[397]: fatal: unable to use my own hostname
 /etc/rc.d/postfix exited with code 1
 Starting inetd.
 Starting cron.
 The following components reported failures:
     /etc/rc.d/postfix
 See /var/run/rc.log for more information.
 Wed Jan  1 20:53:20 UTC 2014

 NetBSD/alpha (Amnesiac) (console)

 ----------------------------------------------------------------

 Dear port-alpha-maintainer.
 Why do you ignore this problem over a month?
 http://mail-index.netbsd.org/port-alpha/2013/12/23/msg000684.html
 http://mail-index.netbsd.org/netbsd-bugs/2013/12/07/msg035191.html
 I was a little disappointed.

 That's very nice of you!
  --
  Naruaki Etomi / nullnilaki@gmail.com

State-Changed-From-To: open->closed
State-Changed-By: matt@NetBSD.org
State-Changed-When: Wed, 01 Jan 2014 21:56:26 +0000
State-Changed-Why:
Bug was fixed.


>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.