Status of uvm_fault in 4.2

2007-09-18 Thread Jon Steel
Hi

Back in OpenBSD 4.0 I got the error below regarding a uvm_fualt.
According to the cvs logs in pmap.c the bug was not occuring in OpenBSD
4.1 due to some code being reverted, so we switched to that. It seemed
to corret the problem until just the other day. I had a computer
constantly rebooting all night, and on one of the shutdowns I got the error.

I noticed that there is a lot of changes going on in pmap.c since 4.1
and I was wondering on the status of this error? Has it actually been
fixed yet? If it has not, is there anything I can do to help? I have a
few dual and quad core machines I could use to test any changes.

Thanks

Jonathan Steel

uvm_fault(0x..., 0x..., 0, 1) - e
kernel: page fault trap, code = 0
stopped at pmap_page_remove_86+0x114:
0(%eax, %edx, 4), %eax

The trace output is:

pmap_page_remove_86(d0d31420,c0,e9b57e2c,d04adeb9,e99f) at 
pmap_page_remove_86+0x114
uvm_vnp_terminate(d8034e04,0,0,0,0,14,0,d7e95004) at uvm_vnpterminate+0x31f
uvm_attach(d8034e04,0,2,0,d7f38378) at uvn_attach+0x2b5
uvm_unmap_detach(d7e959a4,0,d7f3841c,1) at uvm_unmap_detach+-x62
uvmspace_free(d7f38378,6,d08120e0) at uvmspace_free+0xfd
uvm_exit(d7fbb868,14,8,286) at uvm_exit+0x19
reaper(d80df430) at reaper+0x90
Bad frame pointer: 0xd0913eb8



Timeout in ichiic on boot

2007-08-24 Thread Jon Steel
Hi

When turning on a computer I once get several errors like the following: 

ichiic0: exec: op 1, addr 0x49, cmdlen 1, len 0, flags 0x08: timeout,
status 0x41BUSY,INUSE

This is a box running OpenBSD 4.1 with multi-processors enabled.
According to my dmesg below, I believe the device that is causing this
timeout is the PCI_PRODUCT_INTEL_82801GB_SMB. The person who started up
the computer does not remember, but he may have plugged in a usb
keyboard during the boot. Is it reasonable that this could have caused
the problem? When trying to duplicate the problem in this manner, I did
manage to lock the computer up once when the USB drivers were loading.

My only other guess is that its a problem caused by the wbwdg driver
that I wrote for the watchdog portion of the W83627HF chip. But Im lead
to believe its not this, because the error occurs well before that
driver is loaded, and it does load successfully.

I have included both a normal dmesg, and the dmesg upon a crash. The
only difference other than the error message as I can see is that the
lm0 as isa0 is not detected after the error, and so the lm1 attached to
the pci is not detached. This would make sense because the winbond chip
is busy and so when the isa driver scans for devices it does not find
the winbond chip.

I also noticed in lm_isa.c the following comment, Most devices
supported by this driver can attach to iic(4) as well.  However, we
prefer to attach them to isa(4) since that causes less overhead and is
more reliable. Could this problem be caused by a 'reliability' issue,
whatever that would be? If not, does anybody have any idea what the
problem is here?

Thank You

Jonathan Steel


*FAILED BOOT*

OpenBSD 4.1 (GENERIC.esentire) #0: Wed Aug 15 20:55:55 UTC 2007
   
[EMAIL PROTECTED]:/usr/src/sys/arch/i386/compile/GENERIC.esentire
cpu0: Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz (GenuineIntel 686-class)
2.40 GHz
cpu0:
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,EST,TM2,CX16,xTPR
real mem  = 2145869824 (2095576K)
avail mem = 1950765056 (1905044K)
using 4278 buffers containing 107417600 bytes (104900K) of memory
mainbus0 (root)
bios0 at mainbus0: AT/286+ BIOS, date 02/05/07, BIOS32 rev. 0 @ 0xfd470,
SMBIOS
rev. 2.51 @ 0x7feea000 (31 entries)
bios0: Supermicro PDSMi
pcibios0 at bios0: rev 2.1 @ 0xfd470/0xb90
pcibios0: PCI BIOS has 20 Interrupt Routing table entries
pcibios0: PCI Interrupt Router at 000:31:0 (Intel 82801GB LPC rev 0x00)
pcibios0: PCI bus #15 is the last bus
bios0: ROM list: 0xc/0xb000 0xcb000/0x1000 0xcc000/0x1000 0xcd000/0x1000
acpi at mainbus0 not configured
ipmi at mainbus0 not configured
mainbus0: Intel MP Specification (Version 1.4)
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: apic clock running at 266 MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz (GenuineIntel 686-class)
2.40 GHz
cpu1:
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,EST,TM2,CX16,xTPR
mainbus0: bus 0 is type PCI
mainbus0: bus 9 is type PCI
mainbus0: bus 10 is type PCI
mainbus0: bus 13 is type PCI
mainbus0: bus 14 is type PCI
mainbus0: bus 15 is type PCI
mainbus0: bus 16 is type ISA
ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins
ioapic1 at mainbus0: apid 3 pa 0xfec1, version 20, 24 pins
pci0 at mainbus0 bus 0: configuration mode 1 (no bios)
pchb0 at pci0 dev 0 function 0 Intel E7230 MCH rev 0xc0
ppb0 at pci0 dev 1 function 0 Intel E7230 PCIE rev 0xc0
pci1 at ppb0 bus 1
ppb1 at pci0 dev 28 function 0 Intel 82801GB PCIE rev 0x01
pci2 at ppb1 bus 9
ppb2 at pci2 dev 0 function 0 Intel PCIE-PCIE rev 0x09
pci3 at ppb2 bus 10
em0 at pci3 dev 1 function 0 Intel PRO/1000GT (82541GI) rev 0x05: apic
3 int 0 (irq 11), address 00:0e:0c:c6:49:f2
Intel IOxAPIC rev 0x09 at pci2 dev 0 function 1 not configured
ppb3 at pci0 dev 28 function 4 Intel 82801G PCIE rev 0x01
pci4 at ppb3 bus 13
em1 at pci4 dev 0 function 0 Intel PRO/1000MT (82573E) rev 0x03: apic
2 int 16 (irq 11), address 00:30:48:8d:cd:02
ppb4 at pci0 dev 28 function 5 Intel 82801G PCIE rev 0x01
pci5 at ppb4 bus 14
em2 at pci5 dev 0 function 0 Intel PRO/1000MT (82573L) rev 0x00: apic
2 int 17 (irq 11), address 00:30:48:8d:cd:03
uhci0 at pci0 dev 29 function 0 Intel 82801GB USB rev 0x01: apic 2 int
23 (irq 10)
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1 at pci0 dev 29 function 1 Intel 82801GB USB rev 0x01: apic 2 int
19 (irq 11)
usb1 at uhci1: USB revision 1.0
uhub1 at usb1
uhub1: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
uhci2 at pci0 dev 29 function 2 Intel 82801GB USB rev 0x01: apic 2 int
18 (irq 5)
usb2 at uhci2: USB revision 1.0
uhub2 at usb2
uhub2: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub2: 2 

