Re: SMP + APM = panic -> fixed!

2000-06-07 Thread Mitsuru IWASAKI

Hi,

> On Wed, 7 Jun 2000, Mitsuru IWASAKI wrote:
> 
> > We're having this problem for long time (from the old 4.0-CURRENT
> > days), but Mr. SUMITANI discovered a bug and fixed it.
> > The problem was that we got worng gdt pointer for the current cpu,
> > then panic...
> > The followings is a patch to fix the problem.  Thanks a lot, SUMITANI-san!
> 
>   Yes, this fixes panic and even 'halt -p' works as expected. 'zzz'

OK, I think many people will be happy with poweroff on SMP system, so
I'd like to commit this first.  Then I'll track it down and try to fix later
in order to support suspend/resume SMP system.

Thanks


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: SMP + APM = panic -> fixed!

2000-06-06 Thread Boris Popov

On Wed, 7 Jun 2000, Mitsuru IWASAKI wrote:

> We're having this problem for long time (from the old 4.0-CURRENT
> days), but Mr. SUMITANI discovered a bug and fixed it.
> The problem was that we got worng gdt pointer for the current cpu,
> then panic...
> The followings is a patch to fix the problem.  Thanks a lot, SUMITANI-san!

Yes, this fixes panic and even 'halt -p' works as expected. 'zzz'
command works too, but machine never come back from the suspend mode
(looks like interrupt controller programmed incorrectly or something
like this).

--
Boris Popov
http://www.butya.kz/~bp/



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: SMP + APM = panic -> fixed!

2000-06-06 Thread Mitsuru IWASAKI

> > Please test this and I'll commit & MFC this if we have no problem with
> > this fix.
> 
> I don't have an SMP + APM system around at the moment, but the
> fix does look correct to me, go ahead and commit it.  Thanks for
> tracking this down!

Thank you for reviewing this.  I'm going to comit tomorrow night
(JST), then MFC on early next week if no problems are reported.

Thanks


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: SMP + APM = panic -> fixed!

2000-06-06 Thread Jonathan Lemon

On Wed, Jun 07, 2000 at 02:06:15AM +0900, Mitsuru IWASAKI wrote:
> 
> We're having this problem for long time (from the old 4.0-CURRENT
> days), but Mr. SUMITANI discovered a bug and fixed it.
> The problem was that we got worng gdt pointer for the current cpu,
> then panic...
> The followings is a patch to fix the problem.  Thanks a lot, SUMITANI-san!
> Please test this and I'll commit & MFC this if we have no problem with
> this fix.

I don't have an SMP + APM system around at the moment, but the
fix does look correct to me, go ahead and commit it.  Thanks for
tracking this down!
--
Jonathan


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



SMP + APM = panic -> fixed!

2000-06-06 Thread Mitsuru IWASAKI

Hi,

We're having this problem for long time (from the old 4.0-CURRENT
days), but Mr. SUMITANI discovered a bug and fixed it.
The problem was that we got worng gdt pointer for the current cpu,
then panic...
The followings is a patch to fix the problem.  Thanks a lot, SUMITANI-san!
Please test this and I'll commit & MFC this if we have no problem with
this fix.
I love to have APM enabled SMP system with 4.1-RELEASE.

Index: bios.c
===
RCS file: /home/ncvs/src/sys/i386/i386/bios.c,v
retrieving revision 1.32
diff -u -r1.32 bios.c
--- bios.c  2000/05/17 19:44:16 1.32
+++ bios.c  2000/06/06 16:47:46
@@ -262,7 +262,7 @@
 union descriptor *p_gdt;
 
 #ifdef SMP
-p_gdt = &gdt[cpuid];
+p_gdt = &gdt[cpuid * NGDT];
 #else
 p_gdt = gdt;
 #endif


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: SMP & APM

1999-05-05 Thread Daniel J. O'Connor

On 05-May-99 Luoqi Chen wrote:
>  My SMP vm sharing commit broke APM. Please try out this patch,

That patch seems to have fixed it! Great stuff :)

---
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum




To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-current" in the body of the message



Re: SMP & APM

1999-05-05 Thread Mike Smith
> 
> On 05-May-99 Luoqi Chen wrote:
> > > Also, nm kernel.debug | sort shows that 0xc0208a4c is in Xbpt
> >  Are you sure it's in Xbpt? Xbpt has only 6 lines of code and none of them 
> > is
> >  likely to generate a page fault. What's the address of symbol Xbpt?
> 
> Yeah, well, it didn't look likely to me either but.. :-/
> 
> Here is part of nm kernel.debug | sort
> ...
> c0208a30 T Xnmi
> c0208a3c T Xbpt
> c0208a50 T Xofl
> ...
> 
> I'll give it another bash and see how goes.. Unfortunatly I can't get crash
> dumps. I should be able to get a null modem cable tomorrow, so I can try a
> serial console and remote gdb.

