From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 20 01:48:24 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 3373CC82 for ; Sat, 20 Apr 2013 01:48:24 +0000 (UTC) (envelope-from jdc@koitsu.org) Received: from qmta10.emeryville.ca.mail.comcast.net (qmta10.emeryville.ca.mail.comcast.net [IPv6:2001:558:fe2d:43:76:96:30:17]) by mx1.freebsd.org (Postfix) with ESMTP id 0FC38931 for ; Sat, 20 Apr 2013 01:48:23 +0000 (UTC) Received: from omta18.emeryville.ca.mail.comcast.net ([76.96.30.74]) by qmta10.emeryville.ca.mail.comcast.net with comcast id S1iw1l0041bwxycAA1oNfW; Sat, 20 Apr 2013 01:48:22 +0000 Received: from koitsu.strangled.net ([67.180.84.87]) by omta18.emeryville.ca.mail.comcast.net with comcast id S1oM1l00W1t3BNj8e1oNLi; Sat, 20 Apr 2013 01:48:22 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id CA0EE73A33; Fri, 19 Apr 2013 18:48:21 -0700 (PDT) Date: Fri, 19 Apr 2013 18:48:21 -0700 From: Jeremy Chadwick To: Joshua Isom Subject: Re: Rebooting from loader causes a "fault" in VMware Workstation Message-ID: <20130420014821.GA98555@icarus.home.lan> References: <20130419162834.GA90217@icarus.home.lan> <5171C9FE.8080409@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5171C9FE.8080409@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1366422502; bh=qO4GxaMSFkmgABQvviWyh8jiAt2c7LFCks+F3n1mvfg=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=p5VB19MbMiRTrop41F5mvBIiRvhdU5FjGcdZI6H8dxv8yxFbUYXo46JuhlHRB9a+2 SQPV5wK5ojVpmR+q0ZEFLvUU098r7zzD8pzPWJ9Hm3OV60m7H/xng45CNtLICmhE+r SZnxNZ+6IFUiEaFcLMdf2Fcg3e+sJP+5xfBV8Pjqhkuc8M/TKk8cukVN/Jv+L4fQwk GDUXmygwmNbjWvtKsOApA7f8iftzs9NP7lyYySVR9Oa3Jq8uX27OaXPWXEWH4c2/DU 9t4/BxC3c5eLiRnjFuJ2K7AsQi+JmdYlfOVEG2VCqxUmvifWiM3CpJJ3ITUKDwi8NG Z0YTZugj9wtjA== X-Mailman-Approved-At: Sat, 20 Apr 2013 01:57:01 +0000 Cc: freebsd-hackers@freebsd.org 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: Sat, 20 Apr 2013 01:48:24 -0000 On Fri, Apr 19, 2013 at 05:49:34PM -0500, Joshua Isom wrote: > Basically, the loader finds a simple safe way to reboot that's > worked since the 286, and VMWare doesn't like it. It's called a > triple fault. FreeBSD and Linux even use it to reboot as a fail > safe. Read sys/i386/i386/vm_machdep.c and cpu_reset_real to see how > FreeBSD handles it. VMWare at least says that "it would have caused > the physical machine to restart." Blame VMWare. > > On 4/19/2013 11:28 AM, Jeremy Chadwick wrote: > >(Please keep me CC'd as I'm not subscribed to -hackers) > > > >When running FreeBSD under VMware Workstation (I'm using 9.0.1, but this > >issue has existed for many years now, I remember it occurring on > >Workstation 6.x), the following is reproducible: > > > >1. Power on + boot FreeBSD VM > >2. At loader menu, press "3" to reboot > >3. Loader prints "Rebooting..." > >4. VMware proceeds to show the following message in a dialog box: > > > >"A fault has occurred causing a virtual CPU to enter the shutdown state. > >If this fault had occurred outside of a virtual machine, it would have > >caused the physical machine to restart. The shutdown state can be > >reached incorrectly configuring the virtual machine, a bug in the guest > >operating system, or a problem in VMware Workstation." > > > >It can also happen when dropping to the loader prompt and doing > >"reboot". > > > >It *does not* happen when booting fully into FreeBSD and issuing > >"shutdown -r now". Likewise, hw.acpi.disable_on_reboot and > >hw.acpi.handle_reboot have no bearing (e.g. changing either of those to > >1 (default = 0) then doing "shutdown -r now" to try and induce the > >problem). > > > >So it seems the issue is specific to the bootstrap/loader env. > > > >FreeBSD 9.1-STABLE is being used, but I've seen this happen with FreeBSD > >8.x as well as 7.x. It does not happen with other OSes like Linux and > >Solaris. I have not tried other VM systems (VirtualBox, etc.) but I > >imagine they might just silently deal with the situation rather than > >provide a useful message (although I know VirtualBox has an amazingly > >detailed debugger). > > > >I've looked at sys/boot/i386/loader/main.c (func command_reboot()) and > >the actual magic seems to happen inside of __exit. > > > >__exit comes from sys/boot/i386/btx/lib/btxsys.s, which zeros eax then > >issues INT 0x30 (syscall interrupt). That lead me to this: > > > >http://www.freebsd.org/doc/en/books/arch-handbook/book.html > > > >Eek. x86 architecture is a lot different than I remember it being in > >my 386 days, so this is all a bit over my head. I'm happy to open up a ticket with VMware about the issue as I'm a customer, but I find it a little odd that other operating systems do not exhibit this problem, including another BSD. Ones which reboot just fine from their bootloaders: - Linux -- so many that I don't know where to begin: ArchLinux 2012.10.06, CentOS 6.3, Debian 6.0.7, Finnix 1.0.5, Knoppix 7.0.4, Slackware 14.0, and Ubuntu 11.10 - OpenBSD 5.2 - OpenIndiana -- build 151a7 (server version) So when you say "Blame VMware", I'd be happy to, except there must be something FreeBSD's bootstraps are doing differently than everyone else that causes this oddity. Would you not agree? -- | Jeremy Chadwick jdc@koitsu.org | | UNIX Systems Administrator http://jdc.koitsu.org/ | | Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB |