From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 23 23:18:25 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 36D2BECD; Tue, 23 Apr 2013 23:18:25 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) by mx1.freebsd.org (Postfix) with ESMTP id F38C51475; Tue, 23 Apr 2013 23:18:24 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.15]) by ltcfislmsgpa02.fnfis.com (8.14.5/8.14.5) with ESMTP id r3NNIOot032032 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Tue, 23 Apr 2013 18:18:24 -0500 Received: from LTCFISWMSGMB21.FNFIS.com ([10.132.99.23]) by LTCFISWMSGHT04.FNFIS.com ([10.132.206.15]) with mapi id 14.02.0309.002; Tue, 23 Apr 2013 18:18:23 -0500 From: "Teske, Devin" To: Adrian Chadd Subject: Re: Rebooting from loader causes a "fault" in VMware Workstation Thread-Topic: Rebooting from loader causes a "fault" in VMware Workstation Thread-Index: AQHOPS1WWmBkfRUB50CGHSMu4rHLhJjeeckAgAAx9ICAAKhoAIADYb0AgAGDcACAABoBAIAABjIAgABYD4CAAASPAIAAEN+AgAACNACAAAH0gA== Date: Tue, 23 Apr 2013 23:18:23 +0000 Message-ID: <13CA24D6AB415D428143D44749F57D7201F1CB34@ltcfiswmsgmb21> References: <20130419162834.GA90217@icarus.home.lan> <006B20F1-F67B-4E9D-B0DF-D4ED843F7E8E@FreeBSD.org> <5176B238.7030306@FreeBSD.org> <201304231231.38765.jhb@freebsd.org> <51770149.6020802@FreeBSD.org> <650A4439-B258-4FDA-BD5C-C9DEF5DC81ED@FreeBSD.org> <4735123C-E912-4D32-80D4-D057E2821626@FreeBSD.org> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.126] Content-Type: text/plain; charset="Windows-1252" Content-ID: <0CB19E95BCFF2545A70F2A5516523A3C@fisglobal.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8626, 1.0.431, 0.0.0000 definitions=2013-04-23_09:2013-04-23,2013-04-23,1970-01-01 signatures=0 Cc: Jeremy Chadwick , "freebsd-hackers@freebsd.org" , Dimitry Andric , Andriy Gapon , Joshua Isom , Devin Teske X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske 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 23:18:25 -0000 +1 you rock. I was silently watching this thread from the start, thinking=85 Oh gawd, please don't let this be associated with the massive Forth changes= I've rolled in (this much I had doubted heavily, but kept a watchful eye j= ust in-case). --=20 Devin On Apr 23, 2013, at 4:11 PM, Adrian Chadd wrote: > Hah, nice catch! You guys rock. >=20 > Scratch one less weird shit thing with FreeBSD on VMWARE. >=20 >=20 >=20 > Adrian >=20 > On 23 April 2013 16:03, Dimitry Andric wrote: >>=20 >> On Apr 24, 2013, at 00:03, Dimitry Andric wrote: >>=20 >>> On Apr 23, 2013, at 23:46, Andriy Gapon wrote: >>>> on 23/04/2013 19:31 John Baldwin said the following: >>>>> On Tuesday, April 23, 2013 12:09:28 pm Andriy Gapon wrote: >>> ... >>>>>> 0x00000000000090e8: lgdtl 0x95d0 >>>>>> 0x00000000000090ef: ljmpw $0x18,$0x90f5 >>>>>>=20 >>>>>> Triple fault >>>>>> CPU Reset (CPU 0) >>>>>> ESI=3D0004503c EDI=3D3fe50968 EBP=3D00094a80 ESP=3D00001800 >>>>>> EIP=3D000090ef EFL=3D00000046 [---Z-P-] CPL=3D0 II=3D0 A20=3D1 SMM= =3D0 HLT=3D0 >>>>>> ES =3D0033 0000a000 ffffffff 00cff300 DPL=3D3 DS [-WA] >>>>>> CS =3D0008 00000000 ffffffff 00cf9a00 DPL=3D0 CS32 [-R-] >>>>>> SS =3D0010 00000000 ffffffff 00cf9300 DPL=3D0 DS [-WA] >>>>>> DS =3D0033 0000a000 ffffffff 00cff300 DPL=3D3 DS [-WA] >>>>>> FS =3D0033 0000a000 ffffffff 00cff300 DPL=3D3 DS [-WA] >>>>>> GS =3D0033 0000a000 ffffffff 00cff300 DPL=3D3 DS [-WA] >>>>>> LDT=3D0000 00000000 0000ffff 00008200 DPL=3D0 LDT >>>>>> TR =3D0038 00005f98 00002067 00008900 DPL=3D0 TSS32-avl >>>>>> GDT=3D ff85c789 00000000 >>>>>=20 >>>>> This seems wrong (address is way too high). I wonder if the gdtdesc = was >>>>> trashed by something? Can you dump memory before the lgdtl instructi= on at the >>>>> 0x95d0 address? >>>>=20 >>>> Looks correct: >>>> Breakpoint 1, 0x000090e8 in ?? () >>>> (gdb) x/i $eip >>>> 0x90e8: lgdtl 0x95d0 >>>> (gdb) x/3xh 0x95d0 >>>> 0x95d0: 0x003f 0x9590 0x0000 >>>> (gdb) x/16xh 0x9590 >>>> 0x9590: 0x0000 0x0000 0x0000 0x0000 0xffff 0x0000 0x9a00 0x00cf >>>> 0x95a0: 0xffff 0x0000 0x9300 0x00cf 0xffff 0x0000 0x9a00 0x0000 >>>>=20 >>>> Nevertheless doing stepi leads to exactly the same triple fault. >>>=20 >>>=20 >>> Is it because lgdt loads the GDT from the ds segment, and ds is now 33, >>> not 0 (or equal to CS, I'm not sure which is correct here)? >>=20 >> Indeed, the DS segment was incorrect, the GDT should be loaded from the >> CS segment instead. This diff fixes the issue for me (and now "reboot" >> command from loader nicely reboots in VMware): >>=20 >> Index: sys/boot/i386/btx/btx/btx.S >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- sys/boot/i386/btx/btx/btx.S (revision 248910) >> +++ sys/boot/i386/btx/btx/btx.S (working copy) >> @@ -248,7 +248,7 @@ exit: cli = # Disable interrupts >> /* >> * Restore the GDT in case we caught a kernel trap. >> */ >> - lgdt gdtdesc # Set GDT >> + lgdt %cs:gdtdesc # Set GDT >> /* >> * To 16 bits. >> */ >>=20 >> _______________________________________________ >> freebsd-hackers@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.or= g" > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you.