I wonder if there are problems running the APM requests on an AP?  

Daniel, are you running with the most recent MTRR/SMP fixes?

-- 
\\  Sometimes you're ahead,   \\  Mike Smith
\\  sometimes you're behind.  \\  m...@smith.net.au
\\  The race is long, and in the  \\  msm...@freebsd.org
\\  end it's only with yourself.  \\  msm...@cdrom.com




To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-current" in the body of the message



Re: SMP & APM

1999-05-05 Thread Luoqi Chen
> Hi,
> Has anyone tried having APM and SMP in the same kernel? It panic()'s mine :)
> 
> Basically the machine panics a few seconds after I do 'apmconf -e'. apm seems
> to return normal values though.
> 
> I've attached a sample output from APM, dmesg and my kernel config.
> 
> I get a trap 12: page fault in kernel mode
> mp_lock = 0109; cpuid = 1; lapic.id = 0100
> fault virtual address = 0x75f0
> fault code = supervisor read, page not present
> interrupt pointer = 0x8:0xc0208a4c
> stack pointer = 0x10:0xff80dd78
> frame pointer = 0x10:0xff80dd7c
> code segment =  base 0x0, limit 0xf, type 0x1b
> DPL 0, pres 1, def32 1, gran 1
> processor eflags =  interrupt enabled, resume, IOPL = 0
> current process =   Idle
> interrupt mask =<- SMP: XXX
> 
> Also, nm kernel.debug | sort shows that 0xc0208a4c is in Xbpt
> 
> ---
> Daniel O'Connor software and network engineer
> for Genesis Software - http://www.gsoft.com.au
> "The nice thing about standards is that there
> are so many of them to choose from."
>   -- Andrew Tanenbaum
> 
My SMP vm sharing commit broke APM. Please try out this patch,

Index: apm.c
===
RCS file: /home/ncvs/src/sys/i386/apm/apm.c,v
retrieving revision 1.80
diff -u -r1.80 apm.c
--- apm.c   1999/04/21 07:57:55 1.80
+++ apm.c   1999/05/05 15:44:48
@@ -20,6 +20,7 @@
 
 #include "opt_devfs.h"
 #include "opt_vm86.h"
+#include "opt_smp.h"
 
 #include 
 #include 
@@ -45,6 +46,10 @@
 #include 
 #endif
 
+#ifdef SMP
+#include 
+#endif
+
 static int apm_display __P((int newstate));
 static int apm_int __P((u_long *eax, u_long *ebx, u_long *ecx, u_long *edx));
 static void apm_resume __P((void));
@@ -92,6 +97,10 @@
 static void
 setup_apm_gdt(u_int code32_base, u_int code16_base, u_int data_base, u_int 
code32_limit, u_int code16_limit, u_int data_limit)
 {
+#ifdef SMP
+   int x;
+#endif
+
/* setup 32bit code segment */
gdt_segs[GAPMCODE32_SEL].ssd_base  = code32_base;
gdt_segs[GAPMCODE32_SEL].ssd_limit = code32_limit;
@@ -108,6 +117,14 @@
ssdtosd(gdt_segs + GAPMCODE32_SEL, &gdt[GAPMCODE32_SEL].sd);
ssdtosd(gdt_segs + GAPMCODE16_SEL, &gdt[GAPMCODE16_SEL].sd);
ssdtosd(gdt_segs + GAPMDATA_SEL  , &gdt[GAPMDATA_SEL  ].sd);
+
+#ifdef SMP
+   for (x = 1; x < mp_ncpus; x++) {
+   gdt[x * NGDT + GAPMCODE32_SEL].sd = gdt[GAPMCODE32_SEL].sd;
+   gdt[x * NGDT + GAPMCODE16_SEL].sd = gdt[GAPMCODE16_SEL].sd;
+   gdt[x * NGDT + GAPMDATA_SEL  ].sd = gdt[GAPMDATA_SEL  ].sd;
+   }
+#endif
 }
 
 /* 48bit far pointer. Do not staticize - used from apm_setup.s */

-lq


To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-current" in the body of the message



Re: SMP & APM

