From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 19 18:21:34 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 9C7CB1B6 for ; Fri, 19 Apr 2013 18:21:34 +0000 (UTC) (envelope-from jdc@koitsu.org) Received: from qmta12.emeryville.ca.mail.comcast.net (qmta12.emeryville.ca.mail.comcast.net [IPv6:2001:558:fe2d:44:76:96:27:227]) by mx1.freebsd.org (Postfix) with ESMTP id 83D111101 for ; Fri, 19 Apr 2013 18:21:34 +0000 (UTC) Received: from omta07.emeryville.ca.mail.comcast.net ([76.96.30.59]) by qmta12.emeryville.ca.mail.comcast.net with comcast id RoTl1l0021GXsucACsUbMy; Fri, 19 Apr 2013 16:28:35 +0000 Received: from koitsu.strangled.net ([67.180.84.87]) by omta07.emeryville.ca.mail.comcast.net with comcast id RsUa1l00e1t3BNj8UsUbYc; Fri, 19 Apr 2013 16:28:35 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id BF87373A33; Fri, 19 Apr 2013 09:28:34 -0700 (PDT) Date: Fri, 19 Apr 2013 09:28:34 -0700 From: Jeremy Chadwick To: freebsd-hackers@freebsd.org Subject: Rebooting from loader causes a "fault" in VMware Workstation Message-ID: <20130419162834.GA90217@icarus.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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=1366388915; bh=OpikcpHl421BfsS44/DvaAuQL/kh6SFv99cq+uS0Uko=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=fNwd1OJLUjXvKz3gXlMoLDaQEeQcWNtjZHe71mKHcTl0mau8HjrzMKa9Le70Oqkwz /NtVZxw1Cim4ebDRWxU8ud0QRvyeiNPu/w5lB/wW2xZfRvwT5g0ypxiw135oi9VEi5 iiwkOWr9YLqQqIYEb/8BKxAkHj68tH3Fg5T5+Q8lCCeoEflBSVy8VfeZVsrn8jthAU kvhLgRFpuEKgBfptOu/pKrF05K7MnwQ+6KzY0/vyzbOdbjSpUwN3Ff7AYFnX6+Vs9w EiaceaiW3PQ57sua+0DW77R8O7TpcWW2qZXAVRkGWDvwlhuokS366ZLVA2LA6sjXHU xVcRGgP2BzSWg== X-Mailman-Approved-At: Fri, 19 Apr 2013 18:40:06 +0000 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: Fri, 19 Apr 2013 18:21:34 -0000 (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. -- | 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 |