New W83627HF Watchdog Driver

2007-04-27 Thread Jon Steel
Hi

I have created a driver for the watchdog on the W83627HF. It would be
very easy to support other Winbond watchdogs with this driver but I
didnt bother to because I dont have access to any other chips. I have
tested it on both the SuperMicro 5013G-M and 5015M-MT, and with OpenBSD
3.6, 4.0, and 4.1.

Thanks

Jonathan Steel

=
File: /sys/dev/isa/wbwdgvar.h
=

/*
 * Copyright (c) 2007 Jonathan Steel [EMAIL PROTECTED]
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

/* Registers */
#define WBWDG_ADDR  0x00
#define WBWDG_DATA  (WBWDG_ADDR + 1)   
#define WBWDG_LOGICAL_DEVICE0x07
#define WBWDG_DEVID 0x20
#define WBWDG_DEVREV0x21

/* Locial device 8 registers */
#define WBWDG_ENABLE0x30
#define WBWDG_COUNT_METHOD  0xF3
#define WBWDG_MODE  0xF5
#define WBWDG_TIMEOUT   0xF6

/* Magic numbers */
#define WB_DEVID_W83627HF   0x52
#define WBWDG_ADDR_SIZE 0x02
#define WBWDG_ENTER_CONFIG_MODE 0x87
#define WBWDG_EXIT_CONFIG_MODE  0xAA
#define WBWDG_DEV_WDG   0x08
#define WBWDG_MODE_MIN  (1  3)
#define WBWDG_MAX_TIMEOUT   (0xFF * 60)

struct wbwdg_softc {
struct device sc_dev;

bus_space_tag_t sc_iot;
bus_space_handle_t sc_ioh;
   
/* If the timeout is in minutes or seconds */
int wdg_mode_sec;
};



=
File: /sys/dev/isa/wbwdg.c
=

/*
 * Copyright (c) 2007 Jonathan Steel [EMAIL PROTECTED]
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

/*
 * Winbond W83627HF watchdog driver.
 * Datasheet:
 * www.winbond-usa.com/products/winbond_products/pdfs/PCIC/W83627HF_HGb.pdf
 */

#include sys/param.h
#include sys/systm.h
#include sys/device.h
#include machine/bus.h
#include sys/sensors.h

#include dev/isa/isareg.h
#include dev/isa/isavar.h

#include dev/isa/wbwdgvar.h

#ifdef WBWDG_DEBUG
#define DPRINTF(x) printf x
#else
#define DPRINTF(x)
#endif

int winbond_wdg_match(struct device *, void *, void *);
voidwinbond_wdg_attach(struct device *, struct device *, void *);
voidwinbond_wdg_init(struct wbwdg_softc *sc);
int winbond_wdg_cb(void *, int);

struct cfattach wbwdg_ca = {
sizeof(struct wbwdg_softc),
winbond_wdg_match,
winbond_wdg_attach
};

struct cfdriver wbwdg_cd = {
NULL, wbwdg, DV_DULL
};

static __inline void
winbond_conf_enable(bus_space_tag_t iot, bus_space_handle_t ioh)
{
bus_space_write_1(iot, ioh, WBWDG_ADDR, WBWDG_ENTER_CONFIG_MODE);
bus_space_write_1(iot, ioh, WBWDG_ADDR, WBWDG_ENTER_CONFIG_MODE);
}

static __inline void
winbond_conf_disable(bus_space_tag_t iot, bus_space_handle_t ioh)
{
bus_space_write_1(iot, ioh, WBWDG_ADDR, WBWDG_EXIT_CONFIG_MODE);
}

static __inline u_int8_t
winbond_conf_read(bus_space_tag_t iot, bus_space_handle_t ioh, u_int8_t index)
{
bus_space_write_1(iot, ioh, WBWDG_ADDR, index);
return (bus_space_read_1(iot, ioh, WBWDG_DATA));
}

static __inline void
winbond_conf_write(bus_space_tag_t iot, bus_space_handle_t ioh, u_int8_t index,
u_int8_t data)
{
bus_space_write_1(iot, ioh, WBWDG_ADDR, index);
bus_space_write_1(iot, ioh, WBWDG_DATA, data);
}

int
winbond_wdg_match(struct device *parent, void *match, void *aux)
{
struct isa_attach_args *ia = aux;
bus_space_tag_t iot;
bus_space_handle_t ioh;
u_int8_t device_id;

iot = ia-ia_iot;
if (bus_space_map(iot, ia-ipa_io[0].base, WBWDG_ADDR_SIZE, 0, ioh))
return (0);

/* See if this machine has a compatible 

Re: New W83627HF Watchdog Driver

2007-04-27 Thread Jon Steel
)) {
printf(: can't map I/O space\n);
return;
}

/* Enter configuration mode */
winbond_conf_enable(sc);

/* Read device id and revision */
buf = winbond_conf_read(sc, WBWDG_DEVID);
if (buf == WB_DEVID_W83627HF)
printf(: W83627HF : ); 
buf = winbond_conf_read(sc, WBWDG_DEVREV);
printf(rev 0x%02x:, buf);

/* Initialize logical devices */
winbond_wdg_init(sc);
printf(\n);

/* Escape from configuration mode */
winbond_conf_disable(sc);

return;
}

void
winbond_wdg_init(struct wbwdg_softc *sc)
{
/* Select WDG logical device */
winbond_conf_write(sc, WBWDG_LOGICAL_DEVICE, WBWDG_DEV_WDG);

/* 
 * Enable the timer. The default value of timeout is 0 which
 * means that the timeout is disabled
 */
winbond_conf_write(sc, WBWDG_ENABLE, 1); 
sc-wdg_mode_sec = 0;
   
wdog_register(sc, winbond_wdg_cb);

return;
}

