From owner-freebsd-smp Sat Sep 26 03:09:48 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id DAA14465 for freebsd-smp-outgoing; Sat, 26 Sep 1998 03:09:48 -0700 (PDT) (envelope-from owner-freebsd-smp@FreeBSD.ORG) Received: from outmail.utsunomiya-u.ac.jp (outmail.utsunomiya-u.ac.jp [160.12.196.3]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id DAA14458; Sat, 26 Sep 1998 03:09:44 -0700 (PDT) (envelope-from yokota@zodiac.mech.utsunomiya-u.ac.jp) Received: from zodiac.mech.utsunomiya-u.ac.jp (IDENT:OustuushhoZ30BiKzXfr4nutht+ogGB8@zodiac.mech.utsunomiya-u.ac.jp [160.12.42.1]) by outmail.utsunomiya-u.ac.jp (8.9.1/8.9.1) with ESMTP id TAA01418; Sat, 26 Sep 1998 19:09:38 +0900 (JST) Received: from zodiac.mech.utsunomiya-u.ac.jp (zodiac.mech.utsunomiya-u.ac.jp [160.12.42.1]) by zodiac.mech.utsunomiya-u.ac.jp (8.7.6+2.6Wbeta7/3.4W/zodiac-May96) with ESMTP id TAA20805; Sat, 26 Sep 1998 19:10:43 +0900 (JST) Message-Id: <199809261010.TAA20805@zodiac.mech.utsunomiya-u.ac.jp> To: freebsd-smp@FreeBSD.ORG cc: jlemon@FreeBSD.ORG, yokota@zodiac.mech.utsunomiya-u.ac.jp Subject: VM86 on SMP Date: Sat, 26 Sep 1998 19:10:43 +0900 From: Kazutaka YOKOTA Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I compiled a SMP kernel with VM86. It appears that the kernel panics as soon as something makes a vm86 call. Example 1: Enable apm0, then the kernel panics while apm0 is probed. Trap 12 fault virtual address: 0xa00 fault code: superviser write vm86_prepcall() at vm86_prepcall+0x4a vm86_bioscall() at vm86_bioscall+0xe4 apmprobe() at apmprobe+0x3d movl %eax,0(%edx,0) at vm86_prepcall+0x4a Example 2: Boot the kernel without APM, then try to load the VESA LKM. The same panic at the same place. vm86_prepcall() at vm86_prepcall+0x4a vm86_bioscall() at vm86_bioscall+0xe4 But, this time it is the VESA LKM initialization routine which is calling VM86. The uniprocessor kernel has, of cource, no problems in the above situations. I think the fault is at the following line. We have a hardcoded address here: 0xa00, Is this address valid in SMP? vm86_prepcall(struct vm86frame vmf) { uintptr_t addr[] = { 0xA00, 0x1000 }; /* code, stack */ u_char intcall[] = { CLI, INTn, 0x00, STI, HLT }; if ((vmf.vmf_trapno & PAGE_MASK) <= 0xff) { /*interrupt call requested */ intcall[2] = (u_char)(vmf.vmf_trapno & 0xff); memcpy((void *)addr[0], (void *)intcall, sizeof(intcall)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vmf.vmf_ip = addr[0]; vmf.vmf_cs = 0; } vmf.vmf_sp = addr[1] - 2; /* keep aligned */ vmf.kernel_es = vmf.kernel_ds = 0; vmf.vmf_ss = 0; vmf.vmf_eflags = PSL_VIF | PSL_VM | PSL_USER; vm86_initflags(&vmf); } Kazu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message