From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 19 22:49:40 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 336EF790 for ; Fri, 19 Apr 2013 22:49:40 +0000 (UTC) (envelope-from jrisom@gmail.com) Received: from mail-ie0-x22d.google.com (mail-ie0-x22d.google.com [IPv6:2607:f8b0:4001:c03::22d]) by mx1.freebsd.org (Postfix) with ESMTP id 08FAD2E9 for ; Fri, 19 Apr 2013 22:49:39 +0000 (UTC) Received: by mail-ie0-f173.google.com with SMTP id k5so5251404iea.18 for ; Fri, 19 Apr 2013 15:49:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=m2yuMHAYtoJg/cM4X4zr2Xkuy8a5rZVp2SDhYbsiqiQ=; b=h6BWx2qZWduk4HNUEzWZ3GHdw9yg9PknU4X15Kh3s9WHSi6naV4y8aKXiyjd1b9x47 ZdhhLuXY7a3PYt0vHP37OqSS/0CzFPazJsj+sSFwmriiuZJBiwUhO7fh+ID3q6fiFfoQ ryYI+iIrM1RpwKgpaukGlXAvVV553Bapn/dhSoGmstyUTjZ1fyDm/Nv7DzsjSfWJ6qvR LLQS3sBEvGoqNnOepK/7+U/DW0vjWL2P3MOLNjA/TTPJoETfRX6FeKNqVSYIcgCSc6AM QzxTSKxC1XPOKHVRDQXxZoVw+Sn2nggFiSJIYEXOx1F9LR/Oqfk6v+pWXjBL02xgBQdN WW+g== X-Received: by 10.50.1.38 with SMTP id 6mr16760922igj.106.1366411779673; Fri, 19 Apr 2013 15:49:39 -0700 (PDT) Received: from [192.168.1.34] (c-98-212-197-211.hsd1.il.comcast.net. [98.212.197.211]) by mx.google.com with ESMTPS id dy5sm5417738igc.1.2013.04.19.15.49.38 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 19 Apr 2013 15:49:38 -0700 (PDT) Message-ID: <5171C9FE.8080409@gmail.com> Date: Fri, 19 Apr 2013 17:49:34 -0500 From: Joshua Isom User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Jeremy Chadwick Subject: Re: Rebooting from loader causes a "fault" in VMware Workstation References: <20130419162834.GA90217@icarus.home.lan> In-Reply-To: <20130419162834.GA90217@icarus.home.lan> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: Fri, 19 Apr 2013 22:49:40 -0000 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. >