1999-05-05 Thread Luoqi Chen
> Yeah, well, it didn't look likely to me either but.. :-/
> 
> Here is part of nm kernel.debug | sort
> ...
> c0208a30 T Xnmi
> c0208a3c T Xbpt
> c0208a50 T Xofl
> ...
> 
Did you actually boot from kernel.debug? If not, use the kernel you booted
from, the symbols should still be there.

> I'll give it another bash and see how goes.. Unfortunatly I can't get crash
> dumps. I should be able to get a null modem cable tomorrow, so I can try a
> serial console and remote gdb.
> 
> ---
> Daniel O'Connor software and network engineer
> for Genesis Software - http://www.gsoft.com.au
> "The nice thing about standards is that there
> are so many of them to choose from."
>   -- Andrew Tanenbaum

-lq

PS: `nm -n' sorts the output by address.


To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-current" in the body of the message



Re: SMP & APM

1999-05-05 Thread Daniel J. O'Connor

On 05-May-99 Luoqi Chen wrote:
> > Also, nm kernel.debug | sort shows that 0xc0208a4c is in Xbpt
>  Are you sure it's in Xbpt? Xbpt has only 6 lines of code and none of them is
>  likely to generate a page fault. What's the address of symbol Xbpt?

Yeah, well, it didn't look likely to me either but.. :-/

Here is part of nm kernel.debug | sort
...
c0208a30 T Xnmi
c0208a3c T Xbpt
c0208a50 T Xofl
...

I'll give it another bash and see how goes.. Unfortunatly I can't get crash
dumps. I should be able to get a null modem cable tomorrow, so I can try a
serial console and remote gdb.

---
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum




To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-current" in the body of the message



Re: SMP & APM

1999-05-05 Thread Luoqi Chen
> Hi,
> Has anyone tried having APM and SMP in the same kernel? It panic()'s mine :)
> 
> Basically the machine panics a few seconds after I do 'apmconf -e'. apm seems
> to return normal values though.
> 
> I've attached a sample output from APM, dmesg and my kernel config.
> 
> I get a trap 12: page fault in kernel mode
> mp_lock = 0109; cpuid = 1; lapic.id = 0100
> fault virtual address = 0x75f0
> fault code = supervisor read, page not present
> interrupt pointer = 0x8:0xc0208a4c
> stack pointer = 0x10:0xff80dd78
> frame pointer = 0x10:0xff80dd7c
> code segment =  base 0x0, limit 0xf, type 0x1b
> DPL 0, pres 1, def32 1, gran 1
> processor eflags =  interrupt enabled, resume, IOPL = 0
> current process =   Idle
> interrupt mask =<- SMP: XXX
> 
> Also, nm kernel.debug | sort shows that 0xc0208a4c is in Xbpt
> 
Are you sure it's in Xbpt? Xbpt has only 6 lines of code and none of them is
likely to generate a page fault. What's the address of symbol Xbpt?

> ---
> Daniel O'Connor software and network engineer
> for Genesis Software - http://www.gsoft.com.au
> "The nice thing about standards is that there
> are so many of them to choose from."
>   -- Andrew Tanenbaum
> 

-lq


To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-current" in the body of the message



SMP & APM

1999-05-05 Thread Daniel J. O'Connor
Hi,
Has anyone tried having APM and SMP in the same kernel? It panic()'s mine :)

Basically the machine panics a few seconds after I do 'apmconf -e'. apm seems
to return normal values though.

I've attached a sample output from APM, dmesg and my kernel config.

I get a trap 12: page fault in kernel mode
mp_lock = 0109; cpuid = 1; lapic.id = 0100
fault virtual address = 0x75f0
fault code = supervisor read, page not present
interrupt pointer = 0x8:0xc0208a4c
stack pointer = 0x10:0xff80dd78
frame pointer = 0x10:0xff80dd7c
code segment =  base 0x0, limit 0xf, type 0x1b
DPL 0, pres 1, def32 1, gran 1
processor eflags =  interrupt enabled, resume, IOPL = 0
current process =   Idle
interrupt mask =<- SMP: XXX

Also, nm kernel.debug | sort shows that 0xc0208a4c is in Xbpt

---
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum


Copyright (c) 1992-1999 The FreeBSD Project.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
FreeBSD 4.0-CURRENT #1: Wed May  5 20:41:20 CST 1999
r...@guppy.dons.net.au:/usr/src/sys/compile/GUPPY.nosmp
Timecounter "i8254"  frequency 1193182 Hz
CPU: Pentium II/Xeon/Celeron (350.80-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x653  Stepping=3
  Features=0x183fbff
real memory  = 134217728 (131072K bytes)
avail memory = 127442944 (124456K bytes)
Preloaded elf kernel "kernel.nosmp" at 0xc0308000.
Pentium Pro MTRR support enabled, default memory type is uncacheable
ccd0-3: Concatenated disk drivers
Probing for PnP devices:
CSN 1 Vendor ID: CTL00e4 [0xe4008c0e] Serial 0x12939604 Comp ID: PNPb02f [0x2fb0
d041]
npx0:  on motherboard
npx0: INT 16 interface
apm0:  on motherboard
apm: found APM BIOS version 1.2
pcib0:  on motherboard
pci0:  on pcib0
chip0:  at device 0.0 on pci0
chip1:  at device 1.0 on pci0
isab0:  at device 7.0 on pci0
ide_pci0:  at device 7.1 on pci0
chip2:  at device 7.3 on pci0
de0:  at device 11.0 on pci0
de0: interrupting at irq 11
de0: 21140 [10-100Mb/s] pass 1.1
de0: address 00:80:ad:16:77:3e
de0: enabling 100baseTX port
devclass_alloc_unit: npx0 already exists, using next available unit number
devclass_alloc_unit: apm0 already exists, using next available unit number
isa0:  on motherboard
fdc0: interrupting at irq 6
fdc0:  at port 0x3f0-0x3f7 irq 6 drq 2 on isa0
fdc0: FIFO enabled, 8 bytes threshold
fd0: <1440-KB 3.5" drive> at fdc0 drive 0
wdc0 at port 0x1f0-0x1f7 irq 14 flags 0xa0ffa0ff on isa0
wdc0: unit 0 (wd0): , DMA, 32-bit, multi-block-16
wd0: 12416MB (25429824 sectors), 25228 cyls, 16 heads, 63 S/T, 512 B/S
wdc0: interrupting at irq 14
wdc1 at port 0x170-0x177 irq 15 flags 0xa0ffa0ff on isa0
wdc1: unit 0 (atapi): , removable, dma, ior
dis
wcd0: drive speed 5512KB/sec, 128KB cache
wcd0: supported read types: CD-R, CD-RW, CD-DA
wcd0: Audio: play, 255 volume levels
wcd0: Mechanism: ejectable tray
wcd0: Medium: no/blank disc inside, unlocked
wdc1: interrupting at irq 15
atkbdc0:  at port 0x60 on isa0
psm0:  on atkbdc0
psm0: model MouseMan+, device ID 0
psm0: interrupting at irq 12
atkbd0:  on atkbdc0
atkbd0: interrupting at irq 1
vga0:  on isa0
sc0:  on isa0
sc0: VGA color <16 virtual consoles, flags=0x0>
sio0 at port 0x3f8-0x3ff irq 4 on isa0
sio0: type 16550A
sio0: interrupting at irq 4
sio1 at port 0x2f8-0x2ff irq 3 on isa0
sio1: type 16550A
sio1: interrupting at irq 3
ppc0: not probed (disabled)
sb0 at port 0x220 irq 5 drq 1 on isa0
snd0:  
sb0: interrupting at irq 5
sbxvi0 at drq 5 on isa0
snd0:  
sbmidi0 at port 0x330 on isa0
snd0:  
opl0 at port 0x388 on isa0
snd0:  
awe0 at port 0x620 on isa0
AWE32: not detected

joy0 at port 0x201 on isa0
joy0: joystick
changing root device to wd0s3a
ffs_mountfs: superblock updated for soft updates
DEVICE_SUSPEND error 6, ignored
resumed from suspended mode (slept 00:00:03)
DEVICE_SUSPEND error 6, ignored
resumed from suspended mode (slept 00:00:12)
ffs_mountfs: superblock updated for soft updates
ffs_mountfs: superblock updated for soft updates
de0: enabling 10baseT port
APM version: 1.2
APM Managment: Enabled
AC Line status: on-line
Battery status: unknown
Remaining battery life: unknown
Remaining battery time: unknown
Number of batteries: 0
Resume timer: disabled
Resume on ring indicator: enabled
APM Capacities:
global standby state
global suspend state
resume timer from standby
resume timer from suspend
machine "i386"
cpu "I686_CPU"
ident   TEST
maxusers32

options INCLUDE_CONFIG_FILE # Include this file in kernel

options USERCONFIG  #boot -c editor
options VISUAL_USERCONFIG   #visual boot -c editor

options INET#InterNETworking
options FFS #Berkeley Fast Fi