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



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

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



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
 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 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 sys/param.h
 #include sys/conf.h
@@ -45,6 +46,10 @@
 #include machine/vm86.h
 #endif
 
+#ifdef SMP
+#include machine/smp.h
+#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 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 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