int
winbond_wdg_cb(void *arg, int period)
{
struct wbwdg_softc *sc = arg;
int chip_period;
u_int8_t mode;

if (period  0)
period = 0;
else if (period  WBWDG_MAX_TIMEOUT) 
period = WBWDG_MAX_TIMEOUT;

/* Setup the chip to talk to the watchdog device */  
winbond_conf_enable(sc);
winbond_conf_write(sc, WBWDG_LOGICAL_DEVICE, WBWDG_DEV_WDG);

/* Tell the device to read the timeout as either seconds or minutes */
if (sc-wdg_mode_sec  period  0xFF) {
sc-wdg_mode_sec = 0;

mode = winbond_conf_read(sc, WBWDG_MODE);
mode |= WBWDG_MODE_MIN;
winbond_conf_write(sc, WBWDG_MODE, mode);
}
else if (!sc-wdg_mode_sec  period = 0xFF) {
sc-wdg_mode_sec = 1;

mode = winbond_conf_read(sc, WBWDG_MODE);
mode = ~WBWDG_MODE_MIN;
winbond_conf_write(sc, WBWDG_MODE, mode);
}

chip_period = period;
  
/* Convert the period to minutes if necessary */
if (period  0xFF) 
chip_period = period / 60;

winbond_conf_write(sc, WBWDG_TIMEOUT, chip_period); 

winbond_conf_disable(sc); 

return (period);
}


=
File: wbwdg.4
=

.\ Copyright (c) 2007 Jonathan Steel [EMAIL PROTECTED]
.\
.\ Permission to use, copy, modify, and distribute this software for any
.\ purpose with or without fee is hereby granted, provided that the above
.\ copyright notice and this permission notice appear in all copies.
.\
.\ THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\
.Dd April 27, 2007
.Dt WBWDG 4
.Os
.Sh NAME
.Nm wbwdg 
.Nd Winbond W83627HF watchdog driver
.Sh SYNOPSIS
.Cd wbwdg0 at isa? port 0x2e
.Cd wbwdg1 at isa? port 0x4e
.Sh DESCRIPTION
The
.Nm
driver provides support for the Winbond W83627HF watchdog.
The watchdog timer provides a standard
.Xr watchdog 4
interface.
.Pp
The sensors on the W83627HF are controlled by the 
.Xr lm 4 
driver.
.Ar flags .
.Sh SEE ALSO
.Xr isa 4 ,
.Xr lm 4,
.Xr watchdog 4 ,
.Xr sysctl 8
.Sh AUTHORS
The
.Nm
driver was written by
.An Jonathan Steel Aq [EMAIL PROTECTED] .


Additions to GENERIC


- Add the following in the section for the National Semiconductor drivers.

wbwdt0  at isa? port 0x2e   # Winbond W83627HF watchdog
wbwdt1  at isa? port 0x4e


Additions to /sys/dev/isa/lpt_isa


- Again, add the following in the section for the National Semiconductor 
drivers.

# Winbond w83627hf watchdog timer 
device  wbwdg
attach  wbwdg at isa
filedev/isa/wbwdg.c wbwdg


Jonathan Gray wrote:
 On Sat, Apr 28, 2007 at 02:58:27AM +1000, Jonathan Gray wrote:
   
 On Fri, Apr 27, 2007 at 12:30:56PM -0400, Jon Steel wrote:
 
 Hi

 I have created a driver for the watchdog on the W83627HF. It would be
 very easy to support other Winbond watchdogs with this driver but I
 didnt bother to because I dont have access to any other chips. I have
 tested it on both the SuperMicro 5013G-M and 5015M-MT, and with OpenBSD
 3.6, 4.0, and 4.1.

 Thanks

 Jonathan Steel
   
 You should combine the header with the .c file in this case,
 headers get included in userland and chew up space.

 Also I think readability would be aided if you made your
 conf_read/conf_write functions take a softc as a parameter
 instead of iot

Building boot

2007-04-11 Thread Jon Steel
Hi

Im trying to build boot for OpenBSD 4.0. Ive pasted the output below
from what I get if I do a make clean in /sys/arch/i386/stand/boot and
then do a make in /sys.

The problem is that the boot file that is being created in
/sys/arch/i386/stand/boot is 322K, whereas the original boot was only
38.6K. When I installboot this larger file, the system fails to load
boot upon restarting. So how do I actually make boot? Is it related to
the : relocation truncated to fit: R_386_16 .text messages below?

Thank You

Jonathan Steel

