From owner-freebsd-current Wed May 5 8:52: 6 1999 Delivered-To: freebsd-current@freebsd.org Received: from lor.watermarkgroup.com (lor.watermarkgroup.com [207.202.73.33]) by hub.freebsd.org (Postfix) with ESMTP id B47F014F4C for ; Wed, 5 May 1999 08:51:58 -0700 (PDT) (envelope-from luoqi@watermarkgroup.com) Received: (from luoqi@localhost) by lor.watermarkgroup.com (8.8.8/8.8.8) id LAA10321; Wed, 5 May 1999 11:51:57 -0400 (EDT) (envelope-from luoqi) Date: Wed, 5 May 1999 11:51:57 -0400 (EDT) From: Luoqi Chen Message-Id: <199905051551.LAA10321@lor.watermarkgroup.com> To: current@FreeBSD.ORG, darius@dons.net.au Subject: Re: SMP & APM Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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 = 01000009; cpuid = 1; lapic.id = 01000000 > 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 0xfffff, 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 majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message