From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 23 18:15:40 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A669314C; Tue, 23 Apr 2013 18:15:40 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 8288115AB; Tue, 23 Apr 2013 18:15:40 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id F1969B948; Tue, 23 Apr 2013 14:15:39 -0400 (EDT) From: John Baldwin To: Andriy Gapon Subject: Re: Rebooting from loader causes a "fault" in VMware Workstation Date: Tue, 23 Apr 2013 14:15:31 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <20130419162834.GA90217@icarus.home.lan> <5176B238.7030306@FreeBSD.org> <5176C5B2.3050409@FreeBSD.org> In-Reply-To: <5176C5B2.3050409@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201304231415.31935.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 23 Apr 2013 14:15:40 -0400 (EDT) Cc: freebsd-hackers@freebsd.org, Dimitry Andric X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Apr 2013 18:15:40 -0000 On Tuesday, April 23, 2013 1:32:34 pm Andriy Gapon wrote: > on 23/04/2013 19:09 Andriy Gapon said the following: > > ---------------- > > IN: > > 0x00000000000090d2: cli > > 0x00000000000090d3: mov $0x1800,%esp > > 0x00000000000090d8: mov %cr0,%eax > > 0x00000000000090db: and $0x7fffffff,%eax > > 0x00000000000090e0: mov %eax,%cr0 > > > > ---------------- > > IN: > > 0x00000000000090e3: xor %ecx,%ecx > > 0x00000000000090e5: mov %ecx,%cr3 > > > > ---------------- > > IN: > > 0x00000000000090e8: lgdtl 0x95d0 > > 0x00000000000090ef: ljmpw $0x18,$0x90f5 > > Perhaps the problem is that lgdt is called after disabling paging? That should be fine. Generally speaking paging shouldn't be enabled anyway (it only is if the i386 kernel panics before it has setup its own IDT). With paging disabled that should load the gdt from that physical address which looks correct (the GDT descriptor is stored just after the static gdt in btx.S itself). > > Triple fault > > CPU Reset (CPU 0) > > ESI=0004503c EDI=3fe50968 EBP=00094a80 ESP=00001800 > > EIP=000090ef EFL=00000046 [---Z-P-] CPL=0 II=0 A20=1 SMM=0 HLT=0 > > ES =0033 0000a000 ffffffff 00cff300 DPL=3 DS [-WA] > > CS =0008 00000000 ffffffff 00cf9a00 DPL=0 CS32 [-R-] > > SS =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA] > > DS =0033 0000a000 ffffffff 00cff300 DPL=3 DS [-WA] > > FS =0033 0000a000 ffffffff 00cff300 DPL=3 DS [-WA] > > GS =0033 0000a000 ffffffff 00cff300 DPL=3 DS [-WA] > > LDT=0000 00000000 0000ffff 00008200 DPL=0 LDT > > TR =0038 00005f98 00002067 00008900 DPL=0 TSS32-avl > > GDT= ff85c789 00000000 > > IDT= 00005e00 00000197 > > CR0=00000011 CR2=00000000 CR3=00000000 CR4=00000000 > > DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 > > DR6=00000000ffff0ff0 DR7=0000000000000400 > > CCS=00000001 CCD=00000000 CCO=LOGICL > > EFER=0000000000000000 > > > > > -- > Andriy Gapon > -- John Baldwin