From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MIZ3A-0001pS-D5 for mharc-grub-devel@gnu.org; Sun, 21 Jun 2009 22:14:24 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MIZ38-0001ng-8a for grub-devel@gnu.org; Sun, 21 Jun 2009 22:14:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MIZ33-0001kQ-LO for grub-devel@gnu.org; Sun, 21 Jun 2009 22:14:21 -0400 Received: from [199.232.76.173] (port=33925 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MIZ33-0001kE-Ih for grub-devel@gnu.org; Sun, 21 Jun 2009 22:14:17 -0400 Received: from c60.cesmail.net ([216.154.195.49]:15814) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1MIZ32-0003aH-F7 for grub-devel@gnu.org; Sun, 21 Jun 2009 22:14:17 -0400 Received: from unknown (HELO smtprelay2.cesmail.net) ([192.168.1.112]) by c60.cesmail.net with ESMTP; 21 Jun 2009 22:14:15 -0400 Received: from [192.168.0.22] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by smtprelay2.cesmail.net (Postfix) with ESMTPSA id 0F18A34C6A for ; Sun, 21 Jun 2009 22:20:18 -0400 (EDT) From: Pavel Roskin To: The development of GRUB 2 In-Reply-To: <20090621192555.GB21827@thorin> References: <20090621181748.GA21152@thorin> <20090621185444.GA21590@thorin> <1245611156.4250.11.camel@mj> <20090621192555.GB21827@thorin> Content-Type: text/plain Date: Sun, 21 Jun 2009 22:14:13 -0400 Message-Id: <1245636853.9864.74.camel@mj> Mime-Version: 1.0 X-Mailer: Evolution 2.26.2 (2.26.2-1.fc11) Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH] move grub_stop() (Re: [PATCH] i386-qemu port) X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jun 2009 02:14:22 -0000 On Sun, 2009-06-21 at 21:25 +0200, Robert Millan wrote: > On Sun, Jun 21, 2009 at 03:05:56PM -0400, Pavel Roskin wrote: > > On Sun, 2009-06-21 at 20:54 +0200, Robert Millan wrote: > > > Move grub_stop to init.c to ease code sharing with i386-qemu. > > > > That's not quite a movement. grub_cpu_idle() does nothing. > > Well, the major problem with grub_cpu_idle() doing nothing on coreboot > is CPU consumption during polls. grub_stop() is quite a corner case, > only seen when you hit an error. I think this should do the right thing if our goal is to stop: cli halt: hlt jmp halt The last "jmp" is just in case for non-maskable interrupts. > > I think we need to have several implementations of grub_stop: hard halt > > with interrupts disabled, exit from qemu, exit from other emulators if > > it's different, power off, exit to BIOS. Then different platforms > > should enable and try whatever is appropriate for them. > > Note that we already have: > > grub_stop: Just hang. > > grub_exit: Exit to BIOS/whatever. On coreboot (and on i386-qemu) > there's really no "proper" thing to do. Maybe fallback to > grub_halt or grub_fatal. > > grub_halt: Power off. Theoretically we can have it anywhere, > although in some platforms like coreboot it's not easy; otherwise > it can fallback to grub_stop. > > I think grub_stop is intended to have this behaviour in all platforms. > But I'm not sure how useful is it. Perhaps it could be ditched in > favour of grub_exit? >From the user's standpoint, I think three "stop-like" calls make sense: Try to exit so that BIOS can try another media. Failing that, hang. That would be appropriate for installations on disks that may or may not be bootable. That's grub_exit(). Try for power down the system (that includes telling the emulator to stop). Failing that, hang. That would be appropriate for data centers where we don't want non-functioning systems to consume power. That's grub_halt(). Just stop. Appropriate if there is an important message on the screen that the user must see. -- Regards, Pavel Roskin