bash-3.1# make
=== dev/microcode
=== dev/microcode/atmel
=== dev/microcode/cirruslogic
=== dev/microcode/fxp
=== dev/microcode/kue
=== dev/microcode/neomagic
=== dev/microcode/ral
=== dev/microcode/rum
=== dev/microcode/symbol
=== dev/microcode/typhoon
=== dev/microcode/uyap
=== dev/microcode/yds
=== dev/microcode/zydas
=== arch/alpha
=== arch/alpha/stand
=== arch/alpha/stand/setnetbootinfo
=== arch/alpha/stand/installboot
=== arch/amd64
=== arch/amd64/stand
=== arch/amd64/stand/biosboot
=== arch/amd64/stand/installboot
=== arch/amd64/stand/boot
=== arch/amd64/stand/pxeboot
=== arch/amd64/stand/cdboot
=== arch/armish
=== arch/armish/stand
=== arch/armish/stand/boot
=== arch/aviion
=== arch/aviion/stand
=== arch/aviion/stand/a2coff
=== arch/cats
=== arch/hp300
=== arch/hp300/stand
=== arch/hp300/../m68k
=== arch/hppa
=== arch/hppa/stand
=== arch/hppa/stand/mkboot
=== arch/hppa/stand/boot
=== arch/hppa64
=== arch/hppa64/stand
=== arch/hppa64/stand/mkboot
=== arch/hppa64/stand/boot
=== arch/i386
=== arch/i386/stand
=== arch/i386/stand/etc
=== arch/i386/stand/libsa
=== arch/i386/stand/libkern
=== arch/i386/stand/libz
=== arch/i386/stand/mbr
=== arch/i386/stand/cdbr
=== arch/i386/stand/biosboot
=== arch/i386/stand/installboot
=== arch/i386/stand/boot
cc   -I/sys/arch/i386/stand/boot/../../../..
-I/sys/arch/i386/stand/boot/../libsa -I. -I/sys/arch/i386/stand/boot
-I/sys/arch/i386/stand/boot/../etc/obj
-I/sys/arch/i386/stand/boot/../../../..
-I/sys/arch/i386/stand/boot/../libsa -I. -I/sys/arch/i386/stand/boot
-I/sys/arch/i386/stand/boot/../etc -DBOOTMAGIC=0xc001d00d 
-DLINKADDR=0x40120 -c srt0.S
cc   -Os -Wall -Werror -fno-stack-protector  -D_STANDALONE -nostdinc
-fno-builtin -fpack-struct  -I/sys/arch/i386/stand/boot/../../../..
-I/sys/arch/i386/stand/boot/../libsa -I. -I/sys/arch/i386/stand/boot
-I/sys/arch/i386/stand/boot/../etc/obj
-I/sys/arch/i386/stand/boot/../../../..
-I/sys/arch/i386/stand/boot/../libsa -I. -I/sys/arch/i386/stand/boot
-I/sys/arch/i386/stand/boot/../etc -DBOOTMAGIC=0xc001d00d 
-DLINKADDR=0x40120 -c
/sys/arch/i386/stand/boot/../../../../stand/boot/boot.c
cc   -Os -Wall -Werror -fno-stack-protector  -D_STANDALONE -nostdinc
-fno-builtin -fpack-struct  -I/sys/arch/i386/stand/boot/../../../..
-I/sys/arch/i386/stand/boot/../libsa -I. -I/sys/arch/i386/stand/boot
-I/sys/arch/i386/stand/boot/../etc/obj
-I/sys/arch/i386/stand/boot/../../../..
-I/sys/arch/i386/stand/boot/../libsa -I. -I/sys/arch/i386/stand/boot
-I/sys/arch/i386/stand/boot/../etc -DBOOTMAGIC=0xc001d00d 
-DLINKADDR=0x40120 -c /sys/arch/i386/stand/boot/../../../../stand/boot/cmd.c
cc   -Os -Wall -Werror -fno-stack-protector  -D_STANDALONE -nostdinc
-fno-builtin -fpack-struct  -I/sys/arch/i386/stand/boot/../../../..
-I/sys/arch/i386/stand/boot/../libsa -I. -I/sys/arch/i386/stand/boot
-I/sys/arch/i386/stand/boot/../etc/obj
-I/sys/arch/i386/stand/boot/../../../..
-I/sys/arch/i386/stand/boot/../libsa -I. -I/sys/arch/i386/stand/boot
-I/sys/arch/i386/stand/boot/../etc -DBOOTMAGIC=0xc001d00d 
-DLINKADDR=0x40120 -c
/sys/arch/i386/stand/boot/../../../../stand/boot/vars.c
cc   -Os -Wall -Werror -fno-stack-protector  -D_STANDALONE -nostdinc
-fno-builtin -fpack-struct  -I/sys/arch/i386/stand/boot/../../../..
-I/sys/arch/i386/stand/boot/../libsa -I. -I/sys/arch/i386/stand/boot
-I/sys/arch/i386/stand/boot/../etc/obj
-I/sys/arch/i386/stand/boot/../../../..
-I/sys/arch/i386/stand/boot/../libsa -I. -I/sys/arch/i386/stand/boot
-I/sys/arch/i386/stand/boot/../etc -DBOOTMAGIC=0xc001d00d 
-DLINKADDR=0x40120 -c
/sys/arch/i386/stand/boot/../../../../stand/boot/bootarg.c
cc   -Os -Wall -Werror -fno-stack-protector  -D_STANDALONE -nostdinc
-fno-builtin -fpack-struct  -I/sys/arch/i386/stand/boot/../../../..
-I/sys/arch/i386/stand/boot/../libsa -I. -I/sys/arch/i386/stand/boot
-I/sys/arch/i386/stand/boot/../etc/obj
-I/sys/arch/i386/stand/boot/../../../..
-I/sys/arch/i386/stand/boot/../libsa -I. -I/sys/arch/i386/stand/boot
-I/sys/arch/i386/stand/boot/../etc -DBOOTMAGIC=0xc001d00d 
-DLINKADDR=0x40120 -c conf.c
ld  -nostdlib -Bstatic -Ttext 0x40120 -N -x -noinhibit-exec -o boot
srt0.o boot.o cmd.o vars.o bootarg.o conf.o
/sys/arch/i386/stand/boot/../libsa/libsa.a
/sys/arch/i386/stand/boot/../libz/libz.a
/sys/arch/i386/stand/boot/../libkern/libkern.a
/sys/arch/i386/stand/boot/../libsa/libsa.a(gidt.o)(.text+0x38): In
function `idt':
: relocation truncated to fit: R_386_16 .text
/sys/arch/i386/stand/boot/../libsa/libsa.a(gidt.o)(.text+0x40): In

Issue with rThreads and Shared Libraries

2007-04-05 Thread Jon Steel
Hi

Ive found a way to freeze a program when using rThreads and using a
function pointer back to one of the threads from within a shared
library. The higher the level of interrupts on the system, the more
frequently the problem occurs. The problem can be duplicated as follows:

1. Create a child rThread
2. Pass a function pointer to a shared library
3. Get the shared library to call the function pointer

The program will now lockup, and you must kill -9 it. I originally found
this in pcap, inside pcap_loop when it tries to call the callback
function. I have attached a very small project and shared library that
will reproduce the problem.

Just run

./configure
./make

Then generate a lot of interrupts somehow. I do this by running

iperf -us   // on the test machine
iperf -uc xxx.xxx.xxx.xxx -b 5 -t  // on some other machine

Then if you run ./callback 1 and try and kill it with Ctrl-C, it
should freeze. It may take a few tries though. It usually happens for me
within 3 or 4 tries if I run iperf really fast. If you run ./callback
then it wont lockup. The only difference is that when you pass in the 1,
it creates the child thread.

Id like to try this on current but I cant get rThreads compiled for it.

Does anybody have any insight, or could they test it out on current?

Thanks in advance

Jonathan Steel

[demime 1.01d removed an attachment of type application/x-gzip which had a name 
of amcallback-1.0.tar.gz]



Re: SMP causing uvm_fault

2007-03-29 Thread Jon Steel
Hi

Ive finally got the current version running and the problem below has
disappeared. I was wondering however if the problem has actually been
solved.

The line of code that Im crashing on is line 3005 of pmap.c in version 4.0:

3005if (pve-pv_ptp  (PDE(pve-pv_pmap,
3006 pdei(pve-pv_va))  PG_FRAME) !=
3007 VM_PAGE_TO_PHYS(pve-pv_ptp)) {

Specifically its crashing on PDE(pve-pv_pmap, pdei(pve-pv_val) because
of a page fault. This code has disappeared in -current, but does anybody
who was working on this section of code now why I was having this
problem or if its been fixed?

Thank you

Jonathan  Steel


Jon Steel wrote:
 Hi

 Im having a very similar problem as the one reported in Bug Query 5374.
 Im trying to solve the problem but Im finding it very hard to even get
 started. Is there somewhere besides the code that I can start to try and
 understand how SMP is being handled?

 http://cvs.openbsd.org/cgi-bin/query-pr-wrapper?full=yesnumbers=5374

 I can usually duplicate the crash by running the follwing script several
 times concurrently.

 #!/usr/bin/perl

 system(tcpdump -i em1 -w /var/crashTest1.pcap);
 system(tcpdump -i em1 -w /var/crashTest2.pcap);
 system(tcpdump -i em1 -w /var/crashTest3.pcap);
 system(tcpdump -i em1 -w /var/crashTest4.pcap);
 system(tcpdump -i em1 -w /var/crashTest5.pcap);
 system(tcpdump -i em1 -w /var/crashTest6.pcap);
 system(tcpdump -i em1 -w /var/crashTest7.pcap);

 while (1) {
 system(nmap 192.168.66.90);
 }

 Then after about an hour, when you try and reboot, I get an error:

 uvm_fault(0x..., 0x..., 0, 1) - e
 kernel: page fault trap, code = 0
 stopped at pmap_page_remove_86+0x114:
 0(%eax, %edx, 4), %eax

 The trace output is:

 pmap_page_remove_86(d0d31420,c0,e9b57e2c,d04adeb9,e99f) at 
 pmap_page_remove_86+0x114
 uvm_vnp_terminate(d8034e04,0,0,0,0,14,0,d7e95004) at uvm_vnpterminate+0x31f
 uvm_attach(d8034e04,0,2,0,d7f38378) at uvn_attach+0x2b5
 uvm_unmap_detach(d7e959a4,0,d7f3841c,1) at uvm_unmap_detach+-x62
 uvmspace_free(d7f38378,6,d08120e0) at uvmspace_free+0xfd
 uvm_exit(d7fbb868,14,8,286) at uvm_exit+0x19
 reaper(d80df430) at reaper+0x90
 Bad frame pointer: 0xd0913eb8


 A couple times the error has also occured on its own without saying
 'reboot' when running a ton of nmaps and tcpdumps at the same time.

 This trace is remarkably similar to the one in Bug Query 5374.
 Additionally I am using the same processor as he is. There is an unkown
 core statement in my dmesg but both cores seem to be working correctly.
 Here is my dmesg:

 OpenBSD 4.0 (GENERIC.MP) #936: Sat Sep 16 19:27:28 MDT 2006
 [EMAIL PROTECTED]:/usr/src/sys/arch/i386/compile/GENERIC.MP
 cpu0: Intel(R) Core(TM)2 CPU 6400 @ 2.13GHz (GenuineIntel 686-class)
 2.13 GHz
 cpu0:
 FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CF
 LUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,EST,TM2,CX16
 real mem  = 2145869824 (2095576K)
 avail mem = 1949290496 (1903604K)
 using 4256 buffers containing 107397120 bytes (104880K) of memory
 mainbus0 (root)
 bios0 at mainbus0: AT/286+(e6) BIOS, date 10/30/06, BIOS32 rev. 0 @
 0xfd470, SMB IOS rev. 2.51 @ 0x7feea000 (33 entries)
 bios0: Supermicro PDSMi
 pcibios0 at bios0: rev 2.1 @ 0xfd470/0xb90
 pcibios0: PCI BIOS has 20 Interrupt Routing table entries
 pcibios0: PCI Interrupt Router at 000:31:0 (Intel 82801GB LPC rev 0x00)
 pcibios0: PCI bus #15 is the last bus
 bios0: ROM list: 0xc/0xb000 0xcb000/0x1000 0xcc000/0x1000 0xcd000/0x1000
 ipmi at mainbus0 not configured
 mainbus0: Intel MP Specification (Version 1.4) (INTELMUKILTEO)
 cpu0 at mainbus0: apid 0 (boot processor)
 cpu0: unknown Core FSB_FREQ value 0 (0x4208)
 cpu0: apic clock running at 266 MHz
 cpu1 at mainbus0: apid 1 (application processor)
 cpu1: Intel(R) Core(TM)2 CPU 6400 @ 2.13GHz (GenuineIntel 686-class)
 2.13 GHz
 cpu1:
 FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CF
 LUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,EST,TM2,CX16
 mainbus0: bus 0 is type PCI
 mainbus0: bus 9 is type PCI
 mainbus0: bus 10 is type PCI
 mainbus0: bus 13 is type PCI
 mainbus0: bus 14 is type PCI
 mainbus0: bus 15 is type PCI
 mainbus0: bus 16 is type ISA
 ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins
 ioapic1 at mainbus0: apid 3 pa 0xfec1, version 20, 24 pins
 pci0 at mainbus0 bus 0: configuration mode 1 (no bios)
 pchb0 at pci0 dev 0 function 0 Intel E7230 MCH rev 0xc0
 ppb0 at pci0 dev 1 function 0 Intel E7230 PCIE rev 0xc0
 pci1 at ppb0 bus 1
 ppb1 at pci0 dev 28 function 0 Intel 82801GB PCIE rev 0x01
 pci2 at ppb1 bus 9
 ppb2 at pci2 dev 0 function 0 Intel PCIE-PCIE rev 0x09
 pci3 at ppb2 bus 10
 em0 at pci3 dev 1 function 0 Intel PRO/1000GT (82541GI) rev 0x05: apic
 3 int 0  (irq 11), address 00:0e:0c:b6:80:9e
 Intel IOxAPIC rev 0x09 at pci2 dev 0 function 1 not configured
 ppb3 at pci0 dev 28 function 4 Intel 82801G PCIE rev

GENERIC config failed in current

2007-03-29 Thread Jon Steel
Hi

When I installed the current version of the source, my computer froze
when starting up after the message mtrr: Pentium Pro MTRR support.
When I used the GENERIC config file that came with 4.0, everything
worked fine. Just wanted to let the developers know in case there is an
issue. My dmesg is included below.

Thanks

Jonathan Steel


OpenBSD 4.0 (GENERIC.MP) #936: Sat Sep 16 19:27:28 MDT 2006
 [EMAIL PROTECTED]:/usr/src/sys/arch/i386/compile/GENERIC.MP
 cpu0: Intel(R) Core(TM)2 CPU 6400 @ 2.13GHz (GenuineIntel 686-class)
 2.13 GHz
 cpu0:
 FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CF
 LUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,EST,TM2,CX16
 real mem  = 2145869824 (2095576K)
 avail mem = 1949290496 (1903604K)
 using 4256 buffers containing 107397120 bytes (104880K) of memory
 mainbus0 (root)
 bios0 at mainbus0: AT/286+(e6) BIOS, date 10/30/06, BIOS32 rev. 0 @
 0xfd470, SMB IOS rev. 2.51 @ 0x7feea000 (33 entries)
 bios0: Supermicro PDSMi
 pcibios0 at bios0: rev 2.1 @ 0xfd470/0xb90
 pcibios0: PCI BIOS has 20 Interrupt Routing table entries
 pcibios0: PCI Interrupt Router at 000:31:0 (Intel 82801GB LPC rev 0x00)
 pcibios0: PCI bus #15 is the last bus
 bios0: ROM list: 0xc/0xb000 0xcb000/0x1000 0xcc000/0x1000
0xcd000/0x1000
 ipmi at mainbus0 not configured
 mainbus0: Intel MP Specification (Version 1.4) (INTELMUKILTEO)
 cpu0 at mainbus0: apid 0 (boot processor)
 cpu0: unknown Core FSB_FREQ value 0 (0x4208)
 cpu0: apic clock running at 266 MHz
 cpu1 at mainbus0: apid 1 (application processor)
 cpu1: Intel(R) Core(TM)2 CPU 6400 @ 2.13GHz (GenuineIntel 686-class)
 2.13 GHz
 cpu1:
 FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CF
 LUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,EST,TM2,CX16
 mainbus0: bus 0 is type PCI
 mainbus0: bus 9 is type PCI
 mainbus0: bus 10 is type PCI
 mainbus0: bus 13 is type PCI
 mainbus0: bus 14 is type PCI
 mainbus0: bus 15 is type PCI
 mainbus0: bus 16 is type ISA
 ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins
 ioapic1 at mainbus0: apid 3 pa 0xfec1, version 20, 24 pins
 pci0 at mainbus0 bus 0: configuration mode 1 (no bios)
 pchb0 at pci0 dev 0 function 0 Intel E7230 MCH rev 0xc0
 ppb0 at pci0 dev 1 function 0 Intel E7230 PCIE rev 0xc0
 pci1 at ppb0 bus 1
 ppb1 at pci0 dev 28 function 0 Intel 82801GB PCIE rev 0x01
 pci2 at ppb1 bus 9
 ppb2 at pci2 dev 0 function 0 Intel PCIE-PCIE rev 0x09
 pci3 at ppb2 bus 10
 em0 at pci3 dev 1 function 0 Intel PRO/1000GT (82541GI) rev 0x05: apic
 3 int 0  (irq 11), address 00:0e:0c:b6:80:9e
 Intel IOxAPIC rev 0x09 at pci2 dev 0 function 1 not configured
 ppb3 at pci0 dev 28 function 4 Intel 82801G PCIE rev 0x01
 pci4 at ppb3 bus 13
 em1 at pci4 dev 0 function 0 Intel PRO/1000MT (82573E) rev 0x03: apic
 2 int 16  (irq 11), address 00:30:48:8a:ca:f8
 ppb4 at pci0 dev 28 function 5 Intel 82801G PCIE rev 0x01
 pci5 at ppb4 bus 14
 em2 at pci5 dev 0 function 0 Intel PRO/1000MT (82573L) rev 0x00: apic
 2 int 17  (irq 11), address 00:30:48:8a:ca:f9
 uhci0 at pci0 dev 29 function 0 Intel 82801GB USB rev 0x01: apic 2 int
 23 (irq  10)
 usb0 at uhci0: USB revision 1.0
 uhub0 at usb0
 uhub0: Intel UHCI root hub, rev 1.00/1.00, addr 1
 uhub0: 2 ports with 2 removable, self powered
 uhci1 at pci0 dev 29 function 1 Intel 82801GB USB rev 0x01: apic 2 int
 19 (irq  11)
 usb1 at uhci1: USB revision 1.0
 uhub1 at usb1
 uhub1: Intel UHCI root hub, rev 1.00/1.00, addr 1
 uhub1: 2 ports with 2 removable, self powered
 uhci2 at pci0 dev 29 function 2 Intel 82801GB USB rev 0x01: apic 2 int
 18 (irq  5)
 usb2 at uhci2: USB revision 1.0
 uhub2 at usb2
 uhub2: Intel UHCI root hub, rev 1.00/1.00, addr 1
 uhub2: 2 ports with 2 removable, self powered
 uhci3 at pci0 dev 29 function 3 Intel 82801GB USB rev 0x01: apic 2 int
 16 (irq  11)
 usb3 at uhci3: USB revision 1.0
 uhub3 at usb3
 uhub3: Intel UHCI root hub, rev 1.00/1.00, addr 1
 uhub3: 2 ports with 2 removable, self powered
 ehci0 at pci0 dev 29 function 7 Intel 82801GB USB rev 0x01: apic 2 int
 23 (irq  10)
 usb4 at ehci0: USB revision 2.0
 uhub4 at usb4
 uhub4: Intel EHCI root hub, rev 2.00/1.00, addr 1
 uhub4: 8 ports with 8 removable, self powered
 ppb5 at pci0 dev 30 function 0 Intel 82801BA AGP rev 0xe1
 pci6 at ppb5 bus 15
 vga1 at pci6 dev 0 function 0 ATI ES1000 rev 0x02
 wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
 wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
 ichpcib0 at pci0 dev 31 function 0 Intel 82801GB LPC rev 0x01: PM
disabled
 pciide0 at pci0 dev 31 function 1 Intel 82801GB IDE rev 0x01: DMA,
 channel 0 c onfigured to compatibility, channel 1 configured to
 compatibility
 atapiscsi0 at pciide0 channel 0 drive 0
 scsibus0 at atapiscsi0: 2 targets
 cd0 at scsibus0 targ 0 lun 0: TEAC, CD-224E-N, 1.AA SCSI0 5/cdrom
 removable
 cd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2
 pciide0: channel 1 disabled (no drives)
 pciide1 at pci0 dev 31 

Re: SMP causing uvm_fault

2007-03-29 Thread Jon Steel
I forgot to add:

In the log of pmap.c I found

revision 1.97
date: 2007/02/20 21:15:01;  author: tom;  state: Exp;  lines: +204 -500
Revert PAE pmap for now, until the strange bug is found.  This stops
the freezes many of us are seeing (especially on amd64 machines running
OpenBSD/i386).

Much testing by nick@ (as always - thanks!), hugh@, ian@, kettenis@
and Sam Smith (s (at) msmith (dot) net).

Requested by, input from, and ok deraadt@  ok art@, kettenis@, miod@


What is the strange bug?

Thanks again


Jon Steel wrote:
 Hi

 Ive finally got the current version running and the problem below has
 disappeared. I was wondering however if the problem has actually been
 solved.

 The line of code that Im crashing on is line 3005 of pmap.c in version 4.0:

 3005if (pve-pv_ptp  (PDE(pve-pv_pmap,
 3006 pdei(pve-pv_va))  PG_FRAME) !=
 3007 VM_PAGE_TO_PHYS(pve-pv_ptp)) {

 Specifically its crashing on PDE(pve-pv_pmap, pdei(pve-pv_val) because
 of a page fault. This code has disappeared in -current, but does anybody
 who was working on this section of code now why I was having this
 problem or if its been fixed?

 Thank you

 Jonathan  Steel


 Jon Steel wrote:
   
 Hi

 Im having a very similar problem as the one reported in Bug Query 5374.
 Im trying to solve the problem but Im finding it very hard to even get
 started. Is there somewhere besides the code that I can start to try and
 understand how SMP is being handled?

 http://cvs.openbsd.org/cgi-bin/query-pr-wrapper?full=yesnumbers=5374

 I can usually duplicate the crash by running the follwing script several
 times concurrently.

 #!/usr/bin/perl

 system(tcpdump -i em1 -w /var/crashTest1.pcap);
 system(tcpdump -i em1 -w /var/crashTest2.pcap);
 system(tcpdump -i em1 -w /var/crashTest3.pcap);
 system(tcpdump -i em1 -w /var/crashTest4.pcap);
 system(tcpdump -i em1 -w /var/crashTest5.pcap);
 system(tcpdump -i em1 -w /var/crashTest6.pcap);
 system(tcpdump -i em1 -w /var/crashTest7.pcap);

 while (1) {
 system(nmap 192.168.66.90);
 }

 Then after about an hour, when you try and reboot, I get an error:

 uvm_fault(0x..., 0x..., 0, 1) - e
 kernel: page fault trap, code = 0
 stopped at pmap_page_remove_86+0x114:
 0(%eax, %edx, 4), %eax

 The trace output is:

 pmap_page_remove_86(d0d31420,c0,e9b57e2c,d04adeb9,e99f) at 
 pmap_page_remove_86+0x114
 uvm_vnp_terminate(d8034e04,0,0,0,0,14,0,d7e95004) at uvm_vnpterminate+0x31f
 uvm_attach(d8034e04,0,2,0,d7f38378) at uvn_attach+0x2b5
 uvm_unmap_detach(d7e959a4,0,d7f3841c,1) at uvm_unmap_detach+-x62
 uvmspace_free(d7f38378,6,d08120e0) at uvmspace_free+0xfd
 uvm_exit(d7fbb868,14,8,286) at uvm_exit+0x19
 reaper(d80df430) at reaper+0x90
 Bad frame pointer: 0xd0913eb8


 A couple times the error has also occured on its own without saying
 'reboot' when running a ton of nmaps and tcpdumps at the same time.

 This trace is remarkably similar to the one in Bug Query 5374.
 Additionally I am using the same processor as he is. There is an unkown
 core statement in my dmesg but both cores seem to be working correctly.
 Here is my dmesg:

 OpenBSD 4.0 (GENERIC.MP) #936: Sat Sep 16 19:27:28 MDT 2006
 [EMAIL PROTECTED]:/usr/src/sys/arch/i386/compile/GENERIC.MP
 cpu0: Intel(R) Core(TM)2 CPU 6400 @ 2.13GHz (GenuineIntel 686-class)
 2.13 GHz
 cpu0:
 FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CF
 LUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,EST,TM2,CX16
 real mem  = 2145869824 (2095576K)
 avail mem = 1949290496 (1903604K)
 using 4256 buffers containing 107397120 bytes (104880K) of memory
 mainbus0 (root)
 bios0 at mainbus0: AT/286+(e6) BIOS, date 10/30/06, BIOS32 rev. 0 @
 0xfd470, SMB IOS rev. 2.51 @ 0x7feea000 (33 entries)
 bios0: Supermicro PDSMi
 pcibios0 at bios0: rev 2.1 @ 0xfd470/0xb90
 pcibios0: PCI BIOS has 20 Interrupt Routing table entries
 pcibios0: PCI Interrupt Router at 000:31:0 (Intel 82801GB LPC rev 0x00)
 pcibios0: PCI bus #15 is the last bus
 bios0: ROM list: 0xc/0xb000 0xcb000/0x1000 0xcc000/0x1000 0xcd000/0x1000
 ipmi at mainbus0 not configured
 mainbus0: Intel MP Specification (Version 1.4) (INTELMUKILTEO)
 cpu0 at mainbus0: apid 0 (boot processor)
 cpu0: unknown Core FSB_FREQ value 0 (0x4208)
 cpu0: apic clock running at 266 MHz
 cpu1 at mainbus0: apid 1 (application processor)
 cpu1: Intel(R) Core(TM)2 CPU 6400 @ 2.13GHz (GenuineIntel 686-class)
 2.13 GHz
 cpu1:
 FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CF
 LUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,EST,TM2,CX16
 mainbus0: bus 0 is type PCI
 mainbus0: bus 9 is type PCI
 mainbus0: bus 10 is type PCI
 mainbus0: bus 13 is type PCI
 mainbus0: bus 14 is type PCI
 mainbus0: bus 15 is type PCI
 mainbus0: bus 16 is type ISA
 ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins
 ioapic1 at mainbus0: apid 3 pa 0xfec1, version 20, 24 pins
 pci0 at mainbus0 bus 0

Re: SMP causing uvm_fault

2007-03-27 Thread Jon Steel
Theo de Raadt wrote:

  Can you try this with -current?

   
I tried with current but it froze on bootup after loading the Intel
MTRR. Vijay is having the same problem though and he said that current
did not solve the problem.

Im very suspicious of the following piece of code in
arch/i386/i386/pmap.c, function pmap_page_remove_86:

3052 #if defined(MULTIPROCESSOR)
3053 /*
3054  * Always shoot down the other pmap's
3055  * self-mapping of the PTP.
3056  */
3057 pmap_tlb_shootdown(pve-pv_pmap,
3058 ((vaddr_t)PTE_BASE) +
pve-pv_ptp-offset,
3059 opte, cpumask);
3060 #endif

To start with, I cant even find this function except in the arch/alpha
section.

Also, I tried following the trace through each function and I cant
figure out how many of these functions are calling eachother.

pmap_page_remove_86(d0d31420,c0,e9b57e2c,d04adeb9,e99f) at 
pmap_page_remove_86+0x125
uvm_vnp_terminate(d8034e04,0,0,0,0,14,0,d7e95004) at uvm_vnpterminate+0x36b
uvm_attach(d8034e04,0,2,0,d7f38378) at uvn_attach+0x2d1
uvm_unmap_detach(d7e959a4,0,d7f3841c,1) at uvm_unmap_detach+-x76
uvmspace_free(d7f38378,6,d08120e0) at uvmspace_free+0x10d
uvm_exit(d7fbb868,14,8,286) at uvm_exit+0x13
reaper(d80df430) at reaper+0x9a
Bad frame pointer: 0xd0933eb8


Another question, whats with the uvn_attach versus uvm_attach above?

Vijay also claimed that it was much easier for him to reproduce the
problem. Im guessing that this is because he has a slower processor as
well as half the amount of memory as I do. That makes it easier for him
to bog down the processors, and cause virtual memory swaps if either of
those are linked with the problem.

Thanks



SMP causing uvm_fault

2007-03-26 Thread Jon Steel
Hi

Im having a very similar problem as the one reported in Bug Query 5374.
Im trying to solve the problem but Im finding it very hard to even get
started. Is there somewhere besides the code that I can start to try and
understand how SMP is being handled?

http://cvs.openbsd.org/cgi-bin/query-pr-wrapper?full=yesnumbers=5374

I can usually duplicate the crash by running the follwing script several
times concurrently.

#!/usr/bin/perl

system(tcpdump -i em1 -w /var/crashTest1.pcap);
system(tcpdump -i em1 -w /var/crashTest2.pcap);
system(tcpdump -i em1 -w /var/crashTest3.pcap);
system(tcpdump -i em1 -w /var/crashTest4.pcap);
system(tcpdump -i em1 -w /var/crashTest5.pcap);
system(tcpdump -i em1 -w /var/crashTest6.pcap);
system(tcpdump -i em1 -w /var/crashTest7.pcap);

while (1) {
system(nmap 192.168.66.90);
}

Then after about an hour, when you try and reboot, I get an error:

uvm_fault(0x..., 0x..., 0, 1) - e
kernel: page fault trap, code = 0
stopped at pmap_page_remove_86+0x114:
0(%eax, %edx, 4), %eax

The trace output is:

pmap_page_remove_86(d0d31420,c0,e9b57e2c,d04adeb9,e99f) at 
pmap_page_remove_86+0x114
uvm_vnp_terminate(d8034e04,0,0,0,0,14,0,d7e95004) at uvm_vnpterminate+0x31f
uvm_attach(d8034e04,0,2,0,d7f38378) at uvn_attach+0x2b5
uvm_unmap_detach(d7e959a4,0,d7f3841c,1) at uvm_unmap_detach+-x62
uvmspace_free(d7f38378,6,d08120e0) at uvmspace_free+0xfd
uvm_exit(d7fbb868,14,8,286) at uvm_exit+0x19
reaper(d80df430) at reaper+0x90
Bad frame pointer: 0xd0913eb8


A couple times the error has also occured on its own without saying
'reboot' when running a ton of nmaps and tcpdumps at the same time.

This trace is remarkably similar to the one in Bug Query 5374.
Additionally I am using the same processor as he is. There is an unkown
core statement in my dmesg but both cores seem to be working correctly.
Here is my dmesg:

OpenBSD 4.0 (GENERIC.MP) #936: Sat Sep 16 19:27:28 MDT 2006
[EMAIL PROTECTED]:/usr/src/sys/arch/i386/compile/GENERIC.MP
cpu0: Intel(R) Core(TM)2 CPU 6400 @ 2.13GHz (GenuineIntel 686-class)
2.13 GHz
cpu0:
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CF
LUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,EST,TM2,CX16
real mem  = 2145869824 (2095576K)
avail mem = 1949290496 (1903604K)
using 4256 buffers containing 107397120 bytes (104880K) of memory
mainbus0 (root)
bios0 at mainbus0: AT/286+(e6) BIOS, date 10/30/06, BIOS32 rev. 0 @
0xfd470, SMB IOS rev. 2.51 @ 0x7feea000 (33 entries)
bios0: Supermicro PDSMi
pcibios0 at bios0: rev 2.1 @ 0xfd470/0xb90
pcibios0: PCI BIOS has 20 Interrupt Routing table entries
pcibios0: PCI Interrupt Router at 000:31:0 (Intel 82801GB LPC rev 0x00)
pcibios0: PCI bus #15 is the last bus
bios0: ROM list: 0xc/0xb000 0xcb000/0x1000 0xcc000/0x1000 0xcd000/0x1000
ipmi at mainbus0 not configured
mainbus0: Intel MP Specification (Version 1.4) (INTELMUKILTEO)
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: unknown Core FSB_FREQ value 0 (0x4208)
cpu0: apic clock running at 266 MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM)2 CPU 6400 @ 2.13GHz (GenuineIntel 686-class)
2.13 GHz
cpu1:
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CF
LUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,EST,TM2,CX16
mainbus0: bus 0 is type PCI
mainbus0: bus 9 is type PCI
mainbus0: bus 10 is type PCI
mainbus0: bus 13 is type PCI
mainbus0: bus 14 is type PCI
mainbus0: bus 15 is type PCI
mainbus0: bus 16 is type ISA
ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins
ioapic1 at mainbus0: apid 3 pa 0xfec1, version 20, 24 pins
pci0 at mainbus0 bus 0: configuration mode 1 (no bios)
pchb0 at pci0 dev 0 function 0 Intel E7230 MCH rev 0xc0
ppb0 at pci0 dev 1 function 0 Intel E7230 PCIE rev 0xc0
pci1 at ppb0 bus 1
ppb1 at pci0 dev 28 function 0 Intel 82801GB PCIE rev 0x01
pci2 at ppb1 bus 9
ppb2 at pci2 dev 0 function 0 Intel PCIE-PCIE rev 0x09
pci3 at ppb2 bus 10
em0 at pci3 dev 1 function 0 Intel PRO/1000GT (82541GI) rev 0x05: apic
3 int 0  (irq 11), address 00:0e:0c:b6:80:9e
Intel IOxAPIC rev 0x09 at pci2 dev 0 function 1 not configured
ppb3 at pci0 dev 28 function 4 Intel 82801G PCIE rev 0x01
pci4 at ppb3 bus 13
em1 at pci4 dev 0 function 0 Intel PRO/1000MT (82573E) rev 0x03: apic
2 int 16  (irq 11), address 00:30:48:8a:ca:f8
ppb4 at pci0 dev 28 function 5 Intel 82801G PCIE rev 0x01
pci5 at ppb4 bus 14
em2 at pci5 dev 0 function 0 Intel PRO/1000MT (82573L) rev 0x00: apic
2 int 17  (irq 11), address 00:30:48:8a:ca:f9
uhci0 at pci0 dev 29 function 0 Intel 82801GB USB rev 0x01: apic 2 int
23 (irq  10)
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1 at pci0 dev 29 function 1 Intel 82801GB USB rev 0x01: apic 2 int
19 (irq  11)
usb1 at uhci1: USB revision 1.0
uhub1 at usb1
uhub